You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
440 lines
1.4 MiB
440 lines
1.4 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[210,5,7,8,13],{"+NIl":function(ut,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,h=a.length-1;h>=0;h--){var l=a[h];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function H(c,a,h){return function(){this.name=c,this.bracketNo=0,this.style=a,this.styles=h,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=H("importmodule","tag",["string","builtin"]),n.documentclass=H("documentclass","tag",["","atom"]),n.usepackage=H("usepackage","tag",["atom"]),n.begin=H("begin","tag",["atom"]),n.end=H("end","tag",["atom"]),n.label=H("label","tag",["atom"]),n.ref=H("ref","tag",["atom"]),n.eqref=H("eqref","tag",["atom"]),n.cite=H("cite","tag",["atom"]),n.bibitem=H("bibitem","tag",["atom"]),n.Bibitem=H("Bibitem","tag",["atom"]),n.RBibitem=H("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 x(c,a){var h;if(c.match(/^\\[a-zA-Z@]+/)){var l=c.current().slice(1);return h=n.hasOwnProperty(l)?n[l]:n.DEFAULT,h=new h,z(a,h),I(a,_),h.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return I(a,function(s,i){return p(s,i,"\\]")}),"keyword";if(c.match("\\("))return I(a,function(s,i){return p(s,i,"\\)")}),"keyword";if(c.match("$$"))return I(a,function(s,i){return p(s,i,"$$")}),"keyword";if(c.match("$"))return I(a,function(s,i){return p(s,i,"$")}),"keyword";var u=c.next();if(u=="%")return c.skipToEnd(),"comment";if(u=="}"||u=="]"){if(h=P(a),h)h.closeBracket(u),I(a,_);else return"error";return"bracket"}else return u=="{"||u=="["?(h=n.DEFAULT,h=new h,z(a,h),"bracket"):/\d/.test(u)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),h=G(a),h.name=="begin"&&(h.argument=c.current()),h.styleIdentifier())}function p(c,a,h){if(c.eatSpace())return null;if(h&&c.match(h))return I(a,x),"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 _(c,a){var h=c.peek(),l;return h=="{"||h=="["?(l=P(a),l.openBracket(h),c.eat(h),I(a,x),"bracket"):/[ \t\r]/.test(h)?(c.eat(h),null):(I(a,x),F(a),x(c,a))}return{startState:function(){var c=N.inMathMode?function(a,h){return p(a,h)}:x;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=x,c.cmdState.length=0},lineComment:"%"}}),te.defineMIME("text/x-stex","stex"),te.defineMIME("text/x-latex","stex")})},"+ua5":function(ut,ge,U){},"+vTd":function(ut,ge,U){ut.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(ut,ge,U){ut.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(ut,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 H}),U.d(ge,"c",function(){return n}),U.d(ge,"d",function(){return I}),U.d(ge,"a",function(){return x});class te{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
|
|
|
|
`+p.stack):p},0)}}emit(p){this.listeners.forEach(_=>{_(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const Y=new te;function N(p){G(p)||Y.onUnexpectedError(p);return}function z(p){G(p)||Y.onUnexpectedExternalError(p);return}function P(p){if(p instanceof Error){let{name:_,message:c}=p;const a=p.stacktrace||p.stack;return{$isError:!0,name:_,message:c,stack:a}}return p}const F="Canceled";function G(p){return p instanceof Error&&p.name===F&&p.message===F}function H(){const p=new Error(F);return p.name=p.message,p}function n(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function I(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class x extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"19Vz":function(ut,ge,U){(function(te){te(U("VrN/"))})(function(te){te.defineOption("placeholder","",function(H,n,I){var x=I&&I!=te.Init;if(n&&!x)H.on("blur",P),H.on("change",F),H.on("swapDoc",F),te.on(H.getInputField(),"compositionupdate",H.state.placeholderCompose=function(){z(H)}),F(H);else if(!n&&x){H.off("blur",P),H.off("change",F),H.off("swapDoc",F),te.off(H.getInputField(),"compositionupdate",H.state.placeholderCompose),Y(H);var p=H.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}n&&!H.hasFocus()&&P(H)});function Y(H){H.state.placeholder&&(H.state.placeholder.parentNode.removeChild(H.state.placeholder),H.state.placeholder=null)}function N(H){Y(H);var n=H.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=H.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var I=H.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),n.appendChild(I),H.display.lineSpace.insertBefore(n,H.display.lineSpace.firstChild)}function z(H){setTimeout(function(){var n=!1,I=H.getInputField();I.nodeName=="TEXTAREA"?n=!I.value:H.lineCount()==1&&(n=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),n?N(H):Y(H)},20)}function P(H){G(H)&&N(H)}function F(H){var n=H.getWrapperElement(),I=G(H);n.className=n.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?N(H):Y(H)}function G(H){return H.lineCount()===1&&H.getLine(0)===""}})},"1ZF9":function(ut,ge,U){ut.exports=U.p+"static/Authorize.cc9c212f.png"},"1eCo":function(ut,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={},H=P.htmlMode?Y:N;for(var n in H)G[n]=H[n];for(var n in P)G[n]=P[n];var I,x;function p(d,C){function E(W){return C.tokenize=W,W(d,C)}var w=d.next();if(w=="<")return d.eat("!")?d.eat("[")?d.match("CDATA[")?E(a("atom","]]>")):null:d.match("--")?E(a("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),E(h(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),C.tokenize=a("meta","?>"),"meta"):(I=d.eat("/")?"closeTag":"openTag",C.tokenize=_,"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}p.isInText=!0;function _(d,C){var E=d.next();if(E==">"||E=="/"&&d.eat(">"))return C.tokenize=p,I=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return I="equals",null;if(E=="<"){C.tokenize=p,C.state=i,C.tagName=C.tagStart=null;var w=C.tokenize(d,C);return w?w+" tag error":"tag error"}else return/[\'\"]/.test(E)?(C.tokenize=c(E),C.stringStartCol=d.column(),C.tokenize(d,C)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(d){var C=function(E,w){for(;!E.eol();)if(E.next()==d){w.tokenize=_;break}return"string"};return C.isInAttribute=!0,C}function a(d,C){return function(E,w){for(;!E.eol();){if(E.match(C)){w.tokenize=p;break}E.next()}return d}}function h(d){return function(C,E){for(var w;(w=C.next())!=null;){if(w=="<")return E.tokenize=h(d+1),E.tokenize(C,E);if(w==">")if(d==1){E.tokenize=p;break}else return E.tokenize=h(d-1),E.tokenize(C,E)}return"meta"}}function l(d,C,E){this.prev=d.context,this.tagName=C,this.indent=d.indented,this.startOfLine=E,(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 E;;){if(!d.context)return;if(E=d.context.tagName,!G.contextGrabbers.hasOwnProperty(E)||!G.contextGrabbers[E].hasOwnProperty(C))return;u(d)}}function i(d,C,E){return d=="openTag"?(E.tagStart=C.column(),D):d=="closeTag"?A:i}function D(d,C,E){return d=="word"?(E.tagName=C.current(),x="tag",R):G.allowMissingTagName&&d=="endTag"?(x="tag bracket",R(d,C,E)):(x="error",D)}function A(d,C,E){if(d=="word"){var w=C.current();return E.context&&E.context.tagName!=w&&G.implicitlyClosed.hasOwnProperty(E.context.tagName)&&u(E),E.context&&E.context.tagName==w||G.matchClosing===!1?(x="tag",S):(x="tag error",O)}else return G.allowMissingTagName&&d=="endTag"?(x="tag bracket",S(d,C,E)):(x="error",O)}function S(d,C,E){return d!="endTag"?(x="error",S):(u(E),i)}function O(d,C,E){return x="error",S(d,C,E)}function R(d,C,E){if(d=="word")return x="attribute",g;if(d=="endTag"||d=="selfcloseTag"){var w=E.tagName,j=E.tagStart;return E.tagName=E.tagStart=null,d=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(w)?s(E,w):(s(E,w),E.context=new l(E,w,j==E.indented)),i}return x="error",R}function g(d,C,E){return d=="equals"?b:(G.allowMissing||(x="error"),R(d,C,E))}function b(d,C,E){return d=="string"?f:d=="word"&&G.allowUnquoted?(x="string",R):(x="error",R(d,C,E))}function f(d,C,E){return d=="string"?f:R(d,C,E)}return{startState:function(d){var C={tokenize:p,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 E=C.tokenize(d,C);return(E||I)&&E!="comment"&&(x=null,C.state=C.state(I||E,d,C),x&&(E=x=="error"?E+" error":x)),E},indent:function(d,C,E){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!=_&&d.tokenize!=p)return E?E.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==b&&(d.state=R)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var C=[],E=d.context;E;E=E.prev)E.tagName&&C.push(E.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(ut,ge,U){ut.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"24hK":function(ut,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(ut,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 H=G[0];return typeof z[H]!="undefined"?z[H]:F}),P}function Y(N,z,...P){return te(z,P)}},"55Ip":function(ut,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),H=U("wx14"),n=U("zLVn"),I=U("9R94"),x=function(b){Object(Y.a)(f,b);function f(){for(var C,E=arguments.length,w=new Array(E),j=0;j<E;j++)w[j]=arguments[j];return C=b.call.apply(b,[this].concat(w))||this,C.history=Object(P.a)(C.props),C}var d=f.prototype;return d.render=function(){return z.a.createElement(te.c,{history:this.history,children:this.props.children})},f}(z.a.Component),p=function(b){Object(Y.a)(f,b);function f(){for(var C,E=arguments.length,w=new Array(E),j=0;j<E;j++)w[j]=arguments[j];return C=b.call.apply(b,[this].concat(w))||this,C.history=Object(P.b)(C.props),C}var d=f.prototype;return d.render=function(){return z.a.createElement(te.c,{history:this.history,children:this.props.children})},f}(z.a.Component),_=function(f,d){return typeof f=="function"?f(d):f},c=function(f,d){return typeof f=="string"?Object(P.c)(f,null,null,d):f},a=function(f){return f},h=z.a.forwardRef;typeof h=="undefined"&&(h=a);function l(b){return!!(b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)}var u=h(function(b,f){var d=b.innerRef,C=b.navigate,E=b.onClick,w=Object(n.a)(b,["innerRef","navigate","onClick"]),j=w.target,W=Object(H.a)({},w,{onClick:function(M){try{E&&E(M)}catch(m){throw M.preventDefault(),m}!M.defaultPrevented&&M.button===0&&(!j||j==="_self")&&!l(M)&&(M.preventDefault(),C())}});return a!==h?W.ref=f||d:W.ref=d,z.a.createElement("a",W)}),s=h(function(b,f){var d=b.component,C=d===void 0?u:d,E=b.replace,w=b.to,j=b.innerRef,W=Object(n.a)(b,["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(_(w,T.location),T.location),v=m?M.createHref(m):"",K=Object(H.a)({},W,{href:v,navigate:function(){var q=_(w,T.location),re=E?M.replace:M.push;re(q)}});return a!==h?K.ref=f||j:K.innerRef=j,z.a.createElement(C,K)})});if(!1)var i,D;var A=function(f){return f},S=z.a.forwardRef;typeof S=="undefined"&&(S=A);function O(){for(var b=arguments.length,f=new Array(b),d=0;d<b;d++)f[d]=arguments[d];return f.filter(function(C){return C}).join(" ")}var R=S(function(b,f){var d=b["aria-current"],C=d===void 0?"page":d,E=b.activeClassName,w=E===void 0?"active":E,j=b.activeStyle,W=b.className,T=b.exact,M=b.isActive,m=b.location,v=b.sensitive,K=b.strict,X=b.style,q=b.to,re=b.innerRef,ye=Object(n.a)(b,["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(_(q,ue),ue),Ee=fe.pathname,se=Ee&&Ee.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ae=se?Object(te.f)(ue.pathname,{path:se,exact:T,sensitive:v,strict:K}):null,Oe=!!(M?M(ae,ue):ae),ze=Oe?O(W,w):W,Ye=Oe?Object(H.a)({},X,{},j):X,He=Object(H.a)({"aria-current":Oe&&C||null,className:ze,style:Ye,to:fe},ye);return A!==S?He.ref=f||re:He.innerRef=re,z.a.createElement(s,He)})});if(!1)var g},"5VLF":function(ut,ge,U){"use strict";var te,Y;function N(z,P,F){var G=function(H,n){return z.js_beautify(H,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&&(ut.exports=Y))},"5Y4S":function(ut,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(ut,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"),H=U("q1tI"),n=U.n(H),I=U("TSYQ"),x=U.n(I),p=function(R){var g,b="".concat(R.rootPrefixCls,"-item"),f=x()(b,"".concat(b,"-").concat(R.page),(g={},Object(Y.a)(g,"".concat(b,"-active"),R.active),Object(Y.a)(g,R.className,!!R.className),Object(Y.a)(g,"".concat(b,"-disabled"),!R.page),g)),d=function(){R.onClick(R.page)},C=function(w){R.onKeyPress(w,R.onClick,R.page)};return n.a.createElement("li",{title:R.showTitle?R.page:null,className:f,onClick:d,onKeyPress:C,tabIndex:"0"},R.itemRender(R.page,"page",n.a.createElement("a",{rel:"nofollow"},R.page)))},_=p,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(O){Object(F.a)(g,O);var R=Object(G.a)(g);function g(){var b;Object(z.a)(this,g);for(var f=arguments.length,d=new Array(f),C=0;C<f;C++)d[C]=arguments[C];return b=R.call.apply(R,[this].concat(d)),b.state={goInputText:""},b.buildOptionText=function(E){return"".concat(E," ").concat(b.props.locale.items_per_page)},b.changeSize=function(E){b.props.changeSize(Number(E))},b.handleChange=function(E){b.setState({goInputText:E.target.value})},b.handleBlur=function(E){var w=b.props,j=w.goButton,W=w.quickGo,T=w.rootPrefixCls,M=b.state.goInputText;if(j||M==="")return;if(E.relatedTarget&&(E.relatedTarget.className.indexOf("".concat(T,"-prev"))>=0||E.relatedTarget.className.indexOf("".concat(T,"-next"))>=0))return;b.setState({goInputText:""}),W(b.getValidValue())},b.go=function(E){var w=b.state.goInputText;if(w==="")return;(E.keyCode===c.ENTER||E.type==="click")&&(b.setState({goInputText:""}),b.props.quickGo(b.getValidValue()))},b}return Object(P.a)(g,[{key:"getValidValue",value:function(){var f=this.state,d=f.goInputText,C=f.current;return!d||isNaN(d)?C:Number(d)}},{key:"getPageSizeOptions",value:function(){var f=this.props,d=f.pageSize,C=f.pageSizeOptions;return C.some(function(E){return E.toString()===d.toString()})?C:C.concat([d.toString()]).sort(function(E,w){var j=isNaN(Number(E))?0:Number(E),W=isNaN(Number(w))?0:Number(w);return j-W})}},{key:"render",value:function(){var f=this,d=this.props,C=d.pageSize,E=d.locale,w=d.rootPrefixCls,j=d.changeSize,W=d.quickGo,T=d.goButton,M=d.selectComponentClass,m=d.buildOptionText,v=d.selectPrefixCls,K=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 Ee=fe.map(function(se,ae){return n.a.createElement(re.Option,{key:ae,value:se.toString()},(m||f.buildOptionText)(se))});ye=n.a.createElement(re,{disabled:K,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}},Ee)}return W&&(T&&(ue=typeof T=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:K,className:"".concat(q,"-quick-jumper-button")},E.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},T)),pe=n.a.createElement("div",{className:"".concat(q,"-quick-jumper")},E.jump_to,n.a.createElement("input",{disabled:K,type:"text",value:X,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,ue)),n.a.createElement("li",{className:"".concat(q)},ye,pe)}}]),g}(n.a.Component);a.defaultProps={pageSizeOptions:["10","20","50","100"]};var h=a,l=U("N2Kk");function u(){}function s(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O}function i(O,R,g){return g}function D(O,R,g){var b=typeof O=="undefined"?R.pageSize:O;return Math.floor((g.total-1)/b)+1}var A=function(O){Object(F.a)(g,O);var R=Object(G.a)(g);function g(b){var f;Object(z.a)(this,g),f=R.call(this,b),f.getJumpPrevPage=function(){return Math.max(1,f.state.current-(f.props.showLessItems?3:5))},f.getJumpNextPage=function(){return Math.min(D(void 0,f.state,f.props),f.state.current+(f.props.showLessItems?3:5))},f.getItemIcon=function(j,W){var T=f.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)({},f.props))),M},f.savePaginationNode=function(j){f.paginationNode=j},f.isValid=function(j){return s(j)&&j!==f.state.current},f.shouldDisplayQuickJumper=function(){var j=f.props,W=j.showQuickJumper,T=j.pageSize,M=j.total;return M<=T?!1:W},f.handleKeyDown=function(j){(j.keyCode===c.ARROW_UP||j.keyCode===c.ARROW_DOWN)&&j.preventDefault()},f.handleKeyUp=function(j){var W=f.getValidValue(j),T=f.state.currentInputValue;W!==T&&f.setState({currentInputValue:W}),j.keyCode===c.ENTER?f.handleChange(W):j.keyCode===c.ARROW_UP?f.handleChange(W-1):j.keyCode===c.ARROW_DOWN&&f.handleChange(W+1)},f.changePageSize=function(j){var W=f.state.current,T=D(j,f.state,f.props);W=W>T?T:W,T===0&&(W=f.state.current),typeof j=="number"&&("pageSize"in f.props||f.setState({pageSize:j}),"current"in f.props||f.setState({current:W,currentInputValue:W})),f.props.onShowSizeChange(W,j),"onChange"in f.props&&f.props.onChange&&f.props.onChange(W,j)},f.handleChange=function(j){var W=f.props.disabled,T=j;if(f.isValid(T)&&!W){var M=D(void 0,f.state,f.props);T>M?T=M:T<1&&(T=1),"current"in f.props||f.setState({current:T,currentInputValue:T});var m=f.state.pageSize;return f.props.onChange(T,m),T}return f.state.current},f.prev=function(){f.hasPrev()&&f.handleChange(f.state.current-1)},f.next=function(){f.hasNext()&&f.handleChange(f.state.current+1)},f.jumpPrev=function(){f.handleChange(f.getJumpPrevPage())},f.jumpNext=function(){f.handleChange(f.getJumpNextPage())},f.hasPrev=function(){return f.state.current>1},f.hasNext=function(){return f.state.current<D(void 0,f.state,f.props)},f.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)}},f.runIfEnterPrev=function(j){f.runIfEnter(j,f.prev)},f.runIfEnterNext=function(j){f.runIfEnter(j,f.next)},f.runIfEnterJumpPrev=function(j){f.runIfEnter(j,f.jumpPrev)},f.runIfEnterJumpNext=function(j){f.runIfEnter(j,f.jumpNext)},f.handleGoTO=function(j){(j.keyCode===c.ENTER||j.type==="click")&&f.handleChange(f.state.currentInputValue)};var d=b.onChange!==u,C="current"in b;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 E=b.defaultCurrent;"current"in b&&(E=b.current);var w=b.defaultPageSize;return"pageSize"in b&&(w=b.pageSize),E=Math.min(E,D(w,void 0,b)),f.state={current:E,currentInputValue:E,pageSize:w},f}return Object(P.a)(g,[{key:"componentDidUpdate",value:function(f,d){var C=this.props.prefixCls;if(d.current!==this.state.current&&this.paginationNode){var E=this.paginationNode.querySelector(".".concat(C,"-item-").concat(d.current));E&&document.activeElement===E&&E.blur()}}},{key:"getValidValue",value:function(f){var d=f.target.value,C=D(void 0,this.state,this.props),E=this.state.currentInputValue,w;return d===""?w=d:isNaN(Number(d))?w=E:d>=C?w=C:w=Number(d),w}},{key:"getShowSizeChanger",value:function(){var f=this.props,d=f.showSizeChanger,C=f.total,E=f.totalBoundaryShowSizeChanger;return typeof d!="undefined"?d:C>E}},{key:"renderPrev",value:function(f){var d=this.props,C=d.prevIcon,E=d.itemRender,w=E(f,"prev",this.getItemIcon(C,"prev page")),j=!this.hasPrev();return Object(H.isValidElement)(w)?Object(H.cloneElement)(w,{disabled:j}):w}},{key:"renderNext",value:function(f){var d=this.props,C=d.nextIcon,E=d.itemRender,w=E(f,"next",this.getItemIcon(C,"next page")),j=!this.hasNext();return Object(H.isValidElement)(w)?Object(H.cloneElement)(w,{disabled:j}):w}},{key:"render",value:function(){var f=this,d=this.props,C=d.prefixCls,E=d.className,w=d.style,j=d.disabled,W=d.hideOnSinglePage,T=d.total,M=d.locale,m=d.showQuickJumper,v=d.showLessItems,K=d.showTitle,X=d.showTotal,q=d.simple,re=d.itemRender,ye=d.showPrevNextJumpers,pe=d.jumpPrevIcon,ue=d.jumpNextIcon,fe=d.selectComponentClass,Ee=d.selectPrefixCls,se=d.pageSizeOptions,ae=this.state,Oe=ae.current,ze=ae.pageSize,Ye=ae.currentInputValue;if(W===!0&&T<=ze)return null;var He=D(void 0,this.state,this.props),Xe=[],We=null,Ke=null,nt=null,de=null,De=null,Ne=m&&m.goButton,Be=v?1:2,at=Oe-1>0?Oe-1:0,lt=Oe+1<He?Oe+1:He,pt=Object.keys(this.props).reduce(function(ce,he){return(he.substr(0,5)==="data-"||he.substr(0,5)==="aria-"||he==="role")&&(ce[he]=f.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:K?"".concat(M.jump_to).concat(Oe,"/").concat(He):null,className:"".concat(C,"-simple-pager")},De)),n.a.createElement("ul",Object(te.a)({className:x()(C,"".concat(C,"-simple"),Object(Y.a)({},"".concat(C,"-disabled"),j),E),style:w,ref:this.savePaginationNode},pt),n.a.createElement("li",{title:K?M.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:x()("".concat(C,"-prev"),Object(Y.a)({},"".concat(C,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(at)),n.a.createElement("li",{title:K?"".concat(Oe,"/").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:K?M.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:x()("".concat(C,"-next"),Object(Y.a)({},"".concat(C,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(lt)),De);if(He<=3+Be*2){var ot={locale:M,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:K,itemRender:re};He||Xe.push(n.a.createElement(_,Object(te.a)({},ot,{key:"noPager",page:He,className:"".concat(C,"-disabled")})));for(var bt=1;bt<=He;bt+=1){var yt=Oe===bt;Xe.push(n.a.createElement(_,Object(te.a)({},ot,{key:bt,page:bt,active:yt})))}}else{var xt=v?M.prev_3:M.prev_5,Ze=v?M.next_3:M.next_5;ye&&(We=n.a.createElement("li",{title:K?xt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:x()("".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:K?Ze:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:x()("".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(_,{locale:M,last:!0,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:He,page:He,active:!1,showTitle:K,itemRender:re}),nt=n.a.createElement(_,{locale:M,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:K,itemRender:re});var kt=Math.max(1,Oe-Be),Ot=Math.min(Oe+Be,He);Oe-1<=Be&&(Ot=1+Be*2),He-Oe<=Be&&(kt=He-Be*2);for(var qe=kt;qe<=Ot;qe+=1){var st=Oe===qe;Xe.push(n.a.createElement(_,{locale:M,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:qe,page:qe,active:st,showTitle:K,itemRender:re}))}Oe-1>=Be*2&&Oe!==1+2&&(Xe[0]=Object(H.cloneElement)(Xe[0],{className:"".concat(C,"-item-after-jump-prev")}),Xe.unshift(We)),He-Oe>=Be*2&&Oe!==He-2&&(Xe[Xe.length-1]=Object(H.cloneElement)(Xe[Xe.length-1],{className:"".concat(C,"-item-before-jump-next")}),Xe.push(Ke)),kt!==1&&Xe.unshift(nt),Ot!==He&&Xe.push(de)}var xe=null;X&&(xe=n.a.createElement("li",{className:"".concat(C,"-total-text")},X(T,[T===0?0:(Oe-1)*ze+1,Oe*ze>T?T:Oe*ze])));var we=!this.hasPrev()||!He,me=!this.hasNext()||!He;return n.a.createElement("ul",Object(te.a)({className:x()(C,E,Object(Y.a)({},"".concat(C,"-disabled"),j)),style:w,unselectable:"unselectable",ref:this.savePaginationNode},pt),xe,n.a.createElement("li",{title:K?M.prev_page:null,onClick:this.prev,tabIndex:we?null:0,onKeyPress:this.runIfEnterPrev,className:x()("".concat(C,"-prev"),Object(Y.a)({},"".concat(C,"-disabled"),we)),"aria-disabled":we},this.renderPrev(at)),Xe,n.a.createElement("li",{title:K?M.next_page:null,onClick:this.next,tabIndex:me?null:0,onKeyPress:this.runIfEnterNext,className:x()("".concat(C,"-next"),Object(Y.a)({},"".concat(C,"-disabled"),me)),"aria-disabled":me},this.renderNext(lt)),n.a.createElement(h,{disabled:j,locale:M,rootPrefixCls:C,selectComponentClass:fe,selectPrefixCls:Ee,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Oe,pageSize:ze,pageSizeOptions:se,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ne}))}}],[{key:"getDerivedStateFromProps",value:function(f,d){var C={};if("current"in f&&(C.current=f.current,f.current!==d.current&&(C.currentInputValue=C.current)),"pageSize"in f&&f.pageSize!==d.pageSize){var E=d.current,w=D(f.pageSize,d,f);E=E>w?w:E,"current"in f||(C.current=E,C.currentInputValue=E),C.pageSize=f.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(ut,ge,U){var te,Y;(function(){var N;(function(){"use strict";var P=[function(n,I,x){var p=x(1).Beautifier,_=x(5).Options;function c(a,h){var l=new p(a,h);return l.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new _}},function(n,I,x){var p=x(2).Output,_=x(3).Token,c=x(4),a=x(5).Options,h=x(7).Tokenizer,l=x(7).line_starters,u=x(7).positionable_operators,s=x(7).TOKEN;function i(v,K){return K.indexOf(v)!==-1}function D(v){return v.replace(/^\s+/g,"")}function A(v){for(var K={},X=0;X<v.length;X++)K[v[X].replace(/-/g,"_")]=v[X];return K}function S(v,K){return v&&v.type===s.RESERVED&&v.text===K}function O(v,K){return v&&v.type===s.RESERVED&&i(v.text,K)}var R=["case","return","do","if","throw","else","await","break","continue","async"],g=["before-newline","after-newline","preserve-newline"],b=A(g),f=[b.before_newline,b.preserve_newline],d={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(v,K){if(K.multiline_frame||K.mode===d.ForInitializer||K.mode===d.Conditional)return;v.remove_indent(K.start_line_index)}function E(v){v=v.replace(c.allLineBreaks,`
|
|
`);for(var K=[],X=v.indexOf(`
|
|
`);X!==-1;)K.push(v.substring(0,X)),v=v.substring(X+1),X=v.indexOf(`
|
|
`);return v.length&&K.push(v),K}function w(v){return v===d.ArrayLiteral}function j(v){return i(v,[d.Expression,d.ForInitializer,d.Conditional])}function W(v,K){for(var X=0;X<v.length;X++){var q=v[X].trim();if(q.charAt(0)!==K)return!1}return!0}function T(v,K){for(var X=0,q=v.length,re;X<q;X++)if(re=v[X],re&&re.indexOf(K)!==0)return!1;return!0}function M(v,K){K=K||{},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(K)}M.prototype.create_flags=function(v,K){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:K,parent:v,last_token:v?v.last_token:new _(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 K=v.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,K),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var X=new h(v,this._options);return this._tokens=X.tokenize(),v},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v,K=this._reset(this._source_text),X=this._options.eol;this._options.eol==="auto"&&(X=`
|
|
`,K&&c.lineBreak.test(K||"")&&(X=K.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,K){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,K):v.type===s.COMMENT?this.handle_comment(v,K):v.type===s.DOT?this.handle_dot(v):v.type===s.EOF?this.handle_eof(v):v.type===s.UNKNOWN?this.handle_unknown(v,K):this.handle_unknown(v,K)},M.prototype.handle_whitespace_and_comments=function(v,K){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,K),this.handle_token(re,K),re=v.comments_before.next();if(q)for(var ye=0;ye<X;ye+=1)this.print_newline(ye>0,K);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,K);for(var pe=1;pe<X;pe+=1)this.print_newline(!0,K)}};var m=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(v,K){if(K=K===void 0?!1:K,this._output.just_added_newline())return;var X=this._options.preserve_newlines&&v.newlines||K,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,f)||i(v.text,u);X=X&&re}if(X)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(O(this._flags.last_token,m))return;this._output.set_wrap_point()}},M.prototype.print_newline=function(v,K){if(!K&&(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 K=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(K),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(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||O(this._flags.last_token,["get","set"]))},M.prototype.start_of_statement=function(v){var K=!1;return K=K||O(this._flags.last_token,["var","let","const"])&&v.type===s.WORD,K=K||S(this._flags.last_token,"do"),K=K||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&O(this._flags.last_token,m)&&!v.newlines,K=K||S(this._flags.last_token,"else")&&!(S(v,"if")&&!v.comments_before),K=K||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),K=K||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,K=K||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),K?(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,O(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 K=d.Expression;if(v.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(v),this.set_mode(K),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}K=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,K=d.ForInitializer):i(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,K=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);O(X,["async","function"])||X.text==="*"&&O(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(K),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 K=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(K.type,[s.STRING,s.WORD,s.RESERVED])||i(K.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])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var q=!K.comments_before&&K.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||O(this._flags.last_token,R)&&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 K=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!K?this._output.space_before_token=!0:this._options.brace_style==="expand"?K||this.print_newline():K||(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 K=this._tokens.peek();K.text===":"&&(v.type=s.WORD)}}if(this.start_of_statement(v)?O(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||!O(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&&O(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?O(this._flags.last_token,["get","set","new","export"])||O(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":O(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"),O(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"),O(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"?O(this._flags.last_token,R)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(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||!O(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()):O(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 K=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&S(K,"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 K=v.text==="*"&&(O(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=!K;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,f)&&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&&!K&&this._options.preserve_newlines&&i(v.text,u)){var ue=v.text===":",fe=ue&&pe,Ee=ue&&!pe;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!Ee,this.print_token(v),(!ue||fe)&&this.allow_wrap_or_preserved_newline(v),this._output.space_before_token=!0;return;case b.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 b.preserve_newline:Ee||this.allow_wrap_or_preserved_newline(v),re=!(this._output.just_added_newline()||Ee),this._output.space_before_token=re,this.print_token(v),this._output.space_before_token=!0;return}}if(K){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=O(this._flags.last_token,R)&&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,K){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,K),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,K)},M.prototype.print_block_commment=function(v,K){var X=E(v.text),q,re=!1,ye=!1,pe=v.whitespace_before,ue=pe.length;if(this.print_newline(!1,K),this.print_token_line_indentation(v),this._output.add_token(X[0]),this.print_newline(!1,K),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,K);this._flags.alignment=0}},M.prototype.handle_comment=function(v,K){v.newlines?this.print_newline(!1,K):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(v),this.print_newline(!1,K)},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),O(this._flags.last_token,R)?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,K){this.print_token(v),v.text[v.text.length-1]===`
|
|
`&&this.print_newline(!1,K)},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(_){this.__parent=_,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 _=new I(this.__parent);return _.set_indent(this.__indent_count,this.__alignment_count),_},I.prototype.item=function(_){return _<0?this.__items[this.__items.length+_]:this.__items[_]},I.prototype.has_match=function(_){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(_))return!0;return!1},I.prototype.set_indent=function(_,c){this.is_empty()&&(this.__indent_count=_||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 _=this.__parent.current_line;return _.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),_.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),_.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,_.__items[0]===" "&&(_.__items.splice(0,1),_.__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(_){this.__items.push(_);var c=_.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=_.length-c:this.__character_count+=_.length},I.prototype.pop=function(){var _=null;return this.is_empty()||(_=this.__items.pop(),this.__character_count-=_.length),_},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 _="";return this.is_empty()?this.__parent.indent_empty_lines&&(_=this.__parent.get_indent_string(this.__indent_count)):(_=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),_+=this.__items.join("")),_};function x(_,c){this.__cache=[""],this.__indent_size=_.indent_size,this.__indent_string=_.indent_char,_.indent_with_tabs||(this.__indent_string=new Array(_.indent_size+1).join(_.indent_char)),c=c||"",_.indent_level>0&&(c=new Array(_.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}x.prototype.get_indent_size=function(_,c){var a=this.__base_string_length;return c=c||0,_<0&&(a=0),a+=_*this.__indent_size,a+=c,a},x.prototype.get_indent_string=function(_,c){var a=this.__base_string;return c=c||0,_<0&&(_=0,a=""),c+=_*this.__indent_size,this.__ensure_cache(c),a+=this.__cache[c],a},x.prototype.__ensure_cache=function(_){for(;_>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var _=this.__cache.length,c=0,a="";this.__indent_size&&_>=this.__indent_size&&(c=Math.floor(_/this.__indent_size),_-=c*this.__indent_size,a=new Array(c+1).join(this.__indent_string)),_&&(a+=new Array(_+1).join(" ")),this.__cache.push(a)};function p(_,c){this.__indent_cache=new x(_,c),this.raw=!1,this._end_with_newline=_.end_with_newline,this.indent_size=_.indent_size,this.wrap_line_length=_.wrap_line_length,this.indent_empty_lines=_.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()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(_,c){return this.__indent_cache.get_indent_string(_,c)},p.prototype.get_indent_size=function(_,c){return this.__indent_cache.get_indent_size(_,c)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(_){return this.is_empty()||!_&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(_){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 _!==`
|
|
`&&(a=a.replace(/[\n]/g,_)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(_,c){return _=_||0,c=c||0,this.next_line.set_indent(_,c),this.__lines.length>1?(this.current_line.set_indent(_,c),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(_){for(var c=0;c<_.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(_.whitespace_before),this.current_line.push(_.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(_){this.__add_space_before_token(),this.current_line.push(_),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.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(" "))},p.prototype.remove_indent=function(_){for(var c=this.__lines.length;_<c;)this.__lines[_]._remove_indent(),_++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(_){for(_=_===void 0?!1:_,this.current_line.trim();_&&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},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(_,c){for(var a=this.__lines.length-2;a>=0;){var h=this.__lines[a];if(h.is_empty())break;if(h.item(0).indexOf(_)!==0&&h.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=p},function(n){function I(x,p,_,c){this.type=x,this.text=p,this.comments_before=null,this.newlines=_||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 x="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",_="\\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}|["+x+_+"])",h="(?:\\\\u[0-9a-fA-F]{4}|["+p+_+c+"])*";I.identifier=new RegExp(a+h,"g"),I.identifierStart=new RegExp(a),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+_+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,x){var p=x(6).Options,_=["before-newline","after-newline","preserve-newline"];function c(a){p.call(this,a,"js");var h=this.raw_options.brace_style||null;h==="expand-strict"?this.raw_options.brace_style="expand":h==="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",_),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new p,n.exports.Options=c},function(n){function I(_,c){this.raw_options=x(_,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(_,c){var a=this.raw_options[_],h=c||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(h=a.concat()):typeof a=="string"&&(h=a.split(/[^a-zA-Z0-9_\/\-]+/)),h},I.prototype._get_boolean=function(_,c){var a=this.raw_options[_],h=a===void 0?!!c:!!a;return h},I.prototype._get_characters=function(_,c){var a=this.raw_options[_],h=c||"";return typeof a=="string"&&(h=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},I.prototype._get_number=function(_,c){var a=this.raw_options[_];c=parseInt(c,10),isNaN(c)&&(c=0);var h=parseInt(a,10);return isNaN(h)&&(h=c),h},I.prototype._get_selection=function(_,c,a){var h=this._get_selection_list(_,c,a);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+_+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[_]+"'");return h[0]},I.prototype._get_selection_list=function(_,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 h=this._get_array(_,a);if(!this._is_valid_selection(h,c))throw new Error("Invalid Option Value: The option '"+_+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[_]+"'");return h},I.prototype._is_valid_selection=function(_,c){return _.length&&c.length&&!_.some(function(a){return c.indexOf(a)===-1})};function x(_,c){var a={};_=p(_);var h;for(h in _)h!==c&&(a[h]=_[h]);if(c&&_[c])for(h in _[c])a[h]=_[c][h];return a}function p(_){var c={},a;for(a in _){var h=a.replace(/-/g,"_");c[h]=_[a]}return c}n.exports.Options=I,n.exports.normalizeOpts=p,n.exports.mergeOpts=x},function(n,I,x){var p=x(8).InputScanner,_=x(9).Tokenizer,c=x(9).TOKEN,a=x(13).Directives,h=x(4),l=x(12).Pattern,u=x(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]/,O=/[^\d\.]/,R=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),g=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";g=g.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),g="\\?\\.(?!\\d) "+g,g=g.replace(/ /g,"|");var b=new RegExp(g),f="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=f.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+d.join("|")+")$"),E,w=function(W,T){_.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(h.identifier).matching(h.identifierMatch),number:M.matching(A),punct:M.matching(b),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(h.lineBreak),shebang:M.starting_with(/#!/).until_after(h.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 _,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(){E=!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(h.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==="."&&O.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(h.newline);)T+=this._input.next();return E=!0,this._create_token(i.COMMENT,T)}}else if(E&&W==="-"&&(T=this.__patterns.html_comment_end.read(),T))return E=!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(h.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(h.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(h.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(h.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+}$/,"}"),K=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||K&&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(h.allLineBreaks,`
|
|
`),this._create_token(i.STRING,M)}}return null};function j(W){for(var T="",M=0,m=new p(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 K=v.read(),X="";this._input.hasNext();){if(X=this._input.next(),X===W||!T&&h.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(),K+=X}return K},n.exports.Tokenizer=w,n.exports.TOKEN=i,n.exports.positionable_operators=R.slice(),n.exports.line_starters=f.slice()},function(n){var I=RegExp.prototype.hasOwnProperty("sticky");function x(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}x.prototype.restart=function(){this.__position=0},x.prototype.back=function(){this.__position>0&&(this.__position-=1)},x.prototype.hasNext=function(){return this.__position<this.__input_length},x.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},x.prototype.peek=function(p){var _=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(_=this.__input.charAt(p)),_},x.prototype.__match=function(p,_){p.lastIndex=_;var c=p.exec(this.__input);return c&&!(I&&p.sticky)&&(c.index!==_&&(c=null)),c},x.prototype.test=function(p,_){return _=_||0,_+=this.__position,_>=0&&_<this.__input_length?!!this.__match(p,_):!1},x.prototype.testChar=function(p,_){var c=this.peek(_);return p.lastIndex=0,c!==null&&p.test(c)},x.prototype.match=function(p){var _=this.__match(p,this.__position);return _?this.__position+=_[0].length:_=null,_},x.prototype.read=function(p,_,c){var a="",h;return p&&(h=this.match(p),h&&(a+=h[0])),_&&(h||!p)&&(a+=this.readUntil(_,c)),a},x.prototype.readUntil=function(p,_){var c="",a=this.__position;p.lastIndex=this.__position;var h=p.exec(this.__input);return h?(a=h.index,_&&(a+=h[0].length)):a=this.__input_length,c=this.__input.substring(this.__position,a),this.__position=a,c},x.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},x.prototype.get_regexp=function(p,_){var c=null,a="g";return _&&I&&(a="y"),typeof p=="string"&&p!==""?c=new RegExp(p,a):p&&(c=new RegExp(p.source,a)),c},x.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},x.prototype.peekUntilAfter=function(p){var _=this.__position,c=this.readUntilAfter(p);return this.__position=_,c},x.prototype.lookBack=function(p){var _=this.__position-1;return _>=p.length&&this.__input.substring(_-p.length,_).toLowerCase()===p},n.exports.InputScanner=x},function(n,I,x){var p=x(8).InputScanner,_=x(3).Token,c=x(10).TokenStream,a=x(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(u,s){this._input=new p(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 _(h.START,""),i=null,D=[],A=new c;s.type!==h.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(h.RAW,i):this._create_token(h.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 _(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=h},function(n){function I(x){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=x}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 x=null;return this.hasNext()&&(x=this.__tokens[this.__position],this.__position+=1),x},I.prototype.peek=function(x){var p=null;return x=x||0,x+=this.__position,x>=0&&x<this.__tokens_length&&(p=this.__tokens[x]),p},I.prototype.add=function(x){this.__parent_token&&(x.parent=this.__parent_token),this.__tokens.push(x),this.__tokens_length+=1},n.exports.TokenStream=I},function(n,I,x){var p=x(12).Pattern;function _(c,a){p.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=""}_.prototype=new p,_.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+"]")},_.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},_.prototype.matching=function(c,a){var h=this._create();return h.__set_whitespace_patterns(c,a),h._update(),h},_.prototype._create=function(){return new _(this._input,this)},_.prototype.__split=function(c,a){c.lastIndex=0;for(var h=0,l=[],u=c.exec(a);u;)l.push(a.substring(h,u.index)),h=u.index+u[0].length,u=c.exec(a);return h<a.length?l.push(a.substring(h,a.length)):l.push(""),l},n.exports.WhitespacePattern=_},function(n){function I(x,p){this._input=x,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}I.prototype.read=function(){var x=this._input.read(this._starting_pattern);return(!this._starting_pattern||x)&&(x+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),x},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.prototype.until_after=function(x){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(x),p._update(),p},I.prototype.until=function(x){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(x),p._update(),p},I.prototype.starting_with=function(x){var p=this._create();return p._starting_pattern=this._input.get_regexp(x,!0),p._update(),p},I.prototype.matching=function(x){var p=this._create();return p._match_pattern=this._input.get_regexp(x,!0),p._update(),p},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},n.exports.Pattern=I},function(n){function I(x,p){x=typeof x=="string"?x:x.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(x+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(x+/\sbeautify\signore:end\s/.source+p,"g")}I.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var _=this.__directive_pattern.exec(x);_;)p[_[1]]=_[2],_=this.__directive_pattern.exec(x);return p},I.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},function(n,I,x){var p=x(12).Pattern,_={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(a,h){p.call(this,a,h),this.__template_pattern=null,this._disabled=Object.assign({},_),this._excluded=Object.assign({},_),h&&(this.__template_pattern=this._input.get_regexp(h.__template_pattern),this._excluded=Object.assign(this._excluded,h._excluded),this._disabled=Object.assign(this._disabled,h._disabled));var l=new p(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 p,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(a){var h=this._create();return h._disabled[a]=!0,h._update(),h},c.prototype.read_options=function(a){var h=this._create();for(var l in _)h._disabled[l]=a.templating.indexOf(l)===-1;return h._update(),h},c.prototype.exclude=function(a){var h=this._create();return h._excluded[a]=!0,h._update(),h},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 h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),a+=h,h=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="",h=this._input.peek();if(h==="<"){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 h==="{"&&(!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 x=F[n]={exports:{}};return P[n](x,x.exports,G),x.exports}var H=G(0);N=H})();var z=N;!(te=[],Y=function(){return{js_beautify:z}}.apply(ge,te),Y!==void 0&&(ut.exports=Y))})()},"746U":function(ut,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 H}),U.d(ge,"c",function(){return n}),U.d(ge,"a",function(){return I}),U.d(ge,"i",function(){return x}),U.d(ge,"o",function(){return p}),U.d(ge,"e",function(){return a}),U.d(ge,"d",function(){return h}),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!H(s)}function H(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(H(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function x(s){return typeof s=="function"}function p(s,i){const D=Math.min(s.length,i.length);for(let A=0;A<D;A++)_(s[A],i[A])}function _(s,i){if(Y(i)){if(typeof s!==i)throw new Error(`argument does not match constraint: typeof ${i}`)}else if(x(i)){try{if(s instanceof i)return}catch(D){}if(!H(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 h(s,i){const D=S=>function(){const O=Array.prototype.slice.call(arguments,0);return i(S,O)};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(ut,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(_){return typeof _=="string"&&z.test(_)}for(var F=P,G=[],H=0;H<256;++H)G.push((H+256).toString(16).substr(1));function n(_){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(G[_[c+0]]+G[_[c+1]]+G[_[c+2]]+G[_[c+3]]+"-"+G[_[c+4]]+G[_[c+5]]+"-"+G[_[c+6]]+G[_[c+7]]+"-"+G[_[c+8]]+G[_[c+9]]+"-"+G[_[c+10]]+G[_[c+11]]+G[_[c+12]]+G[_[c+13]]+G[_[c+14]]+G[_[c+15]]).toLowerCase();if(!F(a))throw TypeError("Stringified UUID is invalid");return a}var I=n;function x(_,c,a){_=_||{};var h=_.random||(_.rng||N)();if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,c){a=a||0;for(var l=0;l<16;++l)c[a+l]=h[l];return c}return I(h)}var p=ge.a=x},"7ahc":function(ut,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"),H=U("OaEy"),n=U("2fM7"),I=U("q1tI"),x=U.n(I),p=U("VrN/"),_=U.n(p),c=U("p77/"),a=U.n(c),h=U("c5Ni"),l=U.n(h),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,O=A.onCancel,R=Object(I.useState)("python"),g=Object(G.a)(R,2),b=g[0],f=g[1];function d(E){f(i[E][1])}function C(E){S(E)}return x.a.createElement(F.a,Object(Y.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),x.a.createElement(F.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},x.a.createElement(n.a,{onChange:d},Object.keys(i).map(function(E){return x.a.createElement(u,{key:E,value:E},i[E][0])}))),x.a.createElement(F.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},x.a.createElement(D,{mode:b})),x.a.createElement("div",{className:"flex-container flex-end"},x.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),x.a.createElement(z.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function D(A){var S=A.value,O=A.onChange,R=A.mode,g=A.options,b=g===void 0?{}:g,f=Object(I.useRef)(),d=Object(I.useState)(),C=Object(G.a)(d,2),E=C[0],w=C[1];return Object(I.useEffect)(function(){if(E){function j(W){var T=W.getValue();O&&O(T)}return E.on("change",j),function(){E.off("change",j)}}},[E,O]),Object(I.useEffect)(function(){E&&E.setOption("mode",R)},[E,R]),Object(I.useEffect)(function(){E&&((S!==E.getValue()||S==="")&&setTimeout(function(){E.setValue(S||" ")},300))},[E,S]),Object(I.useEffect)(function(){if(f.current&&!E){var j=_.a.fromTextArea(f.current,Object(te.a)({mode:R,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));w(j)}},[f.current,E]),x.a.createElement("div",{className:"my-codemirror-container"},x.a.createElement("textarea",{ref:f}))}},"815F":function(ut,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 p}),U.d(ge,"f",function(){return _}),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,h){return a!=null?a:h}function H(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=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)(!h.has(S)||D===null||D===void 0,"Same 'key' exist in the Tree: ".concat(S)),h.set(S,!0),l(A,"".concat(s).concat(S," > "))})}l(a)}function n(a){function h(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"]),O=Object(Y.a)({key:i},S),R=h(A);return R.length&&(O.children=R),O}).filter(function(s){return s})}return h(a)}function I(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],l=new Set(h===!0?[]:h),u=[];function s(i){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return i.map(function(A,S){var O=Object(F.h)(D?D.pos:"0",S),R=G(A.key,O),g=Object(Y.a)(Object(Y.a)({},A),{},{parent:D,pos:O,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),h===!0||l.has(R)?g.children=s(A.children||[],g):g.children=[],g})}return s(a),u}function x(a,h,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,O=i?Object(F.h)(A.pos,D):"0";if(i){var R=u(i,O),g={node:i,index:D,pos:O,key:R,parentPos:A.node?A.pos:null,level:A.level+1};h(g)}S&&S.forEach(function(b,f){s(b,f,{node:i,pos:O,level:A?A.level+1:-1})})}s(null)}function p(a){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=h.initWrapper,u=h.processEntity,s=h.onProcessFinished,i=arguments.length>2?arguments[2]:void 0,D={},A={},S={posEntities:D,keyEntities:A};return l&&(S=l(S)||S),x(a,function(O){var R=O.node,g=O.index,b=O.pos,f=O.key,d=O.parentPos,C=O.level,E={node:R,index:g,key:f,pos:b,level:C},w=G(f,b);D[b]=E,A[w]=E,E.parent=D[d],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),u&&u(E,S)},i),s&&s(S),S}function _(a,h){var l=h.expandedKeys,u=h.selectedKeys,s=h.loadedKeys,i=h.loadingKeys,D=h.checkedKeys,A=h.halfCheckedKeys,S=h.dragOverNodeKey,O=h.dropPosition,R=h.keyEntities,g=R[a],b={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&&O===0,dragOverGapTop:S===a&&O===-1,dragOverGapBottom:S===a&&O===1};return b}function c(a){var h=a.data,l=a.expanded,u=a.selected,s=a.checked,i=a.loaded,D=a.loading,A=a.halfChecked,S=a.dragOver,O=a.dragOverGapTop,R=a.dragOverGapBottom,g=a.pos,b=a.active,f=Object(Y.a)(Object(Y.a)({},h),{},{expanded:l,selected:u,checked:s,loaded:i,loading:D,halfChecked:A,dragOver:S,dragOverGapTop:O,dragOverGapBottom:R,pos:g,active:b});return"props"in f||Object.defineProperty(f,"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}}),f}},"8EBN":function(ut,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("."),H=G>-1&&z.substring(G+1,z.length);if(H)return te.findModeByExtension(H)},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(ut,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 H}),U.d(ge,"c",function(){return n});var te=U("MI8n"),Y=U("pmY6"),N=U("3/fG"),z=function(I,x,p,_){function c(a){return a instanceof p?a:new p(function(h){h(a)})}return new(p||(p=Promise))(function(a,h){function l(i){try{s(_.next(i))}catch(D){h(D)}}function u(i){try{s(_.throw(i))}catch(D){h(D)}}function s(i){i.done?a(i.value):c(i.value).then(l,u)}s((_=_.apply(I,x||[])).next())})};class P extends Y.a{constructor(I,x="",p="",_=!0,c){super();this._onDidChange=this._register(new te.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=I,this._label=x,this._cssClass=p,this._enabled=_,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,x){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,x){return z(this,void 0,void 0,function*(){if(!I.enabled)return;this._onBeforeRun.fire({action:I});let p;try{yield this.runAction(I,x)}catch(_){p=_}this._onDidRun.fire({action:I,error:p})})}runAction(I,x){return z(this,void 0,void 0,function*(){yield I.run(x)})}}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 H{constructor(I,x,p,_){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=I,this.label=x,this.class=_,this._actions=p}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(ut,ge,U){ut.exports={button:"button___1wy9m"}},"9Bee":function(ut,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"),H=U("WmNS"),n=U.n(H),I=U("q1tI"),x=U.n(I),p=U("vg9a"),_=U("DlQD"),c=U.n(_),a=U("rUJ1");function h(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),ft=Pe[0];return ft.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 O(){return S(l,0,0,u),u.push("</ul>"),u.join("")}var R={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=h(V,k[3]||""),Q=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(Q)>=0){var Pe=f(),ft=ne;ne=Pe,d[Pe]={type:"block",expression:ft}}return{type:"code",raw:V,lang:Q,text:ne}}}},g=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,f=function(){return"__special_katext_id_".concat(b++,"__")},d={};function C(){return d}function E(){b=0,d={}}function w(Z){return Z=Z.replace(g,function(L,k){var V=f();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:R,renderer:s});var M=c.a,m=U("SJMd"),v=U("ulZh"),K=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(gt){Q(gt)}}function ft(rn){try{Lt(V.throw(rn))}catch(gt){Q(gt)}}function Lt(rn){var gt;rn.done?ne(rn.value):(gt=rn.value,gt instanceof k?gt:new k(function(Gt){Gt(gt)})).then(Pe,ft)}Lt((V=V.apply(Z,L||[])).next())})}function Ee(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:ft(0),throw:ft(1),return:ft(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function ft(Lt){return function(rn){return function(gt){if(k)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(k=1,V&&(ne=2>[0]?V.return:gt[0]?V.throw||((ne=V.return)&&ne.call(V),0):V.next)&&!(ne=ne.call(V,gt[1])).done)return ne;switch(V=0,ne&&(gt=[2>[0],ne.value]),gt[0]){case 0:case 1:ne=gt;break;case 4:return Pe.label++,{value:gt[1],done:!1};case 5:Pe.label++,V=gt[1],gt=[0];continue;case 7:gt=Pe.ops.pop(),Pe.trys.pop();continue;default:if(!(ne=Pe.trys,(ne=ne.length>0&&ne[ne.length-1])||gt[0]!==6&>[0]!==2)){Pe=0;continue}if(gt[0]===3&&(!ne||gt[1]>ne[0]&>[1]<ne[3])){Pe.label=gt[1];break}if(gt[0]===6&&Pe.label<ne[1]){Pe.label=ne[1],ne=gt;break}if(ne&&Pe.label<ne[2]){Pe.label=ne[2],Pe.ops.push(gt);break}ne[2]&&Pe.ops.pop(),Pe.trys.pop();continue}gt=L.call(Z,Pe)}catch(Gt){gt=[6,Gt],V=0}finally{k=ne=0}if(5>[0])throw gt[1];return{value:gt[0]?gt[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,ft=Q.length;Pe<ft;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],ft=Q[1];L.setAttribute(Pe,ft)}},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,ft){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(ft),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}(),Oe=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 ft=document.createElementNS("http://www.w3.org/2000/svg","svg");ft.setAttribute("xmlns","http://www.w3.org/2000/svg"),ft.setAttribute("width",k.width.baseVal.valueAsString),ft.setAttribute("height",k.height.baseVal.valueAsString),ft.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),ft.innerHTML=k.innerHTML,ne.naturalSize===!0?(ft.width.baseVal.value=L.naturalWidth,ft.height.baseVal.value=L.naturalHeight):ne.width!==void 0&&ne.height!==void 0&&(ft.width.baseVal.value=ne.width,ft.height.baseVal.value=ne.height),Pe.width=ft.width.baseVal.value,Pe.height=ft.height.baseVal.value;var Lt=ft.outerHTML,rn=Pe.getContext("2d");ne.markersOnly!==!0&&rn.drawImage(L,0,0,Pe.width,Pe.height);var gt=window.URL,Gt=new Image(Pe.width,Pe.height);Gt.setAttribute("crossOrigin","anonymous");var pr=new Blob([Lt],{type:"image/svg+xml"}),Ir=gt.createObjectURL(pr);Gt.onload=function(){rn.drawImage(Gt,0,0),gt.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 Xe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Xe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Xe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new We("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new We("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}(),Xe=function(Z,L){this.selector=Z,this.style=L},We=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 We("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 We("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new We("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new We("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 We("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new We("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 We("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new We("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Xe("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Xe("."+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 We("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 We("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new We("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new We("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new We("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 We("toolbox-panel-row_colors",`
|
|
background-color: `+((L=this.uiStyleSettings.toolboxBackgroundColor)!==null&&L!==void 0?L:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new We("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 We("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new We("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Xe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Xe("."+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 ft=document.createElement("div");ft.className=ne.toolboxButtonStyleClass.name+" "+((Pe=ne.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:ne.toolboxButtonStyleColorsClass.name),ft.innerHTML=Q.icon,ft.title=Q.title,ft.addEventListener("click",function(){ne.panelButtonClick(Q)}),ne.panelButtons.push(ft),ne.buttonRow.appendChild(ft)}),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 ft,Lt;Q.className=k.toolboxButtonStyleClass.name+" "+(Pe===V?""+((ft=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ft!==void 0?ft: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 ft=document.createElement("div");return ft.style.display="inline-block",ft.style.width=Q-2+"px",ft.style.height=Q-2+"px",ft.style.backgroundColor=k,ft.style.borderRadius=Q/2+"px",k==="transparent"&&(ft.style.fill=this.uiStyleSettings.toolboxAccentColor,ft.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(ft),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}(),Be=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}(),at=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}(),pt=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 Be,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 at;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,ft=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,ft),this.positionGrip(this.controlGrips.bottomCenter.visual,Q,ft),this.positionGrip(this.controlGrips.bottomRight.visual,Lt,ft),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),ot=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}(pt),bt=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 ft=document.createElement("div");ft.style.minHeight="20px",ft.style.flexGrow="2",ft.style.display="flex",ft.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",ft.appendChild(Lt),Q.appendChild(ft),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),yt=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 ft=`<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=ft,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 bt("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new yt("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}(ot),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 at;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 bt("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new yt("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 ft=document.createElement("div");ft.style.whiteSpace="nowrap",ft.style.overflow="hidden",ft.style.textOverflow="ellipsis",ft.innerHTML="The quick brown fox jumps over the lazy dog",Pe.appendChild(ft),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}(pt),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 bt("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],ft=V[3],Lt=!1,rn=0;rn<this.canvasElement.height;rn++)for(var gt=0;gt<this.canvasElement.width;gt++)k.data[rn*this.canvasElement.width*4+4*gt+3]>0&&(Lt=!0,rn<Q&&(Q=rn),gt<ne&&(ne=gt),rn>ft&&(ft=rn),gt>Pe&&(Pe=gt));if(Lt){this.left=ne/this.pixelRatio,this.top=Q/this.pixelRatio,this.width=(Pe-ne)/this.pixelRatio,this.height=(ft-Q)/this.pixelRatio;var Gt=document.createElement("canvas");Gt.width=Pe-ne,Gt.height=ft-Q,Gt.getContext("2d").putImageData(this.canvasContext.getImageData(ne,Q,Pe-ne,ft-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}(pt),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(ft){var Lt="both";switch(ft){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 gt=document.createElement("div");gt.style.display="flex",gt.style.alignItems="center",gt.style.minHeight="20px",gt.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>`,gt.style.marginLeft="5px",rn.appendChild(gt)}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}(ot),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>',ke=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 at,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 bt("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new yt("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}(pt),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 bt("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new yt("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,ke,ht,ce,Ot,en]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[xt,xe,me,st,et,Te,ke]},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(),Oe.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 Ee(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 ft=new $t(L,void 0,!0);Pe(ft),ft.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var V=function(Pe){var ft=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,ft))})},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 Ee(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){Oe.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(gt){Q(gt)}}function ft(rn){try{Lt(V.throw(rn))}catch(gt){Q(gt)}}function Lt(rn){var gt;rn.done?ne(rn.value):(gt=rn.value,gt instanceof k?gt:new k(function(Gt){Gt(gt)})).then(Pe,ft)}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:ft(0),throw:ft(1),return:ft(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function ft(Lt){return function(rn){return function(gt){if(k)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(k=1,V&&(ne=2>[0]?V.return:gt[0]?V.throw||((ne=V.return)&&ne.call(V),0):V.next)&&!(ne=ne.call(V,gt[1])).done)return ne;switch(V=0,ne&&(gt=[2>[0],ne.value]),gt[0]){case 0:case 1:ne=gt;break;case 4:return Pe.label++,{value:gt[1],done:!1};case 5:Pe.label++,V=gt[1],gt=[0];continue;case 7:gt=Pe.ops.pop(),Pe.trys.pop();continue;default:if(!(ne=Pe.trys,(ne=ne.length>0&&ne[ne.length-1])||gt[0]!==6&>[0]!==2)){Pe=0;continue}if(gt[0]===3&&(!ne||gt[1]>ne[0]&>[1]<ne[3])){Pe.label=gt[1];break}if(gt[0]===6&&Pe.label<ne[1]){Pe.label=ne[1],ne=gt;break}if(ne&&Pe.label<ne[2]){Pe.label=ne[2],Pe.ops.push(gt);break}ne[2]&&Pe.ops.pop(),Pe.trys.pop();continue}gt=L.call(Z,Pe)}catch(Gt){gt=[6,Gt],V=0}finally{k=ne=0}if(5>[0])throw gt[1];return{value:gt[0]?gt[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],ft=Q[1];L.setAttribute(Pe,ft)}},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,ft){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(ft),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,ft,Lt){return"M"+L+","+k+"V"+(k+ne)+"H"+(L+V)+"V"+k+"H"+Q+"V"+Pe+"H"+(Q+ft)+"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},$n=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 ft=ln.createDefs();Pe.appendChild(ft);var Lt=ln.createElement("clipPath",[["id","text-bg-clip"]]);ft.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 gt=ln.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);gt.appendChild(ln.createTSpan(L+":"+k)),Pe.appendChild(gt);var Gt=gt.getBBox();ln.setAttributes(gt,[["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 ft=k.y+V*(Pe+1);ln.setAttributes(Q,[["x1",""+k.x],["y1",""+ft],["x2",""+(k.x+k.width)],["y2",""+ft]])});var ne=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Q,Pe){var ft=k.x+ne*(Pe+1);ln.setAttributes(Q,[["x1",""+ft],["y1",""+k.y],["x2",""+ft],["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 ft=V/L,Lt=ne/k;return{x:(Q.x-Pe)*ft+Pe,y:(Q.y-Pe)*Lt+Pe,width:Q.width*ft,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="°",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,ft){var Lt=this;return new Promise(function(rn){var gt=document.createElement("canvas");gt.width=L.width.baseVal.value-2*ne,gt.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)/ft,gt.width=k.naturalWidth/Pe,gt.height=k.naturalHeight/ft):Lt.width!==void 0&&Lt.height!==void 0&&(Gt=Lt.width/V.width,pr=Lt.height/V.height,gt.width*=Gt,gt.height*=pr);var Ir=gt.getContext("2d");Ir.translate(gt.width/2,gt.height/2),Ir.rotate(Q*Math.PI/180),Ir.scale(Pe,ft),Ir.translate(-gt.width/2,-gt.height/2),Ir.drawImage(k,0,0,gt.width,gt.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 $n,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 ft=document.createElement("div");ft.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>',ft.appendChild(Lt),Pe.addElement(ft)}var rn=new Nr;rn.minWidth=3*this.toolbarHeight+"px",rn.contentAlign="end",this.topToolbar.addButtonBlock(rn);var gt=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");gt.onClick=this.startRenderAndClose,rn.addButton(gt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(gt.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 $n,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 ft=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");ft.onClick=this.flipHorizontallyButtonClicked,Pe.addButton(ft);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,ft=Z.showLines,Lt=Z.replaces,rn=Z.zoomImg,gt=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(Me){}var Ct=M(mt),Mt=C();if(mt.match(/\[TOC\]/)&&(Ct=Ct.replace("<p>[TOC]</p>",O()),D()),Ct=Ct.replace(/(__special_katext_id_\d+__)/g,function(Me,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"),E(),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=ft,ft&&(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(K.a.isSupported()){var Mt=new K.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),E(),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 x.a.createElement("div",{style:{position:"relative"}},x.a.createElement("div",{ref:Kt,style:Object(P.a)({},pr),className:"".concat(Q||""," markdown-body ").concat(Gi.a.mdBody),onMouseOver:Un,dangerouslySetInnerHTML:{__html:Nn}}),x.a.createElement("div",{ref:Pt,className:Gi.a.button},x.a.createElement(Y.a,null,x.a.createElement(z.a,{onClick:function(){return Sn()}},"\u88C1\u526A"),x.a.createElement(z.a,{onClick:function(){return hr()}},"\u7F16\u8F91"))),x.a.createElement("img",{ref:Rt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),x.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(ut,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 H=setInterval(G,P);return function(){return clearInterval(H)}}},[P])}},"A60/":function(ut,ge,U){ut.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(ut,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 H=document.querySelector("head");return H||document.body}function z(G){var H,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(te.a)())return null;var I=document.createElement("style");if((H=n.csp)===null||H===void 0?void 0:H.nonce){var x;I.nonce=(x=n.csp)===null||x===void 0?void 0:x.nonce}I.innerHTML=G;var p=N(n),_=p.firstChild;return n.prepend&&p.prepend?p.prepend(I):n.prepend&&_?p.insertBefore(I,_):p.appendChild(I),I}var P=new Map;function F(G,H){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=N(n);if(!P.has(I)){var x=z("",n),p=x.parentNode;P.set(I,p),p.removeChild(x)}var _=Array.from(P.get(I).children).find(function(u){return u.tagName==="STYLE"&&u[Y]===H});if(_){var c,a;if(((c=n.csp)===null||c===void 0?void 0:c.nonce)&&_.nonce!==((a=n.csp)===null||a===void 0?void 0:a.nonce)){var h;_.nonce=(h=n.csp)===null||h===void 0?void 0:h.nonce}return _.innerHTML!==G&&(_.innerHTML=G),_}var l=z(G,n);return l[Y]=H,l}},Bd2K:function(ut,ge,U){(function(te){te(U("VrN/"),U("osHv"))})(function(te){te.defineOption("autoCloseTags",!1,function(n,I,x){if(x!=te.Init&&x&&n.removeKeyMap("autoCloseTags"),!I)return;var p={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(p["'/'"]=function(_){return F(_)}),(typeof I!="object"||I.whenOpening!==!1)&&(p["'>'"]=function(_){return z(_)}),n.addKeyMap(p)});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(),x=[],p=n.getOption("autoCloseTags"),_=0;_<I.length;_++){if(!I[_].empty())return te.Pass;var c=I[_].head,a=n.getTokenAt(c),h=te.innerMode(n.getMode(),a.state),l=h.state,u=h.mode.xmlCurrentTag&&h.mode.xmlCurrentTag(l),s=u&&u.name;if(!s)return te.Pass;var i=h.mode.configuration=="html",D=typeof p=="object"&&p.dontCloseTags||i&&Y,A=typeof p=="object"&&p.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||H(n,h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(l)||[],s,c,!0))return te.Pass;var O=typeof p=="object"&&p.emptyTags;if(O&&G(O,s)>-1){x[_]={text:"/>",newPos:te.Pos(c.line,c.ch+2)};continue}var R=A&&G(A,S)>-1;x[_]={indent:R,text:">"+(R?`
|
|
|
|
`:"")+"</"+s+">",newPos:R?te.Pos(c.line+1,0):te.Pos(c.line,c.ch+1)}}for(var g=typeof p=="object"&&p.dontIndentOnAutoClose,_=I.length-1;_>=0;_--){var b=x[_];n.replaceRange(b.text,I[_].head,I[_].anchor,"+insert");var f=n.listSelections().slice(0);f[_]={head:b.newPos,anchor:b.newPos},n.setSelections(f),!g&&b.indent&&(n.indentLine(b.newPos.line,null,!0),n.indentLine(b.newPos.line+1,null,!0))}}function P(n,I){for(var x=n.listSelections(),p=[],_=I?"/":"</",c=n.getOption("autoCloseTags"),a=typeof c=="object"&&c.dontIndentOnSlash,h=0;h<x.length;h++){if(!x[h].empty())return te.Pass;var l=x[h].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=_+"script";else if(A&&s.mode.name=="css")D=_+"style";else{var S=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(i);if(!S||S.length&&H(n,S,S[S.length-1],l))return te.Pass;D=_+S[S.length-1]}n.getLine(l.line).charAt(u.end)!=">"&&(D+=">"),p[h]=D}if(n.replaceSelections(p),x=n.listSelections(),!a)for(var h=0;h<x.length;h++)(h==x.length-1||x[h].head.line<x[h+1].head.line)&&n.indentLine(x[h].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 x=0,p=n.length;x<p;++x)if(n[x]==I)return x;return-1}function H(n,I,x,p,_){if(!te.scanForClosingTag)return!1;var c=Math.min(n.lastLine()+1,p.line+500),a=te.scanForClosingTag(n,p,null,c);if(!a||a.tag!=x)return!1;for(var h=_?1:0,l=I.length-1;l>=0&&I[l]==x;l--)++h;p=a.to;for(var l=1;l<h;l++){var u=te.scanForClosingTag(n,p,null,c);if(!u||u.tag!=x)return!1;p=u.to}return!0}})},BdwD:function(ut,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"),H=U.n(G),n=function(x){var p=x.buttonProps,_=p===void 0?{}:p,c=x.styles,a=c===void 0?{}:c,h=x.customText,l=x.ButtonText,u=x.ButtonClick,s=x.Buttonclass,i=x.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:H.a}),F.a.createElement("p",{className:"mt20 font14"},h||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),l&&F.a.createElement(Y.a,Object(N.a)({className:s,onClick:u},_),l),i&&i)};ge.a=n},BjJ7:function(ut,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(H){var n=!0;if(H.length>0){for(var I=0;I<H.length;I++)if(H[I].compile_success==0||!H[I].compile_success){n=!1;break}}else n=!1;return n}function N(H){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],x=0;x<H.length;x++){var p=H[x],_=n?"".concat(n,"/").concat(p.name):"".concat(p.name);I.push({title:p.name,isLeaf:!(p.type==="tree"),key:_})}return I}function z(H,n,I){for(var x=0;x<H.length;x++){var p=H[x];if(p.key===n){p.children=I;break}p.children&&z(p.children,n,I)}return H}function P(H,n,I){var x;return function(){var p=this,_=arguments,c=function(){x=null,I||H.apply(p,_)},a=I&&!x;clearTimeout(x),x=setTimeout(c,n),a&&H.apply(p,_)}}var F=!0,G=te.a.API_SERVER},"C+DQ":function(ut,ge,U){},"C/vA":function(ut,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(ut,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(H){return H[F.DI_DEPENDENCIES]||[]}F.getServiceDependencies=G})(te||(te={}));const Y=z("instantiationService");function N(F,G,H,n){G[te.DI_TARGET]===G?G[te.DI_DEPENDENCIES].push({id:F,index:H,optional:n}):(G[te.DI_DEPENDENCIES]=[{id:F,index:H,optional:n}],G[te.DI_TARGET]=G)}function z(F){if(te.serviceIds.has(F))return te.serviceIds.get(F);const G=function(H,n,I){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");N(G,H,I,!1)};return G.toString=()=>F,te.serviceIds.set(F,G),G}function P(F){return function(G,H,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(ut,ge,U){(function(te,Y){ut.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}}),H=G.defaults,n=G.getDefaults,I=G.changeDefaults,x=/[&<>"']/,p=/[&<>"']/g,_=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,a={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(we){return a[we]};function l(xe,we){if(we){if(x.test(xe))return xe.replace(p,h)}else if(_.test(xe))return xe.replace(c,h);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 O(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 R={},g=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(xe,we){R[" "+xe]||(g.test(xe)?R[" "+xe]=xe+"/":R[" "+xe]=j(xe,"/",!0)),xe=R[" "+xe];var me=xe.indexOf(":")===-1;return we.substring(0,2)==="//"?me?we:xe.replace(b,"$1")+we:we.charAt(0)==="/"?me?we:xe.replace(f,"$1")+we:xe+we}var C={exec:function(){}};function E(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,ke){for(var et=!1,ht=Re;--ht>=0&&ke[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:O,resolveUrl:d,noopTest:C,merge:E,splitCells:w,rtrim:j,findClosingBracket:W,checkSanitizeDeprecation:T},m=G.defaults,v=M.rtrim,K=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 ke=Te[0].replace(/^ {4}/gm,"");return{type:"code",raw:Te[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:v(ke,`
|
|
`)}}},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:K(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,ke;for(ke=0;ke<Re;ke++)/^ *-+: *$/.test(Te.align[ke])?Te.align[ke]="right":/^ *:-+: *$/.test(Te.align[ke])?Te.align[ke]="center":/^ *:-+ *$/.test(Te.align[ke])?Te.align[ke]="left":Te.align[ke]=null;for(Re=Te.cells.length,ke=0;ke<Re;ke++)Te.cells[ke]=K(Te.cells[ke],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],ke=Re.length>1,et=Re[Re.length-1]===")",ht={type:"list",raw:Te,ordered:ke,start:ke?+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],(ke?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:K(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,ke;for(ke=0;ke<Re;ke++)/^ *-+: *$/.test(Te.align[ke])?Te.align[ke]="right":/^ *:-+: *$/.test(Te.align[ke])?Te.align[ke]="center":/^ *:-+ *$/.test(Te.align[ke])?Te.align[ke]="left":Te.align[ke]=null;for(Re=Te.cells.length,ke=0;ke<Re;ke++)Te.cells[ke]=K(Te.cells[ke].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,ke=Re+he[1].length+Te;he[2]=he[2].substring(0,Te),he[0]=he[0].substring(0,ke).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 ke=Te[0].charAt(0);return{type:"text",raw:ke,text:ke}}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 ke=Re[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ke.lastIndex=0;for(var et;(Re=ke.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 ke=Re[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ke.lastIndex=0;for(var et;(Re=ke.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),ke=Te.startsWith(" ")&&Te.endsWith(" ");return Re&&ke&&(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,ke;return Te[2]==="@"?(Re=X(this.options.mangle?he(Te[1]):Te[1]),ke="mailto:"+Re):(Re=X(Te[1]),ke=Re),{type:"link",raw:Te[0],text:Re,href:ke,tokens:[{type:"text",raw:Re,text:Re}]}}},we.url=function(ce,he){var Te;if(Te=this.rules.inline.url.exec(ce)){var Re,ke;if(Te[2]==="@")Re=X(this.options.mangle?he(Te[0]):Te[0]),ke="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."?ke="http://"+Re:ke=Re}return{type:"link",raw:Te[0],text:Re,href:ke,tokens:[{type:"text",raw:Re,text:Re}]}}},we.inlineText=function(ce,he,Te){var Re=this.rules.inline.text.exec(ce);if(Re){var ke;return he?ke=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Re[0]):X(Re[0]):Re[0]:ke=X(this.options.smartypants?Te(Re[0]):Re[0]),{type:"text",raw:Re[0],text:ke}}},xe}(),ue=M.noopTest,fe=M.edit,Ee=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=Ee({},se),se.gfm=Ee({},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=Ee({},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=Ee({},ae),ae.pedantic=Ee({},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=Ee({},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=Ee({},ae.gfm,{br:fe(ae.br).replace("{2,}","*").getRegex(),text:fe(ae.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Oe={block:se,inline:ae},ze=G.defaults,Ye=Oe.block,He=Oe.inline;function Xe(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 We(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,ke,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,ke=0;ke<et;ke++)Re.items[ke].tokens=this.blockTokens(Re.items[ke].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,ke,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:[]},ke=ht.header.length,Te=0;Te<ke;Te++)ht.tokens.header[Te]=[],this.inlineTokens(ht.header[Te],ht.tokens.header[Te]);for(ke=ht.cells.length,Te=0;Te<ke;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(ke=ht.items.length,Te=0;Te<ke;Te++)this.inline(ht.items[Te].tokens);break}}}return ce},we.inlineTokens=function(ce,he,Te,Re,ke){he===void 0&&(he=[]),Te===void 0&&(Te=!1),Re===void 0&&(Re=!1),ke===void 0&&(ke="");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,ke)){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,ke)){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,We)){ce=ce.substring(et.raw.length),he.push(et);continue}if(!Te&&(et=this.tokenizer.url(ce,We))){ce=ce.substring(et.raw.length),he.push(et);continue}if(et=this.tokenizer.inlineText(ce,Re,Xe)){ce=ce.substring(et.raw.length),ke=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 ke=this.options.highlight(ce,Re);ke!=null&&ke!==ce&&(Te=!0,ce=ke)}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",ke=he&&Te!==1?' start="'+Te+'"':"";return"<"+Re+ke+`>
|
|
`+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}(),Be=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}(),at=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,pt=M.unescape,ot=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 Be,this.slugger=new at}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,ke,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,pt(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,ke=0;ke<ht;ke++)en+=this.renderer.tablecell(this.parseInline($t.tokens.header[ke]),{header:!0,align:$t.align[ke]});for(mn+=this.renderer.tablerow(en),En="",ht=$t.cells.length,ke=0;ke<ht;ke++){for(nn=$t.tokens.cells[ke],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="",ke=0;ke<ht;ke++)Pn=$t.items[ke],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,ke,et=ce.length;for(Re=0;Re<et;Re++){ke=ce[Re];switch(ke.type){case"escape":{Te+=he.text(ke.text);break}case"html":{Te+=he.html(ke.text);break}case"link":{Te+=he.link(ke.href,ke.title,this.parseInline(ke.tokens,he));break}case"image":{Te+=he.image(ke.href,ke.title,ke.text);break}case"strong":{Te+=he.strong(this.parseInline(ke.tokens,he));break}case"em":{Te+=he.em(this.parseInline(ke.tokens,he));break}case"codespan":{Te+=he.codespan(ke.text);break}case"br":{Te+=he.br();break}case"del":{Te+=he.del(this.parseInline(ke.tokens,he));break}case"text":{Te+=he.text(ke.text);break}default:{var ht='Token with "'+ke.type+'" type was not found.';if(this.options.silent){console.error(ht);return}else throw new Error(ht)}}}return Te},xe}(),bt=M.merge,yt=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=bt({},qe.defaults,we||{}),yt(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=ot.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 ke=Ke.lex(xe,we);return we.walkTokens&&qe.walkTokens(ke,we.walkTokens),ot.parse(ke,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 bt(qe.defaults,xe),kt(qe.defaults),qe},qe.getDefaults=Ze,qe.defaults=Ot,qe.use=function(xe){var we=bt({},xe);if(xe.renderer&&function(){var ce=qe.defaults.renderer||new Ne,he=function(ke){var et=ce[ke];ce[ke]=function(){for(var ht=arguments.length,Ut=new Array(ht),nn=0;nn<ht;nn++)Ut[nn]=arguments[nn];var en=xe.renderer[ke].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(ke){var et=ce[ke];ce[ke]=function(){for(var ht=arguments.length,Ut=new Array(ht),nn=0;nn<ht;nn++)Ut[nn]=arguments[nn];var en=xe.tokenizer[ke].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 ke=Re.value;qe.walkTokens(ke,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=ot,qe.parser=ot.parse,qe.Renderer=Ne,qe.TextRenderer=Be,qe.Lexer=Ke,qe.lexer=Ke.lex,qe.Tokenizer=pe,qe.Slugger=at,qe.parse=qe;var st=qe;return st})},EJTS:function(ut,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"),H=U("7Kak"),n=U("9yH6"),I=U("tJVT"),x=U("q1tI"),p=U.n(x),_=U("9Bee"),c=U("+vTd"),a=U.n(c),h=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(O){var R,g=O.data,b=O.selectIds,f=O.onSelectCheckBox,d=f===void 0?function(){}:f,C=O.showCheckbox,E=C===void 0?!0:C,w=Object(x.useState)(!1),j=Object(I.a)(w,2),W=j[0],T=j[1],M=function(){if(g.item_type==="JUDGMENT")return p.a.createElement("div",{className:a.a.judgmentContent},g.choices.map(function(ye,pe){return p.a.createElement(n.a,{key:pe,disabled:!0},ye.choice_text)}));if(g.item_type==="PROGRAM"){var q;return p.a.createElement("div",{className:a.a.programContent},p.a.createElement(_.a,{value:(q=g.program_attr)===null||q===void 0?void 0:q.description}))}if(g.item_type==="COMBINATION"){var re;return p.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 p.a.createElement(x.Fragment,null,p.a.createElement("div",{style:{marginTop:10,marginBottom:10}},p.a.createElement(_.a,{value:fe+ye.name})),ye.choices.map(function(Ee,se){return p.a.createElement("div",{key:se,className:a.a.otherContentItem},p.a.createElement("p",null,s[se]),p.a.createElement(_.a,{className:a.a.otehrContentHtml,value:Ee.choice_text}))}),p.a.createElement("div",{className:a.a.con},p.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(Ee){return Ee==null?void 0:Ee.is_answer})]," "),p.a.createElement("div",null,p.a.createElement("span",null,"\u89E3\u6790\uFF1A"),p.a.createElement(_.a,{className:a.a.parseAnswerHtml,value:ye.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return p.a.createElement("div",{className:a.a.otherContent},g.choices.map(function(ye,pe){return p.a.createElement("div",{key:pe,className:a.a.otherContentItem},p.a.createElement("p",null,s[pe]),p.a.createElement(_.a,{className:a.a.otehrContentHtml,value:ye.choice_text}))}))},m=function(){var q;return p.a.createElement("div",null,(q=g.standard_answer)===null||q===void 0?void 0:q.map(function(re,ye){return p.a.createElement(_.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]:"",Ee="";g.choices.map(function(ze,Ye){ze.is_answer&&(Ee+=i[Ye])});var se=pe[g.item_type],ae={SINGLE:p.a.createElement(_.a,{className:a.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(fe||"\u65E0")}),MULTIPLE:p.a.createElement(_.a,{className:a.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(Ee||"\u65E0")}),COMPLETION:m()},Oe=p.a.createElement(_.a,{className:a.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(se||"\u65E0")});return ae[g.item_type]||Oe},K=function(q){var re=Object(G.a)(b);q.target.checked?re.push(g.id):re=re.filter(function(ye){return ye!==g.id}),d(re)};return p.a.createElement("div",{className:a.a.itemWrap},p.a.createElement("div",{className:a.a.list},E&&p.a.createElement(F.a,{className:"mr10",onChange:K,checked:b.includes(g.id)}),p.a.createElement("div",{className:a.a.title},p.a.createElement(_.a,{key:1,showLines:1,showTextOnly:!0,className:a.a.topicTitleContent,value:g.name})),p.a.createElement("div",{className:a.a.line},p.a.createElement("b",{className:a.a.b1}),p.a.createElement("b",{className:a.a.b2})),p.a.createElement("div",{onClick:function(){return T(!W)},className:a.a.tr},W?"\u6536\u8D77":"\u5C55\u5F00",p.a.createElement("i",{style:{transform:W?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),p.a.createElement("aside",{style:W?{display:"block"}:{display:"none"},className:a.a.itemDetail},p.a.createElement("div",{style:{marginBottom:44}},p.a.createElement(_.a,{key:2,className:a.a.topicTitleContent,value:g.name}),p.a.createElement("div",{className:"".concat(a.a.row," mt15")},M()),p.a.createElement("div",{className:a.a.row},p.a.createElement("div",{className:a.a.updateTimeRow},p.a.createElement("div",{className:a.a.updateTimeWrap},g.item_type==="PROGRAM"&&p.a.createElement("p",{className:a.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(R=g.program_attr)===null||R===void 0?void 0:R.language))))),g.item_type!=="PROGRAM"&&g.item_type!=="COMBINATION"&&p.a.createElement("div",{className:a.a.answerWrapper},p.a.createElement("img",{src:u.a,alt:"",className:a.a.decoration}),p.a.createElement("div",{className:a.a.answer},v()),p.a.createElement("div",{className:a.a.parse},p.a.createElement("div",{className:a.a.parseText},"\u89E3\u6790\uFF1A"),p.a.createElement("div",{className:a.a.parseAnswer},g.analysis?p.a.createElement(_.a,{className:a.a.parseAnswerHtml,value:g.analysis}):"\u6682\u65E0\u89E3\u6790")))))},A=function(O){var R,g,b,f,d,C,E,w,j,W,T,M,m,v,K,X,q=O.isProblemset,re=O.data,ye=O.user,pe=O.activeTabsKey,ue=O.onPublicReview,fe=ue===void 0?function(){}:ue,Ee=O.onStartExperience,se=Ee===void 0?function(){}:Ee,ae=O.onSetPrivate,Oe=ae===void 0?function(){}:ae,ze=O.onCorrection,Ye=ze===void 0?function(){}:ze,He=O.onCollect,Xe=He===void 0?function(){}:He,We=O.onSetPublic,Ke=We===void 0?function(){}:We,nt=O.onDelete,de=nt===void 0?function(){}:nt,De=O.onCancel,Ne=De===void 0?function(){}:De,Be=O.onSelect,at=Be===void 0?function(){}:Be,lt=O.onMoveTo,pt=lt===void 0?function(){}:lt,ot=O.onSetShare,bt=ot===void 0?function(){}:ot,yt=O.onCancelShare,xt=yt===void 0?function(){}:yt,Ze=O.onPublish,kt=Ze===void 0?function(){}:Ze,Ot=O.onCancelPublish,qe=Ot===void 0?function(){}:Ot,st=re.item_type==="PROGRAM"?"/problems/".concat((R=re.program_attr)===null||R===void 0?void 0:R.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=p.a.createElement(z.a,{forceSubMenuRender:!0,className:a.a.menu},pe==="0"&&!re.public&&p.a.createElement(z.a.Item,{key:"-1"},p.a.createElement("a",{className:a.a.actionLink,target:"_blank",href:st},"\u7F16\u8F91")),(pe==="0"||pe==="3")&&re.item_type==="PROGRAM"&&((b=re.program_attr)===null||b===void 0?void 0:b.status)!==0&&!re.public&&((f=re.author)===null||f===void 0?void 0:f.login)===((d=ye.userInfo)===null||d===void 0?void 0:d.login)&&p.a.createElement(z.a.Item,{key:"0"},p.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"&&p.a.createElement(z.a.Item,{key:"1"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return pt(re.id)}},"\u79FB\u52A8\u5230")),pe==="0"&&!(re!=null&&re.is_share)&&p.a.createElement(z.a.Item,{key:"3"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return bt(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)===((E=ye.userInfo)===null||E===void 0?void 0:E.login))&&p.a.createElement(z.a.Item,{key:"3"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return xt(re.id)}},"\u64A4\u9500\u5171\u4EAB")),xe&&p.a.createElement(z.a.Item,{key:"4"},p.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")&&p.a.createElement(z.a.Item,{key:"5"},p.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)&&p.a.createElement(z.a.Item,{key:"6"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Oe(re.id)}},"\u64A4\u9500\u516C\u5F00")),pe==="2"&&p.a.createElement(z.a.Item,{key:"7"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Xe(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)&&p.a.createElement(z.a.Item,{key:"8"},p.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(h.o)()&&!Object(h.m)()&&((m=re.author)===null||m===void 0?void 0:m.login)!==((v=ye.userInfo)===null||v===void 0?void 0:v.login)&&p.a.createElement(z.a.Item,{key:"9"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Xe(re.id,re.is_collected)}},re.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),pe!=="0"&&!Object(h.o)()&&!Object(h.m)()&&p.a.createElement(z.a.Item,{key:"10"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ye(re.id)}},"\u7EA0\u9519")),(pe==="0"&&!re.public||pe==="1"&&Object(h.o)()&&((K=re.author)===null||K===void 0?void 0:K.login)!==((X=ye.userInfo)===null||X===void 0?void 0:X.login))&&p.a.createElement(z.a.Item,{key:"11"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return de(re.id)}},"\u5220\u9664"))),me=p.a.createElement(z.a,{forceSubMenuRender:!0,className:a.a.menu},p.a.createElement(z.a.Item,{key:"10"},p.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ye(re.id)}},"\u7EA0\u9519"))),ce=pe!=="0"&&!Object(h.o)()&&!Object(h.m)();return p.a.createElement(p.a.Fragment,null,q?p.a.createElement(p.a.Fragment,null,re.item_type!=="SUBJECTIVE"&&re.item_type!=="COMBINATION"&&p.a.createElement("span",{className:a.a.textBtn,style:{cursor:"pointer"},onClick:function(){return se(re)}},"\u4F53\u9A8C"),p.a.createElement(Y.a,{overlay:we},p.a.createElement("span",{style:{cursor:"default"},onClick:function(Te){return Te.preventDefault()}},p.a.createElement("span",{className:a.a.textBtn},"\u66F4\u591A")))):ce?p.a.createElement(Y.a,{className:"ml40",overlay:me},p.a.createElement("span",{style:{cursor:"default"},onClick:function(Te){return Te.preventDefault()}},p.a.createElement("span",null,"\u66F4\u591A"))):p.a.createElement("span",null))};ge.b=D},ELLl:function(ut,ge,U){(function(te){te(U("VrN/"))})(function(te){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},N=te.Pos;te.defineOption("autoCloseBrackets",!1,function(a,h,l){l&&l!=te.Init&&(a.removeKeyMap(P),a.state.closeBrackets=null),h&&(F(z(h,"pairs")),a.state.closeBrackets=h,a.addKeyMap(P))});function z(a,h){return h=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[h]!=null?a[h]:Y[h]}var P={Backspace:n,Enter:I};function F(a){for(var h=0;h<a.length;h++){var l=a.charAt(h),u="'"+l+"'";P[u]||(P[u]=G(l))}}F(Y.pairs+"`");function G(a){return function(h){return p(h,a)}}function H(a){var h=a.state.closeBrackets;if(!h||h.override)return h;var l=a.getModeAt(a.getCursor());return l.closeBrackets||h}function n(a){var h=H(a);if(!h||a.getOption("disableInput"))return te.Pass;for(var l=z(h,"pairs"),u=a.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return te.Pass;var i=_(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 h=H(a),l=h&&z(h,"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=_(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 x(a){var h=te.cmpPos(a.anchor,a.head)>0;return{anchor:new N(a.anchor.line,a.anchor.ch+(h?-1:1)),head:new N(a.head.line,a.head.ch+(h?1:-1))}}function p(a,h){var l=H(a);if(!l||a.getOption("disableInput"))return te.Pass;var u=z(l,"pairs"),s=u.indexOf(h);if(s==-1)return te.Pass;for(var i=z(l,"closeBefore"),D=z(l,"triples"),A=u.charAt(s+1)==h,S=a.listSelections(),O=s%2==0,R,g=0;g<S.length;g++){var b=S[g],f=b.head,d,C=a.getRange(f,N(f.line,f.ch+1));if(O&&!b.empty())d="surround";else if((A||!O)&&C==h)A&&c(a,f)?d="both":D.indexOf(h)>=0&&a.getRange(f,N(f.line,f.ch+3))==h+h+h?d="skipThree":d="skip";else if(A&&f.ch>1&&D.indexOf(h)>=0&&a.getRange(N(f.line,f.ch-2),f)==h+h){if(f.ch>2&&/\bstring/.test(a.getTokenTypeAt(N(f.line,f.ch-2))))return te.Pass;d="addFour"}else if(A){var E=f.ch==0?" ":a.getRange(N(f.line,f.ch-1),f);if(!te.isWordChar(C)&&E!=h&&!te.isWordChar(E))d="both";else return te.Pass}else if(O&&(C.length===0||/\s/.test(C)||i.indexOf(C)>-1))d="both";else return te.Pass;if(!R)R=d;else if(R!=d)return te.Pass}var w=s%2?u.charAt(s-1):h,j=s%2?h:u.charAt(s+1);a.operation(function(){if(R=="skip")a.execCommand("goCharRight");else if(R=="skipThree")for(var W=0;W<3;W++)a.execCommand("goCharRight");else if(R=="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]=x(T[W]);a.setSelections(T)}else R=="both"?(a.replaceSelection(w+j,null),a.triggerElectric(w+j),a.execCommand("goCharLeft")):R=="addFour"&&(a.replaceSelection(w+w+w+w,"before"),a.execCommand("goCharRight"))})}function _(a,h){var l=a.getRange(N(h.line,h.ch-1),N(h.line,h.ch+1));return l.length==2?l:null}function c(a,h){var l=a.getTokenAt(N(h.line,h.ch+1));return/\bstring/.test(l.type)&&l.start==h.ch&&(h.ch==0||!/\bstring/.test(a.getTokenTypeAt(h)))}})},FOrL:function(ut,ge,U){ut.exports=U.p+"static/nodata.a6b3f948.png"},FWmy:function(ut,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(ut,ge,U){},IPdS:function(ut,ge,U){ut.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(ut,ge){ut.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(ut,ge){ut.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAhNJREFUWEftlztLA0EQx/97Z2LAF1ooKhZaCClsVARFLAQbbQTBVFY2NjZiI4KFINjo51DBD2BhI4IQfKAIikJAg48oKD4Kk3usbDabXHSTu1yCucJp5pL5z+zvZm4XllBKVZTZSBriaLIV9HMdBIOoJE22XHEaA8U+zMc19B2HbfV5BByCAeAzDMPB4rJiCt0uBoZDHI5uIv4xUczbFJQbqOFdJNVz6Nm64xB7wVtQf0tBhUohJol7VHX1c4jddr0UNV3VIMoGh9hpKB+EakazIer7gc5FwN/o6qUcJyWegKsV4PUgmZINEVwGfHXyWoQAlALMy0zEmHdi2htwsWSBeFnNjIPVYOuIWuJZrG0XtwOQ5PNOPC+U75tIjyM27wGIu1kdFZXyRupxJGPMMxPPQp8vbo3l0fNxMAhmpgYovt8+15yF3u47EPEceg4RnfHAOG6mPQARmSoeQvUDRsLpYLJ0fBylgBAAAoZ5mTGdFVj1p07M65CzThhxQM2xi6QLOtPzTlyOO4Nw1Wz7pN8QugZU+ACZT54Tlhj7bdXJ4j81LN9qupYax/lY6pxIAIpklmaO/+1fUq4Q9VKed+JsxAPjOB32AMTJkAcgjgY8ABHu/YfI3DtU4+/vHWwDG+o9hwh39+HrYR8Uitut7yqPwESgeTBzIWYg75FNEK3NVcFCk6gvitqOELtMZyAKLVJC/TfVWC6c92hknAAAAABJRU5ErkJggg=="},JUtD:function(ut,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"),H=U("W9HT"),n=U("+L6B"),I=U("2/Rp"),x=U("sPJy"),p=U("bE4q"),_=U("5Dmo"),c=U("3S7+"),a=U("lUTK"),h=U("BvKs"),l=U("sRBo"),u=U("kaz8"),s=U("miYZ"),i=U("tsqr"),D=U("7Kak"),A=U("9yH6"),S=U("2qtc"),O=U("kLXV"),R=U("oBTY"),g=U("k1fw"),b=U("9og8"),f=U("tJVT"),d=U("PpiC"),C=U("5NDa"),E=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"),K=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(O.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),Ee=U("xlxt"),se=U.n(Ee),ae=U("P/tu"),Oe=U("wd/R"),ze=U.n(Oe),Ye=function(mt){var Pt=mt.problemset,Rt=mt.dispatch,Ht=Object(M.useState)([]),un=Object(f.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(O.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),Xe=U("i8i3"),We=U.n(Xe),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(f.a)(gn,2),Kn=Ln[0],dn=Ln[1],Sn=Object(M.useState)(1),hr=Object(f.a)(Sn,2),Nn=hr[0],Kt=hr[1],An=Object(M.useState)([]),lr=Object(f.a)(An,2),Un=lr[0],zt=lr[1],jt=Object(M.useState)([]),yn=Object(f.a)(jt,2),Ct=yn[0],Mt=yn[1],Dt=Object(M.useState)(!0),Me=Object(f.a)(Dt,2),Vt=Me[0],Tn=Me[1],mr=Object(M.useState)(!1),On=Object(f.a)(mr,2),ii=On[0],ai=On[1],Kr=Object(M.useState)(!1),jn=Object(f.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(b.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)}}(),Qn=function(){un({type:"problemset/setActionTabs",payload:{}})},oi=function(){var Jt=Object(b.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(),Qn()),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(O.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:We.a.customModal,onCancel:Qn},m.a.createElement("aside",{className:We.a.shareModal},m.a.createElement(H.a,{spinning:Vt},m.a.createElement("div",{className:We.a.content},Nn===1&&m.a.createElement("div",{className:We.a.group},m.a.createElement(ae.a,{value:Un,onChange:function(Yt){return zt(Yt)}})),Nn===2&&m.a.createElement("div",{className:We.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:We.a.footer},m.a.createElement(I.a,{onClick:Qn},"\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(f.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(b.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(O.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")))},Be=Object(v.a)(function(Zt){var mt=Zt.problemset,Pt=Zt.loading,Rt=Zt.globalSetting;return{problemset:mt,globalSetting:Rt,loading:Pt.effects}})(Ne),at=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(b.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(O.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}})(at),pt=U("LvDl"),ot=U("9Bee"),bt=function(mt){var Pt,Rt=mt.problemset,Ht=mt.dispatch,un=Object(M.useState)({}),xn=Object(f.a)(un,2),Cn=xn[0],gn=xn[1],Ln=Object(M.useState)([]),Kn=Object(f.a)(Ln,2),dn=Kn[0],Sn=Kn[1],hr=Object(M.useState)(!1),Nn=Object(f.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(pt.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(b.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(pt.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(Me,Vt){return Object(g.a)(Object(g.a)({},Me),{},{checked:Vt===Mt?Ct.target.checked:!1})});Sn(Dt)},jt=function(){gn({}),Sn([]),An(!1),Ht({type:"problemset/setActionTabs",payload:{}})};return m.a.createElement(O.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(ot.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,Me=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(ot.a,{className:pe.a.html,value:Me}),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"))))},yt=Object(v.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(bt),xt=function(mt){var Pt,Rt=mt.problemset,Ht=mt.dispatch,un=Object(M.useState)({}),xn=Object(f.a)(un,2),Cn=xn[0],gn=xn[1],Ln=Object(M.useState)([]),Kn=Object(f.a)(Ln,2),dn=Kn[0],Sn=Kn[1],hr=Object(M.useState)(!1),Nn=Object(f.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(pt.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(b.a)(T.a.mark(function Mt(){var Dt,Me;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&&(Me=Object(pt.cloneDeep)(Rt==null||((Dt=Rt.actionTabs)===null||Dt===void 0)?void 0:Dt.params),Sn(Me.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 Me=dn.map(function(Vt,Tn){return Object(g.a)(Object(g.a)({},Vt),{},{checked:Tn===Dt?Mt.target.checked:Vt.checked})});Sn(Me)},jt=function(){gn({}),Sn([]),An(!1),Ht({type:"problemset/setActionTabs",payload:{}})},yn=function(){var Mt="";return dn.forEach(function(Dt,Me){Dt.is_answer&&(Mt=Mt+lr[Me])}),Mt};return m.a.createElement(O.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(ot.a,{value:Cn==null?void 0:Cn.name}),dn==null?void 0:dn.map(function(Ct,Mt){var Dt=Ct.is_answer,Me=Ct.checked,Vt=Ct.choice_text,Tn="";return Kt&&Dt&&(Tn=pe.a.green),Kt&&!Dt&&Me&&(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:Me}),m.a.createElement("span",null,lr[Mt],".\xA0"),m.a.createElement(ot.a,{className:pe.a.html,value:Vt}),Kt&&Dt&&m.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),Kt&&!Dt&&Me&&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(f.a)(xn,2),gn=Cn[0],Ln=Cn[1],Kn=Object(M.useState)([]),dn=Object(f.a)(Kn,2),Sn=dn[0],hr=dn[1],Nn=Object(M.useState)(!1),Kt=Object(f.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(pt.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(b.a)(T.a.mark(function Mt(){var Dt,Me;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&&(Me=Object(pt.cloneDeep)(Ht==null||((Dt=Ht.actionTabs)===null||Dt===void 0)?void 0:Dt.params),hr(Me.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 Me=Sn.map(function(Vt,Tn){return Object(g.a)(Object(g.a)({},Vt),{},{checked:Tn===Dt?Mt.target.checked:!1})});hr(Me)},yn=function(){Ln({}),hr([]),lr(!1),un({type:"problemset/setActionTabs",payload:{}})};return m.a.createElement(O.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(ot.a,{value:gn==null?void 0:gn.name}),Sn==null?void 0:Sn.map(function(Ct,Mt){var Dt=Ct.is_answer,Me=Ct.checked,Vt=Ct.choice_text,Tn="";return An&&Dt&&(Tn=pe.a.green),An&&!Dt&&Me&&(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:Me}),m.a.createElement(ot.a,{className:pe.a.html,value:Vt}),An&&Dt&&m.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),An&&!Dt&&Me&&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(f.a)(xn,2),gn=Cn[0],Ln=Cn[1],Kn=Object(M.useState)([]),dn=Object(f.a)(Kn,2),Sn=dn[0],hr=dn[1],Nn=Object(M.useState)(!1),Kt=Object(f.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,Me=Object(pt.cloneDeep)(Ht==null||((Mt=Ht.actionTabs)===null||Mt===void 0)?void 0:Mt.params);Ln(Me),hr(Me==null||((Dt=Me.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(b.a)(T.a.mark(function Mt(){var Dt,Me,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(pt.cloneDeep)(Ht==null||((Dt=Ht.actionTabs)===null||Dt===void 0)?void 0:Dt.params),hr(Vt==null||((Me=Vt.standard_answer)===null||Me===void 0)?void 0:Me.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 Me=Sn.map(function(Vt,Tn){return Object(g.a)(Object(g.a)({},Vt),{},{value:Tn===Dt?Mt.target.value:Vt.value})});hr(Me)},yn=function(){Ln({}),hr([]),lr(!1),un({type:"problemset/setActionTabs",payload:{}})};return m.a.createElement(O.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(ot.a,{value:gn==null?void 0:gn.name}),Sn==null?void 0:Sn.map(function(Ct,Mt){var Dt=Ct.value,Me=Ct.answer,Vt="";return An&&Me!==null&&Me!==void 0&&Me.includes(Dt)&&(Vt=pe.a.green),An&&!(Me!=null&&Me.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(E.a.TextArea,{className:pe.a.textArea,style:{width:610,marginRight:10},onChange:function(mr){return jt(mr,Mt)},value:Dt}),An&&(Me==null?void 0:Me.includes(Dt))&&m.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),An&&!(Me!=null&&Me.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),ke=[],et=function(mt){ke.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=ke.filter(function(Ht){return Ht.element===mt});return Rt.length>0?Rt[0].callbacks.push(Pt):ke.push({element:mt,callbacks:[Pt]}),{clear:function(){ke=ke.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(b.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(O.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"),$n=U("y8nQ"),sr=U("Vl3Y"),Nr=U("nSDg"),hn=U.n(Nr),Qt=U("HBuW"),$r=U("NLgs"),fr=U("vkP9"),Lr=E.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(f.a)(Kt,1),lr=An[0],Un=xn.shixunLists,zt=Object(M.useState)([]),jt=Object(f.a)(zt,2),yn=jt[0],Ct=jt[1],Mt=Object(M.useState)([]),Dt=Object(f.a)(Mt,2),Me=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(f.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(b.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,Qn){On.tag_level=Er,On.sub_discipline_id=ur,On.discipline_id=Qn,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(b.a)(T.a.mark(function Bt(){var Er,ur,Qn;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(Qn=Er(ur),!(typeof Qn=="object")){Xt.next=6;break}return Xt.abrupt("return",Qn.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")),Me==null?void 0:Me.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,Qn){return m.a.createElement("div",{key:Qn,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(Qn){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,Qn){return m.a.createElement("span",{key:Qn,className:"mr30 font12"},"\u7B2C",Qn+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(f.a)(un,1),Cn=xn[0],gn=Object(M.useState)({}),Ln=Object(f.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(E.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"),ft=U.n(Pe),Lt=j.a.TabPane,rn=E.a.Search,gt=E.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(f.a)(Mt,2),Me=Dt[0],Vt=Dt[1],Tn=Object(M.useState)(0),mr=Object(f.a)(Tn,2),On=mr[0],ii=mr[1],ai=Object(M.useState)([]),Kr=Object(f.a)(ai,2),jn=Kr[0],Bt=Kr[1],Er=Object(M.useState)(Gt.Mine),ur=Object(f.a)(Er,2),Qn=ur[0],oi=ur[1],Xt=Object(M.useState)(0),Jt=Object(f.a)(Xt,2),Yt=Jt[0],pn=Jt[1],Gn=Object(M.useState)(-1),Mn=Object(f.a)(Gn,2),qn=Mn[0],gr=Mn[1],wi=Object(M.useState)([]),Zn=Object(f.a)(wi,2),Qi=Zn[0],vr=Zn[1],fi=Object(M.useState)(!1),si=Object(f.a)(fi,2),Ni=si[0],ka=si[1],Lo=Object(M.useState)([]),ua=Object(f.a)(Lo,2),Gr=ua[0],lo=ua[1],uo=Object(M.useState)(0),va=Object(f.a)(uo,2),ya=va[0],$a=va[1],co=Object(M.useState)(!1),Ma=Object(f.a)(co,2),Ca=Ma[0],ho=Ma[1],fo=Object(M.useState)(!1),Na=Object(f.a)(fo,2),po=Na[0],Qa=Na[1],_a=Object(M.useRef)(!1),ra=Object(M.useRef)(""),ba=Object(M.useRef)(),be=Object(M.useRef)(),Le=Object(M.useRef)(),Fe=Object(M.useState)(),Ce=Object(f.a)(Fe,2),ie=Ce[0],ve=Ce[1],le=Object(M.useState)([]),Se=Object(f.a)(le,2),_e=Se[0],je=Se[1],Ue=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"),vt=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=vt?"\u7F16\u8F91\u7F16\u7A0B\u4F5C\u4E1A":"\u65B0\u5EFA\u7F16\u7A0B\u4F5C\u4E1A",Nt=Object(M.useState)({}),Rn=Object(f.a)(Nt,2),Yn=Rn[0],Bn=Rn[1],zn=Object(M.useState)(!1),Xn=Object(f.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(f.a)(cr,2),dr=an[0],Br=an[1],ir=yn.commonHomeWorkAddDefaultData,Ar=Object(M.useState)([]),xr=Object(f.a)(Ar,2),zr=xr[0],Qr=xr[1],Wr=Object(M.useRef)(null),yi=Object(M.useState)(!1),Ii=Object(f.a)(yi,2),Ci=Ii[0],Zr=Ii[1],Pr=Object(M.useState)([]),Tr=Object(f.a)(Pr,2),wn=Tr[0],wr=Tr[1],Ui=Object(M.useState)(""),Zi=Object(f.a)(Ui,2),ia=Zi[0],Cr=Zi[1],Xi=Object(M.useState)(!1),Ji=Object(f.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 rt=Object(b.a)(T.a.mark(function Je(){var $e,it,ct;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(Ke.q)({id:vt});case 2:$e=St.sent,$e!=null&&$e.name&&(ct={description:$e.description,languages:$e.languages,name:$e.name},Hr.current.form.setFieldsValue(ct),Bn(Object(g.a)({},ct)),wr(Object(R.a)($e.data)),je((it=$e.data)===null||it===void 0?void 0:it.map(function(wt){return wt.id})));case 4:case"end":return St.stop()}},Je)}));return function(){return rt.apply(this,arguments)}}();Object(M.useEffect)(function(){vt&&Za()},[vt]),Object(M.useEffect)(function(){var rt;zt({type:"problemset/getDisciplines",payload:{source:"question"}});var Je=((rt=Ct.location.query)===null||rt===void 0?void 0:rt.group_id)||0;Me.group_id=Number(Je),Vt(Me),ti(Me).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 it=[];if(!Je){var ct,At;Kt==null||((ct=Kt.disciplinesData)===null||ct===void 0||((At=ct.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"&&it.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"&&it.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"&&it.push(Vr)})}return it},Ea=function(){var rt=Object(b.a)(T.a.mark(function Je(){return T.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:zt({type:"problemset/getTeachGroupData"});case 1:case"end":return it.stop()}},Je)}));return function(){return rt.apply(this,arguments)}}();Object(M.useEffect)(function(){var rt=Kt.basketData||{},Je=rt.completion_questions_count,$e=Je===void 0?0:Je,it=rt.judgement_questions_count,ct=it===void 0?0:it,At=rt.multiple_questions_count,St=At===void 0?0:At,wt=rt.practical_questions_count,cn=wt===void 0?0:wt,nr=rt.program_questions_count,Oi=nr===void 0?0:nr,Hn=rt.single_questions_count,bi=Hn===void 0?0:Hn,Ei=rt.subjective_questions_count,mi=Ei===void 0?0:Ei,Ri=rt.combination_questions_count,Vr=Ri===void 0?0:Ri,ji=$e+ct+St+cn+Oi+bi+mi+Vr;$a(ji)},[Kt.basketData]);var ti=function(){var rt=Object(b.a)(T.a.mark(function Je($e){var it,ct;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return it=Object(g.a)({},$e),it.item_type=tt?"PROGRAM":$e.item_type,Zr(!0),it.keyword=encodeURIComponent($e.keyword||""),St.next=6,zt({type:"problemset/getItemBanks",payload:it});case 6:if(ct=St.sent,!(ct&&ct.status!==403&&ct.status!==401&&ct.status!==500)){St.next=18;break}return ii(ct.items_count||0),Bt(ct.items||[]),vr(ct.tag_disciplines||[]),ve(ct.used_shixun_ids||[]),ja(ct.items||[]),tt||je([]),lo((ct==null?void 0:ct.navigation)||[]),pn((ct==null?void 0:ct.added_num)||0),Zr(!1),St.abrupt("return",ct);case 18:case"end":return St.stop()}},Je)}));return function($e){return rt.apply(this,arguments)}}(),Yi=function(){zt({type:"problemset/getBasketList",payload:{}})},ja=function(Je){var $e=Je.every(function(it){var ct;return((ct=it.program_attr)===null||ct===void 0?void 0:ct.status)===0});_a.current=$e},Io=function(Je,$e){if(Me.discipline_id=Je||"",Me.sub_discipline_id=$e||"",Me.tag_discipline_id="",Me.page=1,Me.per_page=20,delete Me.id,gr(Je===null?-1:null),Vt(Me),ti(Me),Je===null)return},Po=function(Je){Me.item_type=Je||"",Me.page=1,Me.per_page=20,Vt(Me),ti(Me)},mo=function(Je){Me.difficulty=Je||"",Me.page=1,Me.per_page=20,delete Me.id,Vt(Me),ti(Me)},Ja=function(Je){Me.tag_discipline_id=Je,Me.page=1,Me.per_page=20,delete Me.id,Je===-1&&(Me.discipline_id="",Me.sub_discipline_id="",Me.tag_discipline_id=""),gr(Je),Vt(Me),ti(Me)},qa=Object(M.useState)(!1),da=Object(f.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}}),Me.discipline_id="",Me.sub_discipline_id="",Me.tag_discipline_id="",Me.item_type=null,Me.difficulty=null,Me.type=Je,Je==="0"?Me.group_id=0:Me.group_id=null,Je==="3"&&tt?Me.only_published=!0:Me.only_published=null,Je==="3"?go(!0):go(!1),Me.page=1,Me.per_page=20,delete Me.id,gr(-1),oi(Je),Vt(Me),ti(Me)},Ta=function(Je,$e){Me.page=Je,Me.per_page=$e,Vt(Me),ti(Me)},ha=function(Je){Me.discipline_id="",Me.sub_discipline_id="",Me.tag_discipline_id="",Me.item_type=null,Me.difficulty=null,Me.page=1,Me.keyword=Je,delete Me.id,Je?(Qa(!0),Object(L.a)({name:Je,copywriting:Je,position:tt?"Practice":"ItemBank"})):Qa(!1),gr(-1),Vt(Me),ti(Me)},kr=function(){Me.per_page=20,Vt(Me),ti(Me)},Pi=function(Je){var $e=Je.length===jn.length&&Me.page>1?Me.page-1:Me.page;Me.page=$e,Me.per_page=20,Yi(),Vt(Me),ti(Me)},fa=function(){zt({type:"problemset/setActionTabs",payload:{key:"Problemset-PublicReview"}})},aa=function(){var rt=Object(b.a)(T.a.mark(function Je($e,it){var ct;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:if(!it){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:ct=St.t0,(ct==null?void 0:ct.status)===0&&kr();case 11:case"end":return St.stop()}},Je)}));return function($e,it){return rt.apply(this,arguments)}}(),Sa=function(){var rt=Object(b.a)(T.a.mark(function Je($e){return T.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:Ka($e);case 1:case"end":return ct.stop()}},Je)}));return function($e){return rt.apply(this,arguments)}}(),pa=function(){var rt=Object(b.a)(T.a.mark(function Je($e){return T.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:Ha([$e]);case 1:case"end":return ct.stop()}},Je)}));return function($e){return rt.apply(this,arguments)}}(),Fa=function(Je){be.current="",ba.current="",O.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(it){return ba.current=it.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(gt,{className:"mt10",rows:4,defaultValue:be.current,onChange:function(it){return be.current=it.target.value}})),onOk:function(){return new Promise(function(){var it=Object(b.a)(T.a.mark(function ct(At,St){var wt;return T.a.wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:if(ba.current&&be.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:be.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()}},ct)}));return function(ct,At){return it.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 rt=Object(b.a)(T.a.mark(function Je($e){var it,ct,At,St;return T.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:if(it=$e.item_type,!(it==="PROGRAM")){cn.next=12;break}return ct=$e.program_attr.identifier,cn.next=5,zt({type:"problemset/startExperience",payload:{id:ct}});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:it,params:$e}});case 13:case"end":return cn.stop()}},Je)}));return function($e){return rt.apply(this,arguments)}}(),qi=function(){var rt=Object(b.a)(T.a.mark(function Je($e){var it,ct,At;return T.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(!Me.exam_id){wt.next=6;break}return wt.next=3,Object(Ke.M)({item_id:$e,id:Me.exam_id});case 3:return it=wt.sent,it.status===0&&kr(),wt.abrupt("return");case 6:if(!(Me!=null&&Me.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:Me==null?void 0:Me.exercise_id,item_bank_ids:[$e]}});case 9:return ct=wt.sent,ct.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 rt.apply(this,arguments)}}(),oa=function(){var rt=Object(b.a)(T.a.mark(function Je($e){return T.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:zt({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs($e),group_type:Gt.Mine}}),Me.discipline_id="",Me.sub_discipline_id="",Me.tag_discipline_id="",Me.page=1,Me.per_page=20,Me.group_id=Math.abs($e),gr(-1),Vt(Me),ti(Me).then(function(At){return Qr(At==null?void 0:At.item_banks_group)});case 10:case"end":return ct.stop()}},Je)}));return function($e){return rt.apply(this,arguments)}}(),no=function(){var rt=Object(b.a)(T.a.mark(function Je($e){var it,ct,At;return T.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(!Me.exam_id){wt.next=6;break}return wt.next=3,Object(Ke.t)({exam_id:Me.exam_id,item_bank_ids:[$e]});case 3:return it=wt.sent,it.status===0&&kr(),wt.abrupt("return");case 6:if(!(Me!=null&&Me.exercise_id)){wt.next=12;break}return wt.next=9,Object(fn.a)("/api/exercises/".concat(Me==null?void 0:Me.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:[$e]}});case 9:return ct=wt.sent,ct.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 rt.apply(this,arguments)}}(),ro=function(){var rt=Object(b.a)(T.a.mark(function Je($e){return T.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:if($e){ct.next=3;break}if(_e!=null&&_e.length){ct.next=3;break}return ct.abrupt("return",i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898"));case 3:Le.current=[0],O.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(b.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 ct.stop()}},Je)}));return function($e){return rt.apply(this,arguments)}}(),ko=function(){var rt=Object(b.a)(T.a.mark(function Je($e){var it,ct;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:it=St.sent,ct=(it==null?void 0:it.groups)||[],Le.current=[],O.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}},ct==null?void 0:ct.map(function(wt){return m.a.createElement(u.a,{key:wt.group_id,value:wt.group_id},wt.name)}))),onOk:function(){var wt=Object(b.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(b.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=ct==null||((Vr=ct.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 rt.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:Me}});return},No=function(){var Je={discipline_id:"&discipline_id=".concat(Me.discipline_id),sub_discipline_id:"&sub_discipline_id=".concat(Me.sub_discipline_id),tag_discipline_id:"&sub_discipline_id=".concat(Me.tag_discipline_id),difficulty:"&difficulty=".concat(Me.difficulty),item_type:"&item_type=".concat(Me.item_type),group_id:"&group_id=".concat(Me.group_id||0)},$e="/problemset/newitem?pages=".concat(Me.page);Object.keys(Je).forEach(function(it){Me[it]&&($e=$e+Je[it])}),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 rt=Object(b.a)(T.a.mark(function Je($e){var it;return T.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:it=Object(R.a)($e),jn.forEach(function(St){if(it.includes(St.id)){var wt;St.item_type==="PROGRAM"&&((wt=St.program_attr)===null||wt===void 0?void 0:wt.status)===0&&Object(pt.remove)(it,function(cn){return cn===St.id})}}),O.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(b.a)(T.a.mark(function cn(){var nr;return T.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:if(!Me.exam_id){Hn.next=6;break}return Hn.next=3,Object(Ke.t)({exam_id:Me.exam_id,item_bank_ids:it});case 3:nr=Hn.sent,Hn.next=15;break;case 6:if(!(Me!=null&&Me.exercise_id)){Hn.next=12;break}return Hn.next=9,Object(fn.a)("/api/exercises/".concat(Me==null?void 0:Me.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:it}});case 9:nr=Hn.sent,Hn.next=15;break;case 12:return Hn.next=14,zt({type:"problemset/select",payload:{item_bank_ids:it}});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 rt.apply(this,arguments)}}(),pi=function(){var rt=Object(b.a)(T.a.mark(function Je($e){var it;return T.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!Me.exam_id){At.next=6;break}return At.next=3,Object(fn.a)("/api/examination_banks/".concat(Me.exam_id,"/batch_revoke_item.json"),{method:"post",body:{item_ids:$e}});case 3:it=At.sent,At.next=15;break;case 6:if(!(Me!=null&&Me.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:Me==null?void 0:Me.exercise_id,item_bank_ids:$e}});case 9:it=At.sent,At.next=15;break;case 12:return At.next=14,zt({type:"problemset/unselectAll",payload:{item_ids:$e}});case 14:it=At.sent;case 15:it.status===0&&(kr(),Yi());case 16:case"end":return At.stop()}},Je)}));return function($e){return rt.apply(this,arguments)}}(),qr=function(){var rt=Object(b.a)(T.a.mark(function Je($e){var it;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(!Me.exam_id){At.next=10;break}return At.next=6,Object(Ke.t)({exam_id:Me.exam_id,shixun_ids:$e});case 6:it=At.sent,it.status===0&&kr(),At.next=14;break;case 10:return At.next=12,zt({type:"problemset/select",payload:{shixun_ids:$e}});case 12:it=At.sent,it.status===0&&(Yi(),kr());case 14:case"end":return At.stop()}},Je)}));return function($e){return rt.apply(this,arguments)}}(),Aa=function(){zt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},Ha=function(Je){var $e,it,ct,At;if(!(($e=Kt.teachGroupData)!==null&&$e!==void 0&&(it=$e.groups)!==null&&it!==void 0&&it.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");O.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}},(ct=Kt.teachGroupData)===null||ct===void 0||((At=ct.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(b.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=[],je([]),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(b.a)(T.a.mark(function it(){var ct;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:ct=St.sent,ka(!1),(ct==null?void 0:ct.status)===0&&O.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(ct.success,"\u6761\u8BD5\u9898\uFF0C\u6709").concat(ct.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(ct.success))}});case 6:case"end":return St.stop()}},it)}));return function(){return $e.apply(this,arguments)}}();if(_e!=null&&_e.length){O.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(it){return _e.includes(it.id)}))!==null&&Je!==void 0&&Je.every(function(it){return it.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(it){return _e.includes(it.id)}))!==null&&$e!==void 0&&$e.find(function(it){var ct;return it.item_type==="PROGRAM"&&((ct=it.program_attr)===null||ct===void 0?void 0:ct.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():O.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(ct){return Ue.current=ct.target.checked}},"\u4E0D\u518D\u63D0\u793A")),onOk:function(){Ka()}})},Ka=function(){var rt=Object(b.a)(T.a.mark(function Je($e){var it,ct;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return it=Qn===Gt.TeachGroupShare?1:2,St.next=3,Object(Ke.g)({ids:$e?[$e]:_e,source:it});case 3:ct=St.sent,ct.status===0&&(Ue.current&&window.localStorage.setItem("problemset-set-public-hint-flag","1"),Ue.current=!1,je([]),kr());case 5:case"end":return St.stop()}},Je)}));return function($e){return rt.apply(this,arguments)}}(),vo=function(Je){O.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(b.a)(T.a.mark(function ct(){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()}},ct)}));function it(){return $e.apply(this,arguments)}return it}()})},ma=function(Je){O.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(b.a)(T.a.mark(function ct(){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()}},ct)}));function it(){return $e.apply(this,arguments)}return it}()})},Ga=function(){var rt=Object(b.a)(T.a.mark(function Je($e){return T.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:zt({type:"problemset/getDisciplines",payload:{source:"question",group_id:$e,group_type:Gt.TeachGroupShare}}),Me.page=1,Me.group_id=$e||null,delete Me.id,Vt(Object(g.a)({},Me)),ti(Me);case 6:case"end":return ct.stop()}},Je)}));return function($e){return rt.apply(this,arguments)}}(),Oa=function(Je){Me.sort_by=Je.type,Me.sort_direction=Je.direction,Me.page=1,Me.per_page=20,Br(Je.name),Vt(Me),ti(Me)},yo=function(){Me.page=1,Vt(Me),ti(Me)},za=function(Je){Me.discipline_id="",Me.sub_discipline_id="",Me.tag_discipline_id="",Me.item_type=null,Me.difficulty=null,Me.page=1,Me.per_page=20,Me.group_id=Je,gr(-1),Vt(Me),ti(Me).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:Me}});return}O.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 rt=Object(b.a)(T.a.mark(function Je(){var $e,it,ct,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,it=$e.data||{},ct=it.unpublish_program_question_count,At=it.total_item_banks,ct===0?O.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"}):O.a.confirm({title:"\u63D0\u793A",content:m.a.createElement("span",null,"\u5F53\u524D\u9009\u4E2D",At,"\u9898\uFF0C\u5176\u4E2D\u5305\u542B",ct,"\u9053\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\uFF0C \u8BF7\u786E\u8BA4\u662F\u5426\u53D1\u5E03\uFF1F"),centered:!0,onOk:function(){var cn=Object(b.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 rt.apply(this,arguments)}}(),ci=m.a.createElement(h.a,null,Wn&&m.a.createElement(h.a.Item,{onClick:function(){return ni(!0)}},"\u6279\u91CF\u52A0\u5165"),Wn&&m.a.createElement(h.a.Item,{onClick:function(){return ni(!1)}},"\u6279\u91CF\u79FB\u51FA"),Qn===Gt.Mine&&Ge&&m.a.createElement(h.a.Item,{onClick:function(){return ro()}},"\u79FB\u52A8\u5230"),Qn===Gt.Mine&&Ge&&m.a.createElement(h.a.Item,{onClick:ao},"\u6279\u91CF\u516C\u5F00"),Qn===Gt.Mine&&Ge&&m.a.createElement(h.a.Item,{onClick:function(){return Ha()}},"\u6279\u91CF\u5171\u4EAB"),Qn===Gt.Mine&&Ge&&m.a.createElement(h.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(R.a)($e)),je($e==null?void 0:$e.map(function(cn){return cn.id}))}else if(Je.length>wn.length){var it,ct=jn.filter(function(cn){return Je.includes(cn.id)}),At=wn.map(function(cn){return cn.id}),St=ct.filter(function(cn){return!At.includes(cn.id)});wr([].concat(Object(R.a)(wn),Object(R.a)(St))),je((it=[].concat(Object(R.a)(wn),Object(R.a)(St)))===null||it===void 0?void 0:it.map(function(cn){return cn.id}))}else{var wt=wn.filter(function(cn){return Je.includes(cn.id)});wr(Object(R.a)(wt)),je(wt==null?void 0:wt.map(function(cn){return cn.id}))}else je(Je)},sa=function(Je){if(tt)if(Je){var $e,it=wn==null?void 0:wn.map(function(wt){return wt.id}),ct=jn.filter(function(wt){return!it.includes(wt.id)});wr([].concat(Object(R.a)(wn),Object(R.a)(ct))),je(($e=[].concat(Object(R.a)(wn),Object(R.a)(ct)))===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(R.a)(St)),je(St==null?void 0:St.map(function(wt){return wt.id}))}else je(Je?jn==null?void 0:jn.map(function(wt){return wt.id}):[])},ea=function(){var Je="/problemset/preview";if(Me.exam_id&&(Je="/paperlibrary/edit/".concat(Me.exam_id)),Me!=null&&Me.exercise_id){var $e;Je="/classrooms/".concat(jt==null||(($e=jt.params)===null||$e===void 0)?void 0:$e.coursesId,"/exercise/").concat(Me==null?void 0:Me.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 it,ct=$e.id<0?"--":Wn?$e[Me.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"&&((it=$e.program_attr)===null||it===void 0?void 0:it.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:Qn,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}),ct);return At};Object(M.useEffect)(function(){if(tt){var rt=jt.params,Je=rt.coursesId,$e=rt.categoryId;zt({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:$e,coursesId:Je,type:5}})}},[tt]);var Da=function(){var rt=Object(b.a)(T.a.mark(function Je(){var $e,it,ct,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),it=jt.params,ct=it.coursesId,At=it.categoryId,cn.next=12,Object(fn.a)(vt?"/api/homework_commons/".concat(At,"/update_hack.json"):"/api/courses/".concat(ct,"/homework_commons.json"),{method:vt?"put":"post",body:Object(g.a)(Object(g.a)({},$e),{},{coursesId:ct,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(vt?At:St.homework_id,"/detail?tabs=1")),Fn(!1);case 15:case"end":return cn.stop()}},Je)}));return function(){return rt.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(p.a,{separator:">"},m.a.createElement(p.a.Item,null,m.a.createElement(K.a,{to:"/classrooms/".concat(ir.course_id,"/program_homework")},ir.course_name)),m.a.createElement(p.a.Item,null,m.a.createElement(K.a,{to:"/classrooms/".concat(ir.course_id,"/program_homework")},ir.category.category_name)),m.a.createElement(p.a.Item,null,Tt)))),m.a.createElement("div",{className:me.a.title},tt?Tt:"\u8BD5\u9898\u5E93"),tt&&m.a.createElement(Z,{data:Yn,ref:Hr}),m.a.createElement("div",{className:me.a.headerWrapper},m.a.createElement("div",{className:me.a.tabsWrap},m.a.createElement(j.a,{activeKey:Qn,onChange:Ba,tabBarExtraContent:m.a.createElement("div",{className:me.a.searchWrap},Qn===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(Me.keyword)}}),className:me.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",onChange:function(Je){Me.keyword=Je.target.value,Vt(Object(g.a)({},Me))},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:Me.discipline_id,subDisciplineValue:Me.sub_discipline_id,typeValue:Me.item_type,isprogram_homework:tt,showKnowledge:!0,name:ia,setname:Cr,difficultyValue:Me.difficulty,showShixun:!Object(Or.m)()&&!Me.exercise_id&&Qn!==Gt.TeachGroupShare&&Qn!==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:Me.group_id,showTeachGroup:xa})),m.a.createElement("div",{className:me.a.treeWrapper,style:{display:Qn===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:ft.a,alt:"",className:me.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),m.a.createElement(H.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(h.a,{selectedKeys:[dr]},Ua==null?void 0:Ua.map(function(rt,Je){return m.a.createElement(h.a.Item,{key:rt.name,onClick:function(){return Oa(rt)}},rt.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(rt){return wn==null?void 0:wn.map(function(Je){return Je.id}).includes(rt.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(O.a,{visible:Rr,centered:!0,width:700,okText:"\u786E\u8BA4".concat(vt?"\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(rt,Je){var $e,it,ct,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,rt==null?void 0:rt.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"},rt.difficulty===1&&"\u7B80\u5355",rt.difficulty===2&&"\u9002\u4E2D",rt.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:rt==null||(($e=rt.author)===null||$e===void 0)?void 0:$e.name},m.a.createElement("span",{className:"c-grey-333"},(rt==null||((it=rt.author)===null||it===void 0||((ct=it.name)===null||ct===void 0))?void 0:ct.length)>6?(rt==null||((At=rt.author)===null||At===void 0||((St=At.name)===null||St===void 0))?void 0:St.substr(0,3))+"...":rt==null||((wt=rt.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"},rt==null?void 0:rt.updated_at)))),m.a.createElement("div",{className:me.a.del,onClick:function(){_i(wn.filter(function(nr){return nr.id!==rt.id}).map(function(nr){return nr.id}))}},"\u5220\u9664"))})))),m.a.createElement("div",null,Qn===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(){Me.page=1,Me.keyword=null,delete Me.id,Vt(Me),Qa(!1),ti(Me)},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(Me.keyword),"\u201D")):null,m.a.createElement("div",{className:me.a.contentListWrap},On!==0?m.a.createElement(H.a,{size:"large",spinning:Un["problemset/getItemBanks"]},jn.map(function(rt,Je){var $e,it;return m.a.createElement("div",{className:me.a.li},m.a.createElement("div",{className:me.a.top},m.a.createElement(br.b,{key:rt.id,data:rt,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(ct){return ct.type===rt.item_type}))===null||$e===void 0?void 0:$e.name),m.a.createElement("p",{className:me.a.actionLeftItem},la[rt.difficulty]),m.a.createElement("p",{className:me.a.actionLeftItem},"\u521B\u5EFA\u8005",m.a.createElement("span",{className:"c-grey-333"},rt==null||((it=rt.author)===null||it===void 0)?void 0:it.name)),m.a.createElement("p",{className:me.a.actionLeftItem},"\u66F4\u65B0",m.a.createElement("span",{className:"c-grey-333"},rt==null?void 0:rt.updated_at)),m.a.createElement("p",{className:me.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",m.a.createElement("span",{className:"c-grey-333"},rt==null?void 0:rt.quotes)),!tt&&m.a.createElement("div",{className:me.a.more},li({},rt))))})):m.a.createElement(H.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:Me==null?void 0:Me.per_page,current:Me.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(Be,{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(yt,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"),Qn===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"),Qn===Gt.Mine&&m.a.createElement("div",{className:me.a.btn,onClick:ao}," ",m.a.createElement("i",{className:"iconfont icon-pilianggongkai"}),"\u6279\u91CF\u516C\u5F00"),Qn===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"),Qn===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"),Qn===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 je([])},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:Me==null?void 0:Me.per_page,current:Me.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(vt){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",vt?"\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(ut,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 H(i){return!i||i[Symbol.iterator]().next().done===!0}Y.isEmpty=H;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 x(i,D){for(const A of i)if(D(A))return A;return}Y.find=x;function*p(i,D){for(const A of i)D(A)&&(yield A)}Y.filter=p;function*_(i,D){let A=0;for(const S of i)yield D(S,A++)}Y.map=_;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 h(i,D,A){let S=A;for(const O of i)S=D(S,O);return S}Y.reduce=h;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 O=0;O<D;O++){const R=S.next();if(R.done)return[A,Y.empty()];A.push(R.value)}return[A,{[Symbol.iterator](){return S}}]}Y.consume=u;function s(i,D,A=(S,O)=>S===O){const S=i[Symbol.iterator](),O=D[Symbol.iterator]();for(;;){const R=S.next(),g=O.next();if(R.done!==g.done)return!1;if(R.done)return!0;if(!A(R.value,g.value))return!1}}Y.equals=s})(te||(te={}))},LE3n:function(ut,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"),H=U("2qtc"),n=U("kLXV"),I=U("miYZ"),x=U("tsqr"),p=U("9og8"),_=U("tJVT"),c=U("WmNS"),a=U.n(c),h=U("q1tI"),l=U.n(h),u=U("1vnw"),s=U.n(u),i=U("ErOA"),D=U("Ix/O"),A=U.n(D),S=U("xTzM"),O=U.n(S),R=U("WCUW"),g=U("LvDl"),b=U.n(g),f=function(E){var w=E.isProblemset,j=E.name,W=E.id,T=E.itemBanksCount,M=E.onOpen,m=M===void 0?function(){}:M,v=E.onShare,K=v===void 0?function(){}:v,X=E.onMove,q=X===void 0?function(){}:X,re=E.onDeleteOk,ye=re===void 0?function(){}:re,pe=Object(h.useState)(!1),ue=Object(_.a)(pe,2),fe=ue[0],Ee=ue[1],se=Object(h.useState)(j),ae=Object(_.a)(se,2),Oe=ae[0],ze=ae[1],Ye=Object(h.useState)(j),He=Object(_.a)(Ye,2),Xe=He[0],We=He[1],Ke=function(){var de=Object(p.a)(a.a.mark(function De(Ne){var Be,at,lt;return a.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:if(Be=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],Xe.trim()){ot.next=4;break}return x.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),ot.abrupt("return");case 4:if(!(Xe.charAt(0)===" ")){ot.next=7;break}return x.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),ot.abrupt("return");case 7:at=0;case 8:if(!(at<Xe.length)){ot.next=15;break}if(!Be.includes(Xe.charAt(at))){ot.next=12;break}return x.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),ot.abrupt("return",!1);case 12:at++,ot.next=8;break;case 15:return ot.next=17,Object(i.a)("/api/item_banks_groups/".concat(Math.abs(Ne),".json"),{method:"put",body:{name:Xe}});case 17:lt=ot.sent,lt.status===0&&(Ee(!1),ze(Xe));case 19:case"end":return ot.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(p.a)(a.a.mark(function at(){var lt;return a.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.next=2,Object(i.a)("/api/item_banks_groups/".concat(Math.abs(De),".json"),{method:"delete",body:{}});case 2:lt=ot.sent,lt.status===0&&ye(De);case 4:case"end":return ot.stop()}},at)}));function Be(){return Ne.apply(this,arguments)}return Be}()})};return l.a.createElement("div",{className:s.a.list},fe?l.a.createElement(G.a,{style:{maxWidth:780},value:Xe,onChange:function(De){return We(De.target.value)}}):l.a.createElement("div",{title:Oe,onClick:function(){return m(W)},className:s.a.name},Oe),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(){We(Oe),Ee(!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){x.b.warn("\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u8BD5\u9898");return}K(Math.abs(W))},type:"link"},"\u5171\u4EAB\u5168\u90E8\u8BD5\u9898"),l.a.createElement(P.a,{className:"ml10",onClick:function(){return Ee(!0)},type:"link"},"\u91CD\u547D\u540D"),l.a.createElement(P.a,{onClick:function(){return nt(W)},type:"link",danger:!0},"\u5220\u9664")))},d=function(E){var w=E.isProblemset,j=E.data,W=E.onOpen,T=W===void 0?function(){}:W,M=E.onShare,m=M===void 0?function(){}:M,v=E.reloadData,K=Object(h.useState)(),X=Object(_.a)(K,2),q=X[0],re=X[1];Object(h.useEffect)(function(){re(j==null?void 0:j.map(function(Oe){return{title:l.a.createElement(f,{isProblemset:w,name:Oe.name,id:Oe.id,itemBanksCount:Oe.item_banks_count,onMove:pe,onOpen:T,onShare:m,onDeleteOk:fe}),key:Oe.id,icon:l.a.createElement("img",{src:A.a,className:s.a.folderIcon}),isLeaf:!1}}))},[j]);var ye=function Oe(ze,Ye,He){for(var Xe=Object(g.cloneDeep)(ze),We=0;We<Xe.length;We++){if(Xe[We].key===Ye){if(He==="up"){var Ke=[Xe[We],Xe[We-1]];Xe[We-1]=Ke[0],Xe[We]=Ke[1]}else{var nt=[Xe[We+1],Xe[We]];Xe[We]=nt[0],Xe[We+1]=nt[1]}break}Xe[We].children&&(Xe[We].children=Oe(Xe[We].children,Ye,He))}return Xe},pe=function(){var Oe=Object(p.a)(a.a.mark(function ze(Ye,He){var Xe;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(R.I)({id:Math.abs(Ye)});case 3:Ke.t0=Ke.sent,Ke.next=9;break;case 6:return Ke.next=8,Object(R.H)({id:Math.abs(Ye)});case 8:Ke.t0=Ke.sent;case 9:Xe=Ke.t0,Xe.status===0&&re(function(nt){return ye(nt,Ye,He)});case 11:case"end":return Ke.stop()}},ze)}));return function(Ye,He){return Oe.apply(this,arguments)}}(),ue=function Oe(ze,Ye){return ze.filter(function(He){return He.key===Ye?!1:(He.children&&(He.children=Oe(He.children,Ye)),!0)})},fe=function(ze){re(function(Ye){return ue(Ye,ze)}),v()},Ee=function Oe(ze,Ye,He){return ze.map(function(Xe){return Xe.key===Ye?Object(N.a)(Object(N.a)({},Xe),He):Xe.children?Object(N.a)(Object(N.a)({},Xe),{},{children:Oe(Xe.children,Ye,He)}):Xe})},se=function(){var Oe=Object(p.a)(a.a.mark(function ze(Ye){var He,Xe,We,Ke,nt;return a.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return He=Ye.key,De.next=3,Object(R.B)({group_id:Math.abs(He)});case 3:Xe=De.sent,We=Xe||{},Ke=We.item_banks_group,nt=We.item_banks_group_count,nt>0?re(function(Ne){return Ee(Ne,He,{children:Ke.map(function(Be){return{title:l.a.createElement(f,{isProblemset:w,name:Be.name,id:Be.id,itemBanksCount:Be.item_banks_count,onMove:pe,onOpen:T,onShare:m,onDeleteOk:fe}),key:Be.id,icon:l.a.createElement("img",{src:A.a,className:s.a.folderIcon}),isLeaf:!1}})})}):re(function(Ne){return Ee(Ne,He,{isLeaf:!0})});case 6:case"end":return De.stop()}},ze)}));return function(Ye){return Oe.apply(this,arguments)}}(),ae=function(ze,Ye){var He=Ye.node,Xe=Ye.expanded;re(function(We){return Ee(We,He.key,{icon:Xe?l.a.createElement("img",{src:O.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(ut,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"),H=U("ODXe"),n=U("4IlW"),I=U("bX4T"),x=U("YrtM"),p=U("TSYQ"),_=U.n(p),c=U("+nKL"),a=U("8OUc"),h=function(K,X){var q=K.prefixCls,re=K.id,ye=K.flattenOptions,pe=K.childrenAsData,ue=K.values,fe=K.searchValue,Ee=K.multiple,se=K.defaultActiveFirstOption,ae=K.height,Oe=K.itemHeight,ze=K.notFoundContent,Ye=K.open,He=K.menuItemSelectedIcon,Xe=K.virtual,We=K.onSelect,Ke=K.onToggleOpen,nt=K.onActiveValue,de=K.onScroll,De=K.onMouseEnter,Ne="".concat(q,"-item"),Be=Object(x.a)(function(){return ye},[Ye,ye],function(st,xe){return xe[0]&&st[1]!==xe[1]}),at=P.useRef(null),lt=function(xe){xe.preventDefault()},pt=function(xe){at.current&&at.current.scrollTo({index:xe})},ot=function(xe){for(var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,me=Be.length,ce=0;ce<me;ce+=1){var he=(xe+ce*we+me)%me,Te=Be[he],Re=Te.group,ke=Te.data;if(!Re&&!ke.disabled)return he}return-1},bt=P.useState(function(){return ot(0)}),yt=Object(H.a)(bt,2),xt=yt[0],Ze=yt[1],kt=function(xe){Ze(xe);var we=Be[xe];if(!we){nt(null,-1);return}nt(we.data.value,xe)};P.useEffect(function(){kt(se!==!1?ot(0):-1)},[Be.length,fe]),P.useEffect(function(){var st=setTimeout(function(){if(!Ee&&Ye&&ue.size===1){var xe=Array.from(ue)[0],we=Be.findIndex(function(me){var ce=me.data;return ce.value===xe});kt(we),pt(we)}});return function(){return clearTimeout(st)}},[Ye]);var Ot=function(xe){xe!==void 0&&We(xe,{selected:!ue.has(xe)}),Ee||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=ot(xt+me,me);pt(ce),kt(ce)}break}case n.a.ENTER:{var he=Be[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){pt(xe)}}}),Be.length===0)return P.createElement("div",{role:"listbox",id:"".concat(re,"_list"),className:"".concat(Ne,"-empty"),onMouseDown:lt},ze);function qe(st){var xe=Be[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:at,data:Be,height:ae,itemHeight:Oe,fullHeight:!1,onMouseDown:lt,onScroll:de,virtual:Xe,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:_()(Ne,"".concat(Ne,"-group"))},Te!==void 0?Te:Re);var ke=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=_()(Ne,$t,en,(we={},Object(F.a)(we,"".concat($t,"-grouped"),ce),Object(F.a)(we,"".concat($t,"-active"),xt===xe&&!ke),Object(F.a)(we,"".concat($t,"-disabled"),ke),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||ke)return;kt(xe)},onClick:function(){ke||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(h);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"),O=U("Zm9Q");function R(v){var K=v.key,X=v.props,q=X.children,re=X.value,ye=Object(G.a)(X,["children","value"]);return Object(S.a)({key:K,value:re!==void 0?re:K,children:q},ye)}function g(v){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.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 K||!re?R(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 b=U("2Qr1"),f=U("qNPg"),d=U("U8pU"),C=U("Kwbf"),E=U("WKfj");function w(v){var K=v.mode,X=v.options,q=v.children,re=v.backfill,ye=v.allowClear,pe=v.placeholder,ue=v.getInputElement,fe=v.showSearch,Ee=v.onSearch,se=v.defaultOpen,ae=v.autoFocus,Oe=v.labelInValue,ze=v.value,Ye=v.inputValue,He=v.optionLabelProp,Xe=K==="multiple"||K==="tags",We=fe!==void 0?fe:Xe||K==="combobox",Ke=X||g(q);if(Object(C.a)(K!=="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."),K==="tags"||K==="combobox"){var nt=Ke.some(function(Ne){return Ne.options?Ne.options.some(function(Be){return typeof("value"in Be?Be.value:Be.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)(K!=="combobox"||!He,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(K==="combobox"||!re,"`backfill` only works with `combobox` mode."),Object(C.a)(K==="combobox"||!ue,"`getInputElement` only work with `combobox` mode."),Object(C.b)(K!=="combobox"||!ue||!ye||!pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ee&&!We&&K!=="combobox"&&K!=="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(E.d)(ze);Object(C.a)(!Oe||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)(!Xe||Array.isArray(ze),"`value` should be array when `mode` is `multiple` or `tags`")}if(q){var De=null;Object(O.a)(q).some(function(Ne){if(!P.isValidElement(Ne)||!Ne.type)return!1;var Be=Ne.type;if(Be.isSelectOption)return!1;if(Be.isSelectOptGroup){var at=Object(O.a)(Ne.props.children).every(function(lt){return!P.isValidElement(lt)||!Ne.type||lt.type.isSelectOption?!0:(De=lt.type,!1)});return!at}return De=Be,!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(f.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:g,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:j,fillOptionsWithMissingValue:b.a}),T=function(v){Object(N.a)(X,v);var K=Object(z.a)(X);function X(){var q;return Object(te.a)(this,X),q=K.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(ut,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"),H=U.n(G),n=function(I){Object(N.a)(p,I);var x=Object(z.a)(p);function p(_){var c;Object(te.a)(this,p),c=x.call(this,_);var a=window.document;return c.node=a.createElement("div"),a.body.appendChild(c.node),c}return Object(Y.a)(p,[{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)}}]),p}(F.a.Component)},MI8n:function(ut,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 x}),U.d(ge,"d",function(){return p}),U.d(ge,"f",function(){return _});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 h(w,j){return A((W,T=null,M)=>w(m=>W.call(T,j(m)),null,M))}c.map=h;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 h(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,K,X=0;const q=new n({leakWarningThreshold:M,onFirstListenerAdd(){m=w(re=>{X++,v=j(v,re),T&&!K&&(q.fire(v),v=void 0),clearTimeout(K),K=setTimeout(()=>{const ye=v;v=void 0,K=void 0,(!T||X>1)&&q.fire(ye),X=0},W)})},onLastListenerRemove(){m.dispose()}});return q.event}c.debounce=S;function O(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=O;function R(w,j){return[c.filter(w,j),c.filter(w,W=>!j(W))]}c.split=R;function g(w,j=!1,W=[]){let T=W.slice(),M=w(K=>{T?T.push(K):v.fire(K)});const m=()=>{T&&T.forEach(K=>v.fire(K)),T=null},v=new n({onFirstListenerAdd(){M||(M=w(K=>v.fire(K)))},onFirstListenerDidAdd(){T&&(j?setTimeout(m):m())},onLastListenerRemove(){M&&M.dispose(),M=null}});return v.event}c.buffer=g;class b{constructor(w){this.event=w}map(w){return new b(h(this.event,w))}forEach(w){return new b(l(this.event,w))}filter(w){return new b(u(this.event,w))}reduce(w,j){return new b(D(this.event,w,j))}latch(){return new b(O(this.event))}debounce(w,j=100,W=!1,T){return new b(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 f(w){return new b(w)}c.chain=f;function d(w,j,W=T=>T){const T=(...K)=>v.fire(W(...K)),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=(...K)=>v.fire(W(...K)),M=()=>w.addEventListener(j,T),m=()=>w.removeEventListener(j,T),v=new n({onFirstListenerAdd:M,onLastListenerRemove:m});return v.event}c.fromDOMEventEmitter=C;function E(w){return new Promise(j=>a(w)(j))}c.toPromise=E})(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 H{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 h=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),l=this._stacks.get(h)||0;if(this._stacks.set(h,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(h)||0;this._stacks.set(h,u-1)}}}class n{constructor(c){var a;this._disposed=!1,this._options=c,this._leakageMon=G>0?new H(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,h)=>{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 h instanceof Y.b?h.add(D):Array.isArray(h)&&h.push(D),D}),this._event}fire(c){var a,h;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)}}(h=this._perfMon)===null||h===void 0||h.stop()}}dispose(){var c,a,h,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=(h=this._options)===null||h===void 0?void 0:h.onLastListenerRemove)===null||l===void 0||l.call(h),(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 x 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 p{constructor(){this.buffers=[]}wrapEvent(c){return(a,h,l)=>c(u=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>a.call(h,u)):a.call(h,u)},void 0,l)}bufferEvents(c){const a=[];this.buffers.push(a);const h=c();return this.buffers.pop(),a.forEach(l=>l()),h}}class _{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(ut,ge,U){"use strict";(function(te,Y){U.d(ge,"b",function(){return h}),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 O}),U.d(ge,"c",function(){return R}),U.d(ge,"k",function(){return g}),U.d(ge,"j",function(){return b}),U.d(ge,"a",function(){return f}),U.d(ge,"e",function(){return E});var N;const z="en";let P=!1,F=!1,G=!1,H=!1,n=!1,I=!1,x=!1,p,_=z,c,a;const h=typeof self=="object"?self:typeof te=="object"?te:{};let l;typeof h.vscode!="undefined"&&typeof h.vscode.process!="undefined"?l=h.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,x=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=a.indexOf("Linux")>=0,I=!0,p=navigator.language,_=p;else if(typeof l=="object"){P=l.platform==="win32",F=l.platform==="darwin",G=l.platform==="linux",H=G&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,p=z,_=z;const w=l.env.VSCODE_NLS_CONFIG;if(w)try{const j=JSON.parse(w),W=j.availableLanguages["*"];p=j.locale,_=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,O=I,R=x,g=a,b=function(){if(h.setImmediate)return h.setImmediate.bind(h);if(typeof h.postMessage=="function"&&!h.importScripts){let W=[];h.addEventListener("message",M=>{if(M.data&&M.data.vscodeSetImmediateId)for(let m=0,v=W.length;m<v;m++){const K=W[m];if(K.id===M.data.vscodeSetImmediateId){W.splice(m,1),K.callback();return}}});let T=0;return M=>{const m=++T;W.push({id:m,callback:M}),h.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)}(),f=F||x?2:P?1:3;let d=!0,C=!1;function E(){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(ut,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 H}),U.d(ge,"p",function(){return n}),U.d(ge,"T",function(){return I}),U.d(ge,"q",function(){return x}),U.d(ge,"N",function(){return p}),U.d(ge,"M",function(){return _}),U.d(ge,"Q",function(){return c}),U.d(ge,"u",function(){return a}),U.d(ge,"x",function(){return h}),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 O}),U.d(ge,"R",function(){return R}),U.d(ge,"d",function(){return g}),U.d(ge,"e",function(){return b}),U.d(ge,"E",function(){return f}),U.d(ge,"F",function(){return d}),U.d(ge,"j",function(){return C}),U.d(ge,"z",function(){return E}),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 Ee}),U.d(ge,"o",function(){return se}),U.d(ge,"P",function(){return ae}),U.d(ge,"w",function(){return Oe}),U.d(ge,"c",function(){return ze}),U.d(ge,"y",function(){return Xe});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,Be){const at=parseInt(Be,10);return isNaN(at)||at<0||at>=De.length?Ne:De[at]})}function z(de){return de.replace(/[<>&]/g,function(De){switch(De){case"<":return"<";case">":return">";case"&":return"&";default:return De}})}function P(de){return de.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function F(de,De=" "){const Ne=G(de,De);return H(Ne,De)}function G(de,De){if(!de||!De)return de;const Ne=De.length;if(Ne===0||de.length===0)return de;let Be=0;for(;de.indexOf(De,Be)===Be;)Be=Be+Ne;return de.substring(Be)}function H(de,De){if(!de||!De)return de;const Ne=De.length,Be=de.length;if(Ne===0||Be===0)return de;let at=Be,lt=-1;for(;!(lt=de.lastIndexOf(De,at-1),lt===-1||lt+Ne!==at);){if(lt===0)return"";at=lt}return de.substring(0,at)}function n(de){return de.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function I(de){return de.replace(/\*/g,"")}function x(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 Be="";return Ne.global&&(Be+="g"),Ne.matchCase||(Be+="i"),Ne.multiline&&(Be+="m"),Ne.unicode&&(Be+="u"),new RegExp(de,Be)}function p(de){if(de.source==="^"||de.source==="^$"||de.source==="$"||de.source==="^\\s*$")return!1;const De=de.exec("");return!!(De&&de.lastIndex===0)}function _(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 Be=de.charCodeAt(De);if(Be!==32&&Be!==9)return De}return-1}function h(de,De=0,Ne=de.length){for(let Be=De;Be<Ne;Be++){const at=de.charCodeAt(Be);if(at!==32&&at!==9)return de.substring(De,Be)}return de.substring(De,Ne)}function l(de,De=de.length-1){for(let Ne=De;Ne>=0;Ne--){const Be=de.charCodeAt(Ne);if(Be!==32&&Be!==9)return Ne}return-1}function u(de,De){return de<De?-1:de>De?1:0}function s(de,De,Ne=0,Be=de.length,at=0,lt=De.length){for(;Ne<Be&&at<lt;Ne++,at++){let bt=de.charCodeAt(Ne),yt=De.charCodeAt(at);if(bt<yt)return-1;if(bt>yt)return 1}const pt=Be-Ne,ot=lt-at;return pt<ot?-1:pt>ot?1:0}function i(de,De){return D(de,De,0,de.length,0,De.length)}function D(de,De,Ne=0,Be=de.length,at=0,lt=De.length){for(;Ne<Be&&at<lt;Ne++,at++){let bt=de.charCodeAt(Ne),yt=De.charCodeAt(at);if(bt===yt)continue;if(bt>=128||yt>=128)return s(de.toLowerCase(),De.toLowerCase(),Ne,Be,at,lt);A(bt)&&(bt-=32),A(yt)&&(yt-=32);const xt=bt-yt;if(xt===0)continue;return xt}const pt=Be-Ne,ot=lt-at;return pt<ot?-1:pt>ot?1:0}function A(de){return de>=97&&de<=122}function S(de){return de>=65&&de<=90}function O(de,De){return de.length===De.length&&D(de,De)===0}function R(de,De){const Ne=De.length;return De.length>de.length?!1:D(de,De,0,Ne)===0}function g(de,De){let Ne,Be=Math.min(de.length,De.length);for(Ne=0;Ne<Be;Ne++)if(de.charCodeAt(Ne)!==De.charCodeAt(Ne))return Ne;return Be}function b(de,De){let Ne,Be=Math.min(de.length,De.length);const at=de.length-1,lt=De.length-1;for(Ne=0;Ne<Be;Ne++)if(de.charCodeAt(at-Ne)!==De.charCodeAt(lt-Ne))return Ne;return Be}function f(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 E(de,De,Ne){const Be=de.charCodeAt(Ne);if(f(Be)&&Ne+1<De){const at=de.charCodeAt(Ne+1);if(d(at))return C(Be,at)}return Be}function w(de,De){const Ne=de.charCodeAt(De-1);if(d(Ne)&&De>1){const Be=de.charCodeAt(De-2);if(f(Be))return C(Be,Ne)}return Ne}function j(de,De){const Ne=Ye.getInstance(),Be=De,at=de.length,lt=E(de,at,De);De+=lt>=65536?2:1;let pt=Ne.getGraphemeBreakType(lt);for(;De<at;){const ot=E(de,at,De),bt=Ne.getGraphemeBreakType(ot);if(ze(pt,bt))break;De+=ot>=65536?2:1,pt=bt}return De-Be}function W(de,De){const Ne=Ye.getInstance(),Be=De,at=w(de,De);De-=at>=65536?2:1;let lt=Ne.getGraphemeBreakType(at);for(;De>0;){const pt=w(de,De),ot=Ne.getGraphemeBreakType(pt);if(ze(ot,lt))break;De-=pt>=65536?2:1,lt=ot}return Be-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 K=/^[\t\n\r\x20-\x7E]*$/;function X(de){return K.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 Ee(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 Oe(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 Be=1;for(;Be<=Ne;)if(de<De[3*Be])Be=2*Be;else if(de>De[3*Be+1])Be=2*Be+1;else return De[3*Be+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 Xe(de,De){if(de===0)return 0;const Ne=We(de,De);if(Ne!==void 0)return Ne;const Be=w(De,de);return de-=Ke(Be),de}function We(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 Be=w(De,de);Be===8205&&(de-=Ke(Be))}return de}function Ke(de){return de>=65536?2:1}function nt(de){return 127995<=de&&de<=127999}},NLgs:function(ut,ge,U){"use strict";U.d(ge,"e",function(){return i}),U.d(ge,"f",function(){return D}),U.d(ge,"d",function(){return S}),U.d(ge,"c",function(){return O}),U.d(ge,"a",function(){return R}),U.d(ge,"b",function(){return g});var te=U("miYZ"),Y=U("tsqr"),N=U("9og8"),z=U("2qtc"),P=U("kLXV"),F=U("WmNS"),G=U.n(F),H=U("q1tI"),n=U.n(H),I=U("9kvl"),x=U("xKgJ"),p=U("1vsH"),_=U("RCxd"),c=U("yTi+"),a=U.n(c),h=U("1ZF9"),l=U.n(h),u=U("NoGO"),s=U.n(u),i=function(f){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(D(f)&&A(d))},D=function(f){return Object(x.p)()?!0:(f({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},A=function(){var f,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,C=Object(I.c)()._store.getState(),E=C.user;return(f=E.userInfo)!==null&&f!==void 0&&f.profile_completed?!0:(P.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:d?"\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)},S=function(){var f,d=Object(I.c)()._store.getState(),C=d.user;return(f=C.userInfo)!==null&&f!==void 0&&f.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(p.S)("/account/certification")}}),!1)},O=function(){return Object(x.a)()?!0:(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\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),n.a.createElement("img",{src:s.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},R=function(f,d){return f?!0:(P.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:n.a.createElement("div",null,n.a.createElement("p",null,d||"\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:l.a,width:200}),n.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(p.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},g=function(f){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",C=Object(I.c)()._store.getState(),E=C.shixunsDetail.detail;return(E==null?void 0:E.public)===2||(E==null?void 0:E.public)===1||(E==null?void 0:E.shixun_status)===3?(P.a.info({centered:!0,icon:n.a.createElement(_.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",(E==null?void 0:E.public)===2?"\u5DF2\u516C\u5F00":(E==null?void 0:E.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",d,"\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):(E==null?void 0:E.shixun_status)===2?(P.a.confirm({centered:!0,icon:n.a.createElement(_.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",d,"\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(_.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 j=Object(N.a)(G.a.mark(function T(){var M;return G.a.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,f({type:"shixunsDetail/cancelRelease",payload:{id:E==null?void 0:E.identifier}});case 2:M=v.sent,M.status!==401&&(Y.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),f({type:"shixunsDetail/getShixunsDetail",payload:{id:E==null?void 0:E.identifier}}),f({type:"practiceSetting/getCommonData",payload:{id:E==null?void 0:E.identifier}}));case 4:case"end":return v.stop()}},T)}));function W(){return j.apply(this,arguments)}return W}()})}}),!0):!1}},NoGO:function(ut,ge,U){ut.exports=U.p+"static/newqrcode.d852fdfc.png"},NvD2:function(ut,ge,U){"use strict";U.d(ge,"a",function(){return F});var te=U("Kwbf");function Y(G,H){var n=new Set;return G.forEach(function(I){H.has(I)||n.add(I)}),n}function N(G){var H=G||{},n=H.disabled,I=H.disableCheckbox,x=H.checkable;return!!(n||I)||x===!1}function z(G,H,n,I){for(var x=new Set(G),p=new Set,_=0;_<=n;_+=1){var c=H.get(_)||new Set;c.forEach(function(u){var s=u.key,i=u.node,D=u.children,A=D===void 0?[]:D;x.has(s)&&!I(i)&&A.filter(function(S){return!I(S.node)}).forEach(function(S){x.add(S.key)})})}for(var a=new Set,h=n;h>=0;h-=1){var l=H.get(h)||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 O=S.key,R=x.has(O);D&&!R&&(D=!1),!A&&(R||p.has(O))&&(A=!0)}),D&&x.add(s.key),A&&p.add(s.key),a.add(s.key)})}return{checkedKeys:Array.from(x),halfCheckedKeys:Array.from(Y(p,x))}}function P(G,H,n,I,x){for(var p=new Set(G),_=new Set(H),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;!p.has(i)&&!_.has(i)&&!x(D)&&S.filter(function(O){return!x(O.node)}).forEach(function(O){p.delete(O.key)})})}_=new Set;for(var h=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(x(D)||!s.parent||h.has(s.parent.key))return;if(x(s.parent.node)){h.add(i.key);return}var A=!0,S=!1;(i.children||[]).filter(function(O){return!x(O.node)}).forEach(function(O){var R=O.key,g=p.has(R);A&&!g&&(A=!1),!S&&(g||_.has(R))&&(S=!0)}),A||p.delete(i.key),S&&_.add(i.key),h.add(i.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(Y(_,p))}}function F(G,H,n,I){var x=[],p;I?p=I:p=N;var _=new Set(G.filter(function(l){var u=!!n[l];return u||x.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)(!x.length,"Tree missing follow keys: ".concat(x.slice(0,100).map(function(l){return"'".concat(l,"'")}).join(", ")));var h;return H===!0?h=z(_,c,a,p):h=P(_,H.halfCheckedKeys,c,a,p),h}},"ORt/":function(ut,ge,U){ut.exports={operating:"operating___1LS8K",tip:"tip___3LKV6"}},OZM5:function(ut,ge,U){"use strict";U.d(ge,"b",function(){return I}),U.d(ge,"a",function(){return x}),U.d(ge,"k",function(){return p}),U.d(ge,"h",function(){return _}),U.d(ge,"i",function(){return c}),U.d(ge,"g",function(){return a}),U.d(ge,"c",function(){return h}),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"),H=.25,n=2;function I(S,O){var R=S.slice(),g=R.indexOf(O);return g>=0&&R.splice(g,1),R}function x(S,O){var R=S.slice();return R.indexOf(O)===-1&&R.push(O),R}function p(S){return S.split("-")}function _(S,O){return"".concat(S,"-").concat(O)}function c(S){return S&&S.type&&S.type.isTreeNode}function a(S,O){var R=[S],g=O[S];function b(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];f.forEach(function(d){var C=d.key,E=d.children;R.push(C),b(E)})}return b(g.children),R}function h(S,O){var R=S.clientY,g=O.selectHandle.getBoundingClientRect(),b=g.top,f=g.bottom,d=g.height,C=Math.max(d*H,n);return R<=b+C?-1:R>=f-C?1:0}function l(S,O){if(!S)return;var R=O.multiple;return R?S.slice():S.length?[S[0]]:S}var u=function(O){return O};function s(S,O){if(!S)return[];var R=O||{},g=R.processProps,b=g===void 0?u:g,f=Array.isArray(S)?S:[S];return f.map(function(d){var C=d.children,E=Object(N.a)(d,["children"]),w=s(C,O);return P.a.createElement(G.a,Object.assign({},b(E)),w)})}function i(S){if(!S)return null;var O;if(Array.isArray(S))O={checkedKeys:S,halfCheckedKeys:void 0};else if(Object(Y.a)(S)==="object")O={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 O}function D(S,O){var R=new Set;function g(b){if(R.has(b))return;var f=O[b];if(!f)return;R.add(b);var d=f.parent,C=f.node;if(C.disabled)return;d&&g(d.key)}return(S||[]).forEach(function(b){g(b)}),Object(te.a)(R)}function A(S){var O={};return Object.keys(S).forEach(function(R){(R.startsWith("data-")||R.startsWith("aria-"))&&(O[R]=S[R])}),O}},Ot1p:function(ut,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"),H=U("jrin"),n=U("WmNS"),I=U.n(n),x=U("q1tI"),p=U.n(x),_=U("VrN/"),c=U.n(_),a=U("bdgK"),h=U("p77/"),l=U("Bd2K"),u=U("ELLl"),s=U("19Vz"),i=U("lZu9"),D=U("+NIl"),A=U("kSUc"),S=U("9Bee"),O=function(ke){var et=ke.value,ht=et===void 0?"":et,Ut=ke.className,nn=ke.showTextOnly,en=ke.showLines,mn=ke.style,En=mn===void 0?{}:mn,$t=Object(x.useMemo)(function(){return""},[ht]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:$t}}))},R=U("0Owb"),g=U("dejd"),b=U("C+DQ"),f=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 E(ke){var et=ke.onActionCallback,ht=ke.title,Ut=ke.icon,nn=ke.actionName,en=ke.className,mn=en===void 0?"":en,En=ke.children;function $t(){et(nn)}return p.a.createElement("a",{title:ht,className:mn,onClick:$t},p.a.createElement("i",{className:"md-iconfont ".concat(Ut)}),En)}var w=function(ke){var et=ke.watch,ht=ke.showNullButton,Ut=ke.onActionCallback,nn=ke.fullScreen,en=ke.insertTemp,mn=ke.hidetoolBar,En=ke.uuid,$t=ke.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(f.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(f.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 p.a.createElement("ul",{className:"markdown-toolbar-container"},!mn&&rr.map(function(Dn,Sr){return p.a.createElement("li",{key:Sr},Dn.actionName?p.a.createElement(E,Object(R.a)({},Dn,{onActionCallback:Ut})):p.a.createElement("span",{className:"v-line"}))}),ht?p.a.createElement("li",null,p.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ut},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,en&&p.a.createElement("li",null,p.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(en),onActionCallback:Ut},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(E,{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"),K=U("5rEg"),X={labelCol:{span:4},wrapperCol:{span:20}},q=function(ke){var et=ke.callback,ht=ke.onCancel;function Ut(nn){et(nn)}return p.a.createElement(m.a,Object(R.a)({},X,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ut}),p.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(K.a,null)),p.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(K.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.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},Ee={labelCol:{span:5},wrapperCol:{span:19}},se=function(ke){var et=ke.callback,ht=ke.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];Oe(Dn,En)}return p.a.createElement(m.a,Object(R.a)({form:en},Ee,{className:"upload-image-panel",onFinish:mn}),p.a.createElement(m.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(m.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(K.a,{style:fe})),p.a.createElement(ae,{onFileChange:$t}))),p.a.createElement(m.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(K.a,{style:{width:264}})),p.a.createElement(m.a.Item,{style:{textAlign:"right"}},p.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(T.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))};function ae(ke){var et=ke.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:et}))}function Oe(ke,et){if(!ke)throw new String("\u6CA1\u6709\u6587\u4EF6");var ht=new FormData;ht.append("editormd-image-file",ke),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),ke)},!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"),Xe=U("9yH6"),We=Xe.a.Group,Ke={margin:"0 8px"},nt=function(ke){var et=ke.callback,ht=ke.onCancel;function Ut(nn){et(nn)}return p.a.createElement(m.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ut},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Ke},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Ke},"\u884C\u6570"),p.a.createElement(m.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(Ye.a,null)),p.a.createElement("span",{style:Ke},"\u5217\u6570"),p.a.createElement(m.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(Ye.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:Ke},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(m.a.Item,{name:"align"},p.a.createElement(We,null,p.a.createElement(Xe.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(Xe.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(Xe.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(Xe.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(T.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))},de=U("ErOA"),De=U("7Cbv"),Ne="link",Be="upload-image",at="code-block",lt="add-table",pt="------------",ot={default:pt,left:":".concat(pt),center:":".concat(pt,":"),right:"".concat(pt,":")},bt=U("9VGf"),yt,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(ke){return/^\d+$/.test(ke)?"".concat(ke,"px"):ke}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=(yt={},Object(H.a)(yt,me+"-B","bold"),Object(H.a)(yt,me+"-I","italic"),yt),Te=(xt={},Object(H.a)(xt,Ne,"\u6DFB\u52A0\u94FE\u63A5"),Object(H.a)(xt,at,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(H.a)(xt,Be,"\u6DFB\u52A0\u6587\u4EF6"),Object(H.a)(xt,lt,"\u6DFB\u52A0\u8868\u683C"),xt),Re=ge.a=function(ke){var et=ke.defaultValue,ht=et===void 0?"":et,Ut=ke.onChange,nn=ke.width,en=nn===void 0?"100%":nn,mn=ke.height,En=mn===void 0?400:mn,$t=ke.miniToolbar,rr=$t===void 0?!1:$t,Dn=ke.isFocus,Sr=Dn===void 0?!1:Dn,br=ke.watch,Pn=ke.insertTemp,Dr=ke.mode,Or=Dr===void 0?"markdown":Dr,ln=ke.id,Yr=ln===void 0?"markdown-editor-id":ln,tn=ke.showResizeBar,sn=tn===void 0?!1:tn,$n=ke.noStorage,sr=$n===void 0?!1:$n,Nr=ke.showNullButton,hn=Nr===void 0?!1:Nr,Qt=ke.hidetoolBar,$r=Qt===void 0?!1:Qt,fr=ke.fullScreen,Lr=fr===void 0?!1:fr,kn=ke.onBlur,Ur=ke.onCMBeforeChange,vi=ke.onFullScreen,Ai=ke.className,Et=Ai===void 0?"":Ai,fn=ke.disablePaste,Gi=fn===void 0?!1:fn,zi=ke.placeholder,na=zi===void 0?"":zi,Vi=ke.values,Z=Vi===void 0?"":Vi,L=Object(x.useState)(null),k=Object(G.a)(L,2),V=k[0],ne=k[1],Q=Object(x.useState)(ht),Pe=Object(G.a)(Q,2),ft=Pe[0],Lt=Pe[1],rn=Object(x.useState)(br),gt=Object(G.a)(rn,2),Gt=gt[0],pr=gt[1],Ir=Object(x.useState)(Lr),Zt=Object(G.a)(Ir,2),mt=Zt[0],Pt=Zt[1],Rt=Object(x.useState)(""),Ht=Object(G.a)(Rt,2),un=Ht[0],xn=Ht[1],Cn=Object(x.useState)(0),gn=Object(G.a)(Cn,2),Ln=gn[0],Kn=gn[1],dn=Object(x.useState)(En),Sn=Object(G.a)(dn,2),hr=Sn[0],Nn=Sn[1],Kt=Object(x.useState)(!1),An=Object(G.a)(Kt,2),lr=An[0],Un=An[1],zt=Object(x.useRef)(Object(De.a)()),jt=Object(x.useRef)(!1),yn=Object(x.useRef)(),Ct=Object(x.useRef)(),Mt=Object(x.useRef)(),Dt=Object(x.useRef)(),Me=Object(x.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(".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(x.useEffect)(function(){Lt(Z),V==null||V.setValue(Z)},[Z]),Object(x.useEffect)(function(){vi==null||vi(mt)},[mt]),Object(x.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();Oe(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(".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();Oe(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(".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(x.useCallback)(function(){if(Mt.current)try{}catch(Xt){console.log(Xt,"---- to set md editor body height")}},[hr,Mt,mt]);Object(x.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(x.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(H.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(x.useEffect)(function(){Lr!==mt&&Pt(Lr)},[Lr]),Object(bt.a)(function(){if(!sr&&Ln>0){var Xt=new Date().getTime(),Jt=window.sessionStorage.getItem(Yr);Xt>=Ln+Ot&&(!Jt||Jt!==ft)&&(window.sessionStorage.setItem(Yr,ft),Un(!0))}},Ot),Object(x.useEffect)(function(){pr(br)},[V,br]),Object(x.useEffect)(function(){V&&(Sr&&V.focus())},[V,Sr]),Object(x.useEffect)(function(){if(Gt&&V){var Xt=V.getScrollerElement();function Jt(Yt){var pn=Yt.target;if(Me.current){var Gn=pn.scrollTop/pn.scrollHeight;Me.current.scrollTop=Me.current.scrollHeight*Gn}}return Xt.addEventListener("scroll",Jt),function(){Xt.removeEventListener("scroll",Jt)}}},[V,Gt]),Object(x.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(x.useEffect)(function(){if(V&&kn){function Xt(){kn(V.getValue())}return V.on("blur",Xt),function(){V.off("blur",Xt)}}},[V,kn]),Object(x.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(x.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(x.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 at:xn(at);return;case Be:xn(Be);return;case lt:xn(lt);return;default:throw new Error}},[V,Gt,mt]),On=Object(x.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 at:var pn=Xt.language,Gn=Xt.content;return V.replaceSelection(["```"+pn,Gn,"```"].join(`
|
|
`)),V.focus();case Be:var Mn=Xt.src,qn=Xt.alt;return qn?V.replaceSelection(".concat(Mn,' "').concat(qn,'" )')):V.replaceSelection("")),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(ot[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(x.useMemo)(function(){switch(un){case Ne:return p.a.createElement(q,{callback:On,onCancel:ai});case at:return p.a.createElement(re.b,{callback:On,onCancel:ai});case Be:return p.a.createElement(se,{callback:On,onCancel:ai});case lt:return p.a.createElement(nt,{callback:On,onCancel:ai});default:return null}},[un]);function ai(){xn("")}Object(x.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(x.useEffect)(function(){Nn(En)},[En]);var Kr=xe(en),jn=xe(hr),Bt={width:Kr,height:jn},Er=Object(x.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 Qn(){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 p.a.createElement(x.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:Mt},p.a.createElement("div",{className:"markdown-editor-container ".concat(Et," ").concat(Gt?"on-preview":""," ").concat(rr?"mini":""," ").concat(mt?"full-screen":""),style:Bt},p.a.createElement(w,{insertTemp:Pn,watch:Gt,fullScreen:mt,showNullButton:hn,onActionCallback:mr,hidetoolBar:$r,uuid:zt.current,setOpenPhones:function(){jt.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:Ct,placeholder:na})),Gt?p.a.createElement("div",{ref:Me,className:"preview-container"},Or==="stex"&&p.a.createElement(O,{value:ft}),Or!=="stex"&&p.a.createElement(S.a,{edit:!0,value:ft,replaces:oi})):null))),sn?p.a.createElement("a",{ref:Dt,className:"editor-resize"}):null,p.a.createElement(j.a,null,Te[un]?p.a.createElement(Y.a,{centered:!0,title:Te[un],visible:!0,onCancel:ai,footer:null,className:"markdown-popup-form"},ii):null))}},"P/tu":function(ut,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"),H=U.n(G),n=U("q1tI"),I=U.n(n),x=U("WCUW"),p=U("spXi"),_=U.n(p),c=function(h){var l=h.value,u=h.onChange,s=h.defaultValue,i=h.disabled,D=Object(F.a)(h,["value","onChange","defaultValue","disabled"]),A=Object(n.useState)([]),S=Object(P.a)(A,2),O=S[0],R=S[1],g=Object(n.useState)("1"),b=Object(P.a)(g,2),f=b[0],d=b[1];Object(n.useEffect)(function(){C()},[]);var C=function(){var j=Object(z.a)(H.a.mark(function W(){var T,M;return H.a.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,Object(x.A)({});case 2:T=v.sent,T!=null&&T.data&&(M=[{title:I.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:_.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:E(T.data||[])}],R(M),d("2"));case 4:case"end":return v.stop()}},W)}));return function(){return j.apply(this,arguments)}}(),E=function(W){function T(M){var m=M.children,v=Array.isArray(m)&&m.length>0,K=M==null?void 0:M.group_id;return{title:I.a.createElement("div",{title:M==null?void 0:M.name,className:_.a.name},M==null?void 0:M.name),value:K,key:K,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:_.a.customTree},I.a.createElement(Y.a,Object(N.a)({key:f},w,{showIcon:!0,treeData:O,onSelect:u,disabled:i},D)))};ge.a=c},Q0Vu:function(ut,ge,U){ut.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(ut,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,x=I===void 0?[]:I,p=n.onClick,_=function(){return x.map(function(h,l){return z.a.createElement("div",{key:l,className:F.a.few},z.a.createElement("b",{title:h.name,style:{color:l===0?"#333333":"#999999"},onClick:function(){return p(h.id)}},h.name),l<x.length-1&&z.a.createElement("span",null,"/"))})},c=function(){var h=!0,l=x.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 p(s.id)},key:s.id},s.name)}));return x.map(function(s,i){var D=null;return i>1&&i<x.length-2?h&&(D=z.a.createElement(Y.a,{key:i,placement:"bottom",content:u},z.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),h=!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 p(s.id)}},s.name),i<x.length-1&&z.a.createElement("span",null,"/")),D})};return z.a.createElement("aside",{style:{overflowX:"auto"}},(x==null?void 0:x.length)>5?c():_())};ge.a=G},SJMd:function(ut,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 H=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"],x=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[x,"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"],_=[x,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[x,"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",h=[x,"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=[p,c,_,h,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",O="kwd",R="com",g="typ",b="lit",f="pun",d="pln",C="tag",E="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(We){for(var Ke=0,nt=!1,de=!1,De=0,Ne=We.length;De<Ne;++De){var Be=We[De];if(Be.ignoreCase)de=!0;else if(/[a-z]/i.test(Be.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){nt=!0,de=!1;break}}var at={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=at[kt],Ze||("0"<=kt&&kt<="7"?parseInt(xt.substring(1),8):kt==="u"||kt==="x"?parseInt(xt.substring(2),16):xt.charCodeAt(1))}function pt(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 ot(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(ke,et){return ke[0]-et[0]||et[1]-ke[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(pt(Re[0])),Re[1]>Re[0]&&(Re[1]+1>Re[0]&&qe.push("-"),qe.push(pt(Re[1])))}return qe.push("]"),qe.join("")}function bt(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]=pt(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]=ot(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 yt=[],De=0,Ne=We.length;De<Ne;++De){var Be=We[De];if(Be.global||Be.multiline)throw new Error(""+Be);yt.push("(?:"+bt(Be)+")")}return new RegExp(yt.join("|"),de?"gi":"g")}function v(We,Ke){var nt=/(?:^|\s)nocode(?:\s|$)/,de=[],De=0,Ne=[],Be=0;function at(lt){var pt=lt.nodeType;if(pt==1){if(nt.test(lt.className))return;for(var ot=lt.firstChild;ot;ot=ot.nextSibling)at(ot);var bt=lt.nodeName.toLowerCase();(bt==="br"||bt==="li")&&(de[Be]=`
|
|
`,Ne[Be<<1]=De++,Ne[Be++<<1|1]=lt)}else if(pt==3||pt==4){var yt=lt.nodeValue;yt.length&&(Ke?yt=yt.replace(/\r\n?/g,`
|
|
`):yt=yt.replace(/[ \t\r\n]+/g," "),de[Be]=yt,Ne[Be<<1]=De,De+=yt.length,Ne[Be++<<1|1]=lt)}}return at(We),{sourceCode:de.join("").replace(/\n$/,""),spans:Ne}}function K(We,Ke,nt,de,De){if(!nt)return;var Ne={sourceNode:We,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(We){for(var Ke=void 0,nt=We.firstChild;nt;nt=nt.nextSibling){var de=nt.nodeType;Ke=de===1?Ke?We:nt:de===3&&X.test(nt.nodeValue)?We:Ke}return Ke===We?void 0:Ke}function re(We,Ke){var nt={},de;(function(){for(var Be=We.concat(Ke),at=[],lt={},pt=0,ot=Be.length;pt<ot;++pt){var bt=Be[pt],yt=bt[3];if(yt)for(var xt=yt.length;--xt>=0;)nt[yt.charAt(xt)]=bt;var Ze=bt[1],kt=""+Ze;lt.hasOwnProperty(kt)||(at.push(Ze),lt[kt]=null)}at.push(/[\0-\uffff]/),de=m(at)})();var De=Ke.length,Ne=function(Be){for(var at=Be.sourceCode,lt=Be.basePos,pt=Be.sourceNode,ot=[lt,d],bt=0,yt=at.match(de)||[],xt={},Ze=0,kt=yt.length;Ze<kt;++Ze){var Ot=yt[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=bt;if(bt+=Ot.length,!xe)ot.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 ke=qe.substring(5);K(pt,lt+ce,Ot.substring(0,Te),Ne,ot),K(pt,lt+ce+Te,he,ae(ke,he),ot),K(pt,lt+ce+Re,Ot.substring(Re),Ne,ot)}}Be.decorations=ot};return Ne}function ye(We){var Ke=[],nt=[];We.tripleQuotedStrings?Ke.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):We.multiLineStrings?Ke.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ke.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),We.verbatimStrings&&nt.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var de=We.hashComments;de&&(We.cStyleComments?(de>1?Ke.push([R,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ke.push([R,/^#(?:(?: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([R,/^#[^\r\n]*/,null,"#"])),We.cStyleComments&&(nt.push([R,/^\/\/[^\r\n]*/,null]),nt.push([R,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var De=We.regexLiterals;if(De){var Ne=De>1?"":`
|
|
\r`,Be=Ne?".":"[\\S\\s]",at="/(?=[^/*"+Ne+"])(?:[^/\\x5B\\x5C"+Ne+"]|\\x5C"+Be+"|\\x5B(?:[^\\x5C\\x5D"+Ne+"]|\\x5C"+Be+")*(?:\\x5D|$))+/";nt.push(["lang-regex",RegExp("^"+M+"("+at+")")])}var lt=We.types;lt&&nt.push([g,lt]);var pt=(""+We.keywords).replace(/^ | $/g,"");pt.length&&nt.push([O,new RegExp("^(?:"+pt.replace(/[\s,]+/g,"|")+")\\b"),null]),Ke.push([d,/^\s+/,null,` \r
|
|
\xA0`]);var ot="^.[^\\s\\w.$@'\"`/\\\\]*";return We.regexLiterals&&(ot+="(?!s*/)"),nt.push([b,/^@[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],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[d,/^\\[\s\S]?/,null],[f,new RegExp(ot),null]),re(Ke,nt)}var pe=ye({keywords:D,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ue(We,Ke,nt){for(var de=/(?:^|\s)nocode(?:\s|$)/,De=/\r\n?|\n/,Ne=We.ownerDocument,Be=Ne.createElement("li");We.firstChild;)Be.appendChild(We.firstChild);var at=[Be];function lt(Ze){var kt=Ze.nodeType;if(kt==1&&!de.test(Ze.className))if(Ze.nodeName==="br")pt(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)}pt(Ze),xe||Ze.parentNode.removeChild(Ze)}}}function pt(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;at.push(Ot)}for(var ot=0;ot<at.length;++ot)lt(at[ot]);Ke===(Ke|0)&&at[0].setAttribute("value",Ke);var bt=Ne.createElement("ol");bt.className="linenums";for(var yt=Math.max(0,Ke-1|0)||0,ot=0,xt=at.length;ot<xt;++ot)Be=at[ot],Be.className="L"+(ot+yt)%10,Be.firstChild||Be.appendChild(Ne.createTextNode("\xA0")),bt.appendChild(Be);We.appendChild(bt)}function fe(We){var Ke=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ke=Ke&&+Ke[1]<=8;var nt=/\n/g,de=We.sourceCode,De=de.length,Ne=0,Be=We.spans,at=Be.length,lt=0,pt=We.decorations,ot=pt.length,bt=0;pt[ot]=De;var yt,xt;for(xt=yt=0;xt<ot;)pt[xt]!==pt[xt+2]?(pt[yt++]=pt[xt++],pt[yt++]=pt[xt++]):xt+=2;for(ot=yt,xt=yt=0;xt<ot;){for(var Ze=pt[xt],kt=pt[xt+1],Ot=xt+2;Ot+2<=ot&&pt[Ot+1]===kt;)Ot+=2;pt[yt++]=Ze,pt[yt++]=kt,xt=Ot}ot=pt.length=yt;var qe=We.sourceNode,st="";qe&&(st=qe.style.display,qe.style.display="none");try{for(var xe=null;lt<at;){var we=Be[lt],me=Be[lt+2]||De,ce=pt[bt+2]||De,Ot=Math.min(me,ce),he=Be[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,ke=Re.createElement("span");ke.className=pt[bt+1];var et=he.parentNode;et.replaceChild(ke,he),ke.appendChild(he),Ne<me&&(Be[lt+1]=he=Re.createTextNode(de.substring(Ot,me)),et.insertBefore(he,ke.nextSibling))}Ne=Ot,Ne>=me&&(lt+=2),Ne>=ce&&(bt+=2)}}finally{qe&&(qe.style.display=st)}}var Ee={};function se(We,Ke){for(var nt=Ke.length;--nt>=0;){var de=Ke[nt];Ee.hasOwnProperty(de)?H.console&&console.warn("cannot override language handler %s",de):Ee[de]=We}}function ae(We,Ke){return We&&Ee.hasOwnProperty(We)||(We=/^\s*</.test(Ke)?"default-markup":"default-code"),Ee[We]}se(pe,["default-code"]),se(re([],[[d,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[R,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[f,/^(?:<[%?]|[%?]>)/],["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)))/],[f,/^[=<>\/]+/],["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:p,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:_,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:h,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 Oe(We){var Ke=We.langExtension;try{var nt=v(We.sourceNode,We.pre),de=nt.sourceCode;We.sourceCode=de,We.spans=nt.spans,We.basePos=0,ae(Ke,de)(We),fe(We)}catch(De){H.console&&console.log(De&&De.stack||De)}}function ze(We,Ke,nt){var de=nt||!1,De=Ke||null,Ne=document.createElement("div");Ne.innerHTML="<pre>"+We+"</pre>",Ne=Ne.firstChild,de&&ue(Ne,de,!0);var Be={langExtension:De,numberLines:de,sourceNode:Ne,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Oe(Be),Ne.innerHTML}function Ye(We,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")],Be=[],at=0;at<Ne.length;++at)for(var lt=0,pt=Ne[at].length;lt<pt;++lt)Be.push(Ne[at][lt]);Ne=null;var ot=Date;ot.now||(ot={now:function(){return+new Date}});var bt=0,yt=/\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=H.PR_SHOULD_USE_CONTINUATION?ot.now()+250:Infinity;bt<Be.length&&ot.now()<we;bt++){for(var me=Be[bt],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 ke=me.className;if((ce!==st||xt.test(ke))&&!Ze.test(ke)){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=ke.match(yt);var en;!nn&&(en=q(me))&&Ot.test(en.tagName)&&(nn=en.className.match(yt)),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=ke.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};Oe(Sr)}}}bt<Be.length?H.setTimeout(xe,250):typeof We=="function"&&We()}xe()}var He=H.PR={createSimpleLexer:re,registerLangHandler:se,sourceDecorator:ye,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:W,PR_COMMENT:R,PR_DECLARATION:E,PR_KEYWORD:O,PR_LITERAL:b,PR_NOCODE:T,PR_PLAIN:d,PR_PUNCTUATION:f,PR_SOURCE:w,PR_STRING:S,PR_TAG:C,PR_TYPE:g,prettyPrintOne:N?H.prettyPrintOne=ze:F=ze,prettyPrint:G=N?H.prettyPrint=Ye:G=Ye},Xe=H.define;typeof Xe=="function"&&Xe.amd&&Xe("google-code-prettify",[],function(){return He})})()},T8No:function(ut,ge,U){"use strict";U.d(ge,"a",function(){return G}),U.d(ge,"e",function(){return H}),U.d(ge,"c",function(){return f}),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 p.create(T)}static equals(T,M){return _.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 b.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 b.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 h.create(m[0].trim(),this._deserializeValue(m[1],M))}if(T.indexOf("==")>=0){let m=T.split("==");return _.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()):p.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 K=T.slice(m+1,v),X=T[v+1]==="i"?"i":"";try{return new RegExp(K,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 H(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 x.INSTANCE}}I.INSTANCE=new I;class x{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}}x.INSTANCE=new x;class p{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?x.INSTANCE:I.INSTANCE:new p(T,M)}cmp(T){return T.type!==this.type?this.type-T.type:E(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?x.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 _{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?p.create(T,m):l.create(T,m);const v=P.get(T);if(typeof v=="boolean"){const K=v?"true":"false";return M===K?x.INSTANCE:I.INSTANCE}return new _(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?x.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=h.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 h{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):p.create(T,m);const v=P.get(T);if(typeof v=="boolean"){const K=v?"true":"false";return M===K?I.INSTANCE:x.INSTANCE}return new h(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:x.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=_.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:x.INSTANCE:new l(T,M)}cmp(T){return T.type!==this.type?this.type-T.type:E(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:x.INSTANCE:this}evaluate(T){return!T.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.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=O.create(this)),this.negated}}class O{constructor(T){this._actual=T,this.type=8}static create(T){return new O(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 R(T){let M=null;for(let m=0,v=T.length;m<v;m++){const K=T[m].substituteConstants();if(T[m]!==K&&M===null){M=[];for(let X=0;X<m;X++)M[X]=T[X]}M!==null&&(M[m]=K)}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=R(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 K of T){if(!K)continue;if(K.type===1){v=!0;continue}if(K.type===0)return I.INSTANCE;if(K.type===6){m.push(...K.expr);continue}m.push(K)}if(m.length===0&&v)return x.INSTANCE;if(m.length===0)return;if(m.length===1)return m[0];m.sort(n);for(let K=1;K<m.length;K++)m[K-1].equals(m[K])&&(m.splice(K,1),K--);if(m.length===1)return m[0];for(;m.length>1;){const K=m[m.length-1];if(K.type!==9)break;m.pop();const X=m.pop(),q=m.length===0,re=b.create(K.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=b.create(T,this,!0)}return this.negated}}class b{constructor(T,M){this.expr=T,this.negated=M,this.type=9}static create(T,M,m){return b._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=R(this.expr);return T===this.expr?this:b.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=[],K=!1;if(T){for(let X=0,q=T.length;X<q;X++){const re=T[X];if(!re)continue;if(re.type===0){K=!0;continue}if(re.type===1)return x.INSTANCE;if(re.type===9){v=v.concat(re.expr);continue}v.push(re)}if(v.length===0&&K)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 b(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 K=T.length===0;T.unshift(b.create(v,null,K))}this.negated=T[0]}return this.negated}}class f extends p{constructor(T,M,m){super(T,null);this._defaultValue=M,typeof m=="object"?f._info.push(Object.assign(Object.assign({},m),{key:T})):m!==!0&&f._info.push({key:T,description:m,type:M!=null?typeof M:void 0})}static all(){return f._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 _.create(this.key,T)}}f._info=[];const d=Object(N.c)("contextKeyService"),C="setContext";function E(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 K of M.expr)if(T.equals(K))return!0}const m=T.negate(),v=W(m).concat(W(M));v.sort(n);for(let K=0;K<v.length;K++){const X=v[K],q=X.negate();for(let re=K+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(ut,ge,U){var te,Y;(function(){var N;(function(){"use strict";var P=[,,function(n){function I(_){this.__parent=_,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 _=new I(this.__parent);return _.set_indent(this.__indent_count,this.__alignment_count),_},I.prototype.item=function(_){return _<0?this.__items[this.__items.length+_]:this.__items[_]},I.prototype.has_match=function(_){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(_))return!0;return!1},I.prototype.set_indent=function(_,c){this.is_empty()&&(this.__indent_count=_||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 _=this.__parent.current_line;return _.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),_.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),_.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,_.__items[0]===" "&&(_.__items.splice(0,1),_.__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(_){this.__items.push(_);var c=_.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=_.length-c:this.__character_count+=_.length},I.prototype.pop=function(){var _=null;return this.is_empty()||(_=this.__items.pop(),this.__character_count-=_.length),_},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 _="";return this.is_empty()?this.__parent.indent_empty_lines&&(_=this.__parent.get_indent_string(this.__indent_count)):(_=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),_+=this.__items.join("")),_};function x(_,c){this.__cache=[""],this.__indent_size=_.indent_size,this.__indent_string=_.indent_char,_.indent_with_tabs||(this.__indent_string=new Array(_.indent_size+1).join(_.indent_char)),c=c||"",_.indent_level>0&&(c=new Array(_.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}x.prototype.get_indent_size=function(_,c){var a=this.__base_string_length;return c=c||0,_<0&&(a=0),a+=_*this.__indent_size,a+=c,a},x.prototype.get_indent_string=function(_,c){var a=this.__base_string;return c=c||0,_<0&&(_=0,a=""),c+=_*this.__indent_size,this.__ensure_cache(c),a+=this.__cache[c],a},x.prototype.__ensure_cache=function(_){for(;_>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var _=this.__cache.length,c=0,a="";this.__indent_size&&_>=this.__indent_size&&(c=Math.floor(_/this.__indent_size),_-=c*this.__indent_size,a=new Array(c+1).join(this.__indent_string)),_&&(a+=new Array(_+1).join(" ")),this.__cache.push(a)};function p(_,c){this.__indent_cache=new x(_,c),this.raw=!1,this._end_with_newline=_.end_with_newline,this.indent_size=_.indent_size,this.wrap_line_length=_.wrap_line_length,this.indent_empty_lines=_.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()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(_,c){return this.__indent_cache.get_indent_string(_,c)},p.prototype.get_indent_size=function(_,c){return this.__indent_cache.get_indent_size(_,c)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(_){return this.is_empty()||!_&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(_){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 _!==`
|
|
`&&(a=a.replace(/[\n]/g,_)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(_,c){return _=_||0,c=c||0,this.next_line.set_indent(_,c),this.__lines.length>1?(this.current_line.set_indent(_,c),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(_){for(var c=0;c<_.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(_.whitespace_before),this.current_line.push(_.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(_){this.__add_space_before_token(),this.current_line.push(_),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.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(" "))},p.prototype.remove_indent=function(_){for(var c=this.__lines.length;_<c;)this.__lines[_]._remove_indent(),_++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(_){for(_=_===void 0?!1:_,this.current_line.trim();_&&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},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(_,c){for(var a=this.__lines.length-2;a>=0;){var h=this.__lines[a];if(h.is_empty())break;if(h.item(0).indexOf(_)!==0&&h.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=p},,,,function(n){function I(_,c){this.raw_options=x(_,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(_,c){var a=this.raw_options[_],h=c||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(h=a.concat()):typeof a=="string"&&(h=a.split(/[^a-zA-Z0-9_\/\-]+/)),h},I.prototype._get_boolean=function(_,c){var a=this.raw_options[_],h=a===void 0?!!c:!!a;return h},I.prototype._get_characters=function(_,c){var a=this.raw_options[_],h=c||"";return typeof a=="string"&&(h=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},I.prototype._get_number=function(_,c){var a=this.raw_options[_];c=parseInt(c,10),isNaN(c)&&(c=0);var h=parseInt(a,10);return isNaN(h)&&(h=c),h},I.prototype._get_selection=function(_,c,a){var h=this._get_selection_list(_,c,a);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+_+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[_]+"'");return h[0]},I.prototype._get_selection_list=function(_,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 h=this._get_array(_,a);if(!this._is_valid_selection(h,c))throw new Error("Invalid Option Value: The option '"+_+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[_]+"'");return h},I.prototype._is_valid_selection=function(_,c){return _.length&&c.length&&!_.some(function(a){return c.indexOf(a)===-1})};function x(_,c){var a={};_=p(_);var h;for(h in _)h!==c&&(a[h]=_[h]);if(c&&_[c])for(h in _[c])a[h]=_[c][h];return a}function p(_){var c={},a;for(a in _){var h=a.replace(/-/g,"_");c[h]=_[a]}return c}n.exports.Options=I,n.exports.normalizeOpts=p,n.exports.mergeOpts=x},,function(n){var I=RegExp.prototype.hasOwnProperty("sticky");function x(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}x.prototype.restart=function(){this.__position=0},x.prototype.back=function(){this.__position>0&&(this.__position-=1)},x.prototype.hasNext=function(){return this.__position<this.__input_length},x.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},x.prototype.peek=function(p){var _=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(_=this.__input.charAt(p)),_},x.prototype.__match=function(p,_){p.lastIndex=_;var c=p.exec(this.__input);return c&&!(I&&p.sticky)&&(c.index!==_&&(c=null)),c},x.prototype.test=function(p,_){return _=_||0,_+=this.__position,_>=0&&_<this.__input_length?!!this.__match(p,_):!1},x.prototype.testChar=function(p,_){var c=this.peek(_);return p.lastIndex=0,c!==null&&p.test(c)},x.prototype.match=function(p){var _=this.__match(p,this.__position);return _?this.__position+=_[0].length:_=null,_},x.prototype.read=function(p,_,c){var a="",h;return p&&(h=this.match(p),h&&(a+=h[0])),_&&(h||!p)&&(a+=this.readUntil(_,c)),a},x.prototype.readUntil=function(p,_){var c="",a=this.__position;p.lastIndex=this.__position;var h=p.exec(this.__input);return h?(a=h.index,_&&(a+=h[0].length)):a=this.__input_length,c=this.__input.substring(this.__position,a),this.__position=a,c},x.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},x.prototype.get_regexp=function(p,_){var c=null,a="g";return _&&I&&(a="y"),typeof p=="string"&&p!==""?c=new RegExp(p,a):p&&(c=new RegExp(p.source,a)),c},x.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},x.prototype.peekUntilAfter=function(p){var _=this.__position,c=this.readUntilAfter(p);return this.__position=_,c},x.prototype.lookBack=function(p){var _=this.__position-1;return _>=p.length&&this.__input.substring(_-p.length,_).toLowerCase()===p},n.exports.InputScanner=x},,,,,function(n){function I(x,p){x=typeof x=="string"?x:x.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(x+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(x+/\sbeautify\signore:end\s/.source+p,"g")}I.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var _=this.__directive_pattern.exec(x);_;)p[_[1]]=_[2],_=this.__directive_pattern.exec(x);return p},I.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},,function(n,I,x){var p=x(16).Beautifier,_=x(17).Options;function c(a,h){var l=new p(a,h);return l.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new _}},function(n,I,x){var p=x(17).Options,_=x(2).Output,c=x(8).InputScanner,a=x(13).Directives,h=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(O,R){this._source_text=O||"",this._options=new p(R),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}S.prototype.eatString=function(O){var R="";for(this._ch=this._input.next();this._ch;){if(R+=this._ch,this._ch==="\\")R+=this._input.next();else if(O.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return R},S.prototype.eatWhitespace=function(O){for(var R=s.test(this._input.peek()),g=0;s.test(this._input.peek());)this._ch=this._input.next(),O&&this._ch===`
|
|
`&&((g===0||g<this._options.max_preserve_newlines)&&(g++,this._output.add_new_line(!0)));return R},S.prototype.foundNestedPseudoClass=function(){for(var O=0,R=1,g=this._input.peek(R);g;){if(g==="{")return!0;if(g==="(")O+=1;else if(g===")"){if(O===0)return!1;O-=1}else if(g===";"||g==="}")return!1;R++,g=this._input.peek(R)}return!1},S.prototype.print_string=function(O){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(O)},S.prototype.preserveSingleSpace=function(O){O&&(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 O=this._source_text,R=this._options.eol;R==="auto"&&(R=`
|
|
`,O&&l.test(O||"")&&(R=O.match(l)[0])),O=O.replace(u,`
|
|
`);var g=O.match(/^[\t ]*/)[0];this._output=new _(this._options,g),this._input=new c(O),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var b=0,f=!1,d=!1,C=!1,E=!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 K=this._input.read(D),X=h.get_directives(K);X&&X.ignore==="start"&&(K+=h.readIgnored(this._input)),this.print_string(K),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(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"?E=!0:q==="import"&&(w=!0),q in this.NESTED_AT_RULE?(this._nestedLevel+=1,q in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!f&&b===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,f=this._indentLevel>=this._nestedLevel):f=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&f&&(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,E=!1,d&&(this.outdent(),d=!1),this.print_string(this._ch),f=!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}(f||C)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!E&&b===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,b===0?(d&&(this.outdent(),d=!1),E=!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(),b++,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(")")),b&&(b--,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(),b++,this.indent())}else if(this._ch===")")b&&(b--,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)&&b===0&&!w&&!E?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!d&&b===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(R);return fe},n.exports.Beautifier=S},function(n,I,x){var p=x(6).Options;function _(c){p.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 h=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<h.length;l++)h[l]!=="expand"?this.brace_style="collapse":this.brace_style=h[l]}_.prototype=new p,n.exports.Options=_}],F={};function G(n){var I=F[n];if(I!==void 0)return I.exports;var x=F[n]={exports:{}};return P[n](x,x.exports,G),x.exports}var H=G(15);N=H})();var z=N;!(te=[],Y=function(){return{css_beautify:z}}.apply(ge,te),Y!==void 0&&(ut.exports=Y))})()},Vhoy:function(ut,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 H});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,x)=>` ${x} `).trim():""}class G{constructor(n,I,x){this.id=n,this.definition=I,this.description=x,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 H;(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 x(c){if(c instanceof G)return["codicon","codicon-"+c.id];const a=I.exec(c.id);if(!a)return x(G.error);let[,h,l]=a;const u=["codicon","codicon-"+h];return l&&u.push("codicon-modifier-"+l.substr(1)),u}n.asClassNameArray=x;function p(c){return x(c).join(" ")}n.asClassName=p;function _(c){return"."+x(c).join(".")}n.asCSSSelector=_})(H||(H={})),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(ut,ge,U){(function(te,Y){ut.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,H=G&&(z?document.documentMode||6:+(F||P)[1]),n=!F&&/WebKit\//.test(te),I=n&&/Qt\/\d+\.\d+/.test(te),x=!F&&/Chrome\//.test(te),p=/Opera\//.test(te),_=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(te),a=/PhantomJS/.test(te),h=!F&&/AppleWebKit/.test(te)&&/Mobile\/\w+/.test(te),l=/Android/.test(te),u=h||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(te),s=h||/Mac/.test(Y),i=/\bCrOS\b/.test(te),D=/win/i.test(Y),A=p&&te.match(/Version\/(\d*\.\d*)/);A&&(A=Number(A[1])),A&&A>=15&&(p=!1,n=!0);var S=s&&(I||p&&(A==null||A<12.11)),O=N||G&&H>=9;function R(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var g=function(e,t){var o=e.className,r=R(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 b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function f(e,t){return b(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 E;document.createRange?E=function(e,t,o,r){var y=document.createRange();return y.setEnd(r||e,o),y.setStart(e,t),y}:E=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;R(t).test(o)||(e.className+=(o?" ":"")+t)}function T(e,t){for(var o=e.split(" "),r=0;r<o.length;r++)o[r]&&!R(o[r]).test(t)&&(t+=" "+o[r]);return t}var M=function(e){e.select()};h?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 K(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 Ee(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(Oe(se)+" ");return se[e]}function Oe(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 Xe(e,t){var o;return Object.create?o=Object.create(e):(He.prototype=e,o=new He),t&&v(t,o),o}var We=/[\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()||We.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 Be(e,t,o){for(;(o<0?t>0:t<e.length)&&Ne(e.charAt(t));)t+=o;return t}function at(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 pt=null;function ot(e,t,o){var r;pt=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:pt=y),B.from==t&&(B.from!=B.to&&o!="before"?r=y:pt=y)}return r!=null?r:pt}var bt=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,Ae,Ie){this.level=oe,this.from=Ae,this.to=Ie}return function(oe,Ae){var Ie=Ae=="ltr"?"L":"R";if(oe.length==0||Ae=="ltr"&&!r.test(oe))return!1;for(var Qe=oe.length,Ve=[],dt=0;dt<Qe;++dt)Ve.push(o(oe.charCodeAt(dt)));for(var _t=0,It=Ie;_t<Qe;++_t){var Ft=Ve[_t];Ft=="m"?Ve[_t]=It:It=Ft}for(var qt=0,Wt=Ie;qt<Qe;++qt){var on=Ve[qt];on=="1"&&Wt=="r"?Ve[qt]="n":B.test(on)&&(Wt=on,on=="r"&&(Ve[qt]="R"))}for(var In=1,bn=Ve[0];In<Qe-1;++In){var ar=Ve[In];ar=="+"&&bn=="1"&&Ve[In+1]=="1"?Ve[In]="1":ar==","&&bn==Ve[In+1]&&(bn=="1"||bn=="n")&&(Ve[In]=bn),bn=ar}for(var Fr=0;Fr<Qe;++Fr){var xi=Ve[Fr];if(xi==",")Ve[Fr]="N";else if(xi=="%"){var ei=void 0;for(ei=Fr+1;ei<Qe&&Ve[ei]=="%";++ei);for(var $i=Fr&&Ve[Fr-1]=="!"||ei<Qe&&Ve[ei]=="1"?"1":"N",Wi=Fr;Wi<ei;++Wi)Ve[Wi]=$i;Fr=ei-1}}for(var di=0,Hi=Ie;di<Qe;++di){var Si=Ve[di];Hi=="L"&&Si=="1"?Ve[di]="L":B.test(Si)&&(Hi=Si)}for(var gi=0;gi<Qe;++gi)if(y.test(Ve[gi])){var hi=void 0;for(hi=gi+1;hi<Qe&&y.test(Ve[hi]);++hi);for(var ri=(gi?Ve[gi-1]:Ie)=="L",Ki=(hi<Qe?Ve[hi]:Ie)=="L",Ro=ri==Ki?ri?"L":"R":Ie,Ya=gi;Ya<hi;++Ya)Ve[Ya]=Ro;gi=hi-1}for(var Li=[],wa,Ti=0;Ti<Qe;)if($.test(Ve[Ti])){var _s=Ti;for(++Ti;Ti<Qe&&$.test(Ve[Ti]);++Ti);Li.push(new ee(0,_s,Ti))}else{var Pa=Ti,oo=Li.length,so=Ae=="rtl"?1:0;for(++Ti;Ti<Qe&&Ve[Ti]!="L";++Ti);for(var Mi=Pa;Mi<Ti;)if(J.test(Ve[Mi])){Pa<Mi&&(Li.splice(oo,0,new ee(1,Pa,Mi)),oo+=so);var Do=Mi;for(++Mi;Mi<Ti&&J.test(Ve[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 Ae=="ltr"&&(Li[0].level==1&&(wa=oe.match(/^\s+/))&&(Li[0].from=wa[0].length,Li.unshift(new ee(0,0,wa[0].length))),Oe(Li).level==1&&(wa=oe.match(/\s+$/))&&(Oe(Li).to-=wa[0].length,Li.push(new ee(0,Qe-wa[0].length,Qe)))),Ae=="rtl"?Li.reverse():Li}}();function yt(e,t){var o=e.order;return o==null&&(o=e.order=bt(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 ke(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&&H<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");f(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ut=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&H<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=f(e,document.createTextNode("A\u062EA")),o=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return b(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=f(e,d("span","x")),o=t.getBoundingClientRect(),r=E(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=Xe(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 $n(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=K(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?K(this.string,this.lineStart,this.tabSize):0)},hn.prototype.indentation=function(){return K(this.string,null,this.tabSize)-(this.lineStart?K(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,$n(e.mode,t.state),o,t.lookAhead):new Q(e,$n(e.mode,t),o)},Q.prototype.save=function(e){var t=e!==!1?$n(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,Ae){return y.push(oe,Ae)},B,r);for(var $=o.state,J=function(oe){o.baseTokens=y;var Ae=e.state.overlays[oe],Ie=1,Qe=0;o.state=!0,mt(e,t.text,Ae.mode,o,function(Ve,dt){for(var _t=Ie;Qe<Ve;){var It=y[Ie];It>Ve&&y.splice(Ie,1,Ve,y[Ie+1],It),Ie+=2,Qe=Math.min(Ve,It)}if(!dt)return;if(Ae.opaque)y.splice(_t,Ie-_t,Ve,"overlay "+dt),Ie=_t+2;else for(;_t<Ie;_t+=2){var Ft=y[_t+1];y[_t+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 ft(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&&$n(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==""&>(y,o.state);!B.eol();)Gt(y,B,o.state),B.start=B.pos}function gt(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),Ae;for(r&&(Ae=[]);(r||oe.pos<t.ch)&&!oe.eol();)oe.start=oe.pos,$=Gt(B,oe,ee.state),r&&Ae.push(new pr(oe,$,$n(y.mode,ee.state)));return r?Ae: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,Ae=new hn(t,e.options.tabSize,r),Ie,Qe=e.options.addModeClass&&[null];for(t==""&&Zt(gt(o,r.state),B);!Ae.eol();){if(Ae.pos>e.options.maxHighlightLength?(J=!1,$&&rn(e,t,r,Ae.pos),Ae.pos=t.length,Ie=null):Ie=Zt(Gt(o,Ae,r.state,Qe),B),Qe){var Ve=Qe[0].name;Ve&&(Ie="m-"+(Ie?Ve+" "+Ie:Ve))}if(!J||oe!=Ie){for(;ee<Ae.start;)ee=Math.min(Ae.start,ee+5e3),y(ee,oe);oe=Ie}Ae.start=Ae.pos}for(;ee<Ae.pos;){var dt=Math.min(Ae.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 Ae=K(ee.text,null,e.options.tabSize);(y==null||r>Ae)&&(y=J-1,r=Ae)}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,Ae=Oe(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 Ve=Ln(ee,Qe.marker);Ve?oe&&(Qe.to=Ve.to==null?null:Ve.to+Ae):Qe.to=y}}if(ee)for(var dt=0;dt<ee.length;++dt){var _t=ee[dt];if(_t.to!=null&&(_t.to+=Ae),_t.from==null){var It=Ln(J,_t.marker);It||(_t.from=Ae,oe&&(J||(J=[])).push(_t))}else _t.from+=Ae,oe&&(J||(J=[])).push(_t)}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(Ve){if(Ve.markedSpans)for(var dt=0;dt<Ve.markedSpans.length;++dt){var _t=Ve.markedSpans[dt].marker;_t.readOnly&&(!r||q(r,_t)==-1)&&(r||(r=[])).push(_t)}}),!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 Ae=[ee,1],Ie=fn(oe.from,J.from),Qe=fn(oe.to,J.to);(Ie<0||!$.inclusiveLeft&&!Ie)&&Ae.push({from:oe.from,to:J.from}),(Qe>0||!$.inclusiveRight&&!Qe)&&Ae.push({from:J.to,to:oe.to}),y.splice.apply(y,Ae),ee+=Ae.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 Me(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),Ae=fn(oe.from,o)||zt(ee.marker)-zt(y),Ie=fn(oe.to,r)||jt(ee.marker)-jt(y);if(Ae>=0&&Ie<=0||Ae<=0&&Ie>=0)continue;if(Ae<=0&&(ee.marker.inclusiveRight&&y.inclusiveLeft?fn(oe.to,o)>=0:fn(oe.to,o)>0)||Ae>=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 Qn=function(e,t,o){this.text=e,Un(this,t),this.height=o?o(this):1};Qn.prototype.lineNo=function(){return kn(this)},me(Qn);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)&&($=yt(B,e.doc.direction))&&(r.addToken=wi(r.addToken,$)),r.map=[];var J=t!=e.display.externalMeasured&&kn(B);Qi(B,r,ft(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,Ae;if(!ee.test(t))e.col+=t.length,Ae=document.createTextNode(J),e.map.push(e.pos,e.pos+t.length,Ae),G&&H<9&&(oe=!0),e.pos+=t.length;else{Ae=document.createDocumentFragment();for(var Ie=0;;){ee.lastIndex=Ie;var Qe=ee.exec(t),Ve=Qe?Qe.index-Ie:t.length-Ie;if(Ve){var dt=document.createTextNode(J.slice(Ie,Ie+Ve));G&&H<9?Ae.appendChild(d("span",[dt])):Ae.appendChild(dt),e.map.push(e.pos,e.pos+Ve,dt),e.col+=Ve,e.pos+=Ve}if(!Qe)break;Ie+=Ve+1;var _t=void 0;if(Qe[0]==" "){var It=e.cm.options.tabSize,Ft=It-e.col%It;_t=Ae.appendChild(d("span",ae(Ft),"cm-tab")),_t.setAttribute("role","presentation"),_t.setAttribute("cm-text"," "),e.col+=Ft}else Qe[0]=="\r"||Qe[0]==`
|
|
`?(_t=Ae.appendChild(d("span",Qe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),_t.setAttribute("cm-text",Qe[0]),e.col+=1):(_t=e.cm.options.specialCharPlaceholder(Qe[0]),_t.setAttribute("cm-text",Qe[0]),G&&H<9?Ae.appendChild(d("span",[_t])):Ae.appendChild(_t),e.col+=1);e.map.push(e.pos,e.pos+1,_t),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",[Ae],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(Ae)}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,Ae=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>=Ae)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,Ae="",Ie,Qe,Ve=0,dt,_t,It,Ft,qt;;){if(Ve==ee){dt=_t=It=Qe="",qt=null,Ft=null,Ve=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&&Ve>bn.to&&(Ve=bn.to,_t=""),ar.className&&(dt+=" "+ar.className),ar.css&&(Qe=(Qe?Qe+";":"")+ar.css),ar.startStyle&&bn.from==ee&&(It+=" "+ar.startStyle),ar.endStyle&&bn.to==Ve&&(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&&Ve>bn.from&&(Ve=bn.from)}if(on)for(var xi=0;xi<on.length;xi+=2)on[xi+1]==Ve&&(_t+=" "+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,Ve);;){if(Ae){var Wi=ee+Ae.length;if(!Ft){var di=Wi>$i?Ae.slice(0,$i-ee):Ae;t.addToken(t,di,Ie?Ie+dt:dt,It,ee+di.length==Ve?_t:"",Qe,qt)}if(Wi>=$i){Ae=Ae.slice($i-ee),ee=$i;break}ee=Wi,It=""}Ae=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(Oe(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&&H<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,Ae=B.hasOwnProperty(oe)&&B[oe];Ae&&J.appendChild(d("div",[Ae],"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=R("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;"),f(t.display.measure,d("div",[e.node],null,o))}return e.height=e.node.parentNode.offsetHeight}function ra(e,t){for(var o=ke(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 be(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Le(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=f(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 Fe(e){return re-e.display.nativeBarWidth}function Ce(e){return e.display.scroller.clientWidth-Fe(e)-e.display.barWidth}function ie(e){return e.display.scroller.clientHeight-Fe(e)-e.display.barHeight}function ve(e,t,o){var r=e.options.lineWrapping,y=r&&Ce(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 Se(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,f(e.display.lineMeasure,y.pre),r}function _e(e,t,o,r){return Ge(e,Ue(e,t),o,r)}function je(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 Ue(e,t){var o=kn(t),r=je(e,o);r&&!r.text?r=null:r&&r.changes&&(uo(e,r,o,Wr(e)),e.curOp.forceUpdate=!0),r||(r=Se(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 vt(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=vt(t.map,o,r),B=y.node,$=y.start,J=y.end,ee=y.collapse,oe;if(B.nodeType==3){for(var Ae=0;Ae<4;Ae++){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&&H<9&&$==0&&J==y.coverEnd-y.coverStart?oe=B.parentNode.getBoundingClientRect():oe=Tt(E(B,$,J).getClientRects(),r),oe.left||oe.right||$==0)break;J=$,$=$-1,ee="right"}G&&H<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&&H<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 Ve=oe.top-t.rect.top,dt=oe.bottom-t.rect.top,_t=(Ve+dt)/2,It=t.view.measure.heights,Ft=0;Ft<It.length-1&&!(_t<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=Ve,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 Yn(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,b(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Yn(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 x&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Vn(){return x&&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=Ue(e,r));function $(dt,_t){var It=Ge(e,y,dt,_t?"right":"left",B);return _t?It.left=It.right:It.right=It.left,Jn(e,r,It,o)}var J=yt(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 Ae(dt,_t,It){var Ft=J[_t],qt=Ft.level==1;return $(It?dt-1:dt,qt!=It)}var Ie=ot(J,ee,oe),Qe=pt,Ve=Ae(ee,Ie,oe=="before");return Qe!=null&&(Ve.other=Ae(ee,Qe,oe!="before")),Ve}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=Me($,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=at(function($){return Ge(e,o,$-1).bottom<=r},y,0);return y=at(function($){return Ge(e,o,$).top>r},B,y),{begin:B,end:y}}function an(e,t,o,r){o||(o=Ue(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=Ue(e,t),$=Fn(t),J=0,ee=t.text.length,oe=!0,Ae=yt(t,e.doc.direction);if(Ae){var Ie=(e.options.lineWrapping?Ar:ir)(e,t,o,B,Ae,r,y);oe=Ie.level!=1,J=oe?Ie.from:Ie.to-1,ee=oe?Ie.to:Ie.from-1}var Qe=null,Ve=null,dt=at(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,Ve=bn),!0):!1},J,ee),_t,It,Ft=!1;if(Ve){var qt=r-Ve.left<Ve.right-r,Wt=qt==oe;dt=Qe+(Wt?0:1),It=Wt?"after":"before",_t=qt?Ve.left:Ve.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);_t=on.left,Ft=y<on.top?-1:y>=on.bottom?1:0}return dt=Be(t.text,dt,1),vn(o,dt,It,Ft,r-_t)}function ir(e,t,o,r,y,B,$){var J=at(function(Ie){var Qe=y[Ie],Ve=Qe.level!=1;return dr(tr(e,Et(o,Ve?Qe.to:Qe.from,Ve?"before":"after"),"line",t,r),B,$,!0)},0,y.length-1),ee=y[J];if(J>0){var oe=ee.level!=1,Ae=tr(e,Et(o,oe?ee.from:ee.to,oe?"after":"before"),"line",t,r);dr(Ae,B,$,!0)&&Ae.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 Ae=null,Ie=null,Qe=0;Qe<y.length;Qe++){var Ve=y[Qe];if(Ve.from>=oe||Ve.to<=ee)continue;var dt=Ve.level!=1,_t=Ge(e,r,dt?Math.min(oe,Ve.to)-1:Math.max(ee,Ve.from)).right,It=_t<B?B-_t+1e9:_t-B;(!Ae||Ie>It)&&(Ae=Ve,Ie=It)}return Ae||(Ae=y[y.length-1]),Ae.from<ee&&(Ae={from:ee,to:Ae.to,level:Ae.level}),Ae.to>oe&&(Ae={from:Ae.from,to:oe,level:Ae.level}),Ae}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"))}f(e.measure,xr);var o=xr.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),b(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");f(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&&ke(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 Ae=K(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))-Ae))}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,Ce(e)-r.sizer.offsetLeft)-$.right,oe=y.direction=="ltr";function Ae(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=yt(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;Ae(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),Ae(so,ri.top,Mi-so,ri.bottom),ri.bottom<Ki.top&&Ae(J,ri.bottom,null,Ki.top),Ae(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(),Ve=t.to();if(Qe.line==Ve.line)Ie(Qe.line,Qe.ch,Ve.ch);else{var dt=Qt(y,Qe.line),_t=Qt(y,Ve.line),It=Tn(dt)==Tn(_t),Ft=Ie(Qe.line,Qe.ch,It?dt.text.length+1:null).end,qt=Ie(Ve.line,It?0:null,Ve.ch).start;It&&(Ft.top<qt.top-2?(Ae(Ft.right,Ft.top,null,Ft.bottom),Ae(J,qt.top,qt.left,qt.bottom)):Ae(Ft.right,Ft.top,qt.left-Ft.right,Ft.bottom)),Ft.bottom<qt.top&&Ae(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&&H<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 Ae=y.line.height-$;if((Ae>.005||Ae<-.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+Fe(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),Ae=e.doc.scrollTop,Ie=e.doc.scrollLeft;if(oe.scrollTop!=null&&(ha(e,oe.scrollTop),Math.abs(e.doc.scrollTop-Ae)>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+be(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 Ae=Math.min(t.top,(oe?J:t.bottom)-B);Ae!=y&&($.scrollTop=Ae)}var Ie=e.options.fixedGutter?0:o.gutters.offsetWidth,Qe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:o.scroller.scrollLeft-Ie,Ve=Ce(e)-o.gutters.offsetWidth,dt=t.right-t.left>Ve;return dt&&(t.right=t.left+Ve),t.left<10?$.scrollLeft=0:t.left<Qe?$.scrollLeft=Math.max(0,t.left+Ie-(dt?0:10)):t.right>Ve+Qe-3&&($.scrollLeft=t.right+(dt?0:10)-Ve),$}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+be(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+Fe(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&&H<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+Fe(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,o.sizer.offsetLeft+e.adjustWidthTo-Ce(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?$n(t.mode,r.state):null,ee=Pe(e,B,r,!0);J&&(r.state=J),B.styles=ee.styles;var oe=B.styleClasses,Ae=ee.classes;Ae?B.styleClasses=Ae:oe&&(B.styleClasses=null);for(var Ie=!$||$.length!=B.styles.length||oe!=Ae&&(!oe||!Ae||oe.bgClass!=Ae.bgClass||oe.textClass!=Ae.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=Ce(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=Fe(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Fe(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),b(o.cursorDiv),b(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==Ce(e)){if(o&&o.top!=null&&(o={top:Math.min(e.doc.height+be(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 _t=dt.nextSibling;return n&&s&&e.display.currentWheelTarget==dt?dt.style.display="none":dt.parentNode.removeChild(dt),_t}for(var ee=r.view,oe=r.viewFrom,Ae=0;Ae<ee.length;Ae++){var Ie=ee[Ae];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 Ve=y&&t!=null&&t<=oe&&Ie.lineNumber;Ie.changes&&(q(Ie.changes,"gutter")>-1&&(Ve=!1),uo(e,Ie,oe,o)),Ve&&(b(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+Fe(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;b(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&&H<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:x?li=-.7:_&&(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 rt(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,Ae=B.view;oe!=$;oe=oe.parentNode)for(var Ie=0;Ie<Ae.length;Ie++)if(Ae[Ie].node==oe){e.display.currentWheelTarget=oe;break e}}if(r&&!N&&!p&&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,Ve=e.doc.scrollTop,dt=Ve+B.wrapper.clientHeight;Qe<0?Ve=Math.max(0,Ve+Qe-50):dt=Math.min(e.doc.height,dt+Qe+50),Oa(e,{top:Ve,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 _t=$.scrollLeft-B.wheelStartX,It=$.scrollTop-B.wheelStartY,Ft=It&&B.wheelDY&&It/B.wheelDY||_t&&B.wheelDX&&_t/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 it(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 it=function(e,t){this.anchor=e,this.head=t};it.prototype.from=function(){return Vi(this.anchor,this.head)},it.prototype.to=function(){return na(this.anchor,this.head)},it.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ct(e,t,o){var r=e&&e.options.selectionsMayTouch,y=t[o];t.sort(function(Qe,Ve){return fn(Qe.from(),Ve.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()),Ae=na(J.to(),$.to()),Ie=J.empty()?$.from()==$.head:J.from()==J.head;B<=o&&--o,t.splice(--B,2,new it(Ie?Ae:oe,Ie?oe:Ae))}}return new $e(t,o)}function At(e,t){return new $e([new it(e,t||e)],0)}function St(e){return e.text?Et(e.from.line+e.text.length-1,Oe(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 it(wt(y.anchor,t),wt(y.head,t)))}return ct(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 Ae=e.sel.ranges[$],Ie=fn(Ae.head,Ae.anchor)<0;r[$]=new it(Ie?oe:ee,Ie?ee:oe)}else r[$]=new it(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&&Oe(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 Qn(oe[In],y(In),r));return on}var J=t.from,ee=t.to,oe=t.text,Ae=Qt(e,J.line),Ie=Qt(e,ee.line),Qe=Oe(oe),Ve=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 _t=$(0,oe.length-1);B(Ie,Ie.text,Ve),dt&&e.remove(J.line,dt),_t.length&&e.insert(J.line,_t)}else if(Ae==Ie)if(oe.length==1)B(Ae,Ae.text.slice(0,J.ch)+Qe+Ae.text.slice(ee.ch),Ve);else{var It=$(1,oe.length-1);It.push(new Qn(Qe+Ae.text.slice(ee.ch),Ve,r)),B(Ae,Ae.text.slice(0,J.ch)+oe[0],y(0)),e.insert(J.line+1,It)}else if(oe.length==1)B(Ae,Ae.text.slice(0,J.ch)+oe[0]+Ie.text.slice(ee.ch),y(0)),e.remove(J.line+1,dt);else{B(Ae,Ae.text.slice(0,J.ch)+oe[0],y(0)),B(Ie,Qe+Ie.text.slice(ee.ch),Ve);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=Oe(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return _o(e.done),Oe(e.done);if(e.done.length&&!Oe(e.done).ranges)return Oe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Oe(e.done)}function 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=Oe($.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=Oe(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,Oe(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=Oe(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],Ae=void 0;if(J.push({from:oe.from,to:oe.to,text:oe.text}),t)for(var Ie in oe)(Ae=Ie.match(/^spans_(\d+)$/))&&(q(t,Number(Ae[1]))>-1&&(Oe(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 it(y,t)}else return new it(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 $=ct(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,ct(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 it(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?ct(e.cm,r.ranges,r.ranges.length-1):t}function Ss(e,t,o){var r=e.history.done,y=Oe(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 it(ee,oe))}return y?ct(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,Ae="selectRight"in ee?!ee.selectRight:ee.inclusiveRight;if((J.from==null||(oe?J.from<=t.ch:J.from<t.ch))&&(J.to==null||(Ae?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?Ae: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 Ve=ee.find(r<0?-1:1);return(r<0?oe:Ae)&&(Ve=Ds(e,Ve,r,Ve.line==t.line?B:null)),Ve?Eo(e,Ve,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 Ae=[];Qo($,ee),ee.push({changes:Ae,generation:y.generation}),y.generation=B.generation||++y.maxGeneration;for(var Ie=we(e,"beforeChange")||e.cm&&we(e.cm,"beforeChange"),Qe=function(_t){var It=B.changes[_t];if(It.origin=t,Ie&&!Is(e,It,!1))return J.length=0,{};Ae.push(Bi(e,It));var Ft=_t?cn(e,It):Oe(J);Uo(e,It,Ft,Ts(e,It)),!_t&&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))})},Ve=B.changes.length-1;Ve>=0;--Ve){var dt=Qe(Ve);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 it(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:[Oe(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(Ve){if(Ve==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(Ve){var dt=Er(Ve);dt>y.maxLineLength&&(y.maxLine=Ve,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 Ae=we(e,"changes"),Ie=we(e,"change");if(Ie||Ae){var Qe={from:B,to:$,text:t.text,removed:t.removed,origin:t.origin};Ie&&Gr(e,"change",e,Qe),Ae&&(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]),Ae=Er(oe);Ae>e.display.maxLineLength&&(e.display.maxLine=oe,e.display.maxLineLength=Ae,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),$=je(r,B);if($&&(Yn($),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 Ae=t.line;Ae<=o.line;Ae++)wn(ee,Ae,"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;$=Oe(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 Qn("",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=Xe(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 it(L(this,e[y].anchor),L(this,e[y].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Di(this,ct(this.cm,r,t),o)}),addSelection:qr(function(e,t,o){var r=this.sel.ranges.slice(0);r.push(new it(L(this,e),L(this,t||e))),Di(this,ct(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(R(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(R(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 Ve={from:o,to:o,text:t.doc.splitLines(B.filter(function(dt){return dt!=null}).join(t.doc.lineSeparator())),origin:"paste"};xo(t.doc,Ve),Ss(t.doc,At(L(t.doc,o),L(t.doc,St(Ve))))})()},ee=function(Ve,dt){if(t.options.allowDropFileTypes&&q(t.options.allowDropFileTypes,Ve.type)==-1){J();return}var _t=new FileReader;_t.onerror=function(){return J()},_t.onload=function(){var It=_t.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(It)){J();return}B[dt]=It,J()},_t.readAsText(Ve)},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 Ae=e.dataTransfer.getData("Text");if(Ae){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(Ae,"around","paste"),t.display.input.focus()}}catch(Ve){}}}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&&!_){var o=d("img",null,null,"position: fixed; left: 0; top: 0;");o.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(o.width=o.height=1,e.display.wrapper.appendChild(o),o._top=o.offsetTop),t.dataTransfer.setDragImage(o,0,0),p&&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)),f(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(p&&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,Oe(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=Be(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=yt(o,t.doc.direction);if(B){var $=y<0?Oe(B):B[0],J=y<0==($.level==1),ee=J?"after":"before",oe;if($.level>0||t.doc.direction=="rtl"){var Ae=Ue(t,o);oe=y<0?o.text.length-1:0;var Ie=Ge(t,Ae,oe).top;oe=at(function(Qe){return Ge(t,Ae,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=yt(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=ot(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||Ue(e,t),an(e,t,ee,Ft)):{begin:0,end:t.text.length}},Ae=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<=Ae.end:Qe>=$.from&&Qe>=Ae.begin)){var Ve=Ie?"before":"after";return new Et(o.line,Qe,Ve)}}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)}},_t=dt(B+r,r,Ae);if(_t)return _t;var It=r>0?Ae.end:J(Ae.begin,-1);return It!=null&&!(r>0&&It==t.text.length)&&(_t=dt(r>0?0:y.length-1,r,oe(It)),_t)?_t: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(),$=K(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 it(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=yt(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&&H<11&&e.keyCode==27&&(e.returnValue=!1);var o=e.keyCode;t.display.shift=o==16||e.shiftKey;var r=Zs(t,e);p&&(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(p&&o==fs){fs=null,ce(e);return}if(p&&(!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):ke(e)==o.scroller&&ce(e):y==2?(r&&Zo(t.doc,r),setTimeout(function(){return o.input.focus()},20)):y==3&&(O?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&&!_||G&&H==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 it(t,t);if(o=="word")return e.findWordAt(t);if(o=="line")return new it(Et(t.line,0),L(e.doc,Et(t.line+1,0)));var r=o(e,t);return new it(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 it(o,o)):($=B.sel.primary(),J=B.sel.primIndex),r.unit=="rectangle")r.addNew||($=new it(o,o)),o=Zr(e,t,!0,!0),J=-1;else{var Ae=nl(e,o,r.unit);r.extend?$=ls($,Ae.anchor,Ae.head,r.extend):$=Ae}r.addNew?J==-1?(J=oe.length,Di(B,ct(e,oe.concat([$]),J),{scroll:!1,origin:"*mouse"})):oe.length>1&&oe[J].empty()&&r.unit=="char"&&!r.extend?(Di(B,ct(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=K(Qt(B,o.line).text,o.ch,In),ar=K(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=Ee(Wi,Fr,In);Fr==xi?on.push(new it(Et(ei,di),Et(ei,di))):Wi.length>di&&on.push(new it(Et(ei,di),Et(ei,Ee(Wi,xi,In))))}on.length||on.push(new it(o,o)),Di(B,ct(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 it(L(B,gi),hi)),Di(B,ct(e,ri,J),ue)}}var Ve=y.wrapper.getBoundingClientRect(),dt=0;function _t(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&&_t(Wt)}),150)}else{var ar=Wt.clientY<Ve.top?-20:Wt.clientY>Ve.bottom?20:0;ar&&setTimeout(Jr(e,function(){if(dt!=on)return;y.scroller.scrollTop+=ar,_t(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):_t(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=yt(y);if(!B)return t;var $=ot(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 Ae=ot(B,r.ch,r.sticky),Ie=Ae-$||(r.ch-o.ch)*(J.level==1?-1:1);Ae==ee-1||Ae==ee?oe=Ie<0:oe=Ie>0}var Qe=B[ee+(oe?-1:0)],Ve=oe==(Qe.level==1),dt=Ve?Qe.from:Qe.to,_t=Ve?"after":"before";return o.ch==dt&&o.sticky==_t?t:new it(new Et(o.line,dt,_t),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 Ae=Ur(e.doc,B),Ie=e.display.gutterSpecs[ee];return qe(e,o,e,Ae,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;O||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 Ae=ee.text.indexOf(y,oe);if(Ae==-1)break;oe=Ae+y.length,B.push(Et($,Ae))}$++});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&&H<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&&H<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 Ae=e.findWordAt(oe);Zo(e.doc,Ae.anchor,Ae.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 Ae=oe.left-ee.left,Ie=oe.top-ee.top;return Ae*Ae+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 Ae=e.coordsChar(t.activeTouch,"page"),Ie;!oe.prev||$(oe,oe.prev)?Ie=new it(Ae,Ae):!oe.prev.prev||$(oe,oe.prev.prev)?Ie=e.findWordAt(Ae):Ie=new it(Et(Ae.line,0),L(e.doc,Et(Ae.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=K(J.text,null,$);J.stateAfter&&(J.stateAfter=null);var oe=J.text.match(/^\s*/)[0],Ae;if(!r&&!/\S/.test(J.text))Ae=0,o="not";else if(o=="smart"&&(Ae=y.mode.indent(B,J.text.slice(oe.length),J.text),Ae==ye||Ae>150)){if(!r)return;o="prev"}o=="prev"?t>y.first?Ae=K(Qt(y,t-1).text,null,$):Ae=0:o=="add"?Ae=ee+e.options.indentUnit:o=="subtract"?Ae=ee-e.options.indentUnit:typeof o=="number"&&(Ae=ee+o),Ae=Math.max(0,Ae);var Ie="",Qe=0;if(e.options.indentWithTabs)for(var Ve=Math.floor(Ae/$);Ve;--Ve)Qe+=$,Ie+=" ";if(Qe<Ae&&(Ie+=ae(Ae-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 _t=y.sel.ranges[dt];if(_t.head.line==t&&_t.head.ch<oe.length){var It=Et(t,oe.length);us(y,dt,new it(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 Ae=0;Ae<ga.text.length;Ae++)oe.push(B.splitLines(ga.text[Ae]))}}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 Ve=r.ranges[Qe],dt=Ve.from(),_t=Ve.to();Ve.empty()&&(o&&o>0?dt=Et(dt.line,dt.ch-o):e.state.overwrite&&!J?_t=Et(_t.line,Math.min(Qt(B,_t.line).text.length,_t.ch+Oe(ee).length)):J&&ga&&ga.lineWise&&ga.text.join(`
|
|
`)==ee.join(`
|
|
`)&&(dt=_t=Et(dt.line,0)));var It={from:dt,to:_t,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"),h&&(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(),Ae=Math.max(B,ee.line);B=Math.min(this.lastLine(),oe.line-(oe.ch?0:1))+1;for(var Ie=Ae;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 it(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=ft(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 Ae=ee?ee.indexOf("overlay "):-1;return Ae<0?ee:Ae==0?null:ee.slice(0,Ae-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 Ae=0;Ae<$._global.length;Ae++){var Ie=$._global[Ae];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,Ae=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),Ae+y.offsetWidth>Qe&&(Ae=Qe-y.offsetWidth)}y.style.top=oe+"px",y.style.left=y.style.right="",J=="right"?(Ae=ee.sizer.clientWidth-y.offsetWidth,y.style.right="0px"):(J=="left"?Ae=0:J=="middle"&&(Ae=(ee.sizer.clientWidth-y.offsetWidth)/2),y.style.left=Ae+"px"),B&&mo(this,{left:Ae,top:oe,right:Ae+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),Ae=0;Ae<y;++Ae){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(Ae){if(ee)return r<0?Ae.from():Ae.to();var Ie=tr(B,Ae.head,"div");Ae.goalColumn!=null&&(Ie.left=Ae.goalColumn),J.push(Ie.left);var Qe=hl(B,Ie,r,y);return y=="page"&&Ae==$.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($),Ae=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&&Ae(B.charAt($-1));)--$;for(;J<B.length&&Ae(B.charAt(J));)++J}return new it(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-Fe(this)-this.display.barHeight,width:r.scrollWidth-Fe(this)-this.display.barWidth,clientHeight:ie(this),clientWidth:Ce(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 Ae(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")Ae();else if(r=="column")Ae(!0);else if(r=="word"||r=="group")for(var Ie=null,Qe=r=="group",Ve=e.cm&&e.cm.getHelper(t,"wordChars"),dt=!0;!(o<0&&!Ae(!dt));dt=!1){var _t=J.text.charAt(t.ch)||`
|
|
`,It=nt(_t,Ve)?"w":Qe&&_t==`
|
|
`?"n":!Qe||/\s/.test(_t)?null:"p";if(Qe&&!dt&&!It&&(It="s"),Ie&&Ie!=It){o<0&&(o=1,Ae(),t.sticky="after");break}if(It&&(Ie=It),o>0&&!Ae(!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;H<=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 Ae=dl(),Ie=Ae.firstChild;r.display.lineSpace.insertBefore(Ae,r.display.lineSpace.firstChild),Ie.value=ga.text.join(`
|
|
`);var Qe=document.activeElement;M(Ie),setTimeout(function(){r.display.lineSpace.removeChild(Ae),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 Ae=J[J.length-1].measure,Ie=Ae.maps?Ae.maps[Ae.maps.length-1]:Ae.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),Ve;try{Ve=E(ee.node,ee.offset,oe.offset,oe.node)}catch(dt){}Ve&&(!N&&t.state.focused?(e.collapse(ee.node,ee.offset),Ve.collapsed||(e.removeAllRanges(),e.addRange(Ve))):(e.removeAllRanges(),e.addRange(Ve)),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){f(this.cm.display.cursorDiv,e.cursors),f(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&&x&&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,Ae;if(ee==t.view.length-1?(oe=t.viewTo-1,Ae=t.lineDiv.lastChild):(oe=kn(t.view[ee+1].line)-1,Ae=t.view[ee+1].node.previousSibling),!J)return!1;for(var Ie=e.doc.splitLines(tu(e,J,Ae,$,oe)),Qe=$r(e.doc,Et($,0),Et(oe,Qt(e.doc,oe).text.length));Ie.length>1&&Qe.length>1;)if(Oe(Ie)==Oe(Qe))Ie.pop(),Qe.pop(),oe--;else if(Ie[0]==Qe[0])Ie.shift(),Qe.shift(),$++;else break;for(var Ve=0,dt=0,_t=Ie[0],It=Qe[0],Ft=Math.min(_t.length,It.length);Ve<Ft&&_t.charCodeAt(Ve)==It.charCodeAt(Ve);)++Ve;for(var qt=Oe(Ie),Wt=Oe(Qe),on=Math.min(qt.length-(Ie.length==1?Ve:0),Wt.length-(Qe.length==1?Ve: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(;Ve&&Ve>r.ch&&qt.charCodeAt(qt.length-dt-1)==Wt.charCodeAt(Wt.length-dt-1);)Ve--,dt++;Ie[Ie.length-1]=qt.slice(0,qt.length-dt).replace(/^\u200b+/,""),Ie[0]=Ie[0].slice(Ve).replace(/\u200b+$/,"");var In=Et($,Ve),bn=Et(oe,Qe.length?Oe(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=je(e,t.line);if(!o||o.hidden)return null;var r=Qt(e.doc,t.line),y=le(o,r,t.line),B=yt(r,e.doc.direction),$="left";if(B){var J=ot(B,t.ch);$=J%2?"right":"left"}var ee=vt(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(Ve){return function(dt){return dt.id==Ve}}function Ae(){$&&(B+=J,ee&&(B+=J),$=ee=!1)}function Ie(Ve){Ve&&(Ae(),B+=Ve)}function Qe(Ve){if(Ve.nodeType==1){var dt=Ve.getAttribute("cm-text");if(dt){Ie(dt);return}var _t=Ve.getAttribute("cm-marker"),It;if(_t){var Ft=e.findMarks(Et(r,0),Et(y+1,0),oe(+_t));Ft.length&&(It=Ft[0].find(0))&&Ie($r(e.doc,It.from,It.to).join(J));return}if(Ve.getAttribute("contenteditable")=="false")return;var qt=/^(pre|div|p|li|table|br)$/i.test(Ve.nodeName);if(!/^br$/i.test(Ve.nodeName)&&Ve.textContent.length==0)return;qt&&Ae();for(var Wt=0;Wt<Ve.childNodes.length;Wt++)Qe(Ve.childNodes[Wt]);/^(pre|p)$/i.test(Ve.nodeName)&&(ee=!0),qt&&($=!0)}else Ve.nodeType==3&&Ie(Ve.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?Oe(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 Ae(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=Ae($,J,o);if(Ie)return Oo(Ie,y);for(var Qe=J.nextSibling,Ve=$?$.nodeValue.length-o:0;Qe;Qe=Qe.nextSibling){if(Ie=Ae(Qe,Qe.firstChild,0),Ie)return Oo(Et(Ie.line,Ie.ch-Ve),y);Ve+=Qe.textContent.length}for(var dt=J.previousSibling,_t=o;dt;dt=dt.previousSibling){if(Ie=Ae(dt,dt.firstChild,-1),Ie)return Oo(Et(Ie.line,Ie.ch+_t),y);_t+=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),h&&(y.style.width="0px"),Ze(y,"input",function(){G&&H>=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;f(o.cursorDiv,e.cursors),f(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&&H>=9&&(this.hasSelection=o)}else e||(this.prevInput=this.textarea.value="",G&&H>=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&&H>=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&&H>=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||p)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,Ae=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",y.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-Ae.top-5)+"px; left: "+(e.clientX-Ae.left-5)+`px;
|
|
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ie;n&&(Ie=window.scrollY),r.input.focus(),n&&window.scrollTo(null,Ie),r.input.reset(),o.somethingSelected()||(y.value=t.prevInput=" "),t.contextMenuPending=Ve,r.selForContextMenu=o.doc.sel,clearTimeout(r.detectingSelectAll);function Qe(){if(y.selectionStart!=null){var _t=o.somethingSelected(),It="\u200B"+(_t?y.value:"");y.value="\u21DA",y.value=It,t.prevInput=_t?"":"\u200B",y.selectionStart=1,y.selectionEnd=It.length,r.selForContextMenu=o.doc.sel}}function Ve(){if(t.contextMenuPending!=Ve)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=oe,y.style.cssText=ee,G&&H<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=$),y.selectionStart!=null){(!G||G&&H<9)&&Qe();var _t=0,It=function(){r.selForContextMenu==o.doc.sel&&y.selectionStart==0&&y.selectionEnd>0&&t.prevInput=="\u200B"?Jr(o,Ls)(o):_t++<10?r.detectingSelectAll=setTimeout(It,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(It,200)}}if(G&&H>=9&&Qe(),O){Re(e);var dt=function(){Ot(window,"mouseup",dt),setTimeout(Ve,20)};Ze(window,"mouseup",dt)}else setTimeout(Ve,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=rt,e.Doc=Fi,e.splitLines=En,e.countColumn=K,e.findColumn=Ee,e.isWordChar=Ke,e.Pass=ye,e.signal=qe,e.Line=Qn,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=$n,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(ut,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"),H=U("LK+K"),n=U("q1tI"),I=U("TSYQ"),x=U.n(I),p=U("sboe"),_=U("OZM5"),c=function(O){var R=O.prefixCls,g=O.level,b=O.isStart,f=O.isEnd;if(!g)return null;for(var d="".concat(R,"-indent-unit"),C=[],E=0;E<g;E+=1){var w;C.push(n.createElement("span",{key:E,className:x()(d,(w={},Object(te.a)(w,"".concat(d,"-start"),b[E+1]),Object(te.a)(w,"".concat(d,"-end"),f[E+1]),Object(te.a)(w,"".concat(d,"-end-first-level"),!E&&f[0]),w))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(R,"-indent")},C)},a=c,h=U("815F"),l="open",u="close",s="---",i=function(S){Object(G.a)(R,S);var O=Object(H.a)(R);function R(){var g;return Object(z.a)(this,R),g=O.apply(this,arguments),g.state={dragNodeHighlight:!1},g.onSelectorClick=function(b){var f=g.props.context.onNodeClick;f(b,Object(h.b)(g.props)),g.isSelectable()?g.onSelect(b):g.onCheck(b)},g.onSelectorDoubleClick=function(b){var f=g.props.context.onNodeDoubleClick;f(b,Object(h.b)(g.props))},g.onSelect=function(b){if(g.isDisabled())return;var f=g.props.context.onNodeSelect;b.preventDefault(),f(b,Object(h.b)(g.props))},g.onCheck=function(b){if(g.isDisabled())return;var f=g.props,d=f.disableCheckbox,C=f.checked,E=g.props.context.onNodeCheck;if(!g.isCheckable()||d)return;b.preventDefault();var w=!C;E(b,Object(h.b)(g.props),w)},g.onMouseEnter=function(b){var f=g.props.context.onNodeMouseEnter;f(b,Object(h.b)(g.props))},g.onMouseLeave=function(b){var f=g.props.context.onNodeMouseLeave;f(b,Object(h.b)(g.props))},g.onContextMenu=function(b){var f=g.props.context.onNodeContextMenu;f(b,Object(h.b)(g.props))},g.onDragStart=function(b){var f=g.props.context.onNodeDragStart;b.stopPropagation(),g.setState({dragNodeHighlight:!0}),f(b,Object(F.a)(g));try{b.dataTransfer.setData("text/plain","")}catch(d){}},g.onDragEnter=function(b){var f=g.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),f(b,Object(F.a)(g))},g.onDragOver=function(b){var f=g.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),f(b,Object(F.a)(g))},g.onDragLeave=function(b){var f=g.props.context.onNodeDragLeave;b.stopPropagation(),f(b,Object(F.a)(g))},g.onDragEnd=function(b){var f=g.props.context.onNodeDragEnd;b.stopPropagation(),g.setState({dragNodeHighlight:!1}),f(b,Object(F.a)(g))},g.onDrop=function(b){var f=g.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),g.setState({dragNodeHighlight:!1}),f(b,Object(F.a)(g))},g.onExpand=function(b){var f=g.props.context.onNodeExpand;f(b,Object(h.b)(g.props))},g.setSelectHandle=function(b){g.selectHandle=b},g.getNodeState=function(){var b=g.props.expanded;return g.isLeaf()?null:b?l:u},g.hasChildren=function(){var b=g.props.eventKey,f=g.props.context.keyEntities,d=f[b]||{},C=d.children;return!!(C||[]).length},g.isLeaf=function(){var b=g.props,f=b.isLeaf,d=b.loaded,C=g.props.context.loadData,E=g.hasChildren();return f===!1?!1:f||!C&&!E||C&&d&&!E},g.isDisabled=function(){var b=g.props.disabled,f=g.props.context.disabled;return!!(f||b)},g.isCheckable=function(){var b=g.props.checkable,f=g.props.context.checkable;return!f||b===!1?!1:f},g.syncLoadData=function(b){var f=b.expanded,d=b.loading,C=b.loaded,E=g.props.context,w=E.loadData,j=E.onNodeLoad;if(d)return;w&&f&&!g.isLeaf()&&(!g.hasChildren()&&!C&&j(Object(h.b)(g.props)))},g.renderSwitcher=function(){var b=g.props,f=b.expanded,d=b.switcherIcon,C=g.props.context,E=C.prefixCls,w=C.switcherIcon,j=d||w;if(g.isLeaf())return n.createElement("span",{className:x()("".concat(E,"-switcher"),"".concat(E,"-switcher-noop"))},typeof j=="function"?j(Object(N.a)(Object(N.a)({},g.props),{},{isLeaf:!0})):j);var W=x()("".concat(E,"-switcher"),"".concat(E,"-switcher_").concat(f?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 b=g.props,f=b.checked,d=b.halfChecked,C=b.disableCheckbox,E=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:x()("".concat(E,"-checkbox"),f&&"".concat(E,"-checkbox-checked"),!f&&d&&"".concat(E,"-checkbox-indeterminate"),(w||C)&&"".concat(E,"-checkbox-disabled")),onClick:g.onCheck},W)},g.renderIcon=function(){var b=g.props.loading,f=g.props.context.prefixCls;return n.createElement("span",{className:x()("".concat(f,"-iconEle"),"".concat(f,"-icon__").concat(g.getNodeState()||"docu"),b&&"".concat(f,"-icon_loading"))})},g.renderSelector=function(){var b=g.state.dragNodeHighlight,f=g.props,d=f.title,C=f.selected,E=f.icon,w=f.loading,j=f.data,W=g.props.context,T=W.prefixCls,M=W.showIcon,m=W.icon,v=W.draggable,K=W.loadData,X=W.titleRender,q=g.isDisabled(),re="".concat(T,"-node-content-wrapper"),ye;if(M){var pe=E||m;ye=pe?n.createElement("span",{className:x()("".concat(T,"-iconEle"),"".concat(T,"-icon__customize"))},typeof pe=="function"?pe(g.props):pe):g.renderIcon()}else K&&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:x()("".concat(re),"".concat(re,"-").concat(g.getNodeState()||"normal"),!q&&(C||b)&&"".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)(R,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var b=this.props.selectable,f=this.props.context.selectable;return typeof b=="boolean"?b:f}},{key:"render",value:function(){var b,f=this.props,d=f.eventKey,C=f.className,E=f.style,w=f.dragOver,j=f.dragOverGapTop,W=f.dragOverGapBottom,T=f.isLeaf,M=f.isStart,m=f.isEnd,v=f.expanded,K=f.selected,X=f.checked,q=f.halfChecked,re=f.loading,ye=f.domRef,pe=f.active,ue=f.onMouseMove,fe=Object(Y.a)(f,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ee=this.props.context,se=Ee.prefixCls,ae=Ee.filterTreeNode,Oe=Ee.draggable,ze=Ee.keyEntities,Ye=this.isDisabled(),He=Object(_.f)(fe),Xe=ze[d]||{},We=Xe.level,Ke=m[m.length-1];return n.createElement("div",Object.assign({ref:ye,className:x()(C,"".concat(se,"-treenode"),(b={},Object(te.a)(b,"".concat(se,"-treenode-disabled"),Ye),Object(te.a)(b,"".concat(se,"-treenode-switcher-").concat(v?"open":"close"),!T),Object(te.a)(b,"".concat(se,"-treenode-checkbox-checked"),X),Object(te.a)(b,"".concat(se,"-treenode-checkbox-indeterminate"),q),Object(te.a)(b,"".concat(se,"-treenode-selected"),K),Object(te.a)(b,"".concat(se,"-treenode-loading"),re),Object(te.a)(b,"".concat(se,"-treenode-active"),pe),Object(te.a)(b,"".concat(se,"-treenode-leaf-last"),Ke),Object(te.a)(b,"drag-over",!Ye&&w),Object(te.a)(b,"drag-over-gap-top",!Ye&&j),Object(te.a)(b,"drag-over-gap-bottom",!Ye&&W),Object(te.a)(b,"filter-node",ae&&ae(Object(h.b)(this.props))),b)),style:E,onDragEnter:Oe?this.onDragEnter:void 0,onDragOver:Oe?this.onDragOver:void 0,onDragLeave:Oe?this.onDragLeave:void 0,onDrop:Oe?this.onDrop:void 0,onDragEnd:Oe?this.onDragEnd:void 0,onMouseMove:ue},He),n.createElement(a,{prefixCls:se,level:We,isStart:M,isEnd:m}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),R}(n.Component),D=function(O){return n.createElement(p.a.Consumer,null,function(R){return n.createElement(i,Object.assign({},O,{context:R}))})};D.displayName="TreeNode",D.defaultProps={title:s},D.isTreeNode=1;var A=ge.a=D},Y1PL:function(ut,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"),H=U("rePB"),n=U("Zm9Q"),I=U("Kwbf"),x=U("c+Xe"),p=U("m+aA"),_=U("bdgK"),c=new Map;function a(pe){pe.forEach(function(ue){var fe,Ee=ue.target;(fe=c.get(Ee))===null||fe===void 0||fe.forEach(function(se){return se(Ee)})})}var h=new _.default(a),l=null,u=null;function s(pe,ue){c.has(pe)||(c.set(pe,new Set),h.observe(pe)),c.get(pe).add(ue)}function i(pe,ue){c.has(pe)&&(c.get(pe).delete(ue),c.get(pe).size||(h.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,Ee=F.useRef(0),se=F.useRef([]),ae=F.useContext(A),Oe=F.useCallback(function(ze,Ye,He){Ee.current+=1;var Xe=Ee.current;se.current.push({size:ze,element:Ye,data:He}),Promise.resolve().then(function(){Xe===Ee.current&&(fe==null||fe(se.current),se.current=[])}),ae==null||ae(ze,Ye,He)},[fe,ae]);return F.createElement(A.Provider,{value:Oe},ue)}function O(pe){var ue=pe.children,fe=pe.disabled,Ee=F.useRef(null),se=F.useRef(null),ae=F.useContext(A),Oe=F.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ze=F.isValidElement(ue)&&Object(x.c)(ue),Ye=ze?ue.ref:null,He=F.useMemo(function(){return Object(x.a)(Ye,Ee)},[Ye,Ee]),Xe=F.useRef(pe);Xe.current=pe;var We=F.useCallback(function(Ke){var nt=Xe.current,de=nt.onResize,De=nt.data,Ne=Ke.getBoundingClientRect(),Be=Ne.width,at=Ne.height,lt=Ke.offsetWidth,pt=Ke.offsetHeight,ot=Math.floor(Be),bt=Math.floor(at);if(Oe.current.width!==ot||Oe.current.height!==bt||Oe.current.offsetWidth!==lt||Oe.current.offsetHeight!==pt){var yt={width:ot,height:bt,offsetWidth:lt,offsetHeight:pt};Oe.current=yt;var xt=lt===Math.round(Be)?Be:lt,Ze=pt===Math.round(at)?at:pt,kt=Object(G.a)(Object(G.a)({},yt),{},{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(p.a)(Ee.current)||Object(p.a)(se.current);return Ke&&!fe&&s(Ke,We),function(){return i(Ke,We)}},[Ee.current,fe]),F.createElement(D,{ref:se},ze?F.cloneElement(ue,{ref:He}):ue)}var R="rc-observer-key";function g(pe){var ue=pe.children,fe=Object(n.a)(ue);return fe.map(function(Ee,se){var ae=(Ee==null?void 0:Ee.key)||"".concat(R,"-").concat(se);return F.createElement(O,Object(te.a)({},pe,{key:ae}),Ee)})}g.Collection=S;var b=g,f=U("bT9E"),d=U("TSYQ"),C=U.n(d),E=`
|
|
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 Ee=window.getComputedStyle(pe),se=Ee.getPropertyValue("box-sizing")||Ee.getPropertyValue("-moz-box-sizing")||Ee.getPropertyValue("-webkit-box-sizing"),ae=parseFloat(Ee.getPropertyValue("padding-bottom"))+parseFloat(Ee.getPropertyValue("padding-top")),Oe=parseFloat(Ee.getPropertyValue("border-bottom-width"))+parseFloat(Ee.getPropertyValue("border-top-width")),ze=w.map(function(He){return"".concat(He,":").concat(Ee.getPropertyValue(He))}).join(";"),Ye={sizingStyle:ze,paddingSize:ae,borderSize:Oe,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,Ee=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,Oe=se.borderSize,ze=se.boxSizing,Ye=se.sizingStyle;W.setAttribute("style","".concat(Ye,";").concat(E)),W.value=pe.value||pe.placeholder||"";var He=Number.MIN_SAFE_INTEGER,Xe=Number.MAX_SAFE_INTEGER,We=W.scrollHeight,Ke;if(ze==="border-box"?We+=Oe:ze==="content-box"&&(We-=ae),fe!==null||Ee!==null){W.value=" ";var nt=W.scrollHeight-ae;fe!==null&&(He=nt*fe,ze==="border-box"&&(He=He+ae+Oe),We=Math.max(He,We)),Ee!==null&&(Xe=nt*Ee,ze==="border-box"&&(Xe=Xe+ae+Oe),Ke=We>Xe?"":"hidden",We=Math.min(Xe,We))}return{height:We,minHeight:He,maxHeight:Xe,overflowY:Ke,resize:"none"}}var m=U("Gytx"),v=U.n(m),K;(function(pe){pe[pe.NONE=0]="NONE",pe[pe.RESIZING=1]="RESIZING",pe[pe.RESIZED=2]="RESIZED"})(K||(K={}));var X=function(pe){Object(z.a)(fe,pe);var ue=Object(P.a)(fe);function fe(Ee){var se;return Object(Y.a)(this,fe),se=ue.call(this,Ee),se.nextFrameActionId=void 0,se.resizeFrameId=void 0,se.textArea=void 0,se.saveTextArea=function(ae){se.textArea=ae},se.handleResize=function(ae){var Oe=se.state.resizeStatus,ze=se.props,Ye=ze.autoSize,He=ze.onResize;if(Oe!==K.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 Oe=ae.minRows,ze=ae.maxRows,Ye=M(se.textArea,!1,Oe,ze);se.setState({textareaStyles:Ye,resizeStatus:K.RESIZING},function(){cancelAnimationFrame(se.resizeFrameId),se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:K.RESIZED},function(){se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:K.NONE}),se.fixFirefoxAutoScroll()})})})})},se.renderTextArea=function(){var ae=se.props,Oe=ae.prefixCls,ze=Oe===void 0?"rc-textarea":Oe,Ye=ae.autoSize,He=ae.onResize,Xe=ae.className,We=ae.disabled,Ke=se.state,nt=Ke.textareaStyles,de=Ke.resizeStatus,De=Object(f.a)(se.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ne=C()(ze,Xe,Object(H.a)({},"".concat(ze,"-disabled"),We));"value"in De&&(De.value=De.value||"");var Be=Object(G.a)(Object(G.a)(Object(G.a)({},se.props.style),nt),de===K.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return F.createElement(b,{onResize:se.handleResize,disabled:!(Ye||He)},F.createElement("textarea",Object(te.a)({},De,{className:Ne,style:Be,ref:se.saveTextArea})))},se.state={textareaStyles:{},resizeStatus:K.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(Oe){}}},{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(Ee){var se;Object(Y.a)(this,fe),se=ue.call(this,Ee),se.resizableTextArea=void 0,se.focus=function(){se.resizableTextArea.textArea.focus()},se.saveTextArea=function(Oe){se.resizableTextArea=Oe},se.handleChange=function(Oe){var ze=se.props.onChange;se.setValue(Oe.target.value,function(){se.resizableTextArea.resizeTextarea()}),ze&&ze(Oe)},se.handleKeyDown=function(Oe){var ze=se.props,Ye=ze.onPressEnter,He=ze.onKeyDown;Oe.keyCode===13&&Ye&&Ye(Oe),He&&He(Oe)};var ae=typeof Ee.value=="undefined"||Ee.value===null?Ee.defaultValue:Ee.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(ut,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"),H=U("q1tI"),n=U.n(H),I=U("bdgK"),x=U("9og8"),p=U("WmNS"),_=U.n(p),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"]},h={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(K,X){return X.map(function(q){return{label:q,kind:K.languages.CompletionItemKind.Keyword,insertText:q}})},A=function(K){return Object.keys(i.tables).map(function(X){return{label:X,kind:K.languages.CompletionItemKind.Variable,insertText:X}})},S=function(K,X){var q=i.tables[K];return q?q.map(function(re){return{label:re,kind:X.languages.CompletionItemKind.Field,insertText:re}}):[]};function O(v,K,X,q,re){var ye=K.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 R=function(v){i.languages.map(function(re){return v.languages.registerDocumentFormattingEditProvider(re,{provideDocumentFormattingEdits:function(pe,ue,fe){return Object(x.a)(_.a.mark(function Ee(){var se;return _.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.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}),Oe.abrupt("return",[{range:pe.getFullModelRange(),text:se}]);case 2:case"end":return Oe.stop()}},Ee)}))()}}),re});var K=h.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},Ee=ye.getLineContent(pe.lineNumber).substring(ue.startColumn-2,ue.endColumn);return{suggestions:[].concat(Object(Y.a)(h.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)(h.quickKey.map(function(se){return{label:se.label,kind:v.languages.CompletionItemKind.Function,documentation:se.content,insertText:Ee.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(Ee){return{label:Ee,kind:v.languages.CompletionItemKind.Function,documentation:Ee,insertText:Ee,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},Ee=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:Ee.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},Ee=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:Ee.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",b=U("fjLI"),f=U("LvDl"),d=U("+ua5");function C(v){return/^\d+$/.test(v)?"".concat(v,"px"):v}function E(){}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]:[],K=v;if(Array.isArray(v)){for(var X=0;X<v.length;X++){var q=j[v[X]];if(q)return q}return K[0]}return j[K]||K}var T=null,M=ge.b=function(v){var K=v.width,X=K===void 0?"100%":K,q=v.height,re=q===void 0?"100%":q,ye=v.value,pe=v.language,ue=pe===void 0?"javascript":pe,fe=v.style,Ee=fe===void 0?{}:fe,se=v.options,ae=se===void 0?{}:se,Oe=v.overrideServices,ze=Oe===void 0?{}:Oe,Ye=v.theme,He=Ye===void 0?"vs-dark":Ye,Xe=v.onEditBlur,We=v.onSave,Ke=v.autoHeight,nt=Ke===void 0?!1:Ke,de=v.forbidCopy,De=de===void 0?!1:de,Ne=v.onChange,Be=Ne===void 0?E:Ne,at=v.editorDidMount,lt=at===void 0?E:at,pt=v.onFocus,ot=pt===void 0?E:pt,bt=v.filename,yt=bt===void 0?"educoder.txt":bt,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(H.useRef)(),st=Object(H.useRef)({}),xe=Object(H.useRef)(),we=Object(H.useRef)(),me=Object(H.useRef)(!1),ce=Object(H.useRef)(),he=Object(H.useState)(!1),Te=Object(F.a)(he,2),Re=Te[0],ke=Te[1];function et(){var tn;return qe.current&&(tn=new I.default(function(sn){var $n=Object(P.a)(sn),sr;try{for($n.s();!(sr=$n.n()).done;){var Nr=sr.value;(Nr.target.offsetHeight>0||Nr.target.offsetWidth>0)&&st.current.instance.layout()}}catch(hn){$n.e(hn)}finally{$n.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 $n=sn.getModel();$n&&ye!==$n.getValue()&&(w=!0,$n.setValue(ye),sn.layout(),w=!1)}};Object(H.useEffect)(function(){we.current&&clearTimeout(we.current),we.current=setTimeout(function(){Ut()},500)},[ye,Re,st.current]),Object(H.useEffect)(function(){if(xt&&st.current&&st.current.instance){var tn=st.current.instance;tn.changeViewZones(function($n){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,$n.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(),$n=st.current.pastePos||{},sr=new T.Range($n.startLineNumber||sn.endLineNumber,$n.startColumn||sn.endColumn,$n.endLineNumber||sn.endLineNumber,$n.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(),We())}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 $n=window.URL||window.webkitURL||window,sr=new Blob([sn]),Nr=document.createElementNS("http://www.w3.org/1999/xhtml","a");Nr.href=$n.createObjectURL(sr),Nr.download=tn,En(Nr)}Object(H.useEffect)(function(){mn()},[mn]),Object(H.useEffect)(function(){qe.current&&!Re&&Promise.all([U.e(15),U.e(27)]).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,$n=b.d._menuItems,sr=Object(Y.a)($n).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(yt||"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(),Be(sn.getValue(),fr)),ce.current=setTimeout(function(){me.current=!1},500)}),window.Monaco||R(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,Xe&&sn.onDidBlurEditorWidget(function(){Xe(sn.getValue())}),ot&&sn.onDidFocusEditorText(function(){ot(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 ke(!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(H.useEffect)(function(){var tn=st.current.instance;if(tn&&Re)return document.addEventListener("keydown",en,!1),function(){document.removeEventListener("keydown",en)}},[We,Re]),Object(H.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(H.useEffect)(function(){var tn=st.current.instance;tn&&Re&&T.editor.setTheme(He)},[He,Re]),Object(H.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(H.useEffect)(function(){var tn=st.current.instance;tn&&Re&&tn.layout()},[X,re,Re]);var rr=Object(H.useState)(C(X)),Dn=Object(F.a)(rr,2),Sr=Dn[0],br=Dn[1],Pn=Object(H.useState)(C(re)),Dr=Object(F.a)(Pn,2),Or=Dr[0],ln=Dr[1],Yr=Object(te.a)(Object(te.a)({},Ee),{},{width:Sr,height:Or});return n.a.createElement("div",{className:"my-monaco-editor",ref:qe,style:Yr})};function m(v){var K=v.width,X=K===void 0?"100%":K,q=v.height,re=q===void 0?"100%":q,ye=v.original,pe=v.modified,ue=v.language,fe=v.options,Ee=fe===void 0?{}:fe,se=Object(H.useRef)(),ae=Object(H.useState)(null),Oe=Object(F.a)(ae,2),ze=Oe[0],Ye=Oe[1];function He(nt){var de;return se.current&&(de=new I.default(function(De){var Ne=Object(P.a)(De),Be;try{for(Ne.s();!(Be=Ne.n()).done;){var at=Be.value;(at.target.offsetHeight>0||at.target.offsetWidth>0)&&nt.layout()}}catch(lt){Ne.e(lt)}finally{Ne.f()}}),de.observe(se.current)),de}Object(H.useEffect)(function(){se.current&&Promise.all([U.e(15),U.e(27)]).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},Ee),{},{wordWrap:!0}));Ye(de);var De=He(de);return function(){de.dispose();var Ne=de.getModel();Ne&&Ne.dispose(),De.unobserve(se.current)}})},[]),Object(H.useEffect)(function(){ze&&ze.setModel({original:T.editor.createModel(ye,ue),modified:T.editor.createModel(pe,ue)})},[ye,pe,ue,ze]);var Xe=C(X),We=C(re),Ke={width:Xe,height:We};return n.a.createElement("div",{className:"my-diff-editor",ref:se,style:Ke})}},ZpRC:function(ut,ge,U){"use strict";function te(x){return typeof x=="object"&&x!=null&&x.nodeType===1}function Y(x,p){return(!p||x!=="hidden")&&x!=="visible"&&x!=="clip"}function N(x,p){if(x.clientHeight<x.scrollHeight||x.clientWidth<x.scrollWidth){var _=getComputedStyle(x,null);return Y(_.overflowY,p)||Y(_.overflowX,p)||function(c){var a=function(h){if(!h.ownerDocument||!h.ownerDocument.defaultView)return null;try{return h.ownerDocument.defaultView.frameElement}catch(l){return null}}(c);return!!a&&(a.clientHeight<c.scrollHeight||a.clientWidth<c.scrollWidth)}(x)}return!1}function z(x,p,_,c,a,h,l,u){return h<x&&l>p||h>x&&l<p?0:h<=x&&u<=_||l>=p&&u>=_?h-x-c:l>p&&u<_||h<x&&u>_?l-p+a:0}var P=function(x,p){var _=window,c=p.scrollMode,a=p.block,h=p.inline,l=p.boundary,u=p.skipOverflowHiddenElements,s=typeof l=="function"?l:function(nt){return nt!==l};if(!te(x))throw new TypeError("Invalid target");for(var i=document.scrollingElement||document.documentElement,D=[],A=x;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=_.visualViewport?_.visualViewport.width:innerWidth,O=_.visualViewport?_.visualViewport.height:innerHeight,R=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,b=x.getBoundingClientRect(),f=b.height,d=b.width,C=b.top,E=b.right,w=b.bottom,j=b.left,W=a==="start"||a==="nearest"?C:a==="end"?w:C+f/2,T=h==="center"?j+d/2:h==="end"?E:j,M=[],m=0;m<D.length;m++){var v=D[m],K=v.getBoundingClientRect(),X=K.height,q=K.width,re=K.top,ye=K.right,pe=K.bottom,ue=K.left;if(c==="if-needed"&&C>=0&&j>=0&&w<=O&&E<=S&&C>=re&&w<=pe&&j>=ue&&E<=ye)return M;var fe=getComputedStyle(v),Ee=parseInt(fe.borderLeftWidth,10),se=parseInt(fe.borderTopWidth,10),ae=parseInt(fe.borderRightWidth,10),Oe=parseInt(fe.borderBottomWidth,10),ze=0,Ye=0,He="offsetWidth"in v?v.offsetWidth-v.clientWidth-Ee-ae:0,Xe="offsetHeight"in v?v.offsetHeight-v.clientHeight-se-Oe:0;if(i===v)ze=a==="start"?W:a==="end"?W-O:a==="nearest"?z(g,g+O,O,se,Oe,g+W,g+W+f,f):W-O/2,Ye=h==="start"?T:h==="center"?T-S/2:h==="end"?T-S:z(R,R+S,S,Ee,ae,R+T,R+T+d,d),ze=Math.max(0,ze+g),Ye=Math.max(0,Ye+R);else{ze=a==="start"?W-re-se:a==="end"?W-pe+Oe+Xe:a==="nearest"?z(re,pe,X,se,Oe+Xe,W,W+f,f):W-(re+X/2)+Xe/2,Ye=h==="start"?T-ue-Ee:h==="center"?T-(ue+q/2)+He/2:h==="end"?T-ye+ae+He:z(ue,ye,q,Ee,ae+He,T,T+d,d);var We=v.scrollLeft,Ke=v.scrollTop;W+=Ke-(ze=Math.max(0,Math.min(Ke+ze,v.scrollHeight-X+Xe))),T+=We-(Ye=Math.max(0,Math.min(We+Ye,v.scrollWidth-q+He)))}M.push({el:v,top:ze,left:Ye})}return M};function F(x){return x===Object(x)&&Object.keys(x).length!==0}function G(x,p){p===void 0&&(p="auto");var _="scrollBehavior"in document.body.style;x.forEach(function(c){var a=c.el,h=c.top,l=c.left;a.scroll&&_?a.scroll({top:h,left:l,behavior:p}):(a.scrollTop=h,a.scrollLeft=l)})}function H(x){return x===!1?{block:"end",inline:"nearest"}:F(x)?x:{block:"start",inline:"nearest"}}function n(x,p){var _=!x.ownerDocument.documentElement.contains(x);if(F(p)&&typeof p.behavior=="function")return p.behavior(_?[]:P(x,p));if(_)return;var c=H(p);return G(P(x,c),c.behavior)}var I=ge.a=n},"a+yL":function(ut,ge,U){ut.exports={search:"search___t0h96",btn:"btn___t2oDx"}},bT9E:function(ut,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(ut,ge,U){},d5o6:function(ut,ge,U){ut.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(ut,ge,U){},dmUQ:function(ut,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"),H=U("q1tI"),n=U.n(H),I=U("TSYQ"),x=U.n(I),p=U("4IlW");function _(f,d){var C=Object.keys(f);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(f);d&&(E=E.filter(function(w){return Object.getOwnPropertyDescriptor(f,w).enumerable})),C.push.apply(C,E)}return C}function c(f){for(var d=1;d<arguments.length;d++){var C=arguments[d]!=null?arguments[d]:{};d%2?_(Object(C),!0).forEach(function(E){Object(Y.a)(f,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(C)):_(Object(C)).forEach(function(E){Object.defineProperty(f,E,Object.getOwnPropertyDescriptor(C,E))})}return f}function a(f){var d=h();return function(){var E=Object(G.a)(f),w;if(d){var j=Object(G.a)(this).constructor;w=Reflect.construct(E,arguments,j)}else w=E.apply(this,arguments);return Object(F.a)(this,w)}}function h(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(f){return!1}}function l(){}function u(f){f.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},O=function(d,C){return C===d||typeof C=="number"&&typeof d=="number"&&isNaN(C)&&isNaN(d)},R=function(f){Object(P.a)(C,f);var d=a(C);function C(E){var w;Object(N.a)(this,C),w=d.call(this,E),w.onKeyDown=function(T){var M=w.props,m=M.onKeyDown,v=M.onPressEnter;if(T.keyCode===p.a.UP){var K=w.getRatio(T);w.up(T,K,null),w.stop()}else if(T.keyCode===p.a.DOWN){var X=w.getRatio(T);w.down(T,X,null),w.stop()}else T.keyCode===p.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),K=1;K<m;K++)v[K-1]=arguments[K];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,K=w.getInputDisplayValue({focus:!1,value:m});w.input.value=K&&Number(K),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,K=M.value,X;m?X=v:X=w.toPrecisionAsStep(K),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===p.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=E.value;j===void 0&&(j=E.defaultValue),w.state={focused:E.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(!O(w.value,W)||!O(w.max,M)||!O(w.min,m)){var K=v?W:this.getValidValue(W),X;this.pressingUpOrDown?X=K:this.inputting?X=this.rawInput:X=this.toPrecisionAsStep(K),this.setState({value:K,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===p.a.BACKSPACE?re=this.cursorStart-1:this.lastKeyCode===p.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 p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.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,K=v===void 0?null:v,X=typeof T=="number"?T.toFixed(W):"".concat(T),q=T!==m||X!=="".concat(K);return"value"in this.props?(K=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:K},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),K=this.getPrecision(w);return w?Math.max(K,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 K=this["".concat(w,"Step")](v,T),X=K>m.max||K<m.min;if(K>m.max?K=m.max:K<m.min&&(K=m.min),this.setValue(K,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,K=j.upHandler,X=j.downHandler,q=j.className,re=j.max,ye=j.min,pe=j.style,ue=j.title,fe=j.onMouseEnter,Ee=j.onMouseLeave,se=j.onMouseOver,ae=j.onMouseOut,Oe=j.required,ze=j.onClick,Ye=j.tabIndex,He=j.type,Xe=j.placeholder,We=j.id,Ke=j.inputMode,nt=j.pattern,de=j.step,De=j.maxLength,Ne=j.autoFocus,Be=j.name,at=j.onPaste,lt=j.onInput,pt=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"]),ot=this.state,bt=ot.value,yt=ot.focused,xt=x()(W,(w={},Object(Y.a)(w,q,!!q),Object(Y.a)(w,"".concat(W,"-disabled"),T),Object(Y.a)(w,"".concat(W,"-focused"),yt),w)),Ze={};Object.keys(pt).forEach(function(Re){(Re.substr(0,5)==="data-"||Re.substr(0,5)==="aria-"||Re==="role")&&(Ze[Re]=pt[Re])});var kt=!M&&!T,Ot=this.getInputDisplayValue(null),qe=(bt||bt===0)&&(isNaN(bt)||Number(bt)>=re),st=(bt||bt===0)&&(isNaN(bt)||Number(bt)<=ye),xe=qe||T||M,we=st||T||M,me=x()("".concat(W,"-handler"),"".concat(W,"-handler-up"),Object(Y.a)({},"".concat(W,"-handler-up-disabled"),xe)),ce=x()("".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:Ee,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}),K||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":bt,required:Oe,type:He,placeholder:Xe,onPaste:at,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:Be,title:ue,id:We,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ot),pattern:nt,inputMode:Ke,onInput:lt},Ze))))}}]),C}(n.a.Component);R.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=R,b=ge.a=g},fAei:function(ut,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"),H=U("q1tI"),n=U("4IlW"),I=U("Kwbf"),x=U("TSYQ"),p=U.n(x),_=U("sboe"),c=U("OZM5"),a=U("815F"),h=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,Ee=ye.motion,se=ye.motionNodes,ae=ye.motionType,Oe=ye.onMotionStart,ze=ye.onMotionEnd,Ye=ye.active,He=ye.treeNodeRequiredProps,Xe=Object(l.a)(ye,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),We=H.useState(!0),Ke=Object(h.a)(We,2),nt=Ke[0],de=Ke[1],De=H.useContext(_.a),Ne=De.prefixCls,Be=H.useRef(!1),at=function(){Be.current||ze(),Be.current=!0};return Object(H.useEffect)(function(){se&&ae==="hide"&&nt&&de(!1)},[se]),Object(H.useEffect)(function(){return se&&Oe(),function(){se&&at()}},[]),se?H.createElement(s.default,Object.assign({ref:pe,visible:nt},Ee,{motionAppear:ae==="show",onAppearEnd:at,onLeaveEnd:at}),function(lt,pt){var ot=lt.className,bt=lt.style;return H.createElement("div",{ref:pt,className:p()("".concat(Ne,"-treenode-motion"),ot),style:bt},se.map(function(yt){var xt=yt.data,Ze=xt.key,kt=Object(l.a)(xt,["key"]),Ot=yt.isStart,qe=yt.isEnd;delete kt.children;var st=Object(a.f)(Ze,He);return H.createElement(i.a,Object.assign({},kt,st,{active:Ye,data:yt.data,key:Ze,isStart:Ot,isEnd:qe}))}))}):H.createElement(i.a,Object.assign({domRef:pe,className:ue,style:fe},Xe,{active:Ye}))};D.displayName="MotionTreeNode";var A=H.forwardRef(D),S=A;function O(){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(Ee,se){var ae=new Map;Ee.forEach(function(ze){ae.set(ze,!0)});var Oe=se.filter(function(ze){return!ae.has(ze)});return Oe.length===1?Oe[0]:null}return pe<ue?{add:!0,key:fe(re,ye)}:{add:!1,key:fe(ye,re)}}function R(re,ye,pe){var ue=re.findIndex(function(ae){var Oe=ae.data;return Oe.key===pe}),fe=re[ue+1],Ee=ye.findIndex(function(ae){var Oe=ae.data;return Oe.key===pe});if(fe){var se=ye.findIndex(function(ae){var Oe=ae.data;return Oe.key===fe.data.key});return ye.slice(Ee+1,se)}return ye.slice(Ee+1)}var g={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},b=function(){},f="RC_TREE_MOTION_".concat(Math.random()),d={key:f},C={key:f,level:0,index:0,pos:"0",node:d},E={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,Ee=ye.selectable,se=ye.checkable,ae=ye.expandedKeys,Oe=ye.selectedKeys,ze=ye.checkedKeys,Ye=ye.loadedKeys,He=ye.loadingKeys,Xe=ye.halfCheckedKeys,We=ye.keyEntities,Ke=ye.disabled,nt=ye.dragging,de=ye.dragOverNodeKey,De=ye.dropPosition,Ne=ye.motion,Be=ye.height,at=ye.itemHeight,lt=ye.virtual,pt=ye.focusable,ot=ye.activeItem,bt=ye.focused,yt=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=H.useRef(null);H.useImperativeHandle(pe,function(){return{scrollTo:function(sn){we.current.scrollTo(sn)}}});var me=H.useState(ae),ce=Object(h.a)(me,2),he=ce[0],Te=ce[1],Re=H.useState(fe),ke=Object(h.a)(Re,2),et=ke[0],ht=ke[1],Ut=H.useState(fe),nn=Object(h.a)(Ut,2),en=nn[0],mn=nn[1],En=H.useState([]),$t=Object(h.a)(En,2),rr=$t[0],Dn=$t[1],Sr=H.useState(null),br=Object(h.a)(Sr,2),Pn=br[0],Dr=br[1];function Or(){ht(fe),mn(fe),Dn([]),Dr(null),st()}H.useEffect(function(){Te(ae);var tn=O(he,ae);if(tn.key!==null)if(tn.add){var sn=et.findIndex(function($r){var fr=$r.data.key;return fr===tn.key}),$n=w(R(et,fe,tn.key),lt,Be,at),sr=et.slice();sr.splice(sn+1,0,E),mn(sr),Dn($n),Dr("show")}else{var Nr=fe.findIndex(function($r){var fr=$r.data.key;return fr===tn.key}),hn=w(R(fe,et,tn.key),lt,Be,at),Qt=fe.slice();Qt.splice(Nr+1,0,E),mn(Qt),Dn(hn),Dr("hide")}else et!==fe&&(ht(fe),mn(fe))},[ae,fe]),H.useEffect(function(){nt||Or()},[nt]);var ln=Ne?en:fe,Yr={expandedKeys:ae,selectedKeys:Oe,loadedKeys:Ye,loadingKeys:He,checkedKeys:ze,halfCheckedKeys:Xe,dragOverNodeKey:de,dropPosition:De,keyEntities:We};return H.createElement(H.Fragment,null,bt&&ot&&H.createElement("span",{style:g,"aria-live":"assertive"},W(ot)),H.createElement("div",{role:"tree"},H.createElement("input",{style:g,disabled:pt===!1||Ke,tabIndex:pt!==!1?yt:null,onKeyDown:xt,onFocus:Ze,onBlur:kt,value:"",onChange:b})),H.createElement(u.a,Object.assign({},xe,{data:ln,itemKey:j,height:Be,fullHeight:!1,virtual:lt,itemHeight:at,prefixCls:"".concat(ue,"-list"),ref:we}),function(tn){var sn=tn.pos,$n=tn.data,sr=$n.key,Nr=Object(l.a)($n,["key"]),hn=tn.isStart,Qt=tn.isEnd,$r=Object(a.e)(sr,sn);delete Nr.children;var fr=Object(a.f)($r,Yr);return H.createElement(S,Object.assign({},Nr,fr,{active:ot&&sr===ot.data.key,pos:sn,data:tn.data,isStart:hn,isEnd:Qt,motion:Ne,motionNodes:sr===f?rr:null,motionType:Pn,onMotionStart:qe,onMotionEnd:Or,treeNodeRequiredProps:Yr,onMouseMove:function(){Ot(null)}}))}))},M=H.forwardRef(T);M.displayName="NodeList";var m=M,v=U("NvD2"),K=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=H.createRef(),ue.onNodeDragStart=function(fe,Ee){var se=ue.state,ae=se.expandedKeys,Oe=se.keyEntities,ze=ue.props.onDragStart,Ye=Ee.props.eventKey;ue.dragNode=Ee;var He=Object(c.b)(ae,Ye);ue.setState({dragging:!0,dragNodesKeys:Object(c.g)(Ye,Oe)}),ue.setExpandedKeys(He),ze&&ze({event:fe,node:Object(a.b)(Ee.props)})},ue.onNodeDragEnter=function(fe,Ee){var se=ue.state,ae=se.expandedKeys,Oe=se.keyEntities,ze=se.dragNodesKeys,Ye=ue.props.onDragEnter,He=Ee.props,Xe=He.pos,We=He.eventKey;if(!ue.dragNode||ze.indexOf(We)!==-1)return;var Ke=Object(c.c)(fe,Ee);if(ue.dragNode.props.eventKey===We&&Ke===0){ue.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ue.setState({dragOverNodeKey:We,dropPosition:Ke}),ue.delayedDragEnterLogic||(ue.delayedDragEnterLogic={}),Object.keys(ue.delayedDragEnterLogic).forEach(function(nt){clearTimeout(ue.delayedDragEnterLogic[nt])}),ue.delayedDragEnterLogic[Xe]=window.setTimeout(function(){if(!ue.state.dragging)return;var nt=Object(N.a)(ae),de=Oe[We];de&&(de.children||[]).length&&(nt=Object(c.a)(ae,We)),"expandedKeys"in ue.props||ue.setExpandedKeys(nt),Ye&&Ye({event:fe,node:Object(a.b)(Ee.props),expandedKeys:nt})},400)},0)},ue.onNodeDragOver=function(fe,Ee){var se=ue.state.dragNodesKeys,ae=ue.props.onDragOver,Oe=Ee.props.eventKey;if(se.indexOf(Oe)!==-1)return;if(ue.dragNode&&Oe===ue.state.dragOverNodeKey){var ze=Object(c.c)(fe,Ee);if(ze===ue.state.dropPosition)return;ue.setState({dropPosition:ze})}ae&&ae({event:fe,node:Object(a.b)(Ee.props)})},ue.onNodeDragLeave=function(fe,Ee){var se=ue.props.onDragLeave;ue.setState({dragOverNodeKey:""}),se&&se({event:fe,node:Object(a.b)(Ee.props)})},ue.onNodeDragEnd=function(fe,Ee){var se=ue.props.onDragEnd;ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),se&&se({event:fe,node:Object(a.b)(Ee.props)}),ue.dragNode=null},ue.onNodeDrop=function(fe,Ee){var se=ue.state,ae=se.dragNodesKeys,Oe=ae===void 0?[]:ae,ze=se.dropPosition,Ye=ue.props.onDrop,He=Ee.props,Xe=He.eventKey,We=He.pos;if(ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),Oe.indexOf(Xe)!==-1){Object(I.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Ke=Object(c.k)(We),nt={event:fe,node:Object(a.b)(Ee.props),dragNode:ue.dragNode?Object(a.b)(ue.dragNode.props):null,dragNodesKeys:Oe.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,Ee){var se=ue.props.onClick;se&&se(fe,Ee)},ue.onNodeDoubleClick=function(fe,Ee){var se=ue.props.onDoubleClick;se&&se(fe,Ee)},ue.onNodeSelect=function(fe,Ee){var se=ue.state.selectedKeys,ae=ue.state.keyEntities,Oe=ue.props,ze=Oe.onSelect,Ye=Oe.multiple,He=Ee.selected,Xe=Ee.key,We=!He;We?Ye?se=Object(c.a)(se,Xe):se=[Xe]:se=Object(c.b)(se,Xe);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:We,node:Ee,selectedNodes:Ke,nativeEvent:fe.nativeEvent})},ue.onNodeCheck=function(fe,Ee,se){var ae=ue.state,Oe=ae.keyEntities,ze=ae.checkedKeys,Ye=ae.halfCheckedKeys,He=ue.props,Xe=He.checkStrictly,We=He.onCheck,Ke=Ee.key,nt,de={event:"check",node:Ee,checked:se,nativeEvent:fe.nativeEvent};if(Xe){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(bt){return Oe[bt]}).filter(function(bt){return bt}).map(function(bt){return bt.node}),ue.setUncontrolledState({checkedKeys:De})}else{var Be=Object(v.a)([].concat(Object(N.a)(ze),[Ke]),!0,Oe),at=Be.checkedKeys,lt=Be.halfCheckedKeys;if(!se){var pt=new Set(at);pt.delete(Ke);var ot=Object(v.a)(Array.from(pt),{checked:!1,halfCheckedKeys:lt},Oe);at=ot.checkedKeys,lt=ot.halfCheckedKeys}nt=at,de.checkedNodes=[],de.checkedNodesPositions=[],de.halfCheckedKeys=lt,at.forEach(function(bt){var yt=Oe[bt];if(!yt)return;var xt=yt.node,Ze=yt.pos;de.checkedNodes.push(xt),de.checkedNodesPositions.push({node:xt,pos:Ze})}),ue.setUncontrolledState({checkedKeys:at},!1,{halfCheckedKeys:lt})}We&&We(nt,de)},ue.onNodeLoad=function(fe){return new Promise(function(Ee){ue.setState(function(se){var ae=se.loadedKeys,Oe=ae===void 0?[]:ae,ze=se.loadingKeys,Ye=ze===void 0?[]:ze,He=ue.props,Xe=He.loadData,We=He.onLoad,Ke=fe.key;if(!Xe||Oe.indexOf(Ke)!==-1||Ye.indexOf(Ke)!==-1)return{};var nt=Xe(fe);return nt.then(function(){var de=ue.state,De=de.loadedKeys,Ne=de.loadingKeys,Be=Object(c.a)(De,Ke),at=Object(c.b)(Ne,Ke);We&&We(Be,{event:"load",node:fe}),ue.setUncontrolledState({loadedKeys:Be}),ue.setState({loadingKeys:at}),Ee()}),{loadingKeys:Object(c.a)(Ye,Ke)}})})},ue.onNodeMouseEnter=function(fe,Ee){var se=ue.props.onMouseEnter;se&&se({event:fe,node:Ee})},ue.onNodeMouseLeave=function(fe,Ee){var se=ue.props.onMouseLeave;se&&se({event:fe,node:Ee})},ue.onNodeContextMenu=function(fe,Ee){var se=ue.props.onRightClick;se&&(fe.preventDefault(),se({event:fe,node:Ee}))},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,Ee=fe.expandedKeys,se=fe.selectedKeys,ae=fe.loadedKeys,Oe=fe.loadingKeys,ze=fe.checkedKeys,Ye=fe.halfCheckedKeys,He=fe.dragOverNodeKey,Xe=fe.dropPosition,We=fe.keyEntities;return{expandedKeys:Ee||[],selectedKeys:se||[],loadedKeys:ae||[],loadingKeys:Oe||[],checkedKeys:ze||[],halfCheckedKeys:Ye||[],dragOverNodeKey:He,dropPosition:Xe,keyEntities:We}},ue.setExpandedKeys=function(fe){var Ee=ue.state.treeData,se=Object(a.d)(Ee,fe);ue.setUncontrolledState({expandedKeys:fe,flattenNodes:se},!0)},ue.onNodeExpand=function(fe,Ee){var se=ue.state.expandedKeys,ae=ue.state.listChanging,Oe=ue.props,ze=Oe.onExpand,Ye=Oe.loadData,He=Ee.key,Xe=Ee.expanded;if(ae)return;var We=se.indexOf(He),Ke=!Xe;if(Object(I.a)(Xe&&We!==-1||!Xe&&We===-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:Ee,expanded:Ke,nativeEvent:fe.nativeEvent}),Ke&&Ye){var nt=ue.onNodeLoad(Ee);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 Ee=ue.state.activeKey,se=ue.props.onActiveChange;if(Ee===fe)return;ue.setState({activeKey:fe}),fe!==null&&ue.scrollTo({key:fe}),se&&se(fe)},ue.getActiveItem=function(){var fe=ue.state,Ee=fe.activeKey,se=fe.flattenNodes;return Ee===null?null:se.find(function(ae){var Oe=ae.data.key;return Oe===Ee})||null},ue.offsetActiveKey=function(fe){var Ee=ue.state,se=Ee.flattenNodes,ae=Ee.activeKey,Oe=se.findIndex(function(He){var Xe=He.data.key;return Xe===ae});Oe===-1&&fe<0&&(Oe=se.length),Oe=(Oe+fe+se.length)%se.length;var ze=se[Oe];if(ze){var Ye=ze.data.key;ue.onActiveChange(Ye)}else ue.onActiveChange(null)},ue.onKeyDown=function(fe){var Ee=ue.state,se=Ee.activeKey,ae=Ee.expandedKeys,Oe=Ee.checkedKeys,ze=ue.props,Ye=ze.onKeyDown,He=ze.checkable,Xe=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 We=ue.getActiveItem();if(We&&We.data){var Ke=ue.getTreeNodeRequiredProps(),nt=We.data.isLeaf===!1||!!(We.data.children||[]).length,de=Object(a.b)(Object(Y.a)(Object(Y.a)({},Object(a.f)(se,Ke)),{},{data:We.data,active:!0}));switch(fe.which){case n.a.LEFT:{nt&&ae.includes(se)?ue.onNodeExpand({},de):We.parent&&ue.onActiveChange(We.parent.data.key),fe.preventDefault();break}case n.a.RIGHT:{nt&&!ae.includes(se)?ue.onNodeExpand({},de):We.children&&We.children.length&&ue.onActiveChange(We.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,!Oe.includes(se)):!He&&Xe&&!de.disabled&&de.selectable!==!1&&ue.onNodeSelect({},de);break}}}Ye&&Ye(fe)},ue.setUncontrolledState=function(fe){var Ee=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,Oe=!0,ze={};Object.keys(fe).forEach(function(Ye){if(Ye in ue.props){Oe=!1;return}ae=!0,ze[Ye]=fe[Ye]}),ae&&(!Ee||Oe)&&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,Ee=this.state,se=Ee.focused,ae=Ee.flattenNodes,Oe=Ee.keyEntities,ze=Ee.dragging,Ye=Ee.activeKey,He=this.props,Xe=He.prefixCls,We=He.className,Ke=He.style,nt=He.showLine,de=He.focusable,De=He.tabIndex,Ne=De===void 0?0:De,Be=He.selectable,at=He.showIcon,lt=He.icon,pt=He.switcherIcon,ot=He.draggable,bt=He.checkable,yt=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 H.createElement(_.a.Provider,{value:{prefixCls:Xe,selectable:Be,showIcon:at,icon:lt,switcherIcon:pt,draggable:ot,checkable:bt,checkStrictly:yt,disabled:xt,keyEntities:Oe,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}},H.createElement("div",{className:p()(Xe,We,(fe={},Object(te.a)(fe,"".concat(Xe,"-show-line"),nt),Object(te.a)(fe,"".concat(Xe,"-focused"),se),Object(te.a)(fe,"".concat(Xe,"-active-focused"),Ye!==null),fe))},H.createElement(m,Object.assign({ref:this.listRef,prefixCls:Xe,style:Ke,data:ae,disabled:xt,selectable:Be,checkable:!!bt,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,Ee){var se=Ee.prevProps,ae={prevProps:fe};function Oe(lt){return!se&< in fe||se&&se[lt]!==fe[lt]}var ze;if(Oe("treeData")?ze=fe.treeData:Oe("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)({},f,C),Ye.keyEntities)}var He=ae.keyEntities||Ee.keyEntities;if(Oe("expandedKeys")||se&&Oe("autoExpandParent"))ae.expandedKeys=fe.autoExpandParent||!se&&fe.defaultExpandParent?Object(c.e)(fe.expandedKeys,He):fe.expandedKeys;else if(!se&&fe.defaultExpandAll){var Xe=Object(Y.a)({},He);delete Xe[f],ae.expandedKeys=Object.keys(Xe).map(function(lt){return Xe[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 We=Object(a.d)(ze||Ee.treeData,ae.expandedKeys||Ee.expandedKeys);ae.flattenNodes=We}if(fe.selectable&&(Oe("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(Oe("checkedKeys")?Ke=Object(c.j)(fe.checkedKeys)||{}:!se&&fe.defaultCheckedKeys?Ke=Object(c.j)(fe.defaultCheckedKeys)||{}:ze&&(Ke=Object(c.j)(fe.checkedKeys)||{checkedKeys:Ee.checkedKeys,halfCheckedKeys:Ee.halfCheckedKeys}),Ke){var nt=Ke,de=nt.checkedKeys,De=de===void 0?[]:de,Ne=nt.halfCheckedKeys,Be=Ne===void 0?[]:Ne;if(!fe.checkStrictly){var at=Object(v.a)(De,!0,He);De=at.checkedKeys,Be=at.halfCheckedKeys}ae.checkedKeys=De,ae.halfCheckedKeys=Be}}return Oe("loadedKeys")&&(ae.loadedKeys=fe.loadedKeys),ae}}]),pe}(H.Component);K.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},K.TreeNode=i.a;var X=K,q=ge.b=X},fcSX:function(ut,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"),H=U("q1tI"),n=U("rePB"),I=U("JX7q"),x=U("TSYQ"),p=U.n(x),_=U("qx4F"),c=U("4IlW");function a(T){return Array.isArray(T)?T:[T]}var h={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},l=Object.keys(h).filter(function(T){if(typeof document=="undefined")return!1;var M=document.getElementsByTagName("html")[0];return T in(M?M.style:{})})[0],u=h[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),O=function T(M,m,v,K){if(!m||m===document||m instanceof Document)return!1;if(m===M.parentNode)return!0;var X=Math.max(Math.abs(v),Math.abs(K))===Math.abs(K),q=Math.max(Math.abs(v),Math.abs(K))===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",Ee=re&&ue,se=ye&&fe;return X&&(!Ee||Ee&&(m.scrollTop>=re&&K<0||m.scrollTop<=0&&K>0))||q&&(!se||se&&(m.scrollLeft>=ye&&v<0||m.scrollLeft<=0&&v>0))?T(M,m.parentNode,v,K):!1};function R(T){var M=g();return function(){var v=Object(F.a)(T),K;if(M){var X=Object(F.a)(this).constructor;K=Reflect.construct(v,arguments,X)}else K=v.apply(this,arguments);return Object(P.a)(this,K)}}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 b={},f=function(T){Object(z.a)(m,T);var M=R(m);function m(v){var K;return Object(Y.a)(this,m),K=M.call(this,v),K.domFocus=function(){K.dom&&K.dom.focus()},K.removeStartHandler=function(X){if(X.touches.length>1)return;K.startPos={x:X.touches[0].clientX,y:X.touches[0].clientY}},K.removeMoveHandler=function(X){if(X.changedTouches.length>1)return;var q=X.currentTarget,re=X.changedTouches[0].clientX-K.startPos.x,ye=X.changedTouches[0].clientY-K.startPos.y;(q===K.maskDom||q===K.handlerDom||q===K.contentDom&&O(q,X.target,re,ye))&&X.cancelable&&X.preventDefault()},K.transitionEnd=function(X){var q=X.target;i(q,u,K.transitionEnd),q.style.transition=""},K.onKeyDown=function(X){if(X.keyCode===c.a.ESC){var q=K.props.onClose;X.stopPropagation(),q&&q(X)}},K.onWrapperTransitionEnd=function(X){var q=K.props,re=q.open,ye=q.afterVisibleChange;X.target===K.contentWrapper&&X.propertyName.match(/transform$/)&&(K.dom.style.transition="",!re&&K.getCurrentDrawerSome()&&(document.body.style.overflowX="",K.maskDom&&(K.maskDom.style.left="",K.maskDom.style.width="")),ye&&ye(!!re))},K.openLevelTransition=function(){var X=K.props,q=X.open,re=X.width,ye=X.height,pe=K.getHorizontalBoolAndPlacementName(),ue=pe.isHorizontal,fe=pe.placementName,Ee=K.contentDom?K.contentDom.getBoundingClientRect()[ue?"width":"height"]:0,se=(ue?re:ye)||Ee;K.setLevelAndScrolling(q,fe,se)},K.setLevelTransform=function(X,q,re,ye){var pe=K.props,ue=pe.placement,fe=pe.levelMove,Ee=pe.duration,se=pe.ease,ae=pe.showMask;K.levelDom.forEach(function(Oe){Oe.style.transition="transform ".concat(Ee," ").concat(se),s(Oe,u,K.transitionEnd);var ze=X?re:0;if(fe){var Ye=D(fe,{target:Oe,open:X});ze=X?Ye[0]:Ye[1]||0}var He=typeof ze=="number"?"".concat(ze,"px"):ze,Xe=ue==="left"||ue==="top"?He:"-".concat(He);Xe=ae&&ue==="right"&&ye?"calc(".concat(Xe," + ").concat(ye,"px)"):Xe,Oe.style.transform=ze?"".concat(q,"(").concat(Xe,")"):""})},K.setLevelAndScrolling=function(X,q,re){var ye=K.props.onChange;if(!S){var pe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(_.a)(!0):0;K.setLevelTransform(X,q,re,pe),K.toggleScrollingToDrawerAndBody(pe)}ye&&ye(X)},K.toggleScrollingToDrawerAndBody=function(X){var q=K.props,re=q.getOpenCount,ye=q.getContainer,pe=q.showMask,ue=q.open,fe=ye&&ye(),Ee=re&&re();if(fe&&fe.parentNode===document.body&&pe){var se=["touchstart"],ae=[document.body,K.maskDom,K.handlerDom,K.contentDom];ue&&document.body.style.overflow!=="hidden"?(X&&K.addScrollingEffect(X),Ee===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ae.forEach(function(Oe,ze){if(!Oe)return;s(Oe,se[ze]||"touchmove",ze?K.removeMoveHandler:K.removeStartHandler,K.passive)})):K.getCurrentDrawerSome()&&(Ee||(document.body.style.overflow=""),document.body.style.touchAction="",X&&K.remScrollingEffect(X),ae.forEach(function(Oe,ze){if(!Oe)return;i(Oe,se[ze]||"touchmove",ze?K.removeMoveHandler:K.removeStartHandler,K.passive)}))}},K.addScrollingEffect=function(X){var q=K.props,re=q.placement,ye=q.duration,pe=q.ease,ue=q.getOpenCount,fe=q.switchScrollingEffect,Ee=ue&&ue();Ee===1&&fe();var se="width ".concat(ye," ").concat(pe),ae="transform ".concat(ye," ").concat(pe);K.dom.style.transition="none";switch(re){case"right":K.dom.style.transform="translateX(-".concat(X,"px)");break;case"top":case"bottom":K.dom.style.width="calc(100% - ".concat(X,"px)"),K.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(K.timeout),K.timeout=setTimeout(function(){K.dom&&(K.dom.style.transition="".concat(ae,",").concat(se),K.dom.style.width="",K.dom.style.transform="")})},K.remScrollingEffect=function(X){var q=K.props,re=q.placement,ye=q.duration,pe=q.ease,ue=q.getOpenCount,fe=q.switchScrollingEffect,Ee=ue&&ue();Ee||fe(!0),l&&(document.body.style.overflowX="hidden"),K.dom.style.transition="none";var se,ae="width ".concat(ye," ").concat(pe),Oe="transform ".concat(ye," ").concat(pe);switch(re){case"left":{K.dom.style.width="100%",ae="width 0s ".concat(pe," ").concat(ye);break}case"right":{K.dom.style.transform="translateX(".concat(X,"px)"),K.dom.style.width="100%",ae="width 0s ".concat(pe," ").concat(ye),K.maskDom&&(K.maskDom.style.left="-".concat(X,"px"),K.maskDom.style.width="calc(100% + ".concat(X,"px)"));break}case"top":case"bottom":{K.dom.style.width="calc(100% + ".concat(X,"px)"),K.dom.style.height="100%",K.dom.style.transform="translateZ(0)",se="height 0s ".concat(pe," ").concat(ye);break}default:break}clearTimeout(K.timeout),K.timeout=setTimeout(function(){K.dom&&(K.dom.style.transition="".concat(Oe,",").concat(se?"".concat(se,","):"").concat(ae),K.dom.style.transform="",K.dom.style.width="",K.dom.style.height="")})},K.getCurrentDrawerSome=function(){return!Object.keys(b).some(function(X){return b[X]})},K.getLevelDom=function(X){var q=X.level,re=X.getContainer;if(S)return;var ye=re&&re(),pe=ye?ye.parentNode:null;if(K.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&&K.levelDom.push(fe)})}else q&&a(q).forEach(function(fe){document.querySelectorAll(fe).forEach(function(Ee){K.levelDom.push(Ee)})})},K.getHorizontalBoolAndPlacementName=function(){var X=K.props.placement,q=X==="left"||X==="right",re="translate".concat(q?"X":"Y");return{isHorizontal:q,placementName:re}},K.state={_self:Object(I.a)(K)},K}return Object(N.a)(m,[{key:"componentDidMount",value:function(){var K=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&&(b[this.drawerId]=re),this.openLevelTransition(),this.forceUpdate(function(){K.domFocus()}))}},{key:"componentDidUpdate",value:function(K){var X=this.props,q=X.open,re=X.getContainer,ye=re&&re();q!==K.open&&(q&&this.domFocus(),ye&&ye.parentNode===document.body&&(b[this.drawerId]=!!q),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var K=this.props,X=K.getOpenCount,q=K.open,re=K.switchScrollingEffect,ye=typeof X=="function"&&X();delete b[this.drawerId],q&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ye||(document.body.style.overflow="",re(!0))}},{key:"render",value:function(){var K,X=this,q=this.props,re=q.className,ye=q.children,pe=q.style,ue=q.width,fe=q.height,Ee=q.defaultOpen,se=q.open,ae=q.prefixCls,Oe=q.placement,ze=q.level,Ye=q.levelMove,He=q.ease,Xe=q.duration,We=q.getContainer,Ke=q.handler,nt=q.onChange,de=q.afterVisibleChange,De=q.showMask,Ne=q.maskClosable,Be=q.maskStyle,at=q.onClose,lt=q.onHandleClick,pt=q.keyboard,ot=q.getOpenCount,bt=q.switchScrollingEffect,yt=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=p()(ae,(K={},Object(n.a)(K,"".concat(ae,"-").concat(Oe),!0),Object(n.a)(K,"".concat(ae,"-open"),xt),Object(n.a)(K,re||"",!!re),Object(n.a)(K,"no-mask",!De),K)),kt=this.getHorizontalBoolAndPlacementName(),Ot=kt.placementName,qe=Oe==="left"||Oe==="top"?"-100%":"100%",st=xt?"":"".concat(Ot,"(").concat(qe,")"),xe=Ke&&H.cloneElement(Ke,{onClick:function(me){Ke.props.onClick&&Ke.props.onClick(),lt&<(me)},ref:function(me){X.handlerDom=me}});return H.createElement("div",Object.assign({},yt,{tabIndex:-1,className:Ze,style:pe,ref:function(me){X.dom=me},onKeyDown:xt&&pt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),De&&H.createElement("div",{className:"".concat(ae,"-mask"),onClick:Ne?at:void 0,style:Be,ref:function(me){X.maskDom=me}}),H.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}},H.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(K,X){var q=X.prevProps,re=X._self,ye={prevProps:K};if(q!==void 0){var pe=K.placement,ue=K.level;pe!==q.placement&&(re.contentDom=null),ue!==q.level&&re.getLevelDom(K)}return ye}}]),m}(H.Component);f.defaultProps={switchScrollingEffect:function(){}};var d=f;function C(T){var M=E();return function(){var v=Object(F.a)(T),K;if(M){var X=Object(F.a)(this).constructor;K=Reflect.construct(v,arguments,X)}else K=v.apply(this,arguments);return Object(P.a)(this,K)}}function E(){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 K;Object(Y.a)(this,m),K=M.call(this,v),K.onHandleClick=function(q){var re=K.props,ye=re.onHandleClick,pe=re.open;if(ye&&ye(q),typeof pe=="undefined"){var ue=K.state.open;K.setState({open:!ue})}},K.onClose=function(q){var re=K.props,ye=re.onClose,pe=re.open;ye&&ye(q),typeof pe=="undefined"&&K.setState({open:!1})};var X=typeof v.open!="undefined"?v.open:!!v.defaultOpen;return K.state={open:X},"onMaskClick"in v&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),K}return Object(N.a)(m,[{key:"render",value:function(){var K=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"]),Ee=this.state.open;if(!re)return H.createElement("div",{className:ye,ref:function(Oe){K.dom=Oe}},H.createElement(d,Object.assign({},fe,{open:Ee,handler:ue,getContainer:function(){return K.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var se=!!ue||pe;return H.createElement(G.a,{visible:Ee,forceRender:se,getContainer:re,wrapperClassName:ye},function(ae){var Oe=ae.visible,ze=ae.afterClose,Ye=Object(te.a)(ae,["visible","afterClose"]);return H.createElement(d,Object.assign({},fe,Ye,{open:Oe!==void 0?Oe:Ee,afterVisibleChange:ze!==void 0?ze:fe.afterVisibleChange,handler:ue,onClose:K.onClose,onHandleClick:K.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(K,X){var q=X.prevProps,re={prevProps:K};return typeof q!="undefined"&&K.open!==q.open&&(re.open=K.open),re}}]),m}(H.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:H.createElement("div",{className:"drawer-handle"},H.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(ut,ge,U){"use strict";U.d(ge,"f",function(){return _}),U.d(ge,"b",function(){return c}),U.d(ge,"a",function(){return a}),U.d(ge,"d",function(){return h}),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"),H=U("T8No"),n=U("Cg/j"),I=U("t9D7"),x=function(s,i,D,A){var S=arguments.length,O=S<3?i:A===null?A=Object.getOwnPropertyDescriptor(i,D):A,R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(s,i,D,A);else for(var g=s.length-1;g>=0;g--)(R=s[g])&&(O=(S<3?R(O):S>3?R(i,D,O):R(i,D))||O);return S>3&&O&&Object.defineProperty(i,D,O),O},p=function(s,i){return function(D,A){i(D,A,s)}};function _(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"),h=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 O=this._menuItems.get(A);O||(O=new F.a,this._menuItems.set(A,O)),D.push(O.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)_(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,O){var R,g;if(this._commandService=O,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:(R=i.tooltip)===null||R===void 0?void 0:R.value)!==null&&g!==void 0?g:"",this.enabled=!i.precondition||S.contextMatchesRules(i.precondition),this.checked=void 0,i.toggled){const b=i.toggled.condition?i.toggled:{condition:i.toggled};this.checked=S.contextMatchesRules(b.condition),this.checked&&b.tooltip&&(this.tooltip=typeof b.tooltip=="string"?b.tooltip:b.tooltip.value),b.title&&(this.label=typeof b.title=="string"?b.title:b.title.value)}this.item=i,this.alt=D?new s(D,void 0,A,S,O):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=x([p(3,H.b),p(4,G.b)],u)},i8i3:function(ut,ge,U){ut.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(ut,ge,U){ut.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(ut,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(ut,ge,U){"use strict";U.d(ge,"a",function(){return _});var te=U("qVdP"),Y=U("jsC+"),N=U("lUTK"),z=U("BvKs"),P=U("tJVT"),F=U("q1tI"),G=U.n(F),H=U("Q0Vu"),n=U.n(H),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"}],x=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],p=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],_=function(a){var h=a.showSelectAll,l=h===void 0?!1:h,u=a.disciplinesData,s=u===void 0?[]:u,i=a.knowledgeData,D=i===void 0?[]:i,A=a.directionValue,S=a.subDisciplineValue,O=a.typeValue,R=a.knowledgeValue,g=a.showKnowledge,b=g===void 0?!1:g,f=a.showRandomType,d=f===void 0?!1:f,C=a.difficultyValue,E=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,K=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,Ee=fe===void 0?function(){}:fe,se=a.onDifficultyChange,ae=se===void 0?function(){}:se,Oe=a.handlelanguagesChange,ze=Oe===void 0?function(){}:Oe,Ye=a.onKnowledgeChange,He=Ye===void 0?function(){}:Ye,Xe=a.onRandomChange,We=Xe===void 0?function(){}:Xe,Ke=a.showTeachGroup,nt=Ke===void 0?!1:Ke,de=a.teachGroupData,De=de===void 0?[]:de,Ne=a.onTeachGroupChange,Be=Ne===void 0?function(){}:Ne,at=a.teachGroupValue,lt=Object(F.useState)(0),pt=Object(P.a)(lt,2),ot=pt[0],bt=pt[1],yt=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;(yt==null||((xe=yt.current)===null||xe===void 0)?void 0:xe.clientHeight)>108?bt(1):bt(0)}s.length===0&&bt(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(at?"":n.a.active," "),onClick:function(){return Be(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(at===xe.group_id?n.a.active:""," "),onClick:function(){return Be(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:ot===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:yt,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))})),!!ot&&G.a.createElement("div",{className:n.a.action},ot===1&&G.a.createElement("span",{onClick:function(){return bt(2)}},"\u5C55\u5F00",G.a.createElement("i",{className:"iconfont icon-xiala"})),ot===2&&G.a.createElement("span",{onClick:function(){return bt(1)}},"\u6536\u8D77",G.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),b&&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(R===-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(R===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(R===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(O?"":n.a.active," "),onClick:function(){return Ee(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(O===xe.value?n.a.active:""," "),onClick:function(){return Ee(xe.value)}},xe.name)}),K&&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},x.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(E?"":n.a.active," "),onClick:function(){return We(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},p.map(function(xe){return G.a.createElement("li",{key:xe.name,className:"".concat(n.a.directionItem," ").concat(E===xe.value?n.a.active:""," "),onClick:function(){return We(xe.value)}},xe.name)})))))}},jcZT:function(ut,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"),H=U("tJVT"),n=U("WmNS"),I=U.n(n),x=U("q1tI"),p=U.n(x),_=U("d5o6"),c=U.n(_),a=U("P/tu"),h=U("WCUW"),l=U("9kvl"),u=function(i){var D=i.problemset,A=i.dispatch,S=i.onOk,O=Object(x.useState)(""),R=Object(H.a)(O,2),g=R[0],b=R[1],f=Object(x.useState)([0]),d=Object(H.a)(f,2),C=d[0],E=d[1],w=function(){A({type:"problemset/setActionTabs",payload:{}})};Object(x.useEffect)(function(){if(D.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var W,T;E([(W=D.actionTabs)===null||W===void 0||((T=W.params)===null||T===void 0)?void 0:T.group_id]),b("")}},[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(h.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 p.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},p.a.createElement("div",{className:c.a.addModal},p.a.createElement("div",{className:c.a.row},p.a.createElement("span",{className:c.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),p.a.createElement(z.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:g,onChange:function(T){return b(T.target.value)}})),p.a.createElement("div",{className:c.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},p.a.createElement("span",{className:c.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),p.a.createElement(a.a,{value:C,onChange:function(T){return E(T)}}))))};ge.a=Object(l.a)(function(s){var i=s.problemset;return{problemset:i}})(u)},k3GJ:function(ut,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),H=U("Zm9Q"),n=U("6cGi"),I=U("KQm4"),x=U("xEkU"),p=U.n(x),_=U("t23M");function c(be){var Le=Object(P.useRef)(),Fe=Object(P.useRef)(!1);function Ce(){for(var ie=arguments.length,ve=new Array(ie),le=0;le<ie;le++)ve[le]=arguments[le];Fe.current||(p.a.cancel(Le.current),Le.current=p()(function(){be.apply(void 0,ve)}))}return Object(P.useEffect)(function(){return function(){Fe.current=!0,p.a.cancel(Le.current)}},[]),Ce}function a(be){var Le=Object(P.useRef)([]),Fe=Object(P.useState)({}),Ce=Object(Y.a)(Fe,2),ie=Ce[1],ve=Object(P.useRef)(typeof be=="function"?be():be),le=c(function(){var _e=ve.current;Le.current.forEach(function(je){_e=je(_e)}),Le.current=[],ve.current=_e,ie({})});function Se(_e){Le.current.push(_e),le()}return[ve.current,Se]}var h=U("4IlW");function l(be,Le){var Fe,Ce=be.prefixCls,ie=be.id,ve=be.active,le=be.rtl,Se=be.tab,_e=Se.key,je=Se.tab,Ue=Se.disabled,Ge=Se.closeIcon,tt=be.tabBarGutter,vt=be.tabPosition,Tt=be.closable,Nt=be.renderWrapper,Rn=be.removeAriaLabel,Yn=be.editable,Bn=be.onClick,zn=be.onRemove,Xn=be.onFocus,Vn="".concat(Ce,"-tab");P.useEffect(function(){return zn},[]);var Fn={};vt==="top"||vt==="bottom"?Fn[le?"marginLeft":"marginRight"]=tt:Fn.marginBottom=tt;var Jn=Yn&&Tt!==!1&&!Ue;function er(_n){if(Ue)return;Bn(_n)}function jr(_n){_n.preventDefault(),_n.stopPropagation(),Yn.onEdit("remove",{key:_e,event:_n})}var tr=P.createElement("div",{key:_e,ref:Le,className:G()(Vn,(Fe={},Object(te.a)(Fe,"".concat(Vn,"-with-remove"),Jn),Object(te.a)(Fe,"".concat(Vn,"-active"),ve),Object(te.a)(Fe,"".concat(Vn,"-disabled"),Ue),Fe)),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":Ue,tabIndex:Ue?null:0,onClick:function(vn){vn.stopPropagation(),er(vn)},onKeyDown:function(vn){[h.a.SPACE,h.a.ENTER].includes(vn.which)&&(vn.preventDefault(),er(vn))},onFocus:Xn},je),Jn&&P.createElement("button",{type:"button","aria-label":Rn||"remove",tabIndex:0,className:"".concat(Vn,"-remove"),onClick:function(vn){vn.stopPropagation(),jr(vn)}},Ge||Yn.removeIcon||"\xD7"));return Nt&&(tr=Nt(tr)),tr}var u=P.forwardRef(l),s={width:0,height:0,left:0,top:0};function i(be,Le,Fe){return Object(P.useMemo)(function(){for(var Ce,ie=new Map,ve=Le.get((Ce=be[0])===null||Ce===void 0?void 0:Ce.key)||s,le=ve.left+ve.width,Se=0;Se<be.length;Se+=1){var _e=be[Se].key,je=Le.get(_e);if(!je){var Ue;je=Le.get((Ue=be[Se-1])===null||Ue===void 0?void 0:Ue.key)||s}var Ge=ie.get(_e)||Object(z.a)({},je);Ge.right=le-Ge.left-Ge.width,ie.set(_e,Ge)}return ie},[be.map(function(Ce){return Ce.key}).join("_"),Le,Fe])}var D={width:0,height:0,left:0,top:0,right:0};function A(be,Le,Fe,Ce,ie){var ve=ie.tabs,le=ie.tabPosition,Se=ie.rtl,_e,je,Ue;["top","bottom"].includes(le)?(_e="width",je=Se?"right":"left",Ue=Math.abs(Le.left)):(_e="height",je="top",Ue=-Le.top);var Ge=Le[_e],tt=Fe[_e],vt=Ce[_e],Tt=Ge;return tt+vt>Ge&&(Tt=Ge-vt),Object(P.useMemo)(function(){if(!ve.length)return[0,0];for(var Nt=ve.length,Rn=Nt,Yn=0;Yn<Nt;Yn+=1){var Bn=be.get(ve[Yn].key)||D;if(Bn[je]+Bn[_e]>Ue+Tt){Rn=Yn-1;break}}for(var zn=0,Xn=Nt-1;Xn>=0;Xn-=1){var Vn=be.get(ve[Xn].key)||D;if(Vn[je]<Ue){zn=Xn+1;break}}return[zn,Rn]},[be,Ue,Tt,le,ve.map(function(Nt){return Nt.key}).join("_"),Se])}var S=U("wx14"),O=U("1OyB"),R=U("vuIU"),g=U("JX7q"),b=U("Ji7U"),f=U("LK+K"),d=U("I8Z2"),C=U("bT9E"),E=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,K=/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,Ee=/\b(CriOS|Chrome)(?:.+)Mobile/i,se=/Mobile(?:.+)Firefox\b/i;function ae(be,Le){return be.test(Le)}function Oe(be){var Le=be||(typeof navigator!="undefined"?navigator.userAgent:""),Fe=(Le||"").split("[FBAN");if(typeof Fe[1]!="undefined"){var Ce=Fe,ie=Object(Y.a)(Ce,1);Le=ie[0]}if(Fe=Le.split("Twitter"),typeof Fe[1]!="undefined"){var ve=Fe,le=Object(Y.a)(ve,1);Le=le[0]}var Se={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(K,Le)),device:!ae(re,Le)&&(ae(X,Le)||ae(q,Le)||ae(v,Le)||ae(K,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(Ee,Le),device:ae(pe,Le)||ae(ue,Le)||ae(fe,Le)||ae(se,Le)||ae(Ee,Le)},any:null,phone:null,tablet:null};return Se.any=Se.apple.device||Se.android.device||Se.windows.device||Se.other.device,Se.phone=Se.apple.phone||Se.android.phone||Se.windows.phone,Se.tablet=Se.apple.tablet||Se.android.tablet||Se.windows.tablet,Se}var ze=Object(z.a)(Object(z.a)({},Oe()),{},{isMobile:Oe}),Ye=ze;function He(){}function Xe(be,Le,Fe){var Ce=Le||"";return be.key||"".concat(Ce,"item_").concat(Fe)}function We(be){return"".concat(be,"-menu-")}function Ke(be,Le){var Fe=-1;P.Children.forEach(be,function(Ce){Fe+=1,Ce&&Ce.type&&Ce.type.isMenuItemGroup?P.Children.forEach(Ce.props.children,function(ie){Fe+=1,Le(ie,Fe)}):Le(Ce,Fe)})}function nt(be,Le,Fe){if(!be||Fe.find)return;P.Children.forEach(be,function(Ce){if(Ce){var ie=Ce.type;if(!ie||!(ie.isSubMenu||ie.isMenuItem||ie.isMenuItemGroup))return;Le.indexOf(Ce.key)!==-1?Fe.find=!0:Ce.props.children&&nt(Ce.props.children,Le,Fe)}})}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 Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=Le&&typeof Le.getBoundingClientRect=="function"&&Le.getBoundingClientRect().width;if(Ce){if(Fe){var ie=getComputedStyle(Le),ve=ie.marginLeft,le=ie.marginRight;Ce+=+ve.replace("px","")+ +le.replace("px","")}Ce=+Ce.toFixed(6)}return Ce||0},Ne=function(Le,Fe,Ce){Le&&Object(W.a)(Le.style)==="object"&&(Le.style[Fe]=Ce)},Be=function(){return Ye.any},at=U("bdgK"),lt=U("i8i4"),pt=U.n(lt),ot=U("wgJM"),bt=U("l4aY"),yt=U("m+aA"),xt=U("c+Xe"),Ze=U("zT1h"),kt=U("QC+M");function Ot(be,Le,Fe){return Fe?be[0]===Le[0]:be[0]===Le[0]&&be[1]===Le[1]}function qe(be,Le,Fe){var Ce=be[Le]||{};return Object(z.a)(Object(z.a)({},Ce),Fe)}function st(be,Le,Fe,Ce){for(var ie=Fe.points,ve=Object.keys(be),le=0;le<ve.length;le+=1){var Se=ve[le];if(Ot(be[Se].points,ie,Ce))return"".concat(Le,"-placement-").concat(Se)}return""}var xe=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var be=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(be)||/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(be==null?void 0:be.substr(0,4)))},we=U("MNnm");function me(be,Le){var Fe={};return Fe[be.toLowerCase()]=Le.toLowerCase(),Fe["Webkit".concat(be)]="webkit".concat(Le),Fe["Moz".concat(be)]="moz".concat(Le),Fe["ms".concat(be)]="MS".concat(Le),Fe["O".concat(be)]="o".concat(Le.toLowerCase()),Fe}function ce(be,Le){var Fe={animationend:me("Animation","AnimationEnd"),transitionend:me("Transition","TransitionEnd")};return be&&("AnimationEvent"in Le||delete Fe.animationend.animation,"TransitionEvent"in Le||delete Fe.transitionend.transition),Fe}var he=ce(Object(we.a)(),typeof window!="undefined"?window:{}),Te={};if(Object(we.a)()){var Re=document.createElement("div");Te=Re.style}var ke={};function et(be){if(ke[be])return ke[be];var Le=he[be];if(Le)for(var Fe=Object.keys(Le),Ce=Fe.length,ie=0;ie<Ce;ie+=1){var ve=Fe[ie];if(Object.prototype.hasOwnProperty.call(Le,ve)&&ve in Te)return ke[be]=Le[ve],ke[be]}return""}var ht=et("animationend"),Ut=et("transitionend"),nn=!!(ht&&Ut),en=ht||"animationend",mn=Ut||"transitionend";function En(be,Le){if(!be)return null;if(Object(W.a)(be)==="object"){var Fe=Le.replace(/-\w/g,function(Ce){return Ce[1].toUpperCase()});return be[Fe]}return"".concat(be,"-").concat(Le)}var $t="none",rr="appear",Dn="enter",Sr="leave",br="none",Pn="prepare",Dr="start",Or="active",ln="end";function Yr(be){var Le=Object(P.useRef)(!1),Fe=Object(P.useState)(be),Ce=Object(Y.a)(Fe,2),ie=Ce[0],ve=Ce[1];function le(Se){Le.current||ve(Se)}return Object(P.useEffect)(function(){return function(){Le.current=!0}},[]),[ie,le]}var tn=Object(we.a)()?P.useLayoutEffect:P.useEffect,sn=tn,$n=function(){var be=P.useRef(null);function Le(){ot.a.cancel(be.current)}function Fe(Ce){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Le();var ve=Object(ot.a)(function(){ie<=1?Ce({isCanceled:function(){return ve!==be.current}}):Fe(Ce,ie-1)});be.current=ve}return P.useEffect(function(){return function(){Le()}},[]),[Fe,Le]},sr=[Pn,Dr,Or,ln],Nr=!1,hn=!0;function Qt(be){return be===Or||be===ln}var $r=function(be,Le){var Fe=P.useState(br),Ce=Object(Y.a)(Fe,2),ie=Ce[0],ve=Ce[1],le=$n(),Se=Object(Y.a)(le,2),_e=Se[0],je=Se[1];function Ue(){ve(Pn)}return sn(function(){if(ie!==br&&ie!==ln){var Ge=sr.indexOf(ie),tt=sr[Ge+1],vt=Le(ie);vt===Nr?ve(tt):_e(function(Tt){function Nt(){if(Tt.isCanceled())return;ve(tt)}vt===!0?Nt():Promise.resolve(vt).then(Nt)})}},[be,ie]),P.useEffect(function(){return function(){je()}},[]),[Ue,ie]},fr=function(be){var Le=Object(P.useRef)(),Fe=Object(P.useRef)(be);Fe.current=be;var Ce=P.useCallback(function(le){Fe.current(le)},[]);function ie(le){le&&(le.removeEventListener(mn,Ce),le.removeEventListener(en,Ce))}function ve(le){Le.current&&Le.current!==le&&ie(Le.current),le&&le!==Le.current&&(le.addEventListener(mn,Ce),le.addEventListener(en,Ce),Le.current=le)}return P.useEffect(function(){return function(){ie(Le.current)}},[]),[ve,ie]};function Lr(be,Le,Fe,Ce){var ie=Ce.motionEnter,ve=ie===void 0?!0:ie,le=Ce.motionAppear,Se=le===void 0?!0:le,_e=Ce.motionLeave,je=_e===void 0?!0:_e,Ue=Ce.motionDeadline,Ge=Ce.motionLeaveImmediately,tt=Ce.onAppearPrepare,vt=Ce.onEnterPrepare,Tt=Ce.onLeavePrepare,Nt=Ce.onAppearStart,Rn=Ce.onEnterStart,Yn=Ce.onLeaveStart,Bn=Ce.onAppearActive,zn=Ce.onEnterActive,Xn=Ce.onLeaveActive,Vn=Ce.onAppearEnd,Fn=Ce.onEnterEnd,Jn=Ce.onLeaveEnd,er=Ce.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=Fe();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,vt),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,Yn),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()),Ue>0&&(clearTimeout(Qr.current),Qr.current=setTimeout(function(){Zr({deadline:!0})},Ue))),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,!be)return;var yr;!Rr&&Le&&Se&&(yr=rr),Rr&&Le&&ve&&(yr=Dn),(Rr&&!Le&&je||!Rr&&Ge&&!Le&&je)&&(yr=Sr),yr&&(dr(yr),ia())},[Le]),Object(P.useEffect)(function(){(an===rr&&!Se||an===Dn&&!ve||an===Sr&&!je)&&dr($t)},[Se,ve,je]),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(be){Object(b.a)(Fe,be);var Le=Object(f.a)(Fe);function Fe(){return Object(O.a)(this,Fe),Le.apply(this,arguments)}return Object(R.a)(Fe,[{key:"render",value:function(){return this.props.children}}]),Fe}(P.Component),Ur=kn;function vi(be){var Le=be;Object(W.a)(be)==="object"&&(Le=be.transitionSupport);function Fe(ie){return!!(ie.motionName&&Le)}var Ce=P.forwardRef(function(ie,ve){var le=ie.visible,Se=le===void 0?!0:le,_e=ie.removeOnLeave,je=_e===void 0?!0:_e,Ue=ie.forceRender,Ge=ie.children,tt=ie.motionName,vt=ie.leavedClassName,Tt=ie.eventProps,Nt=Fe(ie),Rn=Object(P.useRef)(),Yn=Object(P.useRef)();function Bn(){try{return Object(yt.a)(Rn.current||Yn.current)}catch(dr){return null}}var zn=Lr(Nt,Se,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:Se});if(!Ge)vn=null;else if(Vn===$t||!Fe(ie))er?vn=Ge(Object(z.a)({},Wn),_n):!je&&jr.current?vn=Ge(Object(z.a)(Object(z.a)({},Wn),{},{className:vt}),_n):Ue?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:Yn},vn)});return Ce.displayName="CSSMotion",Ce}var Ai=vi(nn),Et="add",fn="keep",Gi="remove",zi="removed";function na(be){var Le;return be&&Object(W.a)(be)==="object"&&"key"in be?Le=be:Le={key:be},Object(z.a)(Object(z.a)({},Le),{},{key:String(Le.key)})}function Vi(){var be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return be.map(na)}function Z(){var be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Fe=[],Ce=0,ie=Le.length,ve=Vi(be),le=Vi(Le);ve.forEach(function(je){for(var Ue=!1,Ge=Ce;Ge<ie;Ge+=1){var tt=le[Ge];if(tt.key===je.key){Ce<Ge&&(Fe=Fe.concat(le.slice(Ce,Ge).map(function(vt){return Object(z.a)(Object(z.a)({},vt),{},{status:Et})})),Ce=Ge),Fe.push(Object(z.a)(Object(z.a)({},tt),{},{status:fn})),Ce+=1,Ue=!0;break}}Ue||Fe.push(Object(z.a)(Object(z.a)({},je),{},{status:Gi}))}),Ce<ie&&(Fe=Fe.concat(le.slice(Ce).map(function(je){return Object(z.a)(Object(z.a)({},je),{},{status:Et})})));var Se={};Fe.forEach(function(je){var Ue=je.key;Se[Ue]=(Se[Ue]||0)+1});var _e=Object.keys(Se).filter(function(je){return Se[je]>1});return _e.forEach(function(je){Fe=Fe.filter(function(Ue){var Ge=Ue.key,tt=Ue.status;return Ge!==je||tt!==Gi}),Fe.forEach(function(Ue){Ue.key===je&&(Ue.status=fn)})}),Fe}var L=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function k(be){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ai,Fe=function(Ce){Object(b.a)(ve,Ce);var ie=Object(f.a)(ve);function ve(){var le;return Object(O.a)(this,ve),le=ie.apply(this,arguments),le.state={keyEntities:[]},le.removeKey=function(Se){le.setState(function(_e){var je=_e.keyEntities;return{keyEntities:je.map(function(Ue){return Ue.key!==Se?Ue:Object(z.a)(Object(z.a)({},Ue),{},{status:zi})})}})},le}return Object(R.a)(ve,[{key:"render",value:function(){var Se=this,_e=this.state.keyEntities,je=this.props,Ue=je.component,Ge=je.children,tt=je.onVisibleChanged,vt=Object(N.a)(je,["component","children","onVisibleChanged"]),Tt=Ue||P.Fragment,Nt={};return L.forEach(function(Rn){Nt[Rn]=vt[Rn],delete vt[Rn]}),delete vt.keys,P.createElement(Tt,vt,_e.map(function(Rn){var Yn=Rn.status,Bn=Object(N.a)(Rn,["status"]),zn=Yn===Et||Yn===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||Se.removeKey(Bn.key)}}),Ge)}))}}],[{key:"getDerivedStateFromProps",value:function(Se,_e){var je=Se.keys,Ue=_e.keyEntities,Ge=Vi(je),tt=Z(Ue,Ge);return{keyEntities:tt.filter(function(vt){var Tt=Ue.find(function(Nt){var Rn=Nt.key;return vt.key===Rn});return!(Tt&&Tt.status===zi&&vt.status===Gi)})}}}]),ve}(P.Component);return Fe.defaultProps={component:"div"},Fe}var V=k(nn),ne=Ai;function Q(be){var Le=be.prefixCls,Fe=be.motion,Ce=be.animation,ie=be.transitionName;return Fe||(Ce?{motionName:"".concat(Le,"-").concat(Ce)}:ie?{motionName:ie}:null)}function Pe(be){var Le=be.prefixCls,Fe=be.visible,Ce=be.zIndex,ie=be.mask,ve=be.maskMotion,le=be.maskAnimation,Se=be.maskTransitionName;if(!ie)return null;var _e={};return(ve||Se||le)&&(_e=Object(z.a)({motionAppear:!0},Q({motion:ve,prefixCls:Le,transitionName:Se,animation:le}))),P.createElement(ne,Object(S.a)({},_e,{visible:Fe,removeOnLeave:!0}),function(je){var Ue=je.className;return P.createElement("div",{style:{zIndex:Ce},className:G()("".concat(Le,"-mask"),Ue)})})}var ft=U("9mu1"),Lt=U("o0o1"),rn=U.n(Lt),gt=U("HaE+"),Gt=["measure","align",null,"motion"],pr=function(be,Le){var Fe=Object(P.useState)(null),Ce=Object(Y.a)(Fe,2),ie=Ce[0],ve=Ce[1],le=Object(P.useRef)(),Se=Object(P.useRef)(!1);function _e(Ge){Se.current||ve(Ge)}function je(){ot.a.cancel(le.current)}function Ue(Ge){je(),le.current=Object(ot.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")},[be]),Object(P.useEffect)(function(){switch(ie){case"measure":Le();break;default:}ie&&(le.current=Object(ot.a)(Object(gt.a)(rn.a.mark(function Ge(){var tt,vt;return rn.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:tt=Gt.indexOf(ie),vt=Gt[tt+1],vt&&tt!==-1&&_e(vt);case 3:case"end":return Nt.stop()}},Ge)}))))},[ie]),Object(P.useEffect)(function(){return function(){Se.current=!0,je()}},[]),[ie,Ue]},Ir=function(be){var Le=P.useState({width:0,height:0}),Fe=Object(Y.a)(Le,2),Ce=Fe[0],ie=Fe[1];function ve(Se){ie({width:Se.offsetWidth,height:Se.offsetHeight})}var le=P.useMemo(function(){var Se={};if(be){var _e=Ce.width,je=Ce.height;be.indexOf("height")!==-1&&je?Se.height=je:be.indexOf("minHeight")!==-1&&je&&(Se.minHeight=je),be.indexOf("width")!==-1&&_e?Se.width=_e:be.indexOf("minWidth")!==-1&&_e&&(Se.minWidth=_e)}return Se},[be,Ce]);return[le,ve]},Zt=P.forwardRef(function(be,Le){var Fe=be.visible,Ce=be.prefixCls,ie=be.className,ve=be.style,le=be.children,Se=be.zIndex,_e=be.stretch,je=be.destroyPopupOnHide,Ue=be.forceRender,Ge=be.align,tt=be.point,vt=be.getRootDomNode,Tt=be.getClassNameFromAlign,Nt=be.onAlign,Rn=be.onMouseEnter,Yn=be.onMouseLeave,Bn=be.onMouseDown,zn=be.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(vt())}var an=pr(Fe,cr),dr=Object(Y.a)(an,2),Br=dr[0],ir=dr[1],Ar=Object(P.useRef)();function xr(){return tt||vt}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(be));["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:Se,opacity:Br==="motion"||Br==="stable"||!Fe?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(Ce,"-content")},le)),P.createElement(ne,Object(S.a)({visible:Fe,ref:Vn,leavedClassName:"".concat(Ce,"-hidden")},Wr,{onAppearPrepare:yi,onEnterPrepare:yi,removeOnLeave:je,forceRender:Ue}),function(Pr,Tr){var wn=Pr.className,wr=Pr.style,Ui=G()(Ce,ie,er,wn);return P.createElement(ft.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:Yn,onMouseDownCapture:Bn,onTouchStartCapture:zn,style:Object(z.a)(Object(z.a)({},wr),Ii)},Zr))})});Zt.displayName="PopupInner";var mt=Zt,Pt=P.forwardRef(function(be,Le){var Fe=be.prefixCls,Ce=be.visible,ie=be.zIndex,ve=be.children,le=be.mobile;le=le===void 0?{}:le;var Se=le.popupClassName,_e=le.popupStyle,je=le.popupMotion,Ue=je===void 0?{}:je,Ge=le.popupRender,tt=P.useRef();P.useImperativeHandle(Le,function(){return{forceAlign:function(){},getElement:function(){return tt.current}}});var vt=Object(z.a)({zIndex:ie},_e),Tt=ve;return P.Children.count(ve)>1&&(Tt=P.createElement("div",{className:"".concat(Fe,"-content")},ve)),Ge&&(Tt=Ge(Tt)),P.createElement(ne,Object(S.a)({visible:Ce,ref:tt,removeOnLeave:!0},Ue),function(Nt,Rn){var Yn=Nt.className,Bn=Nt.style,zn=G()(Fe,Se,Yn);return P.createElement("div",{ref:Rn,className:zn,style:Object(z.a)(Object(z.a)({},Bn),vt)},Tt)})});Pt.displayName="MobilePopupInner";var Rt=Pt,Ht=["visible","mobile"],un=P.forwardRef(function(be,Le){var Fe=be.visible,Ce=be.mobile,ie=Object(N.a)(be,Ht),ve=Object(P.useState)(Fe),le=Object(Y.a)(ve,2),Se=le[0],_e=le[1],je=Object(P.useState)(!1),Ue=Object(Y.a)(je,2),Ge=Ue[0],tt=Ue[1],vt=Object(z.a)(Object(z.a)({},ie),{},{visible:Se});Object(P.useEffect)(function(){_e(Fe),Fe&&Ce&&tt(xe())},[Fe,Ce]);var Tt=Ge?P.createElement(Rt,Object(S.a)({},vt,{mobile:Ce,ref:Le})):P.createElement(mt,Object(S.a)({},vt,{ref:Le}));return P.createElement("div",null,P.createElement(Pe,vt),Tt)});un.displayName="Popup";var xn=un,Cn=P.createContext(null),gn=Cn;function Ln(){}function Kn(){return""}function dn(be){return be?be.ownerDocument:window.document}var Sn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function hr(be){var Le=function(Fe){Object(b.a)(ie,Fe);var Ce=Object(f.a)(ie);function ie(ve){var le;Object(O.a)(this,ie),le=Ce.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 je=le.props.mouseEnterDelay;le.fireEvents("onMouseEnter",_e),le.delaySetPopupVisible(!0,je,je?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 je;if(_e.relatedTarget&&!_e.relatedTarget.setTimeout&&Object(bt.a)((je=le.popupRef.current)===null||je===void 0?void 0:je.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 je;if(le.preClickTime&&le.preTouchTime?je=Math.min(le.preClickTime,le.preTouchTime):le.preClickTime?je=le.preClickTime:le.preTouchTime&&(je=le.preTouchTime),Math.abs(je-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 Ue=!le.state.popupVisible;(le.isClickToHide()&&!Ue||Ue&&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 je=_e.target,Ue=le.getRootDomNode(),Ge=le.getPopupDomNode();(!Object(bt.a)(Ue,je)||le.isContextMenuOnly())&&!Object(bt.a)(Ge,je)&&!le.hasPopupMouseDown&&le.close()},le.getRootDomNode=function(){var _e=le.props.getTriggerDOMNode;if(_e)return _e(le.triggerRef.current);try{var je=Object(yt.a)(le.triggerRef.current);if(je)return je}catch(Ue){}return pt.a.findDOMNode(Object(g.a)(le))},le.getPopupClassNameFromAlign=function(_e){var je=[],Ue=le.props,Ge=Ue.popupPlacement,tt=Ue.builtinPlacements,vt=Ue.prefixCls,Tt=Ue.alignPoint,Nt=Ue.getPopupClassNameFromAlign;return Ge&&tt&&je.push(st(tt,vt,_e,Tt)),Nt&&je.push(Nt(_e)),je.join(" ")},le.getComponent=function(){var _e=le.props,je=_e.prefixCls,Ue=_e.destroyPopupOnHide,Ge=_e.popupClassName,tt=_e.onPopupAlign,vt=_e.popupMotion,Tt=_e.popupAnimation,Nt=_e.popupTransitionName,Rn=_e.popupStyle,Yn=_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:je,destroyPopupOnHide:Ue,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:Yn,zIndex:Vn,transitionName:Nt,maskAnimation:Bn,maskTransitionName:zn,maskMotion:Xn,ref:le.popupRef,motion:vt,mobile:jr,forceRender:tr}),typeof Fn=="function"?Fn():Fn)},le.attachParent=function(_e){ot.a.cancel(le.attachId);var je=le.props,Ue=je.getPopupContainer,Ge=je.getDocument,tt=le.getRootDomNode(),vt;Ue?(tt||Ue.length===0)&&(vt=Ue(tt)):vt=Ge(le.getRootDomNode()).body,vt?vt.appendChild(_e):le.attachId=Object(ot.a)(function(){le.attachParent(_e)})},le.getContainer=function(){var _e=le.props.getDocument,je=_e(le.getRootDomNode()).createElement("div");return je.style.position="absolute",je.style.top="0",je.style.left="0",je.style.width="100%",le.attachParent(je),je},le.setPoint=function(_e){var je=le.props.alignPoint;if(!je||!_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 Se;return"popupVisible"in ve?Se=!!ve.popupVisible:Se=!!ve.defaultPopupVisible,le.state={prevPopupVisible:Se,popupVisible:Se},Sn.forEach(function(_e){le["fire".concat(_e)]=function(je){le.fireEvents(_e,je)}}),le}return Object(R.a)(ie,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var le=this.props,Se=this.state;if(Se.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),ot.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,Se=le.popupPlacement,_e=le.popupAlign,je=le.builtinPlacements;return Se&&je?qe(je,Se,_e):_e}},{key:"setPopupVisible",value:function(le,Se){var _e=this.props.alignPoint,je=this.state.popupVisible;this.clearDelayTimer(),je!==le&&("popupVisible"in this.props||this.setState({popupVisible:le,prevPopupVisible:je}),this.props.onPopupVisibleChange(le)),_e&&Se&&le&&this.setPoint(Se)}},{key:"delaySetPopupVisible",value:function(le,Se,_e){var je=this,Ue=Se*1e3;if(this.clearDelayTimer(),Ue){var Ge=_e?{pageX:_e.pageX,pageY:_e.pageY}:null;this.delayTimer=window.setTimeout(function(){je.setPopupVisible(le,Ge),je.clearDelayTimer()},Ue)}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 Se=this.props.children.props,_e=this.props;return Se[le]&&_e[le]?this["fire".concat(le)]:Se[le]||_e[le]}},{key:"isClickToShow",value:function(){var le=this.props,Se=le.action,_e=le.showAction;return Se.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,Se=le.action,_e=le.showAction;return Se.indexOf("contextMenu")!==-1||_e.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var le=this.props,Se=le.action,_e=le.hideAction;return Se.indexOf("click")!==-1||_e.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var le=this.props,Se=le.action,_e=le.showAction;return Se.indexOf("hover")!==-1||_e.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var le=this.props,Se=le.action,_e=le.hideAction;return Se.indexOf("hover")!==-1||_e.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var le=this.props,Se=le.action,_e=le.showAction;return Se.indexOf("focus")!==-1||_e.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var le=this.props,Se=le.action,_e=le.hideAction;return Se.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,Se){var _e=this.props.children.props[le];_e&&_e(Se);var je=this.props[le];je&&je(Se)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var le=this.state.popupVisible,Se=this.props,_e=Se.children,je=Se.forceRender,Ue=Se.alignPoint,Ge=Se.className,tt=Se.autoDestroy,vt=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,Ue&&(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()(vt&&vt.props&&vt.props.className,Ge);Nt&&(Tt.className=Nt);var Rn=Object(z.a)({},Tt);Object(xt.c)(vt)&&(Rn.ref=Object(xt.a)(this.triggerRef,vt.ref));var Yn=P.cloneElement(vt,Rn),Bn;return(le||this.popupRef.current||je)&&(Bn=P.createElement(be,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!le&&tt&&(Bn=null),P.createElement(gn.Provider,{value:this.triggerContextValue},Yn,Bn)}}],[{key:"getDerivedStateFromProps",value:function(le,Se){var _e=le.popupVisible,je={};return _e!==void 0&&Se.popupVisible!==_e&&(je.popupVisible=_e,je.prevPopupVisible=Se.popupVisible),je}}]),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,Fe,Ce){var ie=We(Fe),ve=Le.getState();Le.setState({defaultActiveFirst:Object(z.a)(Object(z.a)({},ve.defaultActiveFirst),{},Object(te.a)({},ie,Ce))})},Ct=function(be){Object(b.a)(Fe,be);var Le=Object(f.a)(Fe);function Fe(Ce){var ie;Object(O.a)(this,Fe),ie=Le.call(this,Ce),ie.onDestroy=function(Ue){ie.props.onDestroy(Ue)},ie.onKeyDown=function(Ue){var Ge=Ue.keyCode,tt=ie.menuInstance,vt=ie.props.store,Tt=ie.getVisible();if(Ge===h.a.ENTER)return ie.onTitleClick(Ue),yn(vt,ie.props.eventKey,!0),!0;if(Ge===h.a.RIGHT)return Tt?tt.onKeyDown(Ue):(ie.triggerOpenChange(!0),yn(vt,ie.props.eventKey,!0)),!0;if(Ge===h.a.LEFT){var Nt;if(Tt)Nt=tt.onKeyDown(Ue);else return;return Nt||(ie.triggerOpenChange(!1),Nt=!0),Nt}return Tt&&(Ge===h.a.UP||Ge===h.a.DOWN)?tt.onKeyDown(Ue):void 0},ie.onOpenChange=function(Ue){ie.props.onOpenChange(Ue)},ie.onPopupVisibleChange=function(Ue){ie.triggerOpenChange(Ue,Ue?"mouseenter":"mouseleave")},ie.onMouseEnter=function(Ue){var Ge=ie.props,tt=Ge.eventKey,vt=Ge.onMouseEnter,Tt=Ge.store;yn(Tt,ie.props.eventKey,!1),vt({key:tt,domEvent:Ue})},ie.onMouseLeave=function(Ue){var Ge=ie.props,tt=Ge.parentMenu,vt=Ge.eventKey,Tt=Ge.onMouseLeave;tt.subMenuInstance=Object(g.a)(ie),Tt({key:vt,domEvent:Ue})},ie.onTitleMouseEnter=function(Ue){var Ge=ie.props,tt=Ge.eventKey,vt=Ge.onItemHover,Tt=Ge.onTitleMouseEnter;vt({key:tt,hover:!0}),Tt({key:tt,domEvent:Ue})},ie.onTitleMouseLeave=function(Ue){var Ge=ie.props,tt=Ge.parentMenu,vt=Ge.eventKey,Tt=Ge.onItemHover,Nt=Ge.onTitleMouseLeave;tt.subMenuInstance=Object(g.a)(ie),Tt({key:vt,hover:!1}),Nt({key:vt,domEvent:Ue})},ie.onTitleClick=function(Ue){var Ge=Object(g.a)(ie),tt=Ge.props;if(tt.onTitleClick({key:tt.eventKey,domEvent:Ue}),tt.triggerSubMenuAction==="hover")return;ie.triggerOpenChange(!ie.getVisible(),"click"),yn(tt.store,ie.props.eventKey,!1)},ie.onSubMenuClick=function(Ue){typeof ie.props.onClick=="function"&&ie.props.onClick(ie.addKeyPath(Ue))},ie.onSelect=function(Ue){ie.props.onSelect(Ue)},ie.onDeselect=function(Ue){ie.props.onDeselect(Ue)},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(Ue){ie.menuInstance=Ue},ie.addKeyPath=function(Ue){return Object(z.a)(Object(z.a)({},Ue),{},{keyPath:(Ue.keyPath||[]).concat(ie.props.eventKey)})},ie.triggerOpenChange=function(Ue,Ge){var tt=ie.props.eventKey,vt=function(){ie.onOpenChange({key:tt,item:Object(g.a)(ie),trigger:Ge,open:Ue})};Ge==="mouseenter"?ie.mouseenterTimeout=setTimeout(function(){vt()},0):vt()},ie.isChildrenSelected=function(){var Ue={find:!1};return nt(ie.props.children,ie.props.selectedKeys,Ue),Ue.find},ie.isInlineMode=function(){return ie.getMode()==="inline"},ie.adjustWidth=function(){if(!ie.subMenuTitle||!ie.menuInstance)return;var Ue=lt.findDOMNode(ie.menuInstance);if(Ue.offsetWidth>=ie.subMenuTitle.offsetWidth)return;Ue.style.minWidth="".concat(ie.subMenuTitle.offsetWidth,"px")},ie.saveSubMenuTitle=function(Ue){ie.subMenuTitle=Ue},ie.getBaseProps=function(){var Ue=Object(g.a)(ie),Ge=Ue.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[We(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(Ue,Ge){var tt=Object(g.a)(ie),vt=tt.haveRendered,Tt=ie.props,Nt=Tt.motion,Rn=Tt.rootPrefixCls,Yn=Object(z.a)(Object(z.a)({},Nt),{},{leavedClassName:"".concat(Rn,"-hidden"),removeOnLeave:!1,motionAppear:vt||!Ge||Ue!=="inline"});return Yn};var ve=Ce.store,le=Ce.eventKey,Se=ve.getState(),_e=Se.defaultActiveFirst;ie.isRootMenu=!1;var je=!1;return _e&&(je=_e[le]),yn(ve,le,je),ie.state={mode:Ce.mode,isOpen:Ce.isOpen},ie}return Object(R.a)(Fe,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ie=this,ve=this.props,le=ve.mode,Se=ve.parentMenu,_e=ve.manualRef,je=ve.isOpen,Ue=function(){ie.setState({mode:le,isOpen:je})},Ge=je!==this.state.isOpen,tt=le!==this.state.mode;if((tt||Ge)&&(ot.a.cancel(this.updateStateRaf),tt?this.updateStateRaf=Object(ot.a)(Ue):Ue()),_e&&_e(this),le!=="horizontal"||!(Se==null?void 0:Se.isRootMenu)||!je)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),ot.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,Se=ve.visible,_e=ve.forceSubMenuRender,je=ve.direction,Ue=this.getMotion(le,Se);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Se||_e,!this.haveOpened)return P.createElement("div",null);var Ge=G()("".concat(ve.prefixCls,"-sub"),Object(te.a)({},"".concat(ve.prefixCls,"-rtl"),je==="rtl"));return this.isInlineMode()?P.createElement(ne,Object(S.a)({visible:ve.visible,forceRender:_e},Ue),function(tt){var vt=tt.className,Tt=tt.style,Nt=G()(Ge,vt);return ie.renderPopupMenu(Nt,Tt)}):this.renderPopupMenu(Ge)}},{key:"render",value:function(){var ie,ve,le,Se=Object(z.a)({},this.props),_e=this.getVisible(),je=this.getPrefixCls(),Ue=this.isInlineMode(),Ge=this.getMode(),tt=G()(je,"".concat(je,"-").concat(Ge),(ie={},Object(te.a)(ie,Se.className,!!Se.className),Object(te.a)(ie,this.getOpenClassName(),_e),Object(te.a)(ie,this.getActiveClassName(),Se.active||_e&&!Ue),Object(te.a)(ie,this.getDisabledClassName(),Se.disabled),Object(te.a)(ie,this.getSelectedClassName(),this.isChildrenSelected()),ie));this.internalMenuId||(Se.eventKey?this.internalMenuId="".concat(Se.eventKey,"$Menu"):(zt+=1,this.internalMenuId="$__$".concat(zt,"$Menu")));var vt={},Tt={},Nt={};Se.disabled||(vt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Tt={onClick:this.onTitleClick},Nt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Rn={},Yn=Se.direction,Bn=Yn==="rtl";Ue&&(Bn?Rn.paddingRight=Se.inlineIndent*Se.level:Rn.paddingLeft=Se.inlineIndent*Se.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(je,"-title"),role:"button"},Nt,Tt,{"aria-expanded":_e},zn,{"aria-haspopup":"true",title:typeof Se.title=="string"?Se.title:void 0}),Se.title,Xn||P.createElement("i",{className:"".concat(je,"-arrow")})),Fn=this.renderChildren(),Jn=((ve=Se.parentMenu)===null||ve===void 0?void 0:ve.isRootMenu)?Se.parentMenu.props.getPopupContainer:function(xr){return xr.parentNode},er=jt[Ge],jr=Se.popupOffset?{offset:Se.popupOffset}:{},tr=G()((le={},Object(te.a)(le,Se.popupClassName,Se.popupClassName&&!Ue),Object(te.a)(le,"".concat(je,"-rtl"),Bn),le)),_n=Se.disabled,vn=Se.triggerSubMenuAction,Wn=Se.subMenuOpenDelay,cr=Se.forceSubMenuRender,an=Se.subMenuCloseDelay,dr=Se.builtinPlacements;de.forEach(function(xr){return delete Se[xr]}),delete Se.onClick;var Br=Bn?Object(z.a)(Object(z.a)({},lr),dr):Object(z.a)(Object(z.a)({},An),dr);delete Se.direction;var ir=this.getBaseProps(),Ar=Ue?null:this.getMotion(ir.mode,ir.visible);return P.createElement("li",Object(S.a)({},Se,vt,{className:tt,role:"menuitem"}),P.createElement(Nn,{prefixCls:je,popupClassName:G()("".concat(je,"-popup"),tr),getPopupContainer:Jn,builtinPlacements:Br,popupPlacement:er,popupVisible:Ue?!1:_e,popupAlign:jr,popup:Ue?null:Fn,action:_n||Ue?[]:[vn],mouseEnterDelay:Wn,mouseLeaveDelay:an,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:cr,popupMotion:Ar},Vn),Ue?Fn:null)}}]),Fe}(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(be,Le){var Fe=be.openKeys,Ce=be.activeKey,ie=be.selectedKeys,ve=Le.eventKey,le=Le.subMenuKey;return{isOpen:Fe.indexOf(ve)>-1,active:Ce[le]===ve,selectedKeys:ie}})(Ct);Mt.isSubMenu=!0;var Dt=Mt,Me="menuitem-overflowed",Vt=.5,Tn=function(be){Object(b.a)(Fe,be);var Le=Object(f.a)(Fe);function Fe(){var Ce;return Object(O.a)(this,Fe),Ce=Le.apply(this,arguments),Ce.resizeObserver=null,Ce.mutationObserver=null,Ce.originalTotalWidth=0,Ce.overflowedItems=[],Ce.menuItemSizes=[],Ce.cancelFrameId=null,Ce.state={lastVisibleIndex:void 0},Ce.childRef=P.createRef(),Ce.getMenuItemNodes=function(){var ie=Ce.props.prefixCls,ve=Ce.childRef.current;return ve?[].slice.call(ve.children).filter(function(le){return le.className.split(" ").indexOf("".concat(ie,"-overflowed-submenu"))<0}):[]},Ce.getOverflowedSubMenuItem=function(ie,ve,le){var Se=Ce.props,_e=Se.overflowedIndicator,je=Se.level,Ue=Se.mode,Ge=Se.prefixCls,tt=Se.theme;if(je!==1||Ue!=="horizontal")return null;var vt=Ce.props.children[0],Tt=vt.props,Nt=Tt.children,Rn=Tt.title,Yn=Tt.style,Bn=Object(N.a)(Tt,["children","title","style"]),zn=Object(z.a)({},Yn),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)},Ce.setChildrenWidthAndResize=function(){if(Ce.props.mode!=="horizontal")return;var ie=Ce.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 Se=Ce.getMenuItemNodes(),_e=Se.filter(function(je){return je.className.split(" ").indexOf(Me)>=0});_e.forEach(function(je){Ne(je,"display","inline-block")}),Ce.menuItemSizes=Se.map(function(je){return De(je,!0)}),_e.forEach(function(je){Ne(je,"display","none")}),Ce.overflowedIndicatorWidth=De(ie.children[ie.children.length-1],!0),Ce.originalTotalWidth=Ce.menuItemSizes.reduce(function(je,Ue){return je+Ue},0),Ce.handleResize(),Ne(le,"display","none")},Ce.handleResize=function(){if(Ce.props.mode!=="horizontal")return;var ie=Ce.childRef.current;if(!ie)return;var ve=De(ie);Ce.overflowedItems=[];var le=0,Se;Ce.originalTotalWidth>ve+Vt&&(Se=-1,Ce.menuItemSizes.forEach(function(_e){le+=_e,le+Ce.overflowedIndicatorWidth<=ve&&(Se+=1)})),Ce.setState({lastVisibleIndex:Se})},Ce}return Object(R.a)(Fe,[{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 at.default(function(le){le.forEach(function(){var Se=ie.cancelFrameId;cancelAnimationFrame(Se),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(Se,_e,je){var Ue=_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&&(je>le&&(Ue=P.cloneElement(_e,{style:{display:"none"},eventKey:"".concat(_e.props.eventKey,"-hidden"),className:"".concat(Me)})),je===le+1&&(ve.overflowedItems=ie.slice(le+1).map(function(vt){return P.cloneElement(vt,{key:vt.props.eventKey,mode:"vertical-left"})}),Ge=ve.getOverflowedSubMenuItem(_e.props.eventKey,ve.overflowedItems)));var tt=[].concat(Object(I.a)(Se),[Ge,Ue]);return je===ie.length-1&&tt.push(ve.getOverflowedSubMenuItem(_e.props.eventKey,[],!0)),tt}return[].concat(Object(I.a)(Se),[Ue])},[])}},{key:"render",value:function(){var ie=this.props,ve=ie.visible,le=ie.prefixCls,Se=ie.overflowedIndicator,_e=ie.mode,je=ie.level,Ue=ie.tag,Ge=ie.children,tt=ie.theme,vt=Object(N.a)(ie,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Tt=Ue;return P.createElement(Tt,Object(S.a)({ref:this.childRef},vt),this.renderChildren(Ge))}}]),Fe}(P.Component);Tn.defaultProps={tag:"div",className:""};var mr=Tn;function On(be){return be.length?be.every(function(Le){return!!Le.props.disabled}):!0}function ii(be,Le,Fe){var Ce=be.getState();be.setState({activeKey:Object(z.a)(Object(z.a)({},Ce.activeKey),{},Object(te.a)({},Le,Fe))})}function ai(be){return be.eventKey||"0-menu-"}function Kr(be,Le){var Fe=Le,Ce=be.children,ie=be.eventKey;if(Fe){var ve;if(Ke(Ce,function(le,Se){le&&le.props&&!le.props.disabled&&Fe===Xe(le,ie,Se)&&(ve=!0)}),ve)return Fe}return Fe=null,be.defaultActiveFirst&&Ke(Ce,function(le,Se){!Fe&&le&&!le.props.disabled&&(Fe=Xe(le,ie,Se))}),Fe}function jn(be){if(!be)return;var Le=this.instanceArray.indexOf(be);Le!==-1?this.instanceArray[Le]=be:this.instanceArray.push(be)}var Bt=function(be){Object(b.a)(Fe,be);var Le=Object(f.a)(Fe);function Fe(Ce){var ie;return Object(O.a)(this,Fe),ie=Le.call(this,Ce),ie.onKeyDown=function(ve,le){var Se=ve.keyCode,_e;if(ie.getFlatInstanceArray().forEach(function(Ue){Ue&&Ue.props.active&&Ue.onKeyDown&&(_e=Ue.onKeyDown(ve))}),_e)return 1;var je=null;return(Se===h.a.UP||Se===h.a.DOWN)&&(je=ie.step(Se===h.a.UP?-1:1)),je?(ve.preventDefault(),ii(ie.props.store,ai(ie.props),je.props.eventKey),typeof le=="function"&&le(je),1):void 0},ie.onItemHover=function(ve){var le=ve.key,Se=ve.hover;ii(ie.props.store,ai(ie.props),Se?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(),Se=ie.props.store.getState().activeKey[ai(ie.props)],_e=le.length;if(!_e)return null;ve<0&&(le=le.concat().reverse());var je=-1;if(le.every(function(vt,Tt){return vt&&vt.props.eventKey===Se?(je=Tt,!1):!0}),!ie.props.defaultActiveFirst&&je!==-1&&On(le.slice(je,_e-1)))return;var Ue=(je+1)%_e,Ge=Ue;do{var tt=le[Ge];if(!tt||tt.props.disabled)Ge=(Ge+1)%_e;else return tt}while(Ge!==Ue);return null},ie.renderCommonMenuItem=function(ve,le,Se){var _e=ie.props.store.getState(),je=Object(g.a)(ie),Ue=je.props,Ge=Xe(ve,Ue.eventKey,le),tt=ve.props;if(!tt||typeof ve.type=="string")return ve;var vt=Ge===_e.activeKey,Tt=Object(z.a)(Object(z.a)({mode:tt.mode||Ue.mode,level:Ue.level,inlineIndent:Ue.inlineIndent,renderMenuItem:ie.renderMenuItem,rootPrefixCls:Ue.prefixCls,index:le,parentMenu:Ue.parentMenu,manualRef:tt.disabled?void 0:Object(E.a)(ve.ref,jn.bind(Object(g.a)(ie))),eventKey:Ge,active:!tt.disabled&&vt,multiple:Ue.multiple,onClick:function(Rn){(tt.onClick||He)(Rn),ie.onClick(Rn)},onItemHover:ie.onItemHover,motion:Ue.motion,subMenuOpenDelay:Ue.subMenuOpenDelay,subMenuCloseDelay:Ue.subMenuCloseDelay,forceSubMenuRender:Ue.forceSubMenuRender,onOpenChange:ie.onOpenChange,onDeselect:ie.onDeselect,onSelect:ie.onSelect,builtinPlacements:Ue.builtinPlacements,itemIcon:tt.itemIcon||ie.props.itemIcon,expandIcon:tt.expandIcon||ie.props.expandIcon},Se),{},{direction:Ue.direction});return(Ue.mode==="inline"||Be())&&(Tt.triggerSubMenuAction="click"),P.cloneElement(ve,Object(z.a)(Object(z.a)({},Tt),{},{key:Ge||le}))},ie.renderMenuItem=function(ve,le,Se){if(!ve)return null;var _e=ie.props.store.getState(),je={openKeys:_e.openKeys,selectedKeys:_e.selectedKeys,triggerSubMenuAction:ie.props.triggerSubMenuAction,subMenuKey:Se};return ie.renderCommonMenuItem(ve,le,je)},Ce.store.setState({activeKey:Object(z.a)(Object(z.a)({},Ce.store.getState().activeKey),{},Object(te.a)({},Ce.eventKey,Kr(Ce,Ce.activeKey)))}),ie.instanceArray=[],ie}return Object(R.a)(Fe,[{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)],Se=Kr(ve,le);if(Se!==le)ii(ve.store,ai(ve),Se);else if("activeKey"in ie){var _e=Kr(ie,ie.activeKey);Se!==_e&&ii(ve.store,ai(ve),Se)}}},{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)),Se={className:le,role:ve.role||"menu"};ve.id&&(Se.id=ve.id),ve.focusable&&(Se.tabIndex=0,Se.onKeyDown=this.onKeyDown);var _e=ve.prefixCls,je=ve.eventKey,Ue=ve.visible,Ge=ve.level,tt=ve.mode,vt=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:Ue,overflowedIndicator:vt},Se),Object(H.a)(ve.children).map(function(Nt,Rn){return ie.renderMenuItem(Nt,Rn,je||"0-menu-")}))}}]),Fe}(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,Qn=U("Kwbf");function oi(be,Le,Fe){var Ce=be.prefixCls,ie=be.motion,ve=be.defaultMotions,le=ve===void 0?{}:ve,Se=be.openAnimation,_e=be.openTransitionName,je=Le.switchingModeFromInline;if(ie)return ie;if(Object(W.a)(Se)==="object"&&Se)Object(Qn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Se=="string")return{motionName:"".concat(Ce,"-open-").concat(Se)};if(_e)return{motionName:_e};var Ue=le[Fe];return Ue||(je?null:le.other)}var Xt=function(be){Object(b.a)(Fe,be);var Le=Object(f.a)(Fe);function Fe(Ce){var ie;Object(O.a)(this,Fe),ie=Le.call(this,Ce),ie.onSelect=function(Se){var _e=Object(g.a)(ie),je=_e.props;if(je.selectable){var Ue=ie.store.getState(),Ge=Ue.selectedKeys,tt=Se.key;je.multiple?Ge=Ge.concat([tt]):Ge=[tt],"selectedKeys"in je||ie.store.setState({selectedKeys:Ge}),je.onSelect(Object(z.a)(Object(z.a)({},Se),{},{selectedKeys:Ge}))}},ie.onClick=function(Se){var _e=ie.getRealMenuMode(),je=Object(g.a)(ie),Ue=je.store,Ge=je.props.onOpenChange;_e!=="inline"&&!("openKeys"in ie.props)&&(Ue.setState({openKeys:[]}),Ge([])),ie.props.onClick(Se)},ie.onKeyDown=function(Se,_e){ie.innerMenu.getWrappedInstance().onKeyDown(Se,_e)},ie.onOpenChange=function(Se){var _e=Object(g.a)(ie),je=_e.props,Ue=ie.store.getState().openKeys.concat(),Ge=!1,tt=function(Tt){var Nt=!1;if(Tt.open)Nt=Ue.indexOf(Tt.key)===-1,Nt&&Ue.push(Tt.key);else{var Rn=Ue.indexOf(Tt.key);Nt=Rn!==-1,Nt&&Ue.splice(Rn,1)}Ge=Ge||Nt};Array.isArray(Se)?Se.forEach(tt):tt(Se),Ge&&("openKeys"in ie.props||ie.store.setState({openKeys:Ue}),je.onOpenChange(Ue))},ie.onDeselect=function(Se){var _e=Object(g.a)(ie),je=_e.props;if(je.selectable){var Ue=ie.store.getState().selectedKeys.concat(),Ge=Se.key,tt=Ue.indexOf(Ge);tt!==-1&&Ue.splice(tt,1),"selectedKeys"in je||ie.store.setState({selectedKeys:Ue}),je.onDeselect(Object(z.a)(Object(z.a)({},Se),{},{selectedKeys:Ue}))}},ie.onMouseEnter=function(Se){ie.restoreModeVerticalFromInline();var _e=ie.props.onMouseEnter;_e&&_e(Se)},ie.onTransitionEnd=function(Se){var _e=Se.propertyName==="width"&&Se.target===Se.currentTarget,je=Se.target.className,Ue=Object.prototype.toString.call(je)==="[object SVGAnimatedString]"?je.animVal:je,Ge=Se.propertyName==="font-size"&&Ue.indexOf("anticon")>=0;(_e||Ge)&&ie.restoreModeVerticalFromInline()},ie.setInnerMenu=function(Se){ie.innerMenu=Se},ie.isRootMenu=!0;var ve=Ce.defaultSelectedKeys,le=Ce.defaultOpenKeys;return"selectedKeys"in Ce&&(ve=Ce.selectedKeys||[]),"openKeys"in Ce&&(le=Ce.openKeys||[]),ie.store=Object(d.c)({selectedKeys:ve,openKeys:le,activeKey:{"0-menu-":Kr(Ce,Ce.activeKey)}}),ie.state={switchingModeFromInline:!1,prevProps:Ce,inlineOpenKeys:[],store:ie.store},ie}return Object(R.a)(Fe,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ie){var ve=this.props,le=ve.siderCollapsed,Se=ve.inlineCollapsed,_e=ve.onOpenChange;(!ie.inlineCollapsed&&Se||!ie.siderCollapsed&&le)&&_e([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ie=this.props.collapsedWidth,ve=this.store,le=this.prevOpenKeys,Se=this.getInlineCollapsed()&&(ie===0||ie==="0"||ie==="0px");Se?(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,Se=ve.store,_e=Se.getState(),je={},Ue={prevProps:ie};return le.mode==="inline"&&ie.mode!=="inline"&&(Ue.switchingModeFromInline=!0),"openKeys"in ie?je.openKeys=ie.openKeys||[]:((ie.inlineCollapsed&&!le.inlineCollapsed||ie.siderCollapsed&&!le.siderCollapsed)&&(Ue.switchingModeFromInline=!0,Ue.inlineOpenKeys=_e.openKeys,je.openKeys=[]),(!ie.inlineCollapsed&&le.inlineCollapsed||!ie.siderCollapsed&&le.siderCollapsed)&&(je.openKeys=ve.inlineOpenKeys,Ue.inlineOpenKeys=[])),Object.keys(je).length&&Se.setState(je),Ue}}]),Fe}(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(be){Object(b.a)(Fe,be);var Le=Object(f.a)(Fe);function Fe(){var Ce;return Object(O.a)(this,Fe),Ce=Le.apply(this,arguments),Ce.onKeyDown=function(ie){var ve=ie.keyCode;return ve===h.a.ENTER?(Ce.onClick(ie),!0):void 0},Ce.onMouseLeave=function(ie){var ve=Ce.props,le=ve.eventKey,Se=ve.onItemHover,_e=ve.onMouseLeave;Se({key:le,hover:!1}),_e({key:le,domEvent:ie})},Ce.onMouseEnter=function(ie){var ve=Ce.props,le=ve.eventKey,Se=ve.onItemHover,_e=ve.onMouseEnter;Se({key:le,hover:!0}),_e({key:le,domEvent:ie})},Ce.onClick=function(ie){var ve=Ce.props,le=ve.eventKey,Se=ve.multiple,_e=ve.onClick,je=ve.onSelect,Ue=ve.onDeselect,Ge=ve.isSelected,tt={key:le,keyPath:[le],item:Object(g.a)(Ce),domEvent:ie};_e(tt),Se?Ge?Ue(tt):je(tt):Ge||je(tt)},Ce.saveNode=function(ie){Ce.node=ie},Ce}return Object(R.a)(Fe,[{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)),Se=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"?Se=Object(z.a)(Object(z.a)({},Se),{},{role:"option","aria-selected":ve.isSelected}):(ve.role===null||ve.role==="none")&&(Se.role="none");var _e={onClick:ve.disabled?null:this.onClick,onMouseLeave:ve.disabled?null:this.onMouseLeave,onMouseEnter:ve.disabled?null:this.onMouseEnter},je=Object(z.a)({},ve.style);ve.mode==="inline"&&(ve.direction==="rtl"?je.paddingRight=ve.inlineIndent*ve.level:je.paddingLeft=ve.inlineIndent*ve.level),de.forEach(function(Ge){return delete ve[Ge]}),delete ve.direction;var Ue=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ue=P.createElement(this.props.itemIcon,this.props)),P.createElement("li",Object(S.a)({},Object(C.a)(ve,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Se,_e,{style:je,ref:this.saveNode}),ve.children,Ue)}}]),Fe}(P.Component);Yt.isMenuItem=!0,Yt.defaultProps={onSelect:He,onMouseEnter:He,onMouseLeave:He,manualRef:He};var pn=Object(d.b)(function(be,Le){var Fe=be.activeKey,Ce=be.selectedKeys,ie=Le.eventKey,ve=Le.subMenuKey;return{active:Fe[ve]===ie,isSelected:Array.isArray(Ce)?Ce.indexOf(ie)!==-1:Ce===ie}})(Yt),Gn=pn,Mn=function(be){Object(b.a)(Fe,be);var Le=Object(f.a)(Fe);function Fe(){var Ce;return Object(O.a)(this,Fe),Ce=Le.apply(this,arguments),Ce.renderInnerMenuItem=function(ie){var ve=Ce.props,le=ve.renderMenuItem,Se=ve.index;return le(ie,Se,Ce.props.subMenuKey)},Ce}return Object(R.a)(Fe,[{key:"render",value:function(){var ie=Object(S.a)({},this.props),ve=ie.className,le=ve===void 0?"":ve,Se=ie.rootPrefixCls,_e="".concat(Se,"-item-group-title"),je="".concat(Se,"-item-group-list"),Ue=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(vt){return vt.stopPropagation()},className:"".concat(le," ").concat(Se,"-item-group")}),P.createElement("div",{className:_e,title:typeof Ue=="string"?Ue:void 0},Ue),P.createElement("ul",{className:je},P.Children.map(Ge,this.renderInnerMenuItem)))}}]),Fe}(P.Component);Mn.isMenuItemGroup=!0,Mn.defaultProps={disabled:!0};var qn=Mn,gr=function(Le){var Fe=Le.className,Ce=Le.rootPrefixCls,ie=Le.style;return P.createElement("li",{className:"".concat(Fe," ").concat(Ce,"-item-divider"),style:ie})};gr.defaultProps={disabled:!0,className:"",style:{}};var wi=gr,Zn=Jt,Qi=U("eDIo");function vr(be,Le){var Fe=be.prefixCls,Ce=be.editable,ie=be.locale,ve=be.style;return!Ce||Ce.showAdd===!1?null:P.createElement("button",{ref:Le,type:"button",className:"".concat(Fe,"-nav-add"),style:ve,"aria-label":(ie==null?void 0:ie.addAriaLabel)||"Add tab",onClick:function(Se){Ce.onEdit("add",{event:Se})}},Ce.addIcon||"+")}var fi=P.forwardRef(vr);function si(be,Le){var Fe=be.prefixCls,Ce=be.id,ie=be.tabs,ve=be.locale,le=be.mobile,Se=be.moreIcon,_e=Se===void 0?"More":Se,je=be.moreTransitionName,Ue=be.style,Ge=be.className,tt=be.editable,vt=be.tabBarGutter,Tt=be.rtl,Nt=be.onTabClick,Rn=Object(P.useState)(!1),Yn=Object(Y.a)(Rn,2),Bn=Yn[0],zn=Yn[1],Xn=Object(P.useState)(null),Vn=Object(Y.a)(Xn,2),Fn=Vn[0],Jn=Vn[1],er="".concat(Ce,"-more-popup"),jr="".concat(Fe,"-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":Ce&&"".concat(Ce,"-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){[h.a.DOWN,h.a.SPACE,h.a.ENTER].includes(Ar)&&(zn(!0),ir.preventDefault());return}switch(Ar){case h.a.UP:Wn(-1),ir.preventDefault();break;case h.a.DOWN:Wn(1),ir.preventDefault();break;case h.a.ESC:zn(!1);break;case h.a.SPACE:case h.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",vt);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:je,onVisibleChange:zn,overlayClassName:dr,mouseEnterDelay:.1,mouseLeaveDelay:.1},P.createElement("button",{type:"button",className:"".concat(Fe,"-nav-more"),style:an,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":er,id:"".concat(Ce,"-more"),"aria-expanded":Bn,onKeyDown:cr},_e));return P.createElement("div",{className:G()("".concat(Fe,"-nav-operations"),Ge),style:Ue,ref:Le},Br,P.createElement(fi,{prefixCls:Fe,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 be=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(be)||/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(be.substr(0,4)))}function va(be,Le){var Fe=Object(P.useState)(),Ce=Object(Y.a)(Fe,2),ie=Ce[0],ve=Ce[1],le=Object(P.useState)(0),Se=Object(Y.a)(le,2),_e=Se[0],je=Se[1],Ue=Object(P.useState)(0),Ge=Object(Y.a)(Ue,2),tt=Ge[0],vt=Ge[1],Tt=Object(P.useState)(),Nt=Object(Y.a)(Tt,2),Rn=Nt[0],Yn=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();je(Br),vt(Br-_e),Yn({x:an,y:dr})}function Vn(){if(!ie)return;if(ve(null),Yn(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}),be.current.addEventListener("touchstart",_n,{passive:!1}),be.current.addEventListener("wheel",cr),function(){document.removeEventListener("touchmove",vn),document.removeEventListener("touchend",Wn)}},[])}function ya(){var be=Object(P.useRef)(new Map);function Le(Ce){return be.current.has(Ce)||be.current.set(Ce,P.createRef()),be.current.get(Ce)}function Fe(Ce){be.current.delete(Ce)}return[Le,Fe]}function $a(be,Le){var Fe=P.useRef(be),Ce=P.useState({}),ie=Object(Y.a)(Ce,2),ve=ie[1];function le(Se){var _e=typeof Se=="function"?Se(Fe.current):Se;_e!==Fe.current&&Le(_e,Fe.current),Fe.current=_e,ve({})}return[Fe.current,le]}var co=function(Le){var Fe=Le.position,Ce=Le.prefixCls,ie=Le.extra;if(!ie)return null;var ve,le=ie;return Fe==="right"&&(ve=le.right||!le.left&&le||null),Fe==="left"&&(ve=le.left||null),ve?P.createElement("div",{className:"".concat(Ce,"-extra-content")},ve):null};function Ma(be,Le){var Fe,Ce=P.useContext(ka),ie=Ce.prefixCls,ve=Ce.tabs,le=be.className,Se=be.style,_e=be.id,je=be.animated,Ue=be.activeKey,Ge=be.rtl,tt=be.extra,vt=be.editable,Tt=be.locale,Nt=be.tabPosition,Rn=be.tabBarGutter,Yn=be.children,Bn=be.onTabClick,zn=be.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],rt=li[1];return ci=rt,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]:Ue,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)({},be),{},{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:vt,active:or===Ue,tabPosition:Nt,tabBarGutter:Rn,renderWrapper:Yn,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,rt=((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,it=((sa=Fn.current)===null||sa===void 0?void 0:sa.offsetWidth)||0,ct=((ea=Fn.current)===null||ea===void 0?void 0:ea.offsetHeight)||0;Hr(Da),Ea(rt),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:it)),Xi(St-(wt?0:ct)),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(Ue),ao=Object(P.useRef)();function Ka(){p.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=p()(function(){Ha(_r)}),Ka},[ki,vn,Ge]),Object(P.useEffect)(function(){qi()},[Ue,ki,Ta,vn]),Object(P.useEffect)(function(){io()},[Ge,Rn,Ue,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:Se,onKeyDown:function(){Wa()}},P.createElement(co,{position:"left",extra:tt,prefixCls:ie}),P.createElement(_.a,{onResize:io},P.createElement("div",{className:G()(ma,(Fe={},Object(te.a)(Fe,"".concat(ma,"-ping-left"),Ga),Object(te.a)(Fe,"".concat(ma,"-ping-right"),Oa),Object(te.a)(Fe,"".concat(ma,"-ping-top"),yo),Object(te.a)(Fe,"".concat(ma,"-ping-bottom"),za),Fe)),ref:Xn},P.createElement(_.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:vt,style:{visibility:vo?"hidden":null}}),P.createElement("div",{className:G()("".concat(ie,"-ink-bar"),Object(te.a)({},"".concat(ie,"-ink-bar-animated"),je.inkBar)),style:Aa}))))),P.createElement(Ni,Object.assign({},be,{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(be){var Le=be.id,Fe=be.activeKey,Ce=be.animated,ie=be.tabPosition,ve=be.rtl,le=be.destroyInactiveTabPane,Se=P.useContext(ka),_e=Se.prefixCls,je=Se.tabs,Ue=Ce.tabPane,Ge=je.findIndex(function(tt){return tt.key===Fe});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"),Ue)),style:Ge&&Ue?Object(te.a)({},ve?"marginRight":"marginLeft","-".concat(Ge,"00%")):null},je.map(function(tt){return P.cloneElement(tt.node,{key:tt.key,prefixCls:_e,tabKey:tt.key,id:Le,animated:Ue,active:tt.key===Fe,destroyInactiveTabPane:le})})))}function fo(be){var Le=be.prefixCls,Fe=be.forceRender,Ce=be.className,ie=be.style,ve=be.id,le=be.active,Se=be.animated,_e=be.destroyInactiveTabPane,je=be.tabKey,Ue=be.children,Ge=P.useState(Fe),tt=Object(Y.a)(Ge,2),vt=tt[0],Tt=tt[1];P.useEffect(function(){le?Tt(!0):_e&&Tt(!1)},[le,_e]);var Nt={};return le||(Se?(Nt.visibility="hidden",Nt.height=0,Nt.overflowY="hidden"):Nt.display="none"),P.createElement("div",{id:ve&&"".concat(ve,"-panel-").concat(je),role:"tabpanel",tabIndex:le?0:-1,"aria-labelledby":ve&&"".concat(ve,"-tab-").concat(je),"aria-hidden":!le,style:Object(z.a)(Object(z.a)({},Nt),ie),className:G()("".concat(Le,"-tabpane"),le&&"".concat(Le,"-tabpane-active"),Ce)},(le||vt||Fe)&&Ue)}var Na=0;function po(be){return Object(H.a)(be).map(function(Le){if(P.isValidElement(Le)){var Fe=Le.key!==void 0?String(Le.key):void 0;return Object(z.a)(Object(z.a)({key:Fe},Le.props),{},{node:Le})}return null}).filter(function(Le){return Le})}function Qa(be,Le){var Fe,Ce=be.id,ie=be.prefixCls,ve=ie===void 0?"rc-tabs":ie,le=be.className,Se=be.children,_e=be.direction,je=be.activeKey,Ue=be.defaultActiveKey,Ge=be.editable,tt=be.animated,vt=be.tabPosition,Tt=vt===void 0?"top":vt,Nt=be.tabBarGutter,Rn=be.tabBarStyle,Yn=be.tabBarExtraContent,Bn=be.locale,zn=be.moreIcon,Xn=be.moreTransitionName,Vn=be.destroyInactiveTabPane,Fn=be.renderTabBar,Jn=be.onChange,er=be.onTabClick,jr=be.onTabScroll,tr=Object(N.a)(be,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),_n=po(Se),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:je,defaultValue:Ue}),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:Ce}),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(){Ce||(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:Yn,style:Rn,panes:Se});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:Ce,className:G()(ve,"".concat(ve,"-").concat(wn),(Fe={},Object(te.a)(Fe,"".concat(ve,"-mobile"),dr),Object(te.a)(Fe,"".concat(ve,"-editable"),Ge),Object(te.a)(Fe,"".concat(ve,"-rtl"),vn),Fe),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(ut,ge,U){},lZu9:function(ut,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 K=te.getMode(Y,m);return K.name=="null"?null:K}N.highlightFormatting===void 0&&(N.highlightFormatting=!1),N.maxBlockquoteDepth===void 0&&(N.maxBlockquoteDepth=0),N.taskLists===void 0&&(N.taskLists=!1),N.strikethrough===void 0&&(N.strikethrough=!1),N.emoji===void 0&&(N.emoji=!1),N.fencedCodeBlockHighlighting===void 0&&(N.fencedCodeBlockHighlighting=!0),N.fencedCodeBlockDefaultMode===void 0&&(N.fencedCodeBlockDefaultMode="text/plain"),N.xml===void 0&&(N.xml=!0),N.tokenTypeOverrides===void 0&&(N.tokenTypeOverrides={});var G={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var H in G)G.hasOwnProperty(H)&&N.tokenTypeOverrides[H]&&(G[H]=N.tokenTypeOverrides[H]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,x=/^\[(x| )\](?=\s)/i,p=N.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,_=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,h=/^\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,K){return v.f=v.inline=K,K(m,v)}function i(m,v,K){return v.f=v.block=K,K(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==O){var v=P;if(!v){var K=te.innerMode(z,m.htmlState);v=K.mode.name=="xml"&&K.state.tagStart===null&&!K.state.context&&K.state.tokenize.isInText}v&&(m.f=f,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 K=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,Ee=(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(K&&v.indentation<=pe&&(se=m.match(p))&&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=K?1:v.quote+1,N.highlightFormatting&&(v.formatting="quote"),m.eatSpace(),g(v);if(!Ee&&!v.setext&&K&&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(x,!1)&&(v.taskList=!0),v.f=v.inline,N.highlightFormatting&&(v.formatting=["list","list-"+ae]),g(v)}else{if(K&&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=R,N.highlightFormatting&&(v.formatting="code-block"),v.code=-1,g(v);if(v.setext||(!fe||!ye)&&!v.quote&&v.list===!1&&!v.code&&!Ee&&!h.test(m.string)&&(se=m.lookAhead(1))&&(se=se.match(_)))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(Ee)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 O(m,v){var K=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=f,v.block=S,v.htmlState=null)}return K}function R(m,v){var K=v.listStack[v.listStack.length-1]||0,X=v.indentation<K,q=K+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=f,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 K=0;K<m.formatting.length;K++)v.push(G.formatting+"-"+m.formatting[K]),m.formatting[K]==="header"&&v.push(G.formatting+"-"+m.formatting[K]+"-"+m.header),m.formatting[K]==="quote"&&(!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=m.quote?v.push(G.formatting+"-"+m.formatting[K]+"-"+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 b(m,v){return m.match(c,!0)?g(v):void 0}function f(m,v){var K=v.text(m,v);if(typeof K!="undefined")return K;if(v.list)return v.list=null,g(v);if(v.taskList){var X=m.match(x,!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 Ee=g(v),se=G.formatting+"-escape";return Ee?Ee+" "+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 Ee=g(v);return v.imageAltText=!1,v.image=!1,v.inline=v.f=C,Ee}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 Ee=g(v);return v.linkText=!1,v.inline=v.f=m.match(/\(.*?\)| ?\[.*?\]/,!1)?C:f,Ee}if(q==="<"&&m.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=d,N.highlightFormatting&&(v.formatting="link");var Ee=g(v);return Ee?Ee+=" ":Ee="",Ee+G.linkInline}if(q==="<"&&m.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=d,N.highlightFormatting&&(v.formatting="link");var Ee=g(v);return Ee?Ee+=" ":Ee="",Ee+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 Oe=m.string.substring(m.start,ae);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Oe)&&(v.md_inside=!0)}return m.backUp(1),v.htmlState=te.startState(z),i(m,v,O)}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()||" ",Xe=!/\s/.test(He)&&(!l.test(He)||/\s/.test(Ye)||l.test(Ye)),We=!/\s/.test(Ye)&&(!l.test(Ye)||/\s/.test(He)||l.test(He)),Ke=null,nt=null;if(ze%2&&(!v.em&&Xe&&(q==="*"||!We||l.test(Ye))?Ke=!0:v.em==q&&We&&(q==="*"||!Xe||l.test(He))&&(Ke=!1)),ze>1&&(!v.strong&&Xe&&(q==="*"||!We||l.test(Ye))?nt=!0:v.strong==q&&We&&(q==="*"||!Xe||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 K=m.next();if(K===">"){v.f=v.inline=f,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 K=m.next();return K==="("||K==="["?(v.f=v.inline=w(K==="("?")":"]"),N.highlightFormatting&&(v.formatting="link-string"),v.linkHref=!0,g(v)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(m){return function(v,K){var X=v.next();if(X===m){K.f=K.inline=f,N.highlightFormatting&&(K.formatting="link-string");var q=g(K);return K.linkHref=!1,q}return v.match(E[m]),K.linkHref=!0,g(K)}}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,f)}function W(m,v){if(m.match(/^\]:/,!0)){v.f=v.inline=T,N.highlightFormatting&&(v.formatting="link");var K=g(v);return v.linkText=!1,K}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=f,G.linkHref+" url")}var M={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:f,text:b,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!=O)){var K=m.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(v.indentation=K,v.indentationDiff=null,K>0)return null}}return v.f(m,v)},innerMode:function(m){return m.block==O?{state:m.htmlState,mode:z}:m.localState?{state:m.localState,mode:m.localMode}:{state:m,mode:M}},indent:function(m,v,K){return m.block==O&&z.indent?z.indent(m.htmlState,v,K):m.localState&&m.localMode.indent?m.localMode.indent(m.localState,v,K):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(ut,ge,U){"use strict";U.d(ge,"d",function(){return _}),U.d(ge,"b",function(){return c}),U.d(ge,"e",function(){return a}),U.d(ge,"c",function(){return h}),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 O}),U.d(ge,"k",function(){return R}),U.d(ge,"m",function(){return g}),U.d(ge,"i",function(){return b}),U.d(ge,"o",function(){return f}),U.d(ge,"t",function(){return d}),U.d(ge,"s",function(){return C}),U.d(ge,"p",function(){return E}),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"),H=U("9kvl"),n=U("1vsH"),I=U("m3rI"),x=function(){Object(H.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},p=function(){Object(H.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},_=function(){var M=Object(z.a)(F.a.mark(function m(v){var K;return F.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return x(),q.next=3,Object(G.t)(Object(N.a)({},v));case 3:if(K=q.sent,!(K.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:p();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 K;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(K=q.sent,!(K.status===0)){q.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),H.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_member_act_score")),q.next=13;break;case 8:if(!(K.status===-2)){q.next=12;break}return q.abrupt("return",K);case 12:K.status===-3&&(Object(H.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),H.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 K;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(K=q.sent,!(K.status===0)){q.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),H.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_total_score")),q.next=13;break;case 8:if(!(K.status===-2)){q.next=12;break}return q.abrupt("return",K);case 12:K.status===-3&&(Object(H.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),H.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)}}(),h=function(){var M=Object(z.a)(F.a.mark(function m(v){var K;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(K=q.sent,!(K.status===0)){q.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),H.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_total_exercise_and_other")),q.next=13;break;case 8:if(!(K.status===-2)){q.next=12;break}return q.abrupt("return",K);case 12:K.status===-3&&(Object(H.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),H.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 K;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(K=q.sent,!(K.status===0)){q.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),H.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_total_exercise_and_other")),q.next=13;break;case 8:if(!(K.status===-2)){q.next=12;break}return q.abrupt("return",K);case 12:K.status===-3&&(Object(H.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),H.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 K;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(K=q.sent,!(K.status===0)){q.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),H.d.push("/classrooms/".concat(v.coursesId,"/exportlist/course_total_homework")),q.next=13;break;case 8:if(!(K.status===-2)){q.next=12;break}return q.abrupt("return",K);case 12:K.status===-3&&(Object(H.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),H.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,K){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"),H.d.push("/classrooms/".concat(v.coursesId,"/exportlist/").concat(K))):X.status===-3&&(Object(H.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),H.d.push("/classrooms/".concat(v.coursesId,"/exportlist/").concat(K)));case 4:case"end":return re.stop()}},m)}));return function(v,K){return M.apply(this,arguments)}}(),i=function(){var M=Object(z.a)(F.a.mark(function m(v){var K;return F.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return x(),q.next=3,Object(G.w)(Object(N.a)({},v));case 3:if(K=q.sent,!(K.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:p();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 K;return F.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return x(),q.next=3,Object(G.A)(Object(N.a)({},v));case 3:if(K=q.sent,!(K.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:p();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)}}(),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/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)}}(),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/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)}}(),b=function(){var M=Object(z.a)(F.a.mark(function m(v){var K;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:K=q.sent,K.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),H.d.push("/classrooms/".concat(v.coursesId,"/exportlist/exercise_score"))):K.status===-3&&(Object(H.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),H.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)}}(),f=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)}}(),E=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(ut,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(ut,ge,U){ut.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(ut,ge,U){"use strict";U.d(ge,"b",function(){return G}),U.d(ge,"a",function(){return H});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"),H=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 h=n.handler;n.handler=function(l,...u){return Object(P.o)(u,a),h(l,...u)}}const{id:x}=n;let p=this._commands.get(x);p||(p=new z.a,this._commands.set(x,p));let _=p.unshift(n),c=Object(N.i)(()=>{_();const a=this._commands.get(x);(a==null?void 0:a.isEmpty())&&this._commands.delete(x)});return this._onDidRegisterCommand.fire(x),c}registerCommandAlias(n,I){return H.registerCommand(n,(x,...p)=>x.get(G).executeCommand(I,...p))}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 x=this.getCommand(I);x&&n.set(I,x)}return n}};H.registerCommand("noop",()=>{})},osHv:function(ut,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 H(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 x(l){for(;;){var u=l.text.indexOf(">",l.ch);if(u==-1){if(n(l))continue;return}if(!H(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 p(l){for(;;){var u=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(u==-1){if(I(l))continue;return}if(!H(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 _(l){for(;;){F.lastIndex=l.ch;var u=F.exec(l.text);if(!u){if(n(l))continue;return}if(!H(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(!H(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=_(l),D,A=l.line,S=l.ch-(i?i[0].length:0);if(!i||!(D=x(l)))return;if(D=="selfClose")continue;if(i[1]){for(var O=s.length-1;O>=0;--O)if(s[O]==i[2]){s.length=O;break}if(O<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 h(l,u){for(var s=[];;){var i=c(l);if(!i)return;if(i=="selfClose"){p(l);continue}var D=l.line,A=l.ch,S=p(l);if(!S)return;if(S[1])s.push(S[2]);else{for(var O=s.length-1;O>=0;--O)if(s[O]==S[2]){s.length=O;break}if(O<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=_(s);if(!i||s.line!=u.line)return;var D=x(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=x(i),A=D&&Y(i.line,i.ch),S=D&&p(i);if(!D||!S||N(i,u)>0)return;var O={from:Y(i.line,i.ch),to:A,tag:S[2]};return D=="selfClose"?{open:O,close:null,at:"open"}:S[1]?{open:h(i,S[2]),close:O,at:"close"}:(i=new G(l,A.line,A.ch,s),{open:O,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=h(D,i);if(!A)break;var S=new G(l,u.line,u.ch,s),O=a(S,A.tag);if(O)return{open:A,close:O}}},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(ut,ge,U){"use strict";var te=U("+L6B"),Y=U("2/Rp"),N=U("5Dmo"),z=U("3S7+"),P=U("k1fw"),F=U("tJVT"),G=U("q1tI"),H=U.n(G),n=U("vHTk"),I=U.n(n),x=U("yEEn"),p=U("ZW9T"),_=U("1vsH");ge.a=function(c){var a=c.name,h=c.data,l=c.theme,u=c.type,s=c.filename,i=c.monacoEditor,D=c.className,A=c.style,S=c.close,O=c.onClose,R=c.hasMask,g=Object(G.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),b=Object(F.a)(g,2),f=b[0],d=b[1],C=Object(G.useState)(""),E=Object(F.a)(C,2),w=E[0],j=E[1],W,T=1024*1024,M=10*T,m=Object(G.useRef)();u==="office"&&(W=Object(_.T)(h).filesize,W>M&&(u="other")),s&&(i.filename=s),Object(G.useEffect)(function(){var X,q,re=(X=document.cookie)===null||X===void 0||((q=X.replace(/\s/g,""))===null||q===void 0)?void 0:q.split(";");re==null||re.map(function(ye){var pe=ye.split("=");pe[0]==="_educoder_session"&&j(pe[1])})},[]);var v=function(){if(h.startsWith("http")||h.startsWith("/")){K();return}Object(_.z)(s||"educoder",h,s)},K=function(){Object(_.x)(s||a,h)};return console.log("data:",h,"fileanme:",s," name:",a),H.a.createElement("div",{style:Object(P.a)({},A||{}),className:"".concat(R&&I.a.bgBlack," ").concat(u?I.a.wrp:"hide")},S&&H.a.createElement("div",{className:I.a.close,ref:m},H.a.createElement(z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return m.current}},H.a.createElement("span",{onClick:K},H.a.createElement("i",{className:"icon-quxiaozhiding"}))),H.a.createElement(z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return m.current}},H.a.createElement("span",{className:"",onClick:O},H.a.createElement("i",{className:"icon-guanbi1"})))),H.a.createElement("div",{className:"".concat(I.a[D]," ").concat(D," ").concat(I.a.monaco," ").concat(u==="txt"?"show":"hide")},u==="txt"&&H.a.createElement(p.b,i)),u==="audio"&&H.a.createElement("audio",{src:"".concat(h!=null&&h.startsWith("/")||(h==null?void 0:h.indexOf("https://"))>-1?h:"data:audio/mp3;base64,").concat(h),autoPlay:!0}),u==="video"&&H.a.createElement(H.a.Fragment,null,h!=null&&h.startsWith("/")?H.a.createElement("video",{controls:!0,src:"".concat(h),autoPlay:!0}):H.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(h),autoPlay:!0})),u==="html"&&H.a.createElement("iframe",{src:h+"&disposition=inline"}),u==="pdf"&&H.a.createElement("embed",{className:I.a.embed,src:h}),u==="image"&&H.a.createElement(H.a.Fragment,null,H.a.createElement("img",{src:"".concat(h!=null&&h.startsWith("/")||(h==null?void 0:h.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(h)})),u==="other"&&H.a.createElement("div",null,H.a.createElement(Y.a,{type:"primary",size:"large",onClick:v},H.a.createElement(x.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(u==="download"||u==="office")&&H.a.createElement(Y.a,{type:"primary",size:"large",onClick:v},H.a.createElement(x.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ut,ge,U){},pmY6:function(ut,ge,U){"use strict";U.d(ge,"h",function(){return I}),U.d(ge,"g",function(){return p}),U.d(ge,"f",function(){return _}),U.d(ge,"e",function(){return c}),U.d(ge,"i",function(){return a}),U.d(ge,"b",function(){return h}),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 H(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 x extends Error{constructor(i){super(`Encountered errors while disposing of store. Errors: [${i.join(", ")}]`);this.errors=i}}function p(i){return typeof i.dispose=="function"&&i.dispose.length===0}function _(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 x(D);return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function c(...i){const D=a(()=>_(i));return n(i,D),D}function a(i){const D=F({dispose:Object(te.a)(()=>{G(D),i()})});return D}class h{constructor(){this._toDispose=new Set,this._isDisposed=!1,F(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{_(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 H(i,this),this._isDisposed?h.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}}h.DISABLE_DISPOSED_WARNING=!1;class l{constructor(){this._store=new h,F(this),H(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&&H(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&&H(i,null),i}}class s{constructor(i){this.object=i}dispose(){}}},psGv:function(ut,ge,U){var te,Y;(function(){var N;(function(){"use strict";var G=[,,function(x){function p(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=[]}p.prototype.clone_empty=function(){var a=new p(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},p.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},p.prototype.has_match=function(a){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(a))return!0;return!1},p.prototype.set_indent=function(a,h){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.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)},p.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},p.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},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(a){this.__items.push(a);var h=a.lastIndexOf(`
|
|
`);h!==-1?this.__character_count=a.length-h:this.__character_count+=a.length},p.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.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 _(a,h){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)),h=h||"",a.indent_level>0&&(h=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}_.prototype.get_indent_size=function(a,h){var l=this.__base_string_length;return h=h||0,a<0&&(l=0),l+=a*this.__indent_size,l+=h,l},_.prototype.get_indent_string=function(a,h){var l=this.__base_string;return h=h||0,a<0&&(a=0,l=""),h+=a*this.__indent_size,this.__ensure_cache(h),l+=this.__cache[h],l},_.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var a=this.__cache.length,h=0,l="";this.__indent_size&&a>=this.__indent_size&&(h=Math.floor(a/this.__indent_size),a-=h*this.__indent_size,l=new Array(h+1).join(this.__indent_string)),a&&(l+=new Array(a+1).join(" ")),this.__cache.push(l)};function c(a,h){this.__indent_cache=new _(a,h),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 p(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,h){return this.__indent_cache.get_indent_string(a,h)},c.prototype.get_indent_size=function(a,h){return this.__indent_cache.get_indent_size(a,h)},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 h=this.current_line.pop();h&&(h[h.length-1]===`
|
|
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),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,h){return a=a||0,h=h||0,this.next_line.set_indent(a,h),this.__lines.length>1?(this.current_line.set_indent(a,h),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(a){for(var h=0;h<a.newlines;h++)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 h=this.__lines.length;a<h;)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,h){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)!==h){this.__lines.splice(l+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},x.exports.Output=c},function(x){function p(_,c,a,h){this.type=_,this.text=c,this.comments_before=null,this.newlines=a||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}x.exports.Token=p},,,function(x){function p(a,h){this.raw_options=_(a,h),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"])}p.prototype._get_array=function(a,h){var l=this.raw_options[a],u=h||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(u=l.concat()):typeof l=="string"&&(u=l.split(/[^a-zA-Z0-9_\/\-]+/)),u},p.prototype._get_boolean=function(a,h){var l=this.raw_options[a],u=l===void 0?!!h:!!l;return u},p.prototype._get_characters=function(a,h){var l=this.raw_options[a],u=h||"";return typeof l=="string"&&(u=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),u},p.prototype._get_number=function(a,h){var l=this.raw_options[a];h=parseInt(h,10),isNaN(h)&&(h=0);var u=parseInt(l,10);return isNaN(u)&&(u=h),u},p.prototype._get_selection=function(a,h,l){var u=this._get_selection_list(a,h,l);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[a]+"'");return u[0]},p.prototype._get_selection_list=function(a,h,l){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[h[0]],!this._is_valid_selection(l,h))throw new Error("Invalid Default Value!");var u=this._get_array(a,l);if(!this._is_valid_selection(u,h))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[a]+"'");return u},p.prototype._is_valid_selection=function(a,h){return a.length&&h.length&&!a.some(function(l){return h.indexOf(l)===-1})};function _(a,h){var l={};a=c(a);var u;for(u in a)u!==h&&(l[u]=a[u]);if(h&&a[h])for(u in a[h])l[u]=a[h][u];return l}function c(a){var h={},l;for(l in a){var u=l.replace(/-/g,"_");h[u]=a[l]}return h}x.exports.Options=p,x.exports.normalizeOpts=c,x.exports.mergeOpts=_},,function(x){var p=RegExp.prototype.hasOwnProperty("sticky");function _(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}_.prototype.restart=function(){this.__position=0},_.prototype.back=function(){this.__position>0&&(this.__position-=1)},_.prototype.hasNext=function(){return this.__position<this.__input_length},_.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},_.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},_.prototype.__match=function(c,a){c.lastIndex=a;var h=c.exec(this.__input);return h&&!(p&&c.sticky)&&(h.index!==a&&(h=null)),h},_.prototype.test=function(c,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(c,a):!1},_.prototype.testChar=function(c,a){var h=this.peek(a);return c.lastIndex=0,h!==null&&c.test(h)},_.prototype.match=function(c){var a=this.__match(c,this.__position);return a?this.__position+=a[0].length:a=null,a},_.prototype.read=function(c,a,h){var l="",u;return c&&(u=this.match(c),u&&(l+=u[0])),a&&(u||!c)&&(l+=this.readUntil(a,h)),l},_.prototype.readUntil=function(c,a){var h="",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,h=this.__input.substring(this.__position,l),this.__position=l,h},_.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},_.prototype.get_regexp=function(c,a){var h=null,l="g";return a&&p&&(l="y"),typeof c=="string"&&c!==""?h=new RegExp(c,l):c&&(h=new RegExp(c.source,l)),h},_.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(c){var a=this.__position,h=this.readUntilAfter(c);return this.__position=a,h},_.prototype.lookBack=function(c){var a=this.__position-1;return a>=c.length&&this.__input.substring(a-c.length,a).toLowerCase()===c},x.exports.InputScanner=_},function(x,p,_){var c=_(8).InputScanner,a=_(3).Token,h=_(10).TokenStream,l=_(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 h,this._reset();for(var i,D=new a(u.START,""),A=null,S=[],O=new h;D.type!==u.EOF;){for(i=this._get_next_token(D,A);this._is_comment(i);)O.add(i),i=this._get_next_token(D,A);O.isEmpty()||(i.comments_before=O,O=new h),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()},x.exports.Tokenizer=s,x.exports.TOKEN=u},function(x){function p(_){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=_}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var _=null;return this.hasNext()&&(_=this.__tokens[this.__position],this.__position+=1),_},p.prototype.peek=function(_){var c=null;return _=_||0,_+=this.__position,_>=0&&_<this.__tokens_length&&(c=this.__tokens[_]),c},p.prototype.add=function(_){this.__parent_token&&(_.parent=this.__parent_token),this.__tokens.push(_),this.__tokens_length+=1},x.exports.TokenStream=p},function(x,p,_){var c=_(12).Pattern;function a(h,l){c.call(this,h,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(h,l){h+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+h+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 h=this._input.read(this._match_pattern);if(h===" ")this.whitespace_before_token=" ";else if(h){var l=this.__split(this._newline_regexp,h);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return h},a.prototype.matching=function(h,l){var u=this._create();return u.__set_whitespace_patterns(h,l),u._update(),u},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(h,l){h.lastIndex=0;for(var u=0,s=[],i=h.exec(l);i;)s.push(l.substring(u,i.index)),u=i.index+i[0].length,i=h.exec(l);return u<l.length?s.push(l.substring(u,l.length)):s.push(""),s},x.exports.WhitespacePattern=a},function(x){function p(_,c){this._input=_,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)}p.prototype.read=function(){var _=this._input.read(this._starting_pattern);return(!this._starting_pattern||_)&&(_+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),_},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(_){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(_),c._update(),c},p.prototype.until=function(_){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(_),c._update(),c},p.prototype.starting_with=function(_){var c=this._create();return c._starting_pattern=this._input.get_regexp(_,!0),c._update(),c},p.prototype.matching=function(_){var c=this._create();return c._match_pattern=this._input.get_regexp(_,!0),c._update(),c},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},x.exports.Pattern=p},function(x){function p(_,c){_=typeof _=="string"?_:_.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(_+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(_+/\sbeautify\signore:end\s/.source+c,"g")}p.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(_);a;)c[a[1]]=a[2],a=this.__directive_pattern.exec(_);return c},p.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},x.exports.Directives=p},function(x,p,_){var c=_(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(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}/)}}h.prototype=new c,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(l){var u=this._create();return u._disabled[l]=!0,u._update(),u},h.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},h.prototype.exclude=function(l){var u=this._create();return u._excluded[l]=!0,u._update(),u},h.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},h.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("|")+")")},h.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},x.exports.TemplatablePattern=h},,,,function(x,p,_){var c=_(19).Beautifier,a=_(20).Options;function h(l,u,s,i){var D=new c(l,u,s,i);return D.beautify()}x.exports=h,x.exports.defaultOptions=function(){return new a}},function(x,p,_){var c=_(20).Options,a=_(2).Output,h=_(21).Tokenizer,l=_(21).TOKEN,u=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,i=function(C,E){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,E)};i.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},i.prototype.set_space_before_token=function(C,E){this._output.space_before_token=C,this._output.non_breaking_space=E},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 E=0;C.type!==l.TEXT&&C.previous.type!==l.TEXT&&(E=C.newlines?1:0),this.preserve_newlines&&(E=C.newlines<this.max_preserve_newlines+1?C.newlines:this.max_preserve_newlines+1);for(var w=0;w<E;w++)this.print_newline(w>0);return E!==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 E=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&&(E=w.next.next.text);break}w=w.next}return E},A=function(C,E){var w=null,j=null;return E.closed?(C==="script"?w="text/javascript":C==="style"&&(w="text/css"),w=D(E)||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,E){return E.indexOf(C)!==-1}function O(C,E,w){this.parent=C||null,this.tag=E?E.tag_name:"",this.indent_level=w||0,this.parser_token=E||null}function R(C){this._printer=C,this._current_frame=null}R.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},R.prototype.record_tag=function(C){var E=new O(this._current_frame,C,this._printer.indent_level);this._current_frame=E},R.prototype._try_pop_frame=function(C){var E=null;return C&&(E=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),E},R.prototype._get_frame=function(C,E){for(var w=this._current_frame;w&&!(C.indexOf(w.tag)!==-1);){if(E&&E.indexOf(w.tag)!==-1){w=null;break}w=w.parent}return w},R.prototype.try_pop=function(C,E){var w=this._get_frame([C],E);return this._try_pop_frame(w)},R.prototype.indent_to_tag=function(C){var E=this._get_frame(C);E&&(this._printer.indent_level=E.indent_level)};function g(C,E,w,j){this._source_text=C||"",E=E||{},this._js_beautify=w,this._css_beautify=j,this._tag_stack=null;var W=new c(E,"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,E=this._options.eol;this._options.eol==="auto"&&(E=`
|
|
`,C&&u.test(C)&&(E=C.match(u)[0])),C=C.replace(s,`
|
|
`);var w=C.match(/^[\t ]*/)[0],j={text:"",type:""},W=new b,T=new i(this._options,w),M=new h(C,this._options).tokenize();this._tag_stack=new R(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 K=T._output.get_code(E);return K},g.prototype._handle_tag_close=function(C,E,w){var j={text:E.text,type:E.type};return C.alignment_size=0,w.tag_complete=!0,C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),w.is_unformatted?C.add_raw_token(E):(w.tag_start_char==="<"&&(C.set_space_before_token(E.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&w.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(E)),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,E,w,j){var W=w.has_wrapped_attrs,T={text:E.text,type:E.type};if(C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),w.is_unformatted)C.add_raw_token(E);else if(w.tag_start_char==="{"&&E.type===l.TEXT)C.print_preserved_newlines(E)?(E.newlines=0,C.add_raw_token(E)):C.print_token(E);else{if(E.type===l.ATTRIBUTE?(C.set_space_before_token(!0),w.attr_count+=1):(E.type===l.EQUALS||E.type===l.VALUE&&E.previous.type===l.EQUALS)&&C.set_space_before_token(!1),E.type===l.ATTRIBUTE&&w.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.traverse_whitespace(E),W=W||E.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,K;do{if(K=j.peek(v),K.type===l.ATTRIBUTE){m=!1;break}v+=1}while(v<4&&K.type!==l.EOF&&K.type!==l.TAG_CLOSE);M=!m}M&&(C.print_newline(!1),W=!0)}C.print_token(E),W=W||C.previous_token_wrapped(),w.has_wrapped_attrs=W}return T},g.prototype._handle_text=function(C,E,w){var j={text:E.text,type:"TK_CONTENT"};return w.custom_beautifier_name?this._print_custom_beatifier_text(C,E,w):w.is_unformatted||w.is_content_unformatted?C.add_raw_token(E):(C.traverse_whitespace(E),C.print_token(E)),j},g.prototype._print_custom_beatifier_text=function(C,E,w){var j=this;if(E.text!==""){var W=E.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 K=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(E);return}m=K+X[1]+`
|
|
`,W=X[4],X[5]&&(v=K+X[5]),W=W.replace(/\n[ \t]*$/,""),(X[2]||X[3].indexOf(`
|
|
`)!==-1)&&(X=X[3].match(/[ \t]+$/),X&&(E.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(K+W,re)}else{var ye=E.whitespace_before;ye&&(W=W.replace(new RegExp(`
|
|
(`+ye+")?","g"),`
|
|
`)),W=K+W.replace(/\n/g,`
|
|
`+K)}m&&(W?W=m+W+`
|
|
`+v:W=m+v),C.print_newline(!1),W&&(E.text=W,E.whitespace_before="",E.newlines=0,C.add_raw_token(E),C.print_newline(!0))}},g.prototype._handle_tag_open=function(C,E,w,j){var W=this._get_tag_open_token(E);return(w.is_unformatted||w.is_content_unformatted)&&!w.is_empty_element&&E.type===l.TAG_OPEN&&E.text.indexOf("</")===0?(C.add_raw_token(E),W.start_tag_token=this._tag_stack.try_pop(W.tag_name)):(C.traverse_whitespace(E),this._set_tag_position(C,E,W,w,j),W.is_inline_element||C.set_wrap_point(),C.print_token(E)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(W.alignment_size=E.text.length+1),!W.tag_complete&&!W.is_unformatted&&(C.alignment_size=W.alignment_size),W};var b=function(C,E){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="",!E)this.tag_complete=!0;else{var w;this.tag_start_char=E.text[0],this.text=E.text,this.tag_start_char==="<"?(w=E.text.match(/^<([^\s>]*)/),this.tag_check=w?w[1]:""):(w=E.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=w?w[1]:"",(E.text.startsWith("{{#>")||E.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&E.next!==null?this.tag_check=E.next.text.split(" ")[0]:this.tag_check=E.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),E.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||E.closed&&E.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 E=new b(this._tag_stack.get_parser_token(),C);return E.alignment_size=this._options.wrap_attributes_indent_size,E.is_end_tag=E.is_end_tag||S(E.tag_check,this._options.void_elements),E.is_empty_element=E.tag_complete||E.is_start_tag&&E.is_end_tag,E.is_unformatted=!E.tag_complete&&S(E.tag_check,this._options.unformatted),E.is_content_unformatted=!E.is_empty_element&&S(E.tag_check,this._options.content_unformatted),E.is_inline_element=S(E.tag_name,this._options.inline)||E.tag_name.includes("-")||E.tag_start_char==="{",E},g.prototype._set_tag_position=function(C,E,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,E)))),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,E){E.parent&&C._output.just_added_newline()&&!((E.is_inline_element||E.is_unformatted)&&E.parent.is_inline_element)&&(E.parent.multiline_content=!0)};var f=["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 E=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")E=E||this._tag_stack.try_pop("head");else if(C.tag_name==="li")E=E||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")E=E||this._tag_stack.try_pop("dt",["dl"]),E=E||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&f.indexOf(C.tag_name)!==-1){var w=C.parent.parent;(!w||d.indexOf(w.tag_name)===-1)&&(E=E||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(E=E||this._tag_stack.try_pop("rt",["ruby","rtc"]),E=E||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?E=E||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?E=E||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?E=E||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.tag_name==="tfoot"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("thead",["table"]),E=E||this._tag_stack.try_pop("tbody",["table"])):C.tag_name==="tr"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(C.tag_name==="th"||C.tag_name==="td")&&(E=E||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),E=E||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return C.parent=this._tag_stack.get_parser_token(),E},x.exports.Beautifier=g},function(x,p,_){var c=_(6).Options;function a(h){c.call(this,h,"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,x.exports.Options=a},function(x,p,_){var c=_(9).Tokenizer,a=_(9).TOKEN,h=_(13).Directives,l=_(14).TemplatablePattern,u=_(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 h(/<\!--/,/-->/),D=function(A,S){c.call(this,A,S),this._current_tag_name="";var O=new l(this._input).read_options(this._options),R=new u(this._input);if(this.__patterns={word:O.until(/[\n\r\t <]/),single_quote:O.until_after(/'/),double_quote:O.until_after(/"/),attribute:O.until(/[\n\r\t =>]|\/>/),element_name:O.until(/[\n\r\t >\/]/),handlebars_comment:R.starting_with(/{{!--/).until_after(/--}}/),handlebars:R.starting_with(/{{/).until_after(/}}/),handlebars_open:R.until(/[\n\r\t }]/),handlebars_raw_close:R.until(/}}/),comment:R.starting_with(/<!--/).until_after(/-->/),cdata:R.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:R.starting_with(/<!\[/).until_after(/]>/),processing:R.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var g=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=R.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 O=null;this._readWhitespace();var R=this._input.peek();return R===null?this._create_token(s.EOF,""):(O=O||this._read_open_handlebars(R,S),O=O||this._read_attribute(R,A,S),O=O||this._read_close(R,S),O=O||this._read_raw_content(R,A,S),O=O||this._read_content_word(R),O=O||this._read_comment_or_cdata(R),O=O||this._read_processing(R),O=O||this._read_open(R,S),O=O||this._create_token(s.UNKNOWN,this._input.next()),O)},D.prototype._read_comment_or_cdata=function(A){var S=null,O=null,R=null;if(A==="<"){var g=this._input.peek(1);g==="!"&&(O=this.__patterns.comment.read(),O?(R=i.get_directives(O),R&&R.ignore==="start"&&(O+=i.readIgnored(this._input))):O=this.__patterns.cdata.read()),O&&(S=this._create_token(s.COMMENT,O),S.directives=R)}return S},D.prototype._read_processing=function(A){var S=null,O=null,R=null;if(A==="<"){var g=this._input.peek(1);(g==="!"||g==="?")&&(O=this.__patterns.conditional_comment.read(),O=O||this.__patterns.processing.read()),O&&(S=this._create_token(s.COMMENT,O),S.directives=R)}return S},D.prototype._read_open=function(A,S){var O=null,R=null;return S||A==="<"&&(O=this._input.next(),this._input.peek()==="/"&&(O+=this._input.next()),O+=this.__patterns.element_name.read(),R=this._create_token(s.TAG_OPEN,O)),R},D.prototype._read_open_handlebars=function(A,S){var O=null,R=null;return S||this._options.indent_handlebars&&A==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(O=this.__patterns.handlebars_comment.read(),O=O||this.__patterns.handlebars.read(),R=this._create_token(s.COMMENT,O)):(O=this.__patterns.handlebars_open.read(),R=this._create_token(s.TAG_OPEN,O))),R},D.prototype._read_close=function(A,S){var O=null,R=null;return S&&(S.text[0]==="<"&&(A===">"||A==="/"&&this._input.peek(1)===">")?(O=this._input.next(),A==="/"&&(O+=this._input.next()),R=this._create_token(s.TAG_CLOSE,O)):S.text[0]==="{"&&A==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),R=this._create_token(s.TAG_CLOSE,"}}"))),R},D.prototype._read_attribute=function(A,S,O){var R=null,g="";if(O&&O.text[0]==="<")if(A==="=")R=this._create_token(s.EQUALS,this._input.next());else if(A==='"'||A==="'"){var b=this._input.next();A==='"'?b+=this.__patterns.double_quote.read():b+=this.__patterns.single_quote.read(),R=this._create_token(s.VALUE,b)}else g=this.__patterns.attribute.read(),g&&(S.type===s.EQUALS?R=this._create_token(s.VALUE,g):R=this._create_token(s.ATTRIBUTE,g));return R},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,O){var R="";if(O&&O.text[0]==="{")R=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 b=this._read_comment_or_cdata(A);if(b)return b.type=s.TEXT,b;R=this._input.readUntil(new RegExp("</"+g+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(g)&&(R=this._input.readUntil(new RegExp("</"+g+"[\\n\\r\\t ]*?>","ig")))}return R?this._create_token(s.TEXT,R):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)},x.exports.Tokenizer=D,x.exports.TOKEN=s}],H={};function n(x){var p=H[x];if(p!==void 0)return p.exports;var _=H[x]={exports:{}};return G[x](_,_.exports,n),_.exports}var I=n(18);N=I})();var z=N;if(!0)!(te=[U,U("6UM0"),U("TXwP")],Y=function(G){var H=U("6UM0"),n=U("TXwP");return{html_beautify:function(I,x){return z(I,x,H.js_beautify,n.css_beautify)}}}.apply(ge,te),Y!==void 0&&(ut.exports=Y));else var P,F})()},"rAM+":function(ut,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(p){throw p},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 H=!0,n=!1,I;return{s:function(){P=N[Symbol.iterator]()},n:function(){var p=P.next();return H=p.done,p},e:function(p){n=!0,I=p},f:function(){try{!H&&P.return!=null&&P.return()}finally{if(n)throw I}}}}},rUJ1:function(ut,ge){const U=/[&<>"']/,te=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,z={"&":"&","<":"<",">":">",'"':""","'":"'"},P=R=>z[R];function F(R,g){if(g){if(U.test(R))return R.replace(te,P)}else if(Y.test(R))return R.replace(N,P);return R}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function H(R){return R.replace(G,(g,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const n=/(^|[^\[])\^/g;function I(R,g){R=R.source||R,g=g||"";const b={replace:(f,d)=>(d=d.source||d,d=d.replace(n,"$1"),R=R.replace(f,d),b),getRegex:()=>new RegExp(R,g)};return b}const x=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(R,g,b){if(R){let f;try{f=decodeURIComponent(H(b)).replace(x,"").toLowerCase()}catch(d){return null}if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}g&&!p.test(b)&&(b=u(g,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(f){return null}return b}const c={},a=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(R,g){c[" "+R]||(a.test(R)?c[" "+R]=R+"/":c[" "+R]=A(R,"/",!0)),R=c[" "+R];const b=R.indexOf(":")===-1;return g.substring(0,2)==="//"?b?g:R.replace(h,"$1")+g:g.charAt(0)==="/"?b?g:R.replace(l,"$1")+g:R+g}const s={exec:function(){}};function i(R){let g=1,b,f;for(;g<arguments.length;g++){b=arguments[g];for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&(R[f]=b[f])}return R}function D(R,g){const b=R.replace(/\|/g,(C,E,w)=>{let j=!1,W=E;for(;--W>=0&&w[W]==="\\";)j=!j;return j?"|":" |"}),f=b.split(/ \|/);let d=0;if(f.length>g)f.splice(g);else for(;f.length<g;)f.push("");for(;d<f.length;d++)f[d]=f[d].trim().replace(/\\\|/g,"|");return f}function A(R,g,b){const f=R.length;if(f===0)return"";let d=0;for(;d<f;){const C=R.charAt(f-d-1);if(C===g&&!b)d++;else if(C!==g&&b)d++;else break}return R.substr(0,f-d)}function S(R,g){if(R.indexOf(g[1])===-1)return-1;const b=R.length;let f=0,d=0;for(;d<b;d++)if(R[d]==="\\")d++;else if(R[d]===g[0])f++;else if(R[d]===g[1]&&(f--,f<0))return d;return-1}function O(R){R&&R.sanitize&&!R.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}ut.exports={escape:F,unescape:H,edit:I,cleanUrl:_,resolveUrl:u,noopTest:s,merge:i,splitCells:D,rtrim:A,findClosingBracket:S,checkSanitizeDeprecation:O}},sboe:function(ut,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(ut,ge){ut.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(ut,ge,U){ut.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(ut,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),H=U("m+aA"),n=U("Zm9Q"),I=U("Kwbf"),x=U("c+Xe"),p=U("bdgK"),_="rc-observer-key",c=function(a){Object(z.a)(l,a);var h=Object(P.a)(l);function l(){var u;return Object(Y.a)(this,l),u=h.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,O=A.height,R=D.offsetWidth,g=D.offsetHeight,b=Math.floor(S),f=Math.floor(O);if(u.state.width!==b||u.state.height!==f||u.state.offsetWidth!==R||u.state.offsetHeight!==g){var d={width:b,height:f,offsetWidth:R,offsetHeight:g};u.setState(d),i&&Promise.resolve().then(function(){i(Object(te.a)(Object(te.a)({},d),{},{offsetWidth:R,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(H.a)(this.childNode||this),D=i!==this.currentElement;D&&(this.destroyObserver(),this.currentElement=i),!this.resizeObserver&&i&&(this.resizeObserver=new p.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(x.c)(D)){var A=D.ref;i[0]=F.cloneElement(D,{ref:Object(x.a)(A,this.setChildNode)})}return i.length===1?i[0]:i.map(function(S,O){return!F.isValidElement(S)||"key"in S&&S.key!==null?S:F.cloneElement(S,{key:"".concat(_,"-").concat(O)})})}}]),l}(F.Component);c.displayName="ResizeObserver",ge.a=c},t9D7:function(ut,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 x}),U.d(ge,"a",function(){return p}),U.d(ge,"f",function(){return a}),U.d(ge,"c",function(){return h});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 H;(function(l){function u(s){return s&&typeof s=="object"&&typeof s.id=="string"}l.isThemeColor=u})(H||(H={}));function n(l){return{id:l}}var I;(function(l){function u(O){return O&&typeof O=="object"&&typeof O.id=="string"&&(typeof O.color=="undefined"||H.isThemeColor(O.color))}l.isThemeIcon=u;const s=new RegExp(`^\\$\\((${te.a.iconNameExpression}(?:${te.a.iconModifierExpression})?)\\)$`);function i(O){const R=s.exec(O);if(!R)return;let[,g]=R;return{id:g}}l.fromString=i;function D(O,R){let g=O.id;const b=g.lastIndexOf("~");return b!==-1&&(g=g.substring(0,b)),R&&(g=`${g}~${R}`),{id:g}}l.modify=D;function A(O,R){var g,b;return O.id===R.id&&((g=O.color)===null||g===void 0?void 0:g.id)===((b=R.color)===null||b===void 0?void 0:b.id)}l.isEqual=A;function S(O,R){return{id:O.id,color:R?n(R):void 0}}l.asThemeIcon=S,l.asClassNameArray=te.a.asClassNameArray,l.asClassName=te.a.asClassName,l.asCSSSelector=te.a.asCSSSelector})(I||(I={}));function x(l){switch(l){case F.a.DARK:return"vs-dark";case F.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const p={ThemingContribution:"base.contributions.theming"};class _{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 _;P.a.add(p.ThemingContribution,c);function a(l){return c.onColorThemeChange(l)}class h 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(ut,ge,U){ut.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(ut,ge,U){typeof window!="undefined"&&function(Y,N){ut.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(H){return z[H]}.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(x,p,_){this.fn=x,this.context=p,this.once=_||!1}function H(x,p,_,c,a){if(typeof _!="function")throw new TypeError("The listener must be a function");var h=new G(_,c||x,a),l=P?P+p:p;return x._events[l]?x._events[l].fn?x._events[l]=[x._events[l],h]:x._events[l].push(h):(x._events[l]=h,x._eventsCount++),x}function n(x,p){--x._eventsCount===0?x._events=new F:delete x._events[p]}function I(){this._events=new F,this._eventsCount=0}I.prototype.eventNames=function(){var p=[],_,c;if(this._eventsCount===0)return p;for(c in _=this._events)z.call(_,c)&&p.push(P?c.slice(1):c);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(_)):p},I.prototype.listeners=function(p){var _=P?P+p:p,c=this._events[_];if(!c)return[];if(c.fn)return[c.fn];for(var a=0,h=c.length,l=new Array(h);a<h;a++)l[a]=c[a].fn;return l},I.prototype.listenerCount=function(p){var _=P?P+p:p,c=this._events[_];return c?c.fn?1:c.length:0},I.prototype.emit=function(p,_,c,a,h,l){var u=P?P+p:p;if(!this._events[u])return!1;var s=this._events[u],i=arguments.length,D,A;if(s.fn){s.once&&this.removeListener(p,s.fn,void 0,!0);switch(i){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,_),!0;case 3:return s.fn.call(s.context,_,c),!0;case 4:return s.fn.call(s.context,_,c,a),!0;case 5:return s.fn.call(s.context,_,c,a,h),!0;case 6:return s.fn.call(s.context,_,c,a,h,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,O;for(A=0;A<S;A++){s[A].once&&this.removeListener(p,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,_);break;case 3:s[A].fn.call(s[A].context,_,c);break;case 4:s[A].fn.call(s[A].context,_,c,a);break;default:if(!D)for(O=1,D=new Array(i-1);O<i;O++)D[O-1]=arguments[O];s[A].fn.apply(s[A].context,D)}}}return!0},I.prototype.on=function(p,_,c){return H(this,p,_,c,!1)},I.prototype.once=function(p,_,c){return H(this,p,_,c,!0)},I.prototype.removeListener=function(p,_,c,a){var h=P?P+p:p;if(!this._events[h])return this;if(!_)return n(this,h),this;var l=this._events[h];if(l.fn)l.fn===_&&(!a||l.once)&&(!c||l.context===c)&&n(this,h);else{for(var u=0,s=[],i=l.length;u<i;u++)(l[u].fn!==_||a&&!l[u].once||c&&l[u].context!==c)&&s.push(l[u]);s.length?this._events[h]=s.length===1?s[0]:s:n(this,h)}return this},I.prototype.removeAllListeners=function(p){var _;return p?(_=P?P+p:p,this._events[_]&&n(this,_)):(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,H=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(I,x,p){if(p=p||{},I=I.trim(),x=x.trim(),!x){if(!p.alwaysNormalize)return I;var _=n.parseURL(I);if(!_)throw new Error("Error trying to parse base URL.");return _.path=n.normalizePath(_.path),n.buildURLFromParts(_)}var c=n.parseURL(x);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return p.alwaysNormalize?(c.path=n.normalizePath(c.path),n.buildURLFromParts(c)):x;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 h=F.exec(a.path);a.netLoc=h[1],a.path=h[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=p.alwaysNormalize?n.normalizePath(c.path):c.path),n.buildURLFromParts(l)},parseURL:function(I){var x=P.exec(I);return x?{scheme:x[1]||"",netLoc:x[2]||"",path:x[3]||"",params:x[4]||"",query:x[5]||"",fragment:x[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(G,"");I.length!==(I=I.replace(H,"")).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(p){var _={};function c(h){if(_[h])return _[h].exports;var l=_[h]={i:h,l:!1,exports:{}};return p[h].call(l.exports,l,l.exports,c),l.l=!0,l.exports}c.m=p,c.c=_,c.i=function(h){return h},c.d=function(h,l,u){c.o(h,l)||Object.defineProperty(h,l,{configurable:!1,enumerable:!0,get:u})},c.r=function(h){Object.defineProperty(h,"__esModule",{value:!0})},c.n=function(h){var l=h&&h.__esModule?function(){return h.default}:function(){return h};return c.d(l,"a",l),l},c.o=function(h,l){return Object.prototype.hasOwnProperty.call(h,l)},c.p="/",c.oe=function(h){throw console.error(h),h};var a=c(c.s=ENTRY_MODULE);return a.default||a}var P="[\\.|\\-|\\+|\\w|/|@]+",F="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function G(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function H(p){return!isNaN(1*p)}function n(p,_,c){var a={};a[c]=[];var h=_.toString(),l=h.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(h);){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(h);)p[i[2]]||(a[c].push(i[1]),p[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++)H(a[D[A]][S])&&(a[D[A]][S]=1*a[D[A]][S]);return a}function I(p){var _=Object.keys(p);return _.reduce(function(c,a){return c||p[a].length>0},!1)}function x(p,_){for(var c={main:[_]},a={main:[]},h={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(h[s]=h[s]||{},h[s][D]||!p[s][D])continue;h[s][D]=!0,a[s]=a[s]||[],a[s].push(D);for(var A=n(p,p[s][D],s),S=Object.keys(A),O=0;O<S.length;O++)c[S[O]]=c[S[O]]||[],c[S[O]]=c[S[O]].concat(A[S[O]])}return a}te.exports=function(p,_){_=_||{};var c={main:N.m},a=_.all?{main:Object.keys(c.main)}:x(c,p),h="";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__; })",h=h+"var "+D+" = ("+z.toString().replace("ENTRY_MODULE",JSON.stringify(A))+")({"+a[D].map(function(S){return""+JSON.stringify(S)+": "+c[D][S].toString()}).join(",")+`});
|
|
`}),h=h+"new (("+z.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+a.main.map(function(D){return""+JSON.stringify(D)+": "+c.main[D].toString()}).join(",")+"}))(self);";var l=new window.Blob([h],{type:"text/javascript"});if(_.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 O}),N.d(Y,"mergeConfig",function(){return g}),N.d(Y,"enableStreamingMode",function(){return b});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"),H=N("./src/controller/subtitle-track-controller.ts"),n=N("./src/controller/buffer-controller.ts"),I=N("./src/controller/timeline-controller.ts"),x=N("./src/controller/cap-level-controller.ts"),p=N("./src/controller/fps-controller.ts"),_=N("./src/controller/eme-controller.ts"),c=N("./src/controller/cmcd-controller.ts"),a=N("./src/utils/xhr-loader.ts"),h=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(f){for(var d=1;d<arguments.length;d++){var C=arguments[d];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(f[E]=C[E])}return f},i.apply(this,arguments)}function D(f,d){var C=Object.keys(f);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(f);d&&(E=E.filter(function(w){return Object.getOwnPropertyDescriptor(f,w).enumerable})),C.push.apply(C,E)}return C}function A(f){for(var d=1;d<arguments.length;d++){var C=arguments[d]!=null?arguments[d]:{};d%2?D(Object(C),!0).forEach(function(E){S(f,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(C)):D(Object(C)).forEach(function(E){Object.defineProperty(f,E,Object.getOwnPropertyDescriptor(C,E))})}return f}function S(f,d,C){return d in f?Object.defineProperty(f,d,{value:C,enumerable:!0,configurable:!0,writable:!0}):f[d]=C,f}var O=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:x.default,fpsController:p.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},R()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:H.default,timelineController:I.TimelineController,audioStreamController:P.default,audioTrackController:F.default,emeController:_.default,cmcdController:c.default});function R(){return{cueHandler:l.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function g(f,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({},f,d)}function b(f){var d=f.loader;if(d!==h.default&&d!==a.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),f.progressive=!1;else{var C=Object(h.fetchSupported)();C&&(f.loader=h.default,f.progressive=!0,f.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"),H=N("./src/errors.ts"),n=N("./src/types/loader.ts"),I=N("./src/utils/logger.ts");function x(c,a){for(var h=0;h<a.length;h++){var l=a[h];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function p(c,a,h){return a&&x(c.prototype,a),h&&x(c,h),c}var _=function(){function c(h){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=h;var l=h.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,O=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 R=performance.now()-S.loading.start,g=Math.abs(A.playbackRate);if(R<=500*O/g)return;var b=s.levels,f=s.minAutoLevel,d=b[l.level],C=S.total||Math.max(S.loaded,Math.round(O*d.maxBitrate/8)),E=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/R),w=(C-S.loaded)/E,j=A.currentTime,W=(G.BufferHelper.bufferInfo(A,j,D.maxBufferHole).end-j)/g;if(W>=2*O/g||w<=W)return;var T=Number.POSITIVE_INFINITY,M;for(M=l.level-1;M>f;M--){var m=b[M].maxBitrate;if(T=O*m/(8*.8*E),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(R,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],O=(S.loaded?S.loaded.bytes:0)+D.loaded,R=(S.loaded?S.loaded.duration:0)+A;S.loaded={bytes:O,duration:R},S.realBitrate=Math.round(8*O/R)}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 H.ErrorDetails.FRAG_LOAD_ERROR:case H.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,O=u?u.duration:l?l.duration:0,R=S?S.currentTime:0,g=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():D.abrEwmaDefaultEstimate,f=(G.BufferHelper.bufferInfo(S,R,D.maxBufferHole).end-R)/g,d=this.findBestLevel(b,A,i,f,D.abrBandWidthFactor,D.abrBandWidthUpFactor);if(d>=0)return d;I.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=O?Math.min(O,D.maxStarvationDelay):D.maxStarvationDelay,E=D.abrBandWidthFactor,w=D.abrBandWidthUpFactor;if(!f){var j=this.bitrateTestDelay;if(j){var W=O?Math.min(O,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"),E=w=1}}return d=this.findBestLevel(b,A,i,f+C,E,w),Math.max(d,0)},a.findBestLevel=function(l,u,s,i,D,A){for(var S,O=this.fragCurrent,R=this.partCurrent,g=this.lastLoadedFragLevel,b=this.hls.levels,f=b[g],d=!!(f!=null&&(S=f.details)!==null&&S!==void 0&&S.live),C=f==null?void 0:f.codecSet,E=R?R.duration:O?O.duration:0,w=s;w>=u;w--){var j=b[w];if(!j||C&&j.codecSet!==C)continue;var W=j.details,T=(R?W==null?void 0:W.partTarget:W==null?void 0:W.averagetargetduration)||E,M=void 0;w<=g?M=D*l:M=A*l;var m=b[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},p(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=_},"./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"),H=N("./src/controller/fragment-tracker.ts"),n=N("./src/types/level.ts"),I=N("./src/types/loader.ts"),x=N("./src/loader/fragment.ts"),p=N("./src/demux/chunk-cache.ts"),_=N("./src/demux/transmuxer-interface.ts"),c=N("./src/types/transmuxer.ts"),a=N("./src/controller/fragment-finders.ts"),h=N("./src/utils/discontinuities.ts"),l=N("./src/errors.ts"),u=N("./src/utils/logger.ts");function s(){return s=Object.assign||function(O){for(var R=1;R<arguments.length;R++){var g=arguments[R];for(var b in g)Object.prototype.hasOwnProperty.call(g,b)&&(O[b]=g[b])}return O},s.apply(this,arguments)}function i(O,R){O.prototype=Object.create(R.prototype),O.prototype.constructor=O,D(O,R)}function D(O,R){return D=Object.setPrototypeOf||function(b,f){return b.__proto__=f,b},D(O,R)}var A=100,S=function(O){i(R,O);function R(b,f){var d;return d=O.call(this,b,f,"[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=R.prototype;return g.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},g._registerListeners=function(){var f=this.hls;f.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(F.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.on(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.on(F.Events.ERROR,this.onError,this),f.on(F.Events.BUFFER_RESET,this.onBufferReset,this),f.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g._unregisterListeners=function(){var f=this.hls;f.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(F.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.off(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.off(F.Events.ERROR,this.onError,this),f.off(F.Events.BUFFER_RESET,this.onBufferReset,this),f.off(F.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g.onInitPtsFound=function(f,d){var C=d.frag,E=d.id,w=d.initPTS;if(E==="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(f){if(!this.levels){this.startPosition=f,this.state=P.State.STOPPED;return}var d=this.lastCurrentTime;this.stopLoad(),this.setInterval(A),this.fragLoadError=0,d>0&&f===-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=f,this.tick()},g.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var f,d=this.levels,C=this.trackId,E=d==null||((f=d[C])===null||f===void 0)?void 0:f.details;if(E){if(this.waitForCdnTuneIn(E))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,K=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),K&&O.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 f=this.waitingData;f&&(this.fragmentTracker.removeFragment(f.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},g.onTickEnd=function(){var f=this.media;if(!f||!f.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:f,C=d.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=f.currentTime},g.doTickIdle=function(){var f,d,C=this.hls,E=this.levels,w=this.media,j=this.trackId,W=C.config;if(!E||!E[j])return;if(!w&&(this.startFragRequested||!W.startFragPrefetch))return;var T=E[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,x.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,K=this.getMaxBufferLength(),X=this.audioSwitch;if(v>=K&&!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}((f=ue.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((d=ue.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(ue,M):this.loadFragment(ue,M,ye)},g.getMaxBufferLength=function(){var f=O.prototype.getMaxBufferLength.call(this),d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return d===null?f:Math.max(f,d.len)},g.onMediaDetaching=function(){this.videoBuffer=null,O.prototype.onMediaDetaching.call(this)},g.onAudioTracksUpdated=function(f,d){var C=d.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(E){return new n.Level(E)})},g.onAudioTrackSwitching=function(f,d){var C=!!d.url;this.trackId=d.id;var E=this.fragCurrent;E!=null&&E.loader&&E.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(f,d){this.mainDetails=d.details},g.onAudioTrackLoaded=function(f,d){var C,E=this.levels,w=d.details,j=d.id;if(!E){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=E[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(h.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(f){var d,C=f.frag,E=f.part,w=f.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",K=this.transmuxer;K||(K=this.transmuxer=new _.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=E?E.index:-1,pe=ye!==-1,ue=new c.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,w.byteLength,ye,pe);K.push(w,q,v,"",C,E,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:E,cache:new p.default,complete:!1},Ee=fe.cache;Ee.push(new Uint8Array(w)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},g._handleFragmentLoadComplete=function(f){if(this.waitingData){this.waitingData.complete=!0;return}O.prototype._handleFragmentLoadComplete.call(this,f)},g.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},g.onBufferCreated=function(f,d){var C=d.tracks.audio;C&&(this.mediaBuffer=C.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},g.onFragBuffered=function(f,d){var C=d.frag,E=d.part;if(C.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(C)){this.warn("Fragment "+C.sn+(E?" p: "+E.index:"")+" of level "+C.level+" finished buffering, but was aborted. state: "+this.state+", 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,E)},g.onError=function(f,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,E=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);E&&E.len>.5&&(C=!this.reduceMaxBufferLength(E.len)),C&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},g.onBufferFlushed=function(f,d){var C=d.type;C===x.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},g._handleTransmuxComplete=function(f){var d,C="audio",E=this.hls,w=f.remuxResult,j=f.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,K=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),E.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[x.ElementaryStreamTypes.AUDIO]={startPTS:q,endPTS:re,startDTS:ye,endDTS:pe}),T.setElementaryStreamInfo(x.ElementaryStreamTypes.AUDIO,q,re,ye,pe),this.bufferFragmentData(m,T,M,j)}if(K!=null&&(d=K.samples)!==null&&d!==void 0&&d.length){var ue=s({frag:T,id:C},K);E.trigger(F.Events.FRAG_PARSING_METADATA,ue)}if(v){var fe=s({frag:T,id:C},v);E.trigger(F.Events.FRAG_PARSING_USERDATA,fe)}},g._bufferInitSegment=function(f,d,C){if(this.state!==P.State.PARSING)return;f.video&&delete f.video;var E=f.audio;if(!E)return;E.levelCodec=E.codec,E.id="audio",this.log("Init audio buffer, container:"+E.container+", codecs[parsed]=["+E.codec+"]"),this.hls.trigger(F.Events.BUFFER_CODECS,f);var w=E.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(f,d,C){var E=this.fragmentTracker.getState(f);this.fragCurrent=f,(this.audioSwitch||E===H.FragmentState.NOT_LOADED||E===H.FragmentState.PARTIAL)&&(f.sn==="initSegment"?this._loadInitSegment(f):d.live&&!Object(z.isFiniteNumber)(this.initPTS[f.cc])?(this.log("Waiting for video PTS in continuity counter "+f.cc+" of live stream before loading audio fragment "+f.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,O.prototype.loadFragment.call(this,f,d,C)))},g.completeAudioSwitch=function(){var f=this.hls,d=this.media,C=this.trackId;d&&(this.log("Switching audio track : flushing all audio"),O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,f.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:C})},R}(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 H(_,c){for(var a=0;a<c.length;a++){var h=c[a];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(_,h.key,h)}}function n(_,c,a){return c&&H(_.prototype,c),a&&H(_,a),_}function I(_,c){_.prototype=Object.create(c.prototype),_.prototype.constructor=_,x(_,c)}function x(_,c){return x=Object.setPrototypeOf||function(h,l){return h.__proto__=l,h},x(_,c)}var p=function(_){I(c,_);function c(h){var l;return l=_.call(this,h,"[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,_.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(_.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,O=i.name,R=i.type,g=i.url;if(this.trackId=l,this.trackName=O,this.selectDefaultTrack=!1,this.hls.trigger(z.Events.AUDIO_TRACK_SWITCHING,{id:D,groupId:S,name:O,type:R,url:g}),i.details&&!i.details.live)return;var b=this.switchParams(i.url,s==null?void 0:s.details);this.loadPlaylist(b)},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=p},"./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"),H=N("./src/errors.ts"),n=function(){function I(p,_){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=G.logger.log.bind(G.logger,_+":"),this.warn=G.logger.warn.bind(G.logger,_+":"),this.hls=p}var x=I.prototype;return x.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},x.onError=function(_,c){c.fatal&&c.type===H.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},x.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},x.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},x.stopLoad=function(){this.canLoad=!1,this.clearTimer()},x.switchParams=function(_,c){var a=c==null?void 0:c.renditionReports;if(a)for(var h=0;h<a.length;h++){var l=a[h],u=""+l.URI;if(u===_.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)}}},x.loadPlaylist=function(_){},x.shouldLoadTrack=function(_){return this.canLoad&&_&&!!_.url&&(!_.details||_.details.live)},x.playlistLoaded=function(_,c,a){var h=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 "+_+" "+(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,O=l.lastPartSn,R=l.endSN,g=l.lastPartIndex,b=g!==-1,f=O===R,d=S?0:g;b?(D=f?R+1:O,A=f?d:g+1):D=R+1;var C=l.age,E=C+l.ageHeader,w=Math.min(E-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||!f){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 "+_+" in "+Math.round(T)+" ms"),this.timer=self.setTimeout(function(){return h.loadPlaylist(i)},T)}else this.clearTimer()},x.getDeliveryDirectives=function(_,c,a,h){var l=Object(P.getSkipValue)(_,a);return c!=null&&c.skip&&_.deltaUpdateFailed&&(a=c.msn,h=c.part,l=P.HlsSkip.No),new P.HlsUrlParameters(a,h,l)},x.retryLoadingOrFail=function(_){var c=this,a=this.hls.config,h=this.retryCount<a.levelLoadingMaxRetry;if(h){var l;if(this.retryCount++,_.details.indexOf("LoadTimeOut")>-1&&(l=_.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+_.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 "'+_.details+'"')}}else this.warn('cannot recover from error "'+_.details+'"'),this.clearTimer(),_.fatal=!0;return h},I}()},"./src/controller/base-stream-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"State",function(){return R}),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"),H=N("./src/utils/logger.ts"),n=N("./src/events.ts"),I=N("./src/errors.ts"),x=N("./src/types/transmuxer.ts"),p=N("./src/utils/mp4-tools.ts"),_=N("./src/utils/discontinuities.ts"),c=N("./src/controller/fragment-finders.ts"),a=N("./src/controller/level-helper.ts"),h=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(b,f){for(var d=0;d<f.length;d++){var C=f[d];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(b,C.key,C)}}function D(b,f,d){return f&&i(b.prototype,f),d&&i(b,d),b}function A(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function S(b,f){b.prototype=Object.create(f.prototype),b.prototype.constructor=b,O(b,f)}function O(b,f){return O=Object.setPrototypeOf||function(C,E){return C.__proto__=E,C},O(b,f)}var R={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},g=function(b){S(f,b);function f(C,E,w){var j;return j=b.call(this)||this,j.hls=void 0,j.fragPrevious=null,j.fragCurrent=null,j.fragmentTracker=void 0,j.transmuxer=null,j._state=R.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=H.logger.log.bind(H.logger,w+":"),j.warn=H.logger.warn.bind(H.logger,w+":"),j.hls=C,j.fragmentLoader=new h.default(C.config),j.fragmentTracker=E,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=f.prototype;return d.doTick=function(){this.onTickEnd()},d.onTickEnd=function(){},d.startLoad=function(E){},d.stopLoad=function(){this.fragmentLoader.abort();var E=this.fragCurrent;E&&this.fragmentTracker.removeFragment(E),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=R.STOPPED},d._streamEnded=function(E,w){var j=this.fragCurrent,W=this.fragmentTracker;if(!w.live&&j&&j.sn===w.endSN&&!E.nextStart){var T=W.getState(j);return T===F.FragmentState.PARTIAL||T===F.FragmentState.OK}return!1},d.onMediaAttached=function(E,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===R.STOPPED&&this.startLoad(W.startPosition)},d.onMediaDetaching=function(){var E=this.media;E!=null&&E.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),E&&(E.removeEventListener("seeking",this.onvseeking),E.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 E=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,E.maxBufferHole);if(this.log("media seeking to "+(Object(z.isFiniteNumber)(M)?M.toFixed(3):M)+", state: "+T),T===R.ENDED)this.resetLoadingState();else if(w&&!m.len){var v=E.maxFragLookUpTolerance,K=w.start-v,X=w.start+w.duration+v,q=M>X;(M<K||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(E,w){if(this.state!==R.KEY_LOADING||w.frag!==this.fragCurrent||!this.levels)return;this.state=R.IDLE;var j=this.levels[w.frag.level].details;j&&this.loadFragment(w.frag,j,w.frag.start)},d.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},d.onHandlerDestroyed=function(){this.state=R.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,b.prototype.onHandlerDestroyed.call(this)},d.loadKey=function(E,w){this.log("Loading key for "+E.sn+" of ["+w.startSN+"-"+w.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level),this.state=R.KEY_LOADING,this.fragCurrent=E,this.hls.trigger(n.Events.KEY_LOADING,{frag:E})},d.loadFragment=function(E,w,j){this._loadFragForPlayback(E,w,j)},d._loadFragForPlayback=function(E,w,j){var W=this,T=function(m){if(W.fragContextChanged(E)){W.warn("Fragment "+E.sn+(m.part?" p: "+m.part.index:"")+" of level "+E.level+" was dropped during download."),W.fragmentTracker.removeFragment(E);return}E.stats.chunkCount++,W._handleFragmentLoadProgress(m)};this._doFragLoad(E,w,j,T).then(function(M){if(!M)return;W.fragLoadError=0;var m=W.state;if(W.fragContextChanged(E)){(m===R.FRAG_LOADING||m===R.BACKTRACKING||!W.fragCurrent&&m===R.PARSING)&&(W.fragmentTracker.removeFragment(E),W.state=R.IDLE);return}if("payload"in M&&(W.log("Loaded fragment "+E.sn+" of level "+E.level),W.hls.trigger(n.Events.FRAG_LOADED,M),W.state===R.BACKTRACKING)){W.fragmentTracker.backtrack(E,M),W.resetFragmentLoading(E);return}W._handleFragmentLoadComplete(M)}).catch(function(M){W.warn(M),W.resetFragmentLoading(E)})},d.flushMainBuffer=function(E,w,j){if(j===void 0&&(j=null),!(E-w))return;var W={startOffset:E,endOffset:w,type:j};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,W)},d._loadInitSegment=function(E){var w=this;this._doFragLoad(E).then(function(j){if(!j||w.fragContextChanged(E)||!w.levels)throw new Error("init load aborted");return j}).then(function(j){var W=w.hls,T=j.payload,M=E.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 K=self.performance.now();return W.trigger(n.Events.FRAG_DECRYPTED,{frag:E,payload:v,stats:{tstart:m,tdecrypt:K}}),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[E.level].details;console.assert(m,"Level details are defined when init segment is loaded");var v=E.stats;w.state=R.IDLE,w.fragLoadError=0,E.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:E.type}),w.tick()}).catch(function(j){w.warn(j),w.resetFragmentLoading(E)})},d.fragContextChanged=function(E){var w=this.fragCurrent;return!E||!w||E.level!==w.level||E.sn!==w.sn||E.urlId!==w.urlId},d.fragBufferedComplete=function(E,w){var j=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+E.type+" sn: "+E.sn+(w?" part: "+w.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level+" "+u.default.toString(G.BufferHelper.getBuffered(j))),this.state=R.IDLE,this.tick()},d._handleFragmentLoadComplete=function(E){var w=this.transmuxer;if(!w)return;var j=E.frag,W=E.part,T=E.partsLoaded,M=!T||T.length===0||T.some(function(v){return!v}),m=new x.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,W?W.index:-1,!M);w.flush(m)},d._handleFragmentLoadProgress=function(E){},d._doFragLoad=function(E,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(E.start,j||0),this.config.lowLatencyMode&&w){var M=w.partList;if(M&&W){j>E.end&&w.fragmentHint&&(E=w.fragmentHint);var m=this.getNextPart(M,E,j);if(m>-1){var v=M[m];return this.log("Loading part sn: "+E.sn+" p: "+v.index+" cc: "+E.cc+" of playlist ["+w.startSN+"-"+w.endSN+"] parts [0-"+m+"-"+(M.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(j.toFixed(3))),this.nextLoadPosition=v.start+v.duration,this.state=R.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,part:M[m],targetBufferTime:j}),this.doFragPartsLoad(E,M,m,W).catch(function(K){return T.handleFragLoadError(K)})}else if(!E.url||this.loadedEndOfParts(M,j))return Promise.resolve(null)}}return this.log("Loading fragment "+E.sn+" cc: "+E.cc+" "+(w?"of ["+w.startSN+"-"+w.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(j.toFixed(3))),Object(z.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=R.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,targetBufferTime:j}),this.fragmentLoader.load(E,W).catch(function(K){return T.handleFragLoadError(K)})},d.doFragPartsLoad=function(E,w,j,W){var T=this;return new Promise(function(M,m){var v=[],K=function X(q){var re=w[q];T.fragmentLoader.loadPart(E,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===E)X(q+1);else return M({frag:E,part:pe,partsLoaded:v})}).catch(m)};K(j)})},d.handleFragLoadError=function(E){var w=E.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(E){var w=this.getCurrentContext(E);if(!w||this.state!==R.PARSING){this.fragCurrent||(this.state=R.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,E.partial)},d.getCurrentContext=function(E){var w=this.levels,j=E.level,W=E.sn,T=E.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(E,w,j,W){if(!E||this.state!==R.PARSING)return;var T=E.data1,M=E.data2,m=T;if(T&&M&&(m=Object(p.appendUint8Array)(T,M)),!m||!m.length)return;var v={type:E.type,frag:w,part:j,chunkMeta:W,parent:w.type,data:m};this.hls.trigger(n.Events.BUFFER_APPENDING,v),E.dropped&&E.independent&&!j&&this.flushBufferGap(w)},d.flushBufferGap=function(E){var w=this.media;if(!w)return;if(!G.BufferHelper.isBuffered(w,w.currentTime)){this.flushMainBuffer(0,E.start);return}var j=w.currentTime,W=G.BufferHelper.bufferInfo(w,j,0),T=E.duration,M=Math.min(this.config.maxFragLookUpTolerance*2,T*.25),m=Math.max(Math.min(E.start-M,W.end-M),j+M);E.start-m>M&&this.flushMainBuffer(m,E.start)},d.getFwdBufferInfo=function(E,w){var j=this.config,W=this.getLoadPosition();if(!Object(z.isFiniteNumber)(W))return null;var T=G.BufferHelper.bufferInfo(E,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(E,W,Math.max(T.nextStart,j.maxBufferHole))}return T},d.getMaxBufferLength=function(E){var w=this.config,j;return E?j=Math.max(8*w.maxBufferSize/E,w.maxBufferLength):j=w.maxBufferLength,Math.min(j,w.maxMaxBufferLength)},d.reduceMaxBufferLength=function(E){var w=this.config,j=E||w.maxBufferLength;return w.maxMaxBufferLength>=j?(w.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+w.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(E,w){var j,W,T=w.fragments,M=T.length;if(!M)return null;var m=this.config,v=T[0].start,K;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&&(K=this.getInitialLiveFragment(w,T),this.startPosition=K?this.hls.liveSyncPosition||K.start:E)}else E<=v&&(K=T[0]);if(!K){var q=m.lowLatencyMode?w.partEnd:w.fragmentEnd;K=this.getFragmentAtPosition(E,q,w)}return(j=K)!==null&&j!==void 0&&j.initSegment&&!((W=K)!==null&&W!==void 0&&W.initSegment.data)&&!this.bitrateTest&&(K=K.initSegment),K},d.getNextPart=function(E,w,j){for(var W=-1,T=!1,M=!0,m=0,v=E.length;m<v;m++){var K=E[m];if(M=M&&!K.independent,W>-1&&j<K.start)break;var X=K.loaded;!X&&(T||K.independent||M)&&K.fragment===w&&(W=m),T=X}return W},d.loadedEndOfParts=function(E,w){var j=E[E.length-1];return j&&w>j.start&&j.loaded},d.getInitialLiveFragment=function(E,w){var j=this.fragPrevious,W=null;if(j){if(E.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>=E.startSN&&T<=E.endSN){var M=w[T-E.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?E.fragmentEnd:E.edge,E))}return W},d.getFragmentAtPosition=function(E,w,j){var W=this.config,T=this.fragPrevious,M=j.fragments,m=j.endSN,v=j.fragmentHint,K=W.maxFragLookUpTolerance,X=!!(W.lowLatencyMode&&j.partList&&v);X&&v&&!this.bitrateTest&&(M=M.concat(v),m=v.sn);var q;if(E<w){var re=E>w-K?0:K;q=Object(c.findFragmentByPTS)(T,M,E,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 Ee=ye;M[Ee]&&this.fragmentTracker.getState(M[Ee])===F.FragmentState.BACKTRACKED;)T?q=M[Ee--]:q=M[--Ee];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(E){var w=this.config,j=this.media;if(!j)return;var W=this.hls.liveSyncPosition,T=j.currentTime,M=E.fragments[0].start,m=E.edge,v=T>=M-w.maxFragLookUpTolerance&&T<=m;if(W!==null&&j.duration>W&&(T<W||!v)){var K=w.liveMaxLatencyDuration!==void 0?w.liveMaxLatencyDuration:w.liveMaxLatencyDurationCount*E.targetduration;(!v&&j.readyState<4||T<m-K)&&(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(E,w){var j=this.levels,W=this.levelLastLoaded,T=this.fragPrevious,M=W!==null?j[W]:null,m=E.fragments.length;if(!m)return this.warn("No fragments in live playlist"),0;var v=E.fragments[0].start,K=!w,X=E.alignedSliding&&Object(z.isFiniteNumber)(v);if(K||!X&&!v){Object(_.alignStream)(T,M,E);var q=E.fragments[0].start;return this.log("Live playlist sliding: "+q.toFixed(2)+" start-sn: "+(w?w.startSN:"na")+"->"+E.startSN+" prev-sn: "+(T?T.sn:"na")+" fragments: "+m),q}return v},d.waitForCdnTuneIn=function(E){var w=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*w)},d.setStartPosition=function(E,w){var j=this.startPosition;if(j<w&&(j=-1),j===-1||this.lastCurrentTime===-1){var W=E.startTimeOffset;Object(z.isFiniteNumber)(W)?(j=w+W,W<0&&(j+=E.totalduration),j=Math.min(Math.max(w,j),w+E.totalduration),this.log("Start time offset "+W+" found in playlist, adjust startPosition to "+j),this.startPosition=j):E.live?j=this.hls.liveSyncPosition||w:this.startPosition=j=0,this.lastCurrentTime=j}this.nextLoadPosition=j},d.getLoadPosition=function(){var E=this.media,w=0;return this.loadedmetadata&&E?w=E.currentTime:this.nextLoadPosition&&(w=this.nextLoadPosition),w},d.handleFragLoadAborted=function(E,w){this.transmuxer&&E.sn!=="initSegment"&&E.stats.aborted&&(this.warn("Fragment "+E.sn+(w?" part"+w.index:"")+" of level "+E.level+" was aborted"),this.resetFragmentLoading(E))},d.resetFragmentLoading=function(E){(!this.fragCurrent||!this.fragContextChanged(E))&&(this.state=R.IDLE)},d.onFragmentOrKeyLoadError=function(E,w){if(w.fatal)return;var j=w.frag;if(!j||j.type!==E)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 "+E+" "+j.level+" failed to load, retrying in "+M+"ms"),this.retryDate=self.performance.now()+M,this.fragLoadError++,this.state=R.FRAG_LOADING_WAITING_RETRY}else w.levelRetry?(E===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=R.IDLE):(H.logger.error(w.details+" reaches max retry, redispatch as fatal ..."),w.fatal=!0,this.hls.stopLoad(),this.state=R.ERROR)},d.afterBufferFlushed=function(E,w,j){if(!E)return;var W=G.BufferHelper.getBuffered(E);this.fragmentTracker.detectEvictedFragments(w,W,j),this.state===R.ENDED&&this.resetLoadingState()},d.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=R.IDLE},d.resetLiveStartWhenNotLoaded=function(E){if(!this.loadedmetadata){this.startFragRequested=!1;var w=this.levels?this.levels[E].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(E,w,j,W){var T=this,M=j.details;console.assert(!!M,"level.details must be defined");var m=Object.keys(E.elementaryStreams).reduce(function(v,K){var X=E.elementaryStreams[K];if(X){var q=X.endPTS-X.startPTS;if(q<=0)return T.warn("Could not parse fragment "+E.sn+" "+K+" duration reliably ("+q+") resetting transmuxer to fallback to playlist timing"),T.resetTransmuxer(),v||!1;var re=W?0:Object(a.updateFragPTSDTS)(M,E,X.startPTS,X.endPTS,X.startDTS,X.endDTS);return T.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:M,level:j,drift:re,type:K,frag:E,start:X.startPTS,end:X.endPTS}),!0}return v},!1);m?(this.state=R.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:E,part:w})):this.resetLoadingState()},d.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},D(f,[{key:"state",get:function(){return this._state},set:function(E){var w=this._state;w!==E&&(this._state=E,this.log(w+"->"+E))}}]),f}(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"),H=N("./src/utils/buffer-helper.ts"),n=N("./src/utils/mediasource-helper.ts"),I=N("./src/loader/fragment.ts"),x=N("./src/controller/buffer-operation-queue.ts"),p=Object(n.getMediaSource)(),_=/([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 h=a.prototype;return h.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},h.destroy=function(){this.unregisterListeners(),this.details=null},h.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)},h.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)},h._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new x.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},h.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")},h.onMediaAttaching=function(u,s){var i=this.media=s.media;if(i&&p){var D=this.mediaSource=new p;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}},h.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)},h.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()},h.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 O=s[A],R=O.codec,g=O.levelCodec,b=O.container,f=(S.levelCodec||S.codec).replace(_,"$1"),d=(g||R).replace(_,"$1");if(f!==d){var C=b+";codecs="+(g||R);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()},h.appendChangeType=function(u,s){var i=this,D=this.operationQueue,A={execute:function(){var O=i.sourceBuffer[u];O&&(F.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+s),O.changeType(s)),D.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(O){F.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",O)}};D.append(A,u)},h.onBufferAppending=function(u,s){var i=this,D=this.hls,A=this.operationQueue,S=this.tracks,O=s.data,R=s.type,g=s.frag,b=s.part,f=s.chunkMeta,d=f.buffering[R],C=self.performance.now();d.start=C;var E=g.stats.buffering,w=b?b.stats.buffering:null;E.start===0&&(E.start=C),w&&w.start===0&&(w.start=C);var j=S.audio,W=R==="audio"&&f.id===1&&(j==null?void 0:j.container)==="audio/mpeg",T={execute:function(){if(d.executeStart=self.performance.now(),W){var m=i.sourceBuffer[R];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(O,R)},onStart:function(){},onComplete:function(){var m=self.performance.now();d.executeEnd=d.end=m,E.first===0&&(E.first=m),w&&w.first===0&&(w.first=m);var v=i.sourceBuffer,K={};for(var X in v)K[X]=H.BufferHelper.getBuffered(v[X]);i.appendError=0,i.hls.trigger(P.Events.BUFFER_APPENDED,{type:R,frag:g,part:b,chunkMeta:f,parent:g.type,timeRanges:K})},onError:function(m){F.logger.error("[buffer-controller]: Error encountered while trying to append to the "+R+" 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,R)},h.onBufferFlushing=function(u,s){var i=this,D=this.operationQueue,A=function(O){return{execute:i.removeExecutor.bind(i,O,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(P.Events.BUFFER_FLUSHED,{type:O})},onError:function(g){F.logger.warn("[buffer-controller]: Failed to remove from "+O+" SourceBuffer",g)}}};s.type?D.append(A(s.type),s.type):this.getSourceBufferTypes().forEach(function(S){D.append(A(S),S)})},h.onFragParsed=function(u,s){var i=this,D=s.frag,A=s.part,S=[],O=A?A.elementaryStreams:D.elementaryStreams;O[I.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(O[I.ElementaryStreamTypes.AUDIO]&&S.push("audio"),O[I.ElementaryStreamTypes.VIDEO]&&S.push("video"));var R=function(){var b=self.performance.now();D.stats.buffering.end=b,A&&(A.stats.buffering.end=b);var f=A?A.stats:D.stats;i.hls.trigger(P.Events.FRAG_BUFFERED,{frag:D,part:A,stats:f,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(R,S)},h.onFragChanged=function(u,s){this.flushBackBuffer()},h.onBufferEos=function(u,s){var i=this,D=this.getSourceBufferTypes().reduce(function(A,S){var O=i.sourceBuffer[S];return(!s.type||s.type===S)&&(O&&!O.ended&&(O.ended=!0,F.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),A&&!!(!O||O.ended)},!0);D&&this.blockBuffers(function(){var A=i.mediaSource;if(!A||A.readyState!=="open")return;A.endOfStream()})},h.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()},h.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 O=i.currentTime,R=s.levelTargetDuration,g=Math.max(S,R),b=Math.floor(O/R)*R-g;A.forEach(function(f){var d=D[f];if(d){var C=H.BufferHelper.getBuffered(d);C.length>0&&b>C.start(0)&&(u.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),s.live&&u.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),u.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:f}))}})},h.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,O=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>O&&A>S||!Object(z.isFiniteNumber)(S))&&(F.logger.log("[buffer-controller]: Updating Media Source duration to "+A.toFixed(3)),D.duration=A)},h.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)}},h.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)})}},h.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 O=S.levelCodec||S.codec,R=S.container+";codecs="+O;F.logger.log("[buffer-controller]: creating sourceBuffer("+R+")");try{var g=s[A]=i.addSourceBuffer(R),b=A;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[A]={buffer:g,codec:O,container:S.container,levelCodec:S.levelCodec,id:S.id},D++}catch(f){F.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+f.message),this.hls.trigger(P.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,mimeType:R})}}D&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},h._onSBUpdateStart=function(u){var s=this.operationQueue,i=s.current(u);i.onStart()},h._onSBUpdateEnd=function(u){var s=this.operationQueue,i=s.current(u);i.onComplete(),s.shiftAndExecuteNext(u)},h._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)},h.removeExecutor=function(u,s,i){var D=this.media,A=this.mediaSource,S=this.operationQueue,O=this.sourceBuffer,R=O[u];if(!D||!A||!R){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,b=Object(z.isFiniteNumber)(A.duration)?A.duration:Infinity,f=Math.max(0,s),d=Math.min(i,g,b);d>f?(F.logger.log("[buffer-controller]: Removing ["+f+","+d+"] from the "+u+" SourceBuffer"),console.assert(!R.updating,u+" sourceBuffer must not be updating"),R.remove(f,d)):S.shiftAndExecuteNext(u)},h.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)},h.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 O=i.sourceBuffer[S];(!O||!O.updating)&&D.shiftAndExecuteNext(S)})})},h.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},h.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)},h.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(H){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=H}var G=F.prototype;return G.append=function(n,I){var x=this.queues[I];x.push(n),x.length===1&&this.buffers[I]&&this.executeNext(I)},G.insertAbort=function(n,I){var x=this.queues[I];x.unshift(n),this.executeNext(I)},G.appendBlocker=function(n){var I,x=new Promise(function(_){I=_}),p={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,n),x},G.executeNext=function(n){var I=this.buffers,x=this.queues,p=I[n],_=x[n];if(_.length){var c=_[0];try{c.execute()}catch(a){z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(a),(!p||!p.updating)&&(_.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(H,n){for(var I=0;I<n.length;I++){var x=n[I];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(H,x.key,x)}}function F(H,n,I){return n&&P(H.prototype,n),I&&P(H,I),H}var G=function(){function H(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=H.prototype;return n.setStreamController=function(x){this.streamController=x},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 x=this.hls;x.on(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),x.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),x.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.on(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),x.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var x=this.hls;x.off(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),x.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),x.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.off(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),x.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(x,p){H.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},n.onMediaAttaching=function(x,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},n.onManifestParsed=function(x,p){var _=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,_.config.capLevelToPlayerSize&&p.video&&this.startCapping()},n.onBufferCodecs=function(x,p){var _=this.hls;_.config.capLevelToPlayerSize&&p.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var x=this.hls.levels;if(x.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(x.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},n.getMaxLevel=function(x){var p=this,_=this.hls.levels;if(!_.length)return-1;var c=_.filter(function(a,h){return H.isLevelAllowed(h,p.restrictedLevels)&&h<=x});return this.clientRect=null,H.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 x=this.media,p={width:0,height:0};if(x){var _=x.getBoundingClientRect();p.width=_.width,p.height=_.height,!p.width&&!p.height&&(p.width=_.right-_.left||x.width||0,p.height=_.bottom-_.top||x.height||0)}return this.clientRect=p,p},H.isLevelAllowed=function(x,p){return p===void 0&&(p=[]),p.indexOf(x)===-1},H.getMaxLevelByMediaSize=function(x,p,_){if(!x||!x.length)return-1;for(var c=function(s,i){return i?s.width!==i.width||s.height!==i.height:!0},a=x.length-1,h=0;h<x.length;h+=1){var l=x[h];if((l.width>=p||l.height>=_)&&c(l,x[h+1])){a=h;break}}return a},F(H,[{key:"mediaWidth",get:function(){return this.getDimensions().width*H.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*H.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var x=1;try{x=self.devicePixelRatio}catch(p){}return x}}]),H}();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 H(a,h){for(var l=0;l<h.length;l++){var u=h[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(a,u.key,u)}}function n(a,h,l){return h&&H(a.prototype,h),l&&H(a,l),a}function I(a,h){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=x(a))||h&&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 x(a,h){if(!a)return;if(typeof a=="string")return p(a,h);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 p(a,h)}function p(a,h){(h==null||h>a.length)&&(h=a.length);for(var l=0,u=new Array(h);l<h;l++)u[l]=a[l];return u}function _(){return _=Object.assign||function(a){for(var h=1;h<arguments.length;h++){var l=arguments[h];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},_.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],O=u.getObjectType(A),R={d:A.duration*1e3,ot:O};(O===P.CMCDObjectType.VIDEO||O===P.CMCDObjectType.AUDIO||O==P.CMCDObjectType.MUXED)&&(R.br=S.bitrate/1e3,R.tb=u.getTopBandwidth(O),R.bl=u.getBufferLength(O)),u.apply(D,R)}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 h=a.prototype;return h.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)},h.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()},h.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},h.onMediaAttached=function(u,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},h.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},h.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},h.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}},h.apply=function(u,s){s===void 0&&(s={}),_(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={}),_(u.headers,D)}else{var A=a.toQuery(s);if(!A)return;u.url=a.appendQueryToUri(u.url,A)}},h.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},h.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},h.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},h.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(O,R,g){s(O),this.loader.load(O,R,g)},n(D,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),D}()},h.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(O,R,g){s(O),this.loader.load(O,R,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)},O={br:D,d:D,bl:A,dl:A,mtp:A,nor:S,rtp:A,tb:D},R=Object.keys(u||{}).sort(),g=I(R),b;!(b=g()).done;){var f=b.value,d=u[f];if(!i(d))continue;if(f==="v"&&d===1)continue;if(f=="pr"&&d===1)continue;var C=O[f];C&&(d=C(d));var E=typeof d,w=void 0;f==="ot"||f==="sf"||f==="st"?w=f+"="+d:E==="boolean"?w=f:E==="number"?w=f+"="+d:w=f+"="+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},O=0,R=s;O<R.length;O++){var g=R[O],b=S[g]!=null?S[g]:1;A[b][g]=u[g]}for(var f=0;f<A.length;f++){var d=a.serialize(A[f]);d&&(i["CMCD-"+D[f]]=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 H(c,a){for(var h=0;h<a.length;h++){var l=a[h];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function n(c,a,h){return a&&H(c.prototype,a),h&&H(c,h),c}var I=3,x=function(a,h,l){var u={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(s){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:l.audioRobustness||""})}),h.forEach(function(s){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:l.videoRobustness||""})}),[u]},p=function(a,h,l,u){switch(a){case G.KeySystems.WIDEVINE:return x(h,l,u);default:throw new Error("Unknown key-system: "+a)}},_=function(){function c(h){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=h,this._config=h.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=p(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(O){F.logger.error(O)}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=_},"./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 H=G.prototype;return H.setStreamController=function(I){this.streamController=I},H.registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},H.unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching)},H.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},H.onMediaAttaching=function(I,x){var p=this.hls.config;if(p.capLevelOnFPSDrop){var _=x.media instanceof self.HTMLVideoElement?x.media:null;this.media=_,_&&typeof _.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},H.checkFPS=function(I,x,p){var _=performance.now();if(x){if(this.lastTime){var c=_-this.lastTime,a=p-this.lastDroppedFrames,h=x-this.lastDecodedFrames,l=1e3*a/c,u=this.hls;if(u.trigger(z.Events.FPS_DROP,{currentDropped:a,currentDecoded:h,totalDroppedFrames:p}),l>0&&a>u.config.fpsDroppedMonitoringThreshold*h){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=_,this.lastDroppedFrames=p,this.lastDecodedFrames=x}},H.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var x=I.getVideoPlaybackQuality();this.checkFPS(I,x.totalVideoFrames,x.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 H}),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(x,p,_){if(p===null||!Array.isArray(x)||!x.length||!Object(z.isFiniteNumber)(p))return null;var c=x[0].programDateTime;if(p<(c||0))return null;var a=x[x.length-1].endProgramDateTime;if(p>=(a||0))return null;_=_||0;for(var h=0;h<x.length;++h){var l=x[h];if(n(p,_,l))return l}return null}function G(x,p,_,c){_===void 0&&(_=0),c===void 0&&(c=0);var a=null;if(x?a=p[x.sn-p[0].sn+1]||null:_===0&&p[0].start===0&&(a=p[0]),a&&H(_,c,a)===0)return a;var h=P.default.search(p,H.bind(null,_,c));return h||a}function H(x,p,_){x===void 0&&(x=0),p===void 0&&(p=0);var c=Math.min(p,_.duration+(_.deltaPTS?_.deltaPTS:0));return _.start+_.duration-c<=x?1:_.start-c>x&&_.start?-1:0}function n(x,p,_){var c=Math.min(p,_.duration+(_.deltaPTS?_.deltaPTS:0))*1e3,a=_.endProgramDateTime||0;return a-c>x}function I(x,p){return P.default.search(x,function(_){return _.cc<p?1:_.cc>p?-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(p){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=p,this._registerListeners()}var x=I.prototype;return x._registerListeners=function(){var _=this.hls;_.on(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),_.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),_.on(z.Events.FRAG_LOADED,this.onFragLoaded,this)},x._unregisterListeners=function(){var _=this.hls;_.off(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),_.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),_.off(z.Events.FRAG_LOADED,this.onFragLoaded,this)},x.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},x.getAppendedFrag=function(_,c){if(c===P.PlaylistLevelType.MAIN){var a=this.activeFragment,h=this.activeParts;if(!a)return null;if(h)for(var l=h.length;l--;){var u=h[l],s=u?u.end:a.appendedPTS;if(u.start<=_&&s!==void 0&&_<=s)return l>9&&(this.activeParts=h.slice(l-9)),u}else if(a.start<=_&&a.appendedPTS!==void 0&&_<=a.appendedPTS)return a}return this.getBufferedFrag(_,c)},x.getBufferedFrag=function(_,c){for(var a=this.fragments,h=Object.keys(a),l=h.length;l--;){var u=a[h[l]];if((u==null?void 0:u.body.type)===c&&u.buffered){var s=u.body;if(s.start<=_&&_<=s.end)return s}}return null},x.detectEvictedFragments=function(_,c,a){var h=this;Object.keys(this.fragments).forEach(function(l){var u=h.fragments[l];if(!u)return;if(!u.buffered){u.body.type===a&&h.removeFragment(u.body);return}var s=u.range[_];if(!s)return;s.time.some(function(i){var D=!h.isTimeBuffered(i.startPTS,i.endPTS,c);return D&&h.removeFragment(u.body),D})})},x.detectPartialFragments=function(_){var c=this,a=this.timeRanges,h=_.frag,l=_.part;if(!a||h.sn==="initSegment")return;var u=n(h),s=this.fragments[u];if(!s)return;Object.keys(a).forEach(function(i){var D=h.elementaryStreams[i];if(!D)return;var A=a[i],S=l!==null||D.partial===!0;s.range[i]=c.getBufferedTimes(h,l,S,A)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},x.fragBuffered=function(_){var c=n(_),a=this.fragments[c];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},x.getBufferedTimes=function(_,c,a,h){for(var l={time:[],partial:a},u=c?c.start:_.start,s=c?c.end:_.end,i=_.minEndPTS||s,D=_.maxStartPTS||u,A=0;A<h.length;A++){var S=h.start(A)-this.bufferPadding,O=h.end(A)+this.bufferPadding;if(D>=S&&i<=O){l.time.push({startPTS:Math.max(u,h.start(A)),endPTS:Math.min(s,h.end(A))});break}else if(u<O&&s>S)l.partial=!0,l.time.push({startPTS:Math.max(u,h.start(A)),endPTS:Math.min(s,h.end(A))});else if(s<=S)break}return l},x.getPartialFragment=function(_){var c=null,a,h,l,u=0,s=this.bufferPadding,i=this.fragments;return Object.keys(i).forEach(function(D){var A=i[D];if(!A)return;H(A)&&(h=A.body.start-s,l=A.body.end+s,_>=h&&_<=l&&(a=Math.min(_-h,l-_),u<=a&&(c=A.body,u=a)))}),c},x.getState=function(_){var c=n(_),a=this.fragments[c];return a?a.buffered?H(a)?F.PARTIAL:F.OK:a.backtrack?F.BACKTRACKED:F.APPENDING:F.NOT_LOADED},x.backtrack=function(_,c){var a=n(_),h=this.fragments[a];if(!h||h.backtrack)return null;var l=h.backtrack=c||h.loaded;return h.loaded=null,l},x.getBacktrackData=function(_){var c=n(_),a=this.fragments[c];if(a){var h,l=a.backtrack;if(l!=null&&(h=l.payload)!==null&&h!==void 0&&h.byteLength)return l;this.removeFragment(_)}return null},x.isTimeBuffered=function(_,c,a){for(var h,l,u=0;u<a.length;u++){if(h=a.start(u)-this.bufferPadding,l=a.end(u)+this.bufferPadding,_>=h&&c<=l)return!0;if(c<=h)return!1}return!1},x.onFragLoaded=function(_,c){var a=c.frag,h=c.part;if(a.sn==="initSegment"||a.bitrateTest||h)return;var l=n(a);this.fragments[l]={body:a,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},x.onBufferAppended=function(_,c){var a=this,h=c.frag,l=c.part,u=c.timeRanges;if(h.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=h,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++)h.appendedPTS=Math.max(D.end(A),h.appendedPTS||0)})},x.onFragBuffered=function(_,c){this.detectPartialFragments(c)},x.hasFragment=function(_){var c=n(_);return!!this.fragments[c]},x.removeFragmentsInRange=function(_,c,a){var h=this;Object.keys(this.fragments).forEach(function(l){var u=h.fragments[l];if(!u)return;if(u.buffered){var s=u.body;s.type===a&&s.start<c&&s.end>_&&h.removeFragment(s)}})},x.removeFragment=function(_){var c=n(_);_.stats.loaded=0,_.clearElementaryStreamInfo(),delete this.fragments[c]},x.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function H(I){var x,p;return I.buffered&&(((x=I.range.video)===null||x===void 0?void 0:x.partial)||((p=I.range.audio)===null||p===void 0?void 0:p.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 H}),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 x}),N.d(Y,"default",function(){return p});var z=N("./src/utils/buffer-helper.ts"),P=N("./src/errors.ts"),F=N("./src/events.ts"),G=N("./src/utils/logger.ts"),H=250,n=2,I=.1,x=.05,p=function(){function _(a,h,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=h,this.fragmentTracker=l,this.hls=u}var c=_.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(h){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!==h){if(this.moved=!0,s!==null){if(this.stallReported){var O=self.performance.now()-s;G.logger.warn("playback not stuck anymore @"+i+", after "+Math.round(O)+"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 R=z.BufferHelper.bufferInfo(u,i,0),g=R.len>0,b=R.nextStart||0;if(!g&&!b)return;if(D){var f=R.len>n,d=!b||b-i>n&&!this.fragmentTracker.getPartialFragment(i);if(f||d)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,E=Math.max(b,R.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(E>0&&E<=W){this._trySkipBufferHole(null);return}}var T=self.performance.now();if(s===null){this.stalled=T;return}var M=T-s;!D&&M>=H&&this._reportStall(R.len);var m=z.BufferHelper.bufferInfo(u,i,l.maxBufferHole);this._tryFixBufferStall(m,M)},c._tryFixBufferStall=function(h,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}h.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(h){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="+h+")"),l.trigger(F.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}))},c._trySkipBufferHole=function(h){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 O=A.start(S);if(i+l.maxBufferHole>=D&&i<O){var R=Math.max(O+x,s.currentTime+I);return G.logger.warn("skipping hole, adjusting currentTime from "+i+" to "+R),this.moved=!0,this.stalled=null,s.currentTime=R,h&&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 "+R,frag:h}),R}D=A.end(S)}return 0},c._tryNudgeBuffer=function(){var h=this.config,l=this.hls,u=this.media,s=u.currentTime,i=(this.nudgeRetry||0)+1;if(this.nudgeRetry=i,i<h.nudgeMaxRetry){var D=s+i*h.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 "+h.nudgeMaxRetry+" nudges"),l.trigger(F.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},_}()},"./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,H=function(){function n(x){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=x,this._registerListeners()}var I=n.prototype;return I.destroy=function(){this._unregisterListeners()},I._registerListeners=function(){var p=this.hls;p.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I._unregisterListeners=function(){var p=this.hls;p.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I.onMediaAttached=function(p,_){this.media=_.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(P.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.getID3Track=function(p){if(!this.media)return;for(var _=0;_<p.length;_++){var c=p[_];if(c.kind==="metadata"&&c.label==="id3")return Object(P.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},I.onFragParsingMetadata=function(p,_){if(!this.media)return;var c=_.frag,a=_.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var h=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 O=new h(s,i,"");O.value=S,this.id3Track.addCue(O)}}}}},I.onBufferFlushing=function(p,_){var c=_.startOffset,a=_.endOffset,h=_.type;if(!h||h==="audio"){var l=this.id3Track;l&&Object(P.removeCuesInRange)(l,c,a)}},n}();Y.default=H},"./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,x){for(var p=0;p<x.length;p++){var _=x[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(I,_.key,_)}}function H(I,x,p){return x&&G(I.prototype,x),p&&G(I,p),I}var n=function(){function I(p){var _=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 _.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var x=I.prototype;return x.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},x.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)},x.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)},x.onMediaAttached=function(_,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},x.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},x.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},x.onLevelUpdated=function(_,c){var a=c.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},x.onError=function(_,c){if(c.details!==z.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,F.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},x.timeupdate=function(){var _=this.media,c=this.levelDetails;if(!_||!c)return;this.currentTime=_.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var h=this.config,l=h.lowLatencyMode,u=h.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)),O=Math.round(2/(1+Math.exp(-.75*i-this.edgeStalled))*20)/20;_.playbackRate=Math.min(S,Math.max(1,O))}else _.playbackRate!==1&&_.playbackRate!==0&&(_.playbackRate=1)},x.estimateLiveEdge=function(){var _=this.levelDetails;return _===null?null:_.edge+_.age},x.computeLatency=function(){var _=this.estimateLiveEdge();return _===null?null:_-this.currentTime},H(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var _=this.config,c=this.levelDetails;return _.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:c?_.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var _=this.levelDetails;if(_===null)return null;var c=_.holdBack,a=_.partHoldBack,h=_.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*h);var S=h,O=1;return A+Math.min(this.stallCount*O,S)}},{key:"liveSyncPosition",get:function(){var _=this.estimateLiveEdge(),c=this.targetLatency,a=this.levelDetails;if(_===null||c===null||a===null)return null;var h=a.edge,l=_-c-this.edgeStalled,u=h-a.totalduration,s=h-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(u,l),s)}},{key:"drift",get:function(){var _=this.levelDetails;return _===null?1:_.drift}},{key:"edgeStalled",get:function(){var _=this.levelDetails;if(_===null)return 0;var c=(this.config.lowLatencyMode&&_.partTarget||_.targetduration)*3;return Math.max(_.age-c,0)}},{key:"forwardBufferLength",get:function(){var _=this.media,c=this.levelDetails;if(!_||!c)return 0;var a=_.buffered.length;return a?_.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"),H=N("./src/controller/level-helper.ts"),n=N("./src/controller/base-playlist-controller.ts"),I=N("./src/types/loader.ts");function x(){return x=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},x.apply(this,arguments)}function p(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 _(u,s,i){return s&&p(u.prototype,s),i&&p(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 h=/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 O=[],R=[],g=[],b,f={},d,C=!1,E=!1,w=!1;if(S.levels.forEach(function(M){var m=M.attrs;C=C||!!(M.width&&M.height),E=E||!!M.videoCodec,w=w||!!M.audioCodec,h&&M.audioCodec&&M.audioCodec.indexOf("mp4a.40.34")!==-1&&(M.audioCodec=void 0);var v=M.bitrate+"-"+M.attrs.RESOLUTION+"-"+M.attrs.CODECS;d=f[v],d?d.url.push(M.url):(d=new z.Level(M),f[v]=d,O.push(d)),m&&(m.AUDIO&&Object(H.addGroupId)(d,"audio",m.AUDIO),m.SUBTITLES&&Object(H.addGroupId)(d,"text",m.SUBTITLES))}),(C||E)&&w&&(O=O.filter(function(M){var m=M.videoCodec,v=M.width,K=M.height;return!!m||!!(v&&K)})),O=O.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&&(R=S.audioTracks.filter(function(M){return!M.audioCodec||Object(G.isCodecSupportedInMp4)(M.audioCodec,"audio")}),Object(H.assignTrackIdsByGroup)(R)),S.subtitles&&(g=S.subtitles,Object(H.assignTrackIdsByGroup)(g)),O.length>0){b=O[0].bitrate,O.sort(function(M,m){return M.bitrate-m.bitrate}),this._levels=O;for(var j=0;j<O.length;j++)if(O[j].bitrate===b){this._firstLevel=j,this.log("manifest loaded, "+O.length+" level(s) found, first bitrate: "+b);break}var W=w&&!E,T={levels:O,audioTracks:R,subtitleTracks:g,firstLevel:this._firstLevel,stats:S.stats,audio:w,video:E,altAudio:!W&&R.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 O=S.context,R=this._levels[this.currentLevelIndex];if(O&&(O.type===I.PlaylistContextType.AUDIO_TRACK&&R.audioGroupIds&&O.groupId===R.audioGroupIds[R.urlId]||O.type===I.PlaylistContextType.SUBTITLE_TRACK&&R.textGroupIds&&O.groupId===R.textGroupIds[R.urlId])){this.redundantFailover(this.currentLevelIndex);return}var g=!1,b=!0,f;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&&(f=S.frag.level)):f=S.frag.level}break;case F.ErrorDetails.LEVEL_LOAD_ERROR:case F.ErrorDetails.LEVEL_LOAD_TIMEOUT:O&&(O.deliveryDirectives&&(b=!1),f=O.level),g=!0;break;case F.ErrorDetails.REMUX_ALLOC_ERROR:f=S.level,g=!0;break}f!==void 0&&this.recoverLevel(S,f,g,b)},i.recoverLevel=function(A,S,O,R){var g=A.details,b=this._levels[S];if(b.loadError++,O){var f=this.retryLoadingOrFail(A);if(f)A.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(R){var d=b.url.length;if(d>1&&b.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],O=S.url.length;if(O>1){var R=(S.urlId+1)%O;this.warn("Switching to redundant URL-id "+R),this._levels.forEach(function(g){g.urlId=R}),this.level=A}},i.onFragLoaded=function(A,S){var O=S.frag;if(O!==void 0&&O.type===I.PlaylistLevelType.MAIN){var R=this._levels[O.level];R!==void 0&&(R.fragmentError=0,R.loadError=0)}},i.onLevelLoaded=function(A,S){var O,R=S.level,g=S.details,b=this._levels[R];if(!b){var f;this.warn("Invalid level index "+R),(f=S.deliveryDirectives)!==null&&f!==void 0&&f.skip&&(g.deltaUpdateFailed=!0);return}R===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(R,S,b.details)):(O=S.deliveryDirectives)!==null&&O!==void 0&&O.skip&&(g.deltaUpdateFailed=!0)},i.onAudioTrackSwitched=function(A,S){var O=this.hls.levels[this.currentLevelIndex];if(!O)return;if(O.audioGroupIds){for(var R=-1,g=this.hls.audioTracks[S.id].groupId,b=0;b<O.audioGroupIds.length;b++)if(O.audioGroupIds[b]===g){R=b;break}R!==O.urlId&&(O.urlId=R,this.startLoad())}},i.loadPlaylist=function(A){var S=this.currentLevelIndex,O=this._levels[S];if(this.canLoad&&O&&O.url.length>0){var R=O.urlId,g=O.url[R];if(A)try{g=A.addDirectives(g)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+S+(A?" at sn "+A.msn+" part "+A.part:"")+" with URL-id "+R+" "+g),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:g,level:S,id:R,deliveryDirectives:A||null})}},i.removeLevel=function(A,S){var O=function(b,f){return f!==S},R=this._levels.filter(function(g,b){return b!==A?!0:g.url.length>1&&S!==void 0?(g.url=g.url.filter(O),g.audioGroupIds&&(g.audioGroupIds=g.audioGroupIds.filter(O)),g.textGroupIds&&(g.textGroupIds=g.textGroupIds.filter(O)),g.urlId=0,!0):!1}).map(function(g,b){var f=g.details;return f!=null&&f.fragments&&f.fragments.forEach(function(d){d.level=b}),g});this._levels=R,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:R})},_(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,O=this._levels;if(O.length===0)return;if(this.currentLevelIndex===A&&(S=O[A])!==null&&S!==void 0&&S.details)return;if(A<0||A>=O.length){var R=A<0;if(this.hls.trigger(P.Events.ERROR,{type:F.ErrorTypes.OTHER_ERROR,details:F.ErrorDetails.LEVEL_SWITCH_ERROR,level:A,fatal:R,reason:"invalid level idx"}),R)return;A=Math.min(A,O.length-1)}this.clearTimer();var g=this.currentLevelIndex,b=O[g],f=O[A];this.log("switching to level "+A+" from "+g),this.currentLevelIndex=A;var d=x({},f,{level:A,maxBitrate:f.maxBitrate,uri:f.uri,urlId:f.urlId});delete d._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,d);var C=f.details;if(!C||C.live){var E=this.switchParams(f.uri,b==null?void 0:b.details);this.loadPlaylist(E)}}},{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 H}),N.d(Y,"updateFragPTSDTS",function(){return I}),N.d(Y,"mergeDetails",function(){return x}),N.d(Y,"mapPartIntersection",function(){return p}),N.d(Y,"mapFragmentIntersection",function(){return _}),N.d(Y,"adjustSliding",function(){return c}),N.d(Y,"addSliding",function(){return a}),N.d(Y,"computeReloadInterval",function(){return h}),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 H(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 O=s.cc===i.cc;O&&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,O){var R=A-D;R<=0&&(P.logger.warn("Fragment should have a positive duration",i),A=D+i.duration,O=S+i.duration);var g=D,b=A,f=i.startPTS,d=i.endPTS;if(Object(z.isFiniteNumber)(f)){var C=Math.abs(f-D);Object(z.isFiniteNumber)(i.deltaPTS)?i.deltaPTS=Math.max(C,i.deltaPTS):i.deltaPTS=C,g=Math.max(D,f),D=Math.min(D,f),S=Math.min(S,i.startDTS),b=Math.min(A,d),A=Math.max(A,d),O=Math.max(O,i.endDTS)}i.duration=A-D;var E=D-i.start;i.appendedPTS=A,i.start=i.startPTS=D,i.maxStartPTS=g,i.startDTS=S,i.endPTS=A,i.minEndPTS=b,i.endDTS=O;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,E}function x(s,i){for(var D=null,A=s.fragments,S=A.length-1;S>=0;S--){var O=A[S].initSegment;if(O){D=O;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var R=0,g;if(_(s,i,function(j,W){j.relurl&&(R=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 b=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments;b.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 f=i.skippedSegments;f--;)i.fragments.shift();i.startSN=i.fragments[0].sn,i.startCC=i.fragments[0].cc}var d=i.fragments;if(R){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var C=0;C<d.length;C++)d[C].cc+=R}i.skippedSegments&&(i.startCC=i.fragments[0].cc),p(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 E=i.advancedDateTime;if(i.advanced&&E){var w=i.edge;i.driftStart||(i.driftStartTime=E,i.driftStart=w),i.driftEndTime=E,i.driftEnd=w}else i.driftEndTime=s.driftEndTime,i.driftEnd=s.driftEnd,i.advancedDateTime=s.advancedDateTime}function p(s,i,D){if(s&&i)for(var A=0,S=0,O=s.length;S<=O;S++){var R=s[S],g=i[S+A];R&&g&&R.index===g.index&&R.fragment.sn===g.fragment.sn?D(R,g):A--}}function _(s,i,D){for(var A=i.skippedSegments,S=Math.max(s.startSN,i.startSN)-i.startSN,O=(s.fragmentHint?1:0)+(A?i.endSN:Math.min(s.endSN,i.endSN))-i.startSN,R=i.startSN-s.startSN,g=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,b=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,f=S;f<=O;f++){var d=b[R+f],C=g[f];A&&!C&&f<A&&(C=i.fragments[f]=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 h(s,i){var D=1e3*s.levelTargetDuration,A=D/2,S=s.age,O=S>0&&S<D*3,R=i.loading.end-i.loading.start,g,b=s.availabilityDelay;if(s.updated===!1)if(O){var f=333*s.misses;g=Math.max(Math.min(A,R*2),f),s.availabilityDelay=(s.availabilityDelay||0)+g}else g=A;else O?(b=Math.min(b||D/2,S),s.availabilityDelay=b,g=b+D-S):g=D-R;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 O=A[S];if(O.index===D&&O.fragment.sn===i)return O}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"),H=N("./src/utils/buffer-helper.ts"),n=N("./src/controller/fragment-tracker.ts"),I=N("./src/types/loader.ts"),x=N("./src/loader/fragment.ts"),p=N("./src/demux/transmuxer-interface.ts"),_=N("./src/types/transmuxer.ts"),c=N("./src/controller/gap-controller.ts"),a=N("./src/errors.ts"),h=N("./src/utils/logger.ts");function l(S,O){for(var R=0;R<O.length;R++){var g=O[R];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(S,g.key,g)}}function u(S,O,R){return O&&l(S.prototype,O),R&&l(S,R),S}function s(S,O){S.prototype=Object.create(O.prototype),S.prototype.constructor=S,i(S,O)}function i(S,O){return i=Object.setPrototypeOf||function(g,b){return g.__proto__=b,g},i(S,O)}var D=100,A=function(S){s(O,S);function O(g,b){var f;return f=S.call(this,g,b,"[stream-controller]")||this,f.audioCodecSwap=!1,f.gapController=null,f.level=-1,f._forceStartLoad=!1,f.altAudio=!1,f.audioOnly=!1,f.fragPlaying=null,f.onvplaying=null,f.onvseeked=null,f.fragLastKbps=0,f.stalled=!1,f.couldBacktrack=!1,f.audioCodecSwitch=!1,f.videoBuffer=null,f._registerListeners(),f}var R=O.prototype;return R._registerListeners=function(){var b=this.hls;b.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on(G.Events.ERROR,this.onError,this),b.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R._unregisterListeners=function(){var b=this.hls;b.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off(G.Events.ERROR,this.onError,this),b.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},R.startLoad=function(b){if(this.levels){var f=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}f>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),b=f),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},R.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},R.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var b,f=this.levels,d=this.level,C=f==null||((b=f[d])===null||b===void 0)?void 0:b.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 E,w=self.performance.now(),j=this.retryDate;(!j||w>=j||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},R.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},R.doTickIdle=function(){var b,f,d=this.hls,C=this.levelLastLoaded,E=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(!E||!E[W])return;var T=E[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,K=this.getMaxBufferLength(T.maxBitrate);if(v>=K)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?x.ElementaryStreamTypes.AUDIO:x.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),((b=re.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((f=re.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(re,M):this.loadFragment(re,M,q)},R.loadFragment=function(b,f,d){var C,E=this.fragmentTracker.getState(b);if(this.fragCurrent=b,E===n.FragmentState.BACKTRACKED){var w=this.fragmentTracker.getBacktrackData(b);if(w){this._handleFragmentLoadProgress(w),this._handleFragmentLoadComplete(w);return}else E=n.FragmentState.NOT_LOADED}E===n.FragmentState.NOT_LOADED||E===n.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,b,f,d)):E===n.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},R.getAppendedFrag=function(b){var f=this.fragmentTracker.getAppendedFrag(b,I.PlaylistLevelType.MAIN);return f&&"fragment"in f?f.fragment:f},R.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,I.PlaylistLevelType.MAIN)},R.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},R.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},R.nextLevelSwitch=function(){var b=this.levels,f=this.media;if(f!=null&&f.readyState){var d,C=this.getAppendedFrag(f.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!f.paused&&b){var E=this.hls.nextLoadLevel,w=b[E],j=this.fragLastKbps;j&&this.fragCurrent?d=this.fragCurrent.duration*w.maxBitrate/(1e3*j)+1:d=0}else d=0;var W=this.getBufferedFrag(f.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)}}}},R.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===P.State.KEY_LOADING&&(this.state=P.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},R.flushMainBuffer=function(b,f){S.prototype.flushMainBuffer.call(this,b,f,this.altAudio?"video":null)},R.onMediaAttached=function(b,f){S.prototype.onMediaAttached.call(this,b,f);var d=f.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)},R.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},R.onMediaPlaying=function(){this.tick()},R.onMediaSeeked=function(){var b=this.media,f=b?b.currentTime:null;Object(z.isFiniteNumber)(f)&&this.log("Media seeked to "+f.toFixed(3)),this.tick()},R.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},R.onManifestParsed=function(b,f){var d=!1,C=!1,E;f.levels.forEach(function(w){E=w.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(d=!0),E.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=f.levels,this.startFragRequested=!1},R.onLevelLoading=function(b,f){var d=this.levels;if(!d||this.state!==P.State.IDLE)return;var C=d[f.level];(!C.details||C.details.live&&this.levelLastLoaded!==f.level||this.waitForCdnTuneIn(C.details))&&(this.state=P.State.WAITING_LEVEL)},R.onLevelLoaded=function(b,f){var d,C=this.levels,E=f.level,w=f.details,j=w.totalduration;if(!C){this.warn("Levels were reset while loading level "+E);return}this.log("Level "+E+" 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!==f.level&&W.loader&&(this.state=P.State.IDLE,W.loader.abort()));var T=C[E],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=E,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:w,level:E}),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()},R._handleFragmentLoadProgress=function(b){var f,d=b.frag,C=b.part,E=b.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=(f=d.initSegment)===null||f===void 0?void 0:f.data,v=this._getAudioCodec(j),K=this.transmuxer=this.transmuxer||new p.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),X=C?C.index:-1,q=X!==-1,re=new _.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,E.byteLength,X,q),ye=this.initPTS[d.cc];K.push(E,m,v,T,d,C,W.totalduration,M,re,ye)},R.onAudioTrackSwitching=function(b,f){var d=this.altAudio,C=!!f.url,E=f.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:E})}},R.onAudioTrackSwitched=function(b,f){var d=f.id,C=!!this.hls.audioTracks[d].url;if(C){var E=this.videoBuffer;E&&this.mediaBuffer!==E&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=E)}this.altAudio=C,this.tick()},R.onBufferCreated=function(b,f){var d=f.tracks,C,E,w=!1;for(var j in d){var W=d[j];if(W.id==="main"){if(E=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 "+E+".buffered to schedule main fragment loading"),this.mediaBuffer=C.buffer):this.mediaBuffer=this.media},R.onFragBuffered=function(b,f){var d=f.frag,C=f.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 E=C?C.stats:d.stats;this.fragLastKbps=Math.round(8*E.total/(E.buffering.end-E.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,C)},R.onError=function(b,f){switch(f.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,f);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==P.State.ERROR&&(f.fatal?(this.warn(""+f.details),this.state=P.State.ERROR):!f.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(f.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}},R.checkBuffer=function(){var b=this.media,f=this.gapController;if(!b||!f||!b.readyState)return;var d=H.BufferHelper.getBuffered(b);!this.loadedmetadata&&d.length?(this.loadedmetadata=!0,this.seekToStartPos()):f.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},R.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},R.onBufferFlushed=function(b,f){var d=f.type;if(d!==x.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(d===x.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,d,I.PlaylistLevelType.MAIN)}},R.onLevelsUpdated=function(b,f){this.levels=f.levels},R.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},R.seekToStartPos=function(){var b=this.media,f=b.currentTime,d=this.startPosition;if(d>=0&&f<d){if(b.seeking){h.logger.log("could not seek to "+d+", already seeking at "+f);return}var C=H.BufferHelper.getBuffered(b),E=C.length?C.start(0):0,w=E-d;w>0&&(w<this.config.maxBufferHole||w<this.config.maxFragLookUpTolerance)&&(h.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 "+f),b.currentTime=d}},R._getAudioCodec=function(b){var f=this.config.defaultAudioCodec||b.audioCodec;return this.audioCodecSwap&&f&&(this.log("Swapping audio codec"),f.indexOf("mp4a.40.5")!==-1?f="mp4a.40.2":f="mp4a.40.5"),f},R._loadBitrateTestFrag=function(b){var f=this;this._doFragLoad(b).then(function(d){var C=f.hls;if(!d||C.nextLoadLevel||f.fragContextChanged(b))return;f.fragLoadError=0,f.state=P.State.IDLE,f.startFragRequested=!1,f.bitrateTest=!1;var E=b.stats;E.parsing.start=E.parsing.end=E.buffering.start=E.buffering.end=self.performance.now(),C.trigger(G.Events.FRAG_LOADED,d)})},R._handleTransmuxComplete=function(b){var f,d="main",C=this.hls,E=b.remuxResult,w=b.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=E.video,v=E.text,K=E.id3,X=E.initSegment,q=this.altAudio?void 0:E.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&&E.independent!==!1){if(M.details){var pe=m.startPTS,ue=m.endPTS,fe=m.startDTS,Ee=m.endDTS;if(T)T.elementaryStreams[m.type]={startPTS:pe,endPTS:ue,startDTS:fe,endDTS:Ee};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,Ee,!0)}W.setElementaryStreamInfo(m.type,pe,ue,fe,Ee),this.bufferFragmentData(m,W,T,w)}}else if(E.independent===!1){this.backtrack(W);return}if(q){var ae=q.startPTS,Oe=q.endPTS,ze=q.startDTS,Ye=q.endDTS;T&&(T.elementaryStreams[x.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:Oe,startDTS:ze,endDTS:Ye}),W.setElementaryStreamInfo(x.ElementaryStreamTypes.AUDIO,ae,Oe,ze,Ye),this.bufferFragmentData(q,W,T,w)}if(K!=null&&(f=K.samples)!==null&&f!==void 0&&f.length){var He={frag:W,id:d,samples:K.samples};C.trigger(G.Events.FRAG_PARSING_METADATA,He)}if(v){var Xe={frag:W,id:d,samples:v.samples};C.trigger(G.Events.FRAG_PARSING_USERDATA,Xe)}},R._bufferInitSegment=function(b,f,d,C){var E=this;if(this.state!==P.State.PARSING)return;this.audioOnly=!!f.audio&&!f.video,this.altAudio&&!this.audioOnly&&delete f.audio;var w=f.audio,j=f.video,W=f.audiovideo;if(w){var T=b.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)),b.audioCodec&&b.audioCodec!==T&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+T+'"'),w.levelCodec=T,w.id="main",this.log("Init audio buffer, container:"+w.container+", codecs[selected/level/parsed]=["+(T||"")+"/"+(b.audioCodec||"")+"/"+w.codec+"]")}j&&(j.levelCodec=b.videoCodec,j.id="main",this.log("Init video buffer, container:"+j.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+j.codec+"]")),W&&this.log("Init audiovideo buffer, container:"+W.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+W.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,f),Object.keys(f).forEach(function(m){var v=f[m],K=v.initSegment;K!=null&&K.byteLength&&E.hls.trigger(G.Events.BUFFER_APPENDING,{type:m,data:K,frag:d,part:null,chunkMeta:C,parent:d.type})}),this.tick()},R.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var f=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,f?this.resetFragmentLoading(b):this.state=P.State.BACKTRACKING},R.checkFragmentChanged=function(){var b=this.media,f=null;if(b&&b.readyState>1&&b.seeking===!1){var d=b.currentTime;if(H.BufferHelper.isBuffered(b,d)?f=this.getAppendedFrag(d):H.BufferHelper.isBuffered(b,d+.1)&&(f=this.getAppendedFrag(d+.1)),f){var C=this.fragPlaying,E=f.level;(!C||f.sn!==C.sn||C.level!==E||f.urlId!==C.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:f}),(!C||C.level!==E)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=f)}}},u(O,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var f=this.getAppendedFrag(b.currentTime);if(f)return f.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var f=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(f)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),O}(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"),H=N("./src/utils/discontinuities.ts"),n=N("./src/controller/level-helper.ts"),I=N("./src/controller/fragment-tracker.ts"),x=N("./src/controller/base-stream-controller.ts"),p=N("./src/types/loader.ts"),_=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 h(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,O){return S.__proto__=O,S},l(i,D)}var u=500,s=function(i){h(D,i);function D(S,O){var R;return R=i.call(this,S,O,"[subtitle-stream-controller]")||this,R.levels=[],R.currentTrackId=-1,R.tracksBuffered=[],R.mainDetails=null,R._registerListeners(),R}var A=D.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var O=this.hls;O.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.on(z.Events.ERROR,this.onError,this),O.on(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.on(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.on(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var O=this.hls;O.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.off(z.Events.ERROR,this.onError,this),O.off(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.off(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.off(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.startLoad=function(){this.stopLoad(),this.state=x.State.IDLE,this.setInterval(u),this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},A.onLevelLoaded=function(O,R){this.mainDetails=R.details},A.onSubtitleFragProcessed=function(O,R){var g=R.frag,b=R.success;if(this.fragPrevious=g,this.state=x.State.IDLE,!b)return;var f=this.tracksBuffered[this.currentTrackId];if(!f)return;for(var d,C=g.start,E=0;E<f.length;E++)if(C>=f[E].start&&C<=f[E].end){d=f[E];break}var w=g.start+g.duration;d?d.end=w:(d={start:C,end:w},f.push(d)),this.fragmentTracker.fragBuffered(g)},A.onBufferFlushing=function(O,R){var g=R.startOffset,b=R.endOffset;if(g===0&&b!==Number.POSITIVE_INFINITY){var f=this.currentTrackId,d=this.levels;if(!d.length||!d[f]||!d[f].details)return;var C=d[f].details,E=C.targetduration,w=b-E;if(w<=0)return;R.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,p.PlaylistLevelType.SUBTITLE)}},A.onError=function(O,R){var g,b=R.frag;if(!b||b.type!==p.PlaylistLevelType.SUBTITLE)return;(g=this.fragCurrent)!==null&&g!==void 0&&g.loader&&this.fragCurrent.loader.abort(),this.state=x.State.IDLE},A.onSubtitleTracksUpdated=function(O,R){var g=this,b=R.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(f){return new _.Level(f)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(f){g.tracksBuffered[f.id]=[]}),this.mediaBuffer=null},A.onSubtitleTrackSwitch=function(O,R){if(this.currentTrackId=R.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(O,R){var g,b=R.details,f=R.id,d=this.currentTrackId,C=this.levels;if(!C.length)return;var E=C[d];if(f>=C.length||f!==d||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(g=E.details)!==null&&g!==void 0&&g.live){var w=this.mainDetails;if(b.deltaUpdateFailed||!w)return;var j=w.fragments[0];if(!E.details)b.hasProgramDateTime&&w.hasProgramDateTime?Object(H.alignMediaPlaylistByPDT)(b,w):j&&Object(n.addSliding)(b,j.start);else{var W=this.alignPlaylists(b,E.details);W===0&&j&&Object(n.addSliding)(b,j.start)}}if(E.details=b,this.levelLastLoaded=f,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===x.State.IDLE){var T=Object(G.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);T||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},A._handleFragmentLoadComplete=function(O){var R=O.frag,g=O.payload,b=R.decryptdata,f=this.hls;if(this.fragContextChanged(R))return;if(g&&g.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var d=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(g),b.key.buffer,b.iv.buffer).then(function(C){var E=performance.now();f.trigger(z.Events.FRAG_DECRYPTED,{frag:R,payload:C,stats:{tstart:d,tdecrypt:E}})})}},A.doTick=function(){if(!this.media){this.state=x.State.IDLE;return}if(this.state===x.State.IDLE){var O,R=this.currentTrackId,g=this.levels;if(!g.length||!g[R]||!g[R].details)return;var b=g[R].details,f=b.targetduration,d=this.config,C=this.media,E=F.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-f,d.maxBufferHole),w=E.end,j=E.len,W=this.getMaxBufferLength()+f;if(j>W)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var T=b.fragments,M=T.length,m=b.edge,v,K=this.fragPrevious;if(w<m){var X=d.maxFragLookUpTolerance;K&&b.hasProgramDateTime&&(v=Object(G.findFragmentByPDT)(T,K.endProgramDateTime,X)),v||(v=Object(G.findFragmentByPTS)(K,T,w,X),!v&&K&&K.start<T[0].start&&(v=T[0]))}else v=T[M-1];(O=v)!==null&&O!==void 0&&O.encrypted?(P.logger.log("Loading key for "+v.sn),this.state=x.State.KEY_LOADING,this.hls.trigger(z.Events.KEY_LOADING,{frag:v})):v&&this.fragmentTracker.getState(v)===I.FragmentState.NOT_LOADED&&this.loadFragment(v,b,w)}},A.loadFragment=function(O,R,g){this.fragCurrent=O,i.prototype.loadFragment.call(this,O,R,g)},a(D,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),D}(x.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 H(c,a){for(var h=0;h<a.length;h++){var l=a[h];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function n(c,a,h){return a&&H(c.prototype,a),h&&H(c,h),c}function I(c,a){c.prototype=Object.create(a.prototype),c.prototype.constructor=c,x(c,a)}function x(c,a){return x=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},x(c,a)}var p=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 h=a.prototype;return h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},h.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)},h.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)},h.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)},h.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},h.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=_(this.media.textTracks);u.forEach(function(s){Object(P.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},h.onManifestParsed=function(u,s){this.tracks=s.subtitleTracks},h.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 O=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,O))},h.onLevelLoading=function(u,s){this.switchLevel(s.level)},h.onLevelSwitching=function(u,s){this.switchLevel(s.level)},h.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(R){return!i||R.groupId===i});this.tracksInGroup=A;var S=this.findTrackId(D==null?void 0:D.name)||this.findTrackId();this.groupId=i;var O={subtitleTracks:A};this.log("Updating subtitle tracks, "+A.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(z.Events.SUBTITLE_TRACKS_UPDATED,O),S!==-1&&this.setSubtitleTrack(S,D)}},h.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},h.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)},h.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})}},h.toggleTrackModes=function(u){var s=this,i=this.media,D=this.subtitleDisplay,A=this.trackId;if(!i)return;var S=_(i.textTracks),O=S.filter(function(b){return b.groupId===s.groupId});if(u===-1)[].slice.call(S).forEach(function(b){b.mode="disabled"});else{var R=O[A];R&&(R.mode="disabled")}var g=O[u];g&&(g.mode=D?"showing":"hidden")},h.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,O=A.groupId,R=O===void 0?"":O,g=A.name,b=A.type,f=A.url;this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:R,name:g,type:b,url:f});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})},h.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,s=_(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 _(c){for(var a=[],h=0;h<c.length;h++){var l=c[h];l.kind==="subtitles"&&l.label&&a.push(c[h])}return a}Y.default=p},"./src/controller/timeline-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"TimelineController",function(){return _});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"),H=N("./src/utils/webvtt-parser.ts"),n=N("./src/utils/texttrack-utils.ts"),I=N("./src/utils/imsc1-ttml-parser.ts"),x=N("./src/types/loader.ts"),p=N("./src/utils/logger.ts"),_=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=h(),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,O){for(var R=!1,g=O.length;g--;){var b=O[g],f=a(b[0],b[1],D,A);if(f>=0&&(b[0]=Math.min(b[0],D),b[1]=Math.max(b[1],A),R=!0,f/(A-D)>.5))return}if(R||O.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,O=D.id,R=D.initPTS,g=D.timescale,b=this.unparsedVttFrags;O==="main"&&(this.initPTS[S.cc]=R,this.timescale[S.cc]=g),b.length&&(this.unparsedVttFrags=[],b.forEach(function(f){A.onFragLoaded(P.Events.FRAG_LOADED,f)}))},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,O=D[i],R=O.label,g=O.languageCode,b=this.getExistingTrack(i);if(b)A[i]=b,Object(n.clearCurrentCues)(A[i]),Object(n.sendAddTrackEvent)(A[i],S);else{var f=this.createTextTrack("captions",R,g);f&&(f[i]=!0,A[i]=f)}},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=h(),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||[],O=S.some(function(f){return f.textCodec===I.IMSC1_CODEC});if(this.config.enableWebVTT||O&&this.config.enableIMSC1){var R=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(f,d){var C;if(d<g.length){for(var E=null,w=0;w<g.length;w++)if(c(g[w],f)){E=g[w];break}E&&(C=E)}C?Object(n.clearCurrentCues)(C):(C=A.createTextTrack("subtitles",f.name,f.lang),C&&(C.mode="disabled")),C&&(C.groupId=f.groupId,A.textTracks.push(C))})}else if(!R&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(f){return{label:f.name,kind:f.type.toLowerCase(),default:f.default,subtitleTrack:f}});this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},u.onManifestLoaded=function(i,D){var A=this;this.config.enableCEA708Captions&&D.captions&&D.captions.forEach(function(S){var O=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!O)return;var R="textTrack"+O[1],g=A.captionsProperties[R];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,O=this.lastSn,R=this.lastPartIndex;if(!this.enabled||!(A&&S))return;if(D.frag.type===x.PlaylistLevelType.MAIN){var g,b,f=D.frag.sn,d=(g=D==null||((b=D.part)===null||b===void 0)?void 0:b.index)!=null?g:-1;f===O+1||f===O&&d===R+1||(A.reset(),S.reset()),this.lastSn=f,this.lastPartIndex=d}},u.onFragLoaded=function(i,D){var A=D.frag,S=D.payload,O=this.initPTS,R=this.unparsedVttFrags;if(A.type===x.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(z.isFiniteNumber)(O[A.cc])){R.push(D),O.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 b=this.tracks[A.level],f=this.vttCCs;f[A.cc]||(f[A.cc]={start:A.start,prevCC:this.prevCC,new:!0},this.prevCC=A.cc),b&&b.textCodec===I.IMSC1_CODEC?this._parseIMSC1(A,S):this._parseVTTs(A,S,f)}}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(O){A._appendCues(O,i.level),S.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(O){p.logger.log("Failed to parse IMSC1: "+O),S.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:O})})},u._parseVTTs=function(i,D,A){var S=this,O=this.hls;Object(H.parseWebVTT)(D,this.initPTS[i.cc],this.timescale[i.cc],A,i.cc,i.start,function(R){S._appendCues(R,i.level),O.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(R){S._fallbackToIMSC1(i,D),p.logger.log("Failed to parse VTT cue: "+R),O.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:R})})},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 O=this.tracks[D],R=O.default?"default":"subtitles"+D;A.trigger(P.Events.CUES_PARSED,{type:"subtitles",cues:i,track:R})}},u.onFragDecrypted=function(i,D){var A=D.frag;if(A.type===x.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 O=0;O<D.samples.length;O++){var R=D.samples[O].bytes;if(R){var g=this.extractCea608Data(R);A.addData(D.samples[O].pts,g[0]),S.addData(D.samples[O].pts,g[1])}}},u.onBufferFlushing=function(i,D){var A=D.startOffset,S=D.endOffset,O=D.endOffsetSubtitles,R=D.type,g=this.media;if(!g||g.currentTime<S)return;if(!R||R==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(d){return Object(n.removeCuesInRange)(b[d],A,S)})}if(this.config.renderTextTracksNatively&&(A===0&&O!==void 0)){var f=this.textTracks;Object.keys(f).forEach(function(d){return Object(n.removeCuesInRange)(f[d],A,O)})}},u.extractCea608Data=function(i){for(var D=i[0]&31,A=2,S=[[],[]],O=0;O<D;O++){var R=i[A++],g=127&i[A++],b=127&i[A++],f=(4&R)!==0,d=3&R;if(g===0&&b===0)continue;f&&((d===0||d===1)&&(S[d].push(g),S[d].push(b)))}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 h(){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,H){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=H}var F=P.prototype;return F.decrypt=function(H,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,H)},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 H=G.byteLength,n=H&&new DataView(G.buffer).getUint8(H-1);return n?Object(z.sliceUint8)(G,0,H-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 H=G.prototype;return H.uint8ArrayToUint32Array_=function(I){for(var x=new DataView(I),p=new Uint32Array(4),_=0;_<4;_++)p[_]=x.getUint32(_*4);return p},H.initTable=function(){var I=this.sBox,x=this.invSBox,p=this.subMix,_=p[0],c=p[1],a=p[2],h=p[3],l=this.invSubMix,u=l[0],s=l[1],i=l[2],D=l[3],A=new Uint32Array(256),S=0,O=0,R=0;for(R=0;R<256;R++)R<128?A[R]=R<<1:A[R]=R<<1^283;for(R=0;R<256;R++){var g=O^O<<1^O<<2^O<<3^O<<4;g=g>>>8^g&255^99,I[S]=g,x[g]=S;var b=A[S],f=A[b],d=A[f],C=A[g]*257^g*16843008;_[S]=C<<24|C>>>8,c[S]=C<<16|C>>>16,a[S]=C<<8|C>>>24,h[S]=C,C=d*16843009^f*65537^b*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=b^A[A[A[d^b]]],O^=A[A[O]]):S=O=1}},H.expandKey=function(I){for(var x=this.uint8ArrayToUint32Array_(I),p=!0,_=0;_<x.length&&p;)p=x[_]===this.key[_],_++;if(p)return;this.key=x;var c=this.keySize=x.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var a=this.ksRows=(c+6+1)*4,h,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],O=A[1],R=A[2],g=A[3],b,f;for(h=0;h<a;h++){if(h<c){b=u[h]=x[h];continue}f=b,h%c===0?(f=f<<8|f>>>24,f=i[f>>>24]<<24|i[f>>>16&255]<<16|i[f>>>8&255]<<8|i[f&255],f^=D[h/c|0]<<24):c>6&&h%c===4&&(f=i[f>>>24]<<24|i[f>>>16&255]<<16|i[f>>>8&255]<<8|i[f&255]),u[h]=b=(u[h-c]^f)>>>0}for(l=0;l<a;l++)h=a-l,l&3?f=u[h]:f=u[h-4],l<4||h<=4?s[l]=f:s[l]=S[i[f>>>24]]^O[i[f>>>16&255]]^R[i[f>>>8&255]]^g[i[f&255]],s[l]=s[l]>>>0},H.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},H.decrypt=function(I,x,p){for(var _=this.keySize+6,c=this.invKeySchedule,a=this.invSBox,h=this.invSubMix,l=h[0],u=h[1],s=h[2],i=h[3],D=this.uint8ArrayToUint32Array_(p),A=D[0],S=D[1],O=D[2],R=D[3],g=new Int32Array(I),b=new Int32Array(g.length),f,d,C,E,w,j,W,T,M,m,v,K,X,q,re=this.networkToHostOrderSwap;x<g.length;){for(M=re(g[x]),m=re(g[x+1]),v=re(g[x+2]),K=re(g[x+3]),w=M^c[0],j=K^c[1],W=v^c[2],T=m^c[3],X=4,q=1;q<_;q++)f=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],E=l[T>>>24]^u[w>>16&255]^s[j>>8&255]^i[W&255]^c[X+3],w=f,j=d,W=C,T=E,X=X+4;f=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],E=a[T>>>24]<<24^a[w>>16&255]<<16^a[j>>8&255]<<8^a[W&255]^c[X+3],b[x]=re(f^A),b[x+1]=re(E^S),b[x+2]=re(C^O),b[x+3]=re(d^R),A=M,S=m,O=v,R=K,x=x+4}return b.buffer},G}()},"./src/crypt/decrypter.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return x});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"),H=N("./src/utils/mp4-tools.ts"),n=N("./src/utils/typed-array.ts"),I=16,x=function(){function p(c,a,h){var l=h===void 0?{}:h,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 _=p.prototype;return _.destroy=function(){this.observer=null},_.isSync=function(){return this.config.enableSoftwareAES},_.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var h=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(F.removePadding)(h):h},_.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},_.decrypt=function(a,h,l,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),h,l);var s=this.flush();s&&u(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),h,l).then(u)},_.softwareDecrypt=function(a,h,l){var u=this.currentIV,s=this.currentResult,i=this.remainderData;this.logOnce("JS AES decrypt"),i&&(a=Object(H.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(h);var S=s;return this.currentResult=A.decrypt(D.buffer,0,l),this.currentIV=Object(n.sliceUint8)(D,-16).buffer,S||null},_.webCryptoDecrypt=function(a,h,l){var u=this,s=this.subtle;return(this.key!==h||!this.fastAesKey)&&(this.key=h,this.fastAesKey=new P.default(s,h)),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,h,l)})},_.onWebCryptoError=function(a,h,l,u){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(h,l,u)},_.getValidChunk=function(a){var h=a,l=a.length-a.length%I;return l!==a.length&&(h=Object(n.sliceUint8)(a,0,l),this.remainderData=Object(n.sliceUint8)(a,l)),h},_.logOnce=function(a){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},p}()},"./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,H){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=H}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 H(x,p){x.prototype=Object.create(p.prototype),x.prototype.constructor=x,n(x,p)}function n(x,p){return n=Object.setPrototypeOf||function(c,a){return c.__proto__=a,c},n(x,p)}var I=function(x){H(p,x);function p(c,a){var h;return h=x.call(this)||this,h.observer=void 0,h.config=void 0,h.observer=c,h.config=a,h}var _=p.prototype;return _.resetInitSegment=function(a,h,l){x.prototype.resetInitSegment.call(this,a,h,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}},p.probe=function(a){if(!a)return!1;for(var h=G.getID3Data(a,0)||[],l=h.length,u=a.length;l<u;l++)if(P.probe(a,l))return F.logger.log("ADTS sync word found !"),!0;return!1},_.canParse=function(a,h){return P.canParse(a,h)},_.appendFrame=function(a,h,l){P.initTrackConfig(a,this.observer,h,l,a.manifestCodec);var u=P.appendFrame(a,h,l,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},p}(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 H}),N.d(Y,"getHeaderLength",function(){return n}),N.d(Y,"getFullFrameLength",function(){return I}),N.d(Y,"canGetFrameLength",function(){return x}),N.d(Y,"isHeader",function(){return p}),N.d(Y,"canParse",function(){return _}),N.d(Y,"probe",function(){return c}),N.d(Y,"initTrackConfig",function(){return a}),N.d(Y,"getFrameDuration",function(){return h}),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,O,R,g,b=navigator.userAgent.toLowerCase(),f=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 R=(i[D+2]&1)<<2,R|=(i[D+3]&192)>>>6,z.logger.log("manifest codec:"+A+", ADTS type:"+S+", samplingIndex:"+C),/firefox/i.test(b)?C>=6?(S=5,g=new Array(4),O=C-3):(S=2,g=new Array(2),O=C):b.indexOf("android")!==-1?(S=2,g=new Array(2),O=C):(S=5,g=new Array(4),A&&(A.indexOf("mp4a.40.29")!==-1||A.indexOf("mp4a.40.5")!==-1)||!A&&C>=6?O=C-3:((A&&A.indexOf("mp4a.40.2")!==-1&&(C>=6&&R===1||/vivaldi/i.test(b))||!A&&R===1)&&(S=2,g=new Array(2)),O=C)),g[0]=S<<3,g[0]|=(C&14)>>1,g[1]|=(C&1)<<7,g[1]|=R<<3,S===5&&(g[1]|=(O&14)>>1,g[2]=(O&1)<<7,g[2]|=2<<2,g[3]=0),{config:g,samplerate:d[C],channelCount:R,codec:"mp4a.40."+S,manifestCodec:f}}function H(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 x(s,i){return i+5<s.length}function p(s,i){return i+1<s.length&&H(s,i)}function _(s,i){return x(s,i)&&H(s,i)&&I(s,i)<=s.length-i}function c(s,i){if(p(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||p(s,S)}return!1}function a(s,i,D,A,S){if(!s.samplerate){var O=G(i,D,A,S);if(!O)return;s.config=O.config,s.samplerate=O.samplerate,s.channelCount=O.channelCount,s.codec=O.codec,s.manifestCodec=O.manifestCodec,z.logger.log("parsed codec:"+s.codec+", rate:"+O.samplerate+", channels:"+O.channelCount)}}function h(s){return 1024*9e4/s}function l(s,i,D,A,S){var O=n(s,i),R=I(s,i);if(R-=O,R>0){var g=D+A*S;return{headerLength:O,frameLength:R,stamp:g}}}function u(s,i,D,A,S){var O=h(s.samplerate),R=l(i,D,A,S,O);if(R){var g=R.frameLength,b=R.headerLength,f=R.stamp,d=b+g,C=Math.max(0,D+d-i.length),E;C?(E=new Uint8Array(d-b),E.set(i.subarray(D+b,i.length),0)):E=i.subarray(D+b,D+d);var w={unit:E,pts:f};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"),H=N("./src/utils/typed-array.ts"),n=function(){function x(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=x.prototype;return p.resetInitSegment=function(c,a,h){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(c,a){return!1},p.appendFrame=function(c,a,h){},p.demux=function(c,a){this.cachedData&&(c=Object(G.appendUint8Array)(this.cachedData,c),this.cachedData=null);var h=P.getID3Data(c,0),l=h?h.length:0,u,s,i=this._audioTrack,D=this._id3Track,A=h?P.getTimeStamp(h):void 0,S=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(A,a)),h&&h.length>0&&D.samples.push({pts:this.initPTS,dts:this.initPTS,data:h}),s=this.initPTS;l<S;){if(this.canParse(c,l)){var O=this.appendFrame(i,c,l);O?(this.frameIndex++,s=O.sample.pts,l+=O.length,u=l):l=S}else P.canParse(c,l)?(h=P.getID3Data(c,l),D.samples.push({pts:s,dts:s,data:h}),l+=h.length,u=l):l++;if(l===S&&u!==S){var R=Object(H.sliceUint8)(c,u);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,R):this.cachedData=R}}return{audioTrack:i,avcTrack:Object(F.dummyTrack)(),id3Track:D,textTrack:Object(F.dummyTrack)()}},p.demuxSampleAes=function(c,a,h){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.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)()}},p.destroy=function(){},x}(),I=function(p,_){return Object(z.isFiniteNumber)(p)?p*90:_*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,x;if(n.length)n.length===1?x=n[0]:x=P(n,I);else return new Uint8Array(0);return this.reset(),x},G.reset=function(){this.chunks.length=0,this.dataLength=0},F}();function P(F,G){for(var H=new Uint8Array(G),n=0,I=0;I<F.length;I++){var x=F[I];H.set(x,n),n+=x.length}return H}},"./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(H){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=H,this.bytesAvailable=H.byteLength,this.word=0,this.bitsAvailable=0}var G=F.prototype;return G.loadWord=function(){var n=this.data,I=this.bytesAvailable,x=n.byteLength-I,p=new Uint8Array(4),_=Math.min(4,I);if(_===0)throw new Error("no bytes available");p.set(n.subarray(x,x+_)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=_*8,this.bytesAvailable-=_},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),x=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?x<<I|this.readBits(I):x},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,x=8,p,_=0;_<n;_++)x!==0&&(p=this.readEG(),x=(I+p+256)%256),I=x===0?I:x},G.readSPS=function(){var n=0,I=0,x=0,p=0,_,c,a,h=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);h();var O=h();if(l(5),i(3),h(),A(),O===100||O===110||O===122||O===244||O===44||O===83||O===86||O===118||O===128){var R=u();if(R===3&&i(1),A(),A(),i(1),s())for(c=R!==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(),_=u(),a=0;a<_;a++)D();A(),i(1);var b=u(),f=u(),d=l(1);d===0&&i(1),i(1),s()&&(n=u(),I=u(),x=u(),p=u());var C=[1,1];if(s()&&s()){var E=h();switch(E){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=[h()<<8|h(),h()<<8|h()];break}}}return{width:Math.ceil((b+1)*16-n*2-I*2),height:(2-d)*(f+1)*16-(d?2:4)*(x+p),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 H}),N.d(Y,"getTimeStamp",function(){return n}),N.d(Y,"isTimeStampFrame",function(){return I}),N.d(Y,"getID3Frames",function(){return p}),N.d(Y,"decodeFrame",function(){return _}),N.d(Y,"utf8ArrayToStr",function(){return u}),N.d(Y,"testables",function(){return s});var z=function(S,O){return O+10<=S.length&&(S[O]===73&&S[O+1]===68&&S[O+2]===51&&(S[O+3]<255&&S[O+4]<255&&(S[O+6]<128&&S[O+7]<128&&S[O+8]<128&&S[O+9]<128)))},P=function(S,O){return O+10<=S.length&&(S[O]===51&&S[O+1]===68&&S[O+2]===73&&(S[O+3]<255&&S[O+4]<255&&(S[O+6]<128&&S[O+7]<128&&S[O+8]<128&&S[O+9]<128)))},F=function(S,O){for(var R=O,g=0;z(S,O);){g+=10;var b=G(S,O+6);g+=b,P(S,O+10)&&(g+=10),O+=g}return g>0?S.subarray(R,R+g):void 0},G=function(S,O){var R=0;return R=(S[O]&127)<<21,R|=(S[O+1]&127)<<14,R|=(S[O+2]&127)<<7,R|=S[O+3]&127,R},H=function(S,O){return z(S,O)&&G(S,O+6)+10<=S.length-O},n=function(S){for(var O=p(S),R=0;R<O.length;R++){var g=O[R];if(I(g))return l(g)}return},I=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},x=function(S){var O=String.fromCharCode(S[0],S[1],S[2],S[3]),R=G(S,4),g=10;return{type:O,size:R,data:S.subarray(g,g+R)}},p=function(S){for(var O=0,R=[];z(S,O);){var g=G(S,O+6);O+=10;for(var b=O+g;O+8<b;){var f=x(S.subarray(O)),d=_(f);d&&R.push(d),O+=f.size+10}P(S,O)&&(O+=10)}return R},_=function(S){return S.type==="PRIV"?c(S):S.type[0]==="W"?h(S):a(S)},c=function(S){if(S.size<2)return;var O=u(S.data,!0),R=new Uint8Array(S.data.subarray(O.length+1));return{key:S.type,info:O,data:R.buffer}},a=function(S){if(S.size<2)return;if(S.type==="TXXX"){var O=1,R=u(S.data.subarray(O),!0);O+=R.length+1;var g=u(S.data.subarray(O));return{key:S.type,info:R,data:g}}var b=u(S.data.subarray(1));return{key:S.type,data:b}},h=function(S){if(S.type==="WXXX"){if(S.size<2)return;var O=1,R=u(S.data.subarray(O),!0);O+=R.length+1;var g=u(S.data.subarray(O));return{key:S.type,info:R,data:g}}var b=u(S.data);return{key:S.type,data:b}},l=function(S){if(S.data.byteLength===8){var O=new Uint8Array(S.data),R=O[3]&1,g=(O[4]<<23)+(O[5]<<15)+(O[6]<<7)+O[7];return g/=45,R&&(g+=4772185884e-2),Math.round(g)}return},u=function(S,O){O===void 0&&(O=!1);var R=D();if(R){var g=R.decode(S);if(O){var b=g.indexOf("\0");return b!==-1?g.substring(0,b):g}return g.replace(/\0/g,"")}for(var f=S.length,d,C,E,w="",j=0;j<f;){if(d=S[j++],d===0&&O)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++],E=S[j++],w+=String.fromCharCode((d&15)<<12|(C&63)<<6|(E&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 H(x,p){x.prototype=Object.create(p.prototype),x.prototype.constructor=x,n(x,p)}function n(x,p){return n=Object.setPrototypeOf||function(c,a){return c.__proto__=a,c},n(x,p)}var I=function(x){H(p,x);function p(){return x.apply(this,arguments)||this}var _=p.prototype;return _.resetInitSegment=function(a,h,l){x.prototype.resetInitSegment.call(this,a,h,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}},p.probe=function(a){if(!a)return!1;for(var h=P.getID3Data(a,0)||[],l=h.length,u=a.length;l<u;l++)if(G.probe(a,l))return F.logger.log("MPEG Audio sync word found !"),!0;return!1},_.canParse=function(a,h){return G.canParse(a,h)},_.appendFrame=function(a,h,l){return this.initPTS===null?void 0:G.appendFrame(a,h,l,this.initPTS,this.frameIndex)},p}(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 H=G.prototype;return H.resetTimeStamp=function(){},H.resetInitSegment=function(){},H.resetContiguity=function(){},G.probe=function(I){return Object(z.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},H.demux=function(I){var x=I,p=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(x=Object(z.appendUint8Array)(this.remainderData,I));var _=Object(z.segmentValidRange)(x);this.remainderData=_.remainder,p.samples=_.valid||new Uint8Array}else p.samples=x;return{audioTrack:Object(P.dummyTrack)(),avcTrack:p,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},H.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)()}},H.demuxSampleAes=function(I,x,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},H.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 x}),N.d(Y,"isHeader",function(){return p}),N.d(Y,"canParse",function(){return _}),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]],H=[0,1,1,4];function n(a,h,l,u,s){if(l+24>h.length)return;var i=I(h,l);if(i&&l+i.frameLength<=h.length){var D=i.samplesPerFrame*9e4/i.sampleRate,A=u+s*D,S={unit:h.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,h){var l=a[h+1]>>3&3,u=a[h+1]>>1&3,s=a[h+2]>>4&15,i=a[h+2]>>2&3;if(l!==1&&s!==0&&s!==15&&i!==3){var D=a[h+2]>>1&1,A=a[h+3]>>6,S=l===3?3-u:u===3?3:4,O=P[S*14+s-1]*1e3,R=l===3?0:l===2?1:2,g=F[R*3+i],b=A===3?1:2,f=G[l][u],d=H[u],C=f*8*d,E=Math.floor(f*O/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&&O>=224e3&&A===0&&(a[h+3]=a[h+3]|128),{sampleRate:g,channelCount:b,frameLength:E,samplesPerFrame:C}}}function x(a,h){return a[h]===255&&(a[h+1]&224)===224&&(a[h+1]&6)!==0}function p(a,h){return h+1<a.length&&x(a,h)}function _(a,h){var l=4;return x(a,h)&&l<=a.length-h}function c(a,h){if(h+1<a.length&&x(a,h)){var l=4,u=I(a,h),s=l;u!=null&&u.frameLength&&(s=u.frameLength);var i=h+s;return i===a.length||p(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,x){this.keyData=void 0,this.decrypter=void 0,this.keyData=x,this.decrypter=new z.default(n,I,{removePKCS7Padding:!1})}var H=G.prototype;return H.decryptBuffer=function(I,x){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,x)},H.decryptAacSample=function(I,x,p,_){var c=I[x].unit,a=c.subarray(16,c.length-c.length%16),h=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),l=this;this.decryptBuffer(h,function(u){var s=new Uint8Array(u);c.set(s,16),_||l.decryptAacSamples(I,x+1,p)})},H.decryptAacSamples=function(I,x,p){for(;;x++){if(x>=I.length){p();return}if(I[x].unit.length<32)continue;var _=this.decrypter.isSync();if(this.decryptAacSample(I,x,p,_),!_)return}},H.getAvcEncryptedData=function(I){for(var x=Math.floor((I.length-48)/160)*16+16,p=new Int8Array(x),_=0,c=32;c<=I.length-16;c+=160,_+=16)p.set(I.subarray(c,c+16),_);return p},H.getAvcDecryptedUnit=function(I,x){for(var p=new Uint8Array(x),_=0,c=32;c<=I.length-16;c+=160,_+=16)I.set(p.subarray(_,_+16),c);return I},H.decryptAvcSample=function(I,x,p,_,c,a){var h=Object(P.discardEPB)(c.data),l=this.getAvcEncryptedData(h),u=this;this.decryptBuffer(l.buffer,function(s){c.data=u.getAvcDecryptedUnit(h,s),a||u.decryptAvcSamples(I,x,p+1,_)})},H.decryptAvcSamples=function(I,x,p,_){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;x++,p=0){if(x>=I.length){_();return}for(var c=I[x].units;!(p>=c.length);p++){var a=c[p];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var h=this.decrypter.isSync();if(this.decryptAvcSample(I,x,p,_,a,h),!h)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"),H=N("./src/utils/logger.ts"),n=N("./src/errors.ts"),I=N("./src/utils/mediasource-helper.ts"),x=N("./node_modules/eventemitter3/index.js"),p=N.n(x),_=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(f,d){d=d||{},d.frag=D.frag,d.id=D.id,l.trigger(f,d)};this.observer=new x.EventEmitter,this.observer.on(F.Events.FRAG_DECRYPTED,S),this.observer.on(F.Events.ERROR,S);var O={mp4:_.isTypeSupported("video/mp4"),mpeg:_.isTypeSupported("audio/mpeg"),mp3:_.isTypeSupported('audio/mp4; codecs="mp3"')},R=navigator.vendor;if(A.enableWorker&&typeof Worker!="undefined"){H.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(b){l.trigger(F.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},g.postMessage({cmd:"init",typeSupported:O,vendor:R,id:u,config:JSON.stringify(A)})}catch(b){H.logger.warn("Error in worker:",b),H.logger.error("Error while initializing DemuxerWorker, fallback to inline"),g&&self.URL.revokeObjectURL(g.objectURL),this.transmuxer=new G.default(this.observer,O,A,R,u),this.worker=null}}else this.transmuxer=new G.default(this.observer,O,A,R,u)}var h=a.prototype;return h.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},h.push=function(u,s,i,D,A,S,O,R,g,b){var f=this;g.transmuxing.start=self.performance.now();var d=this.transmuxer,C=this.worker,E=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),K=self.performance.now();(T||M||A.stats.parsing.start===0)&&(A.stats.parsing.start=K),S&&(m||!v)&&(S.stats.parsing.start=K);var X=new G.TransmuxState(W,v,R,T,E);if(!v||W){H.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: `+R+`
|
|
timeOffset: `+E);var q=new G.TransmuxConfig(i,D,s,O,b);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){f.handleTransmuxComplete(ye)}):this.handleTransmuxComplete(re)}},h.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)}},h.handleFlushResult=function(u,s){var i=this;u.forEach(function(D){i.handleTransmuxComplete(D)}),this.onFlush(s)},h.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}}},h.configureTransmuxer=function(u){var s=this.worker,i=this.transmuxer;s?s.postMessage({cmd:"configure",config:u}):i&&i.configure(u)},h.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"),H=N.n(G);function n(c){var a=new G.EventEmitter,h=function(u,s){c.postMessage({event:u,data:s})};a.on(P.Events.FRAG_DECRYPTED,h),a.on(P.Events.ERROR,h),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),h("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){p(c,S,D)}):p(c,A,D);break}default:break}})}function I(c,a){if(_(a.remuxResult))return;var h=[],l=a.remuxResult,u=l.audio,s=l.video;u&&x(h,u),s&&x(h,s),c.postMessage({event:"transmuxComplete",data:a},h)}function x(c,a){a.data1&&c.push(a.data1.buffer),a.data2&&c.push(a.data2.buffer)}function p(c,a,h){a.forEach(function(l){I(c,l)}),c.postMessage({event:"flush",data:h})}function _(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 O});var z=N("./src/events.ts"),P=N("./src/errors.ts"),F=N("./src/crypt/decrypter.ts"),G=N("./src/demux/aacdemuxer.ts"),H=N("./src/demux/mp4demuxer.ts"),n=N("./src/demux/tsdemuxer.ts"),I=N("./src/demux/mp3demuxer.ts"),x=N("./src/remux/mp4-remuxer.ts"),p=N("./src/remux/passthrough-remuxer.ts"),_=N("./src/demux/chunk-cache.ts"),c=N("./src/utils/mp4-tools.ts"),a=N("./src/utils/logger.ts"),h;try{h=self.performance.now.bind(self.performance)}catch(R){a.logger.debug("Unable to use Performance API on this environment"),h=self.Date.now}var l=[{demux:n.default,remux:x.default},{demux:H.default,remux:p.default},{demux:G.default,remux:x.default},{demux:I.default,remux:x.default}],u=1024;l.forEach(function(R){var g=R.demux;u=Math.max(u,g.minProbeByteLength)});var s=function(){function R(b,f,d,C,E){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 _.default,this.observer=b,this.typeSupported=f,this.config=d,this.vendor=C,this.id=E}var g=R.prototype;return g.configure=function(f){this.transmuxConfig=f,this.decrypter&&this.decrypter.reset()},g.push=function(f,d,C,E){var w=this,j=C.transmuxing;j.executeStart=h();var W=new Uint8Array(f),T=this.cache,M=this.config,m=this.currentTransmuxState,v=this.transmuxConfig;E&&(this.currentTransmuxState=E);var K=i(W,d);if(K&&K.method==="AES-128"){var X=this.getDecrypter();if(M.enableSoftwareAES){var q=X.softwareDecrypt(W,K.key.buffer,K.iv.buffer);if(!q)return j.executeEnd=h(),D(C);W=new Uint8Array(q)}else return this.decryptionPromise=X.webCryptoDecrypt(W,K.key.buffer,K.iv.buffer).then(function(Ke){var nt=w.push(Ke,null,C);return w.decryptionPromise=null,nt}),this.decryptionPromise}var re=E||m,ye=re.contiguous,pe=re.discontinuity,ue=re.trackSwitch,fe=re.accurateTimeOffset,Ee=re.timeOffset,se=v.audioCodec,ae=v.videoCodec,Oe=v.defaultInitPts,ze=v.duration,Ye=v.initSegmentData;if((pe||ue)&&this.resetInitSegment(Ye,se,ae,ze),pe&&this.resetInitialTimestamp(Oe),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 Xe=this.transmux(W,K,Ee,fe,C),We=this.currentTransmuxState;return We.contiguous=!0,We.discontinuity=!1,We.trackSwitch=!1,j.executeEnd=h(),Xe},g.flush=function(f){var d=this,C=f.transmuxing;C.executeStart=h();var E=this.decrypter,w=this.cache,j=this.currentTransmuxState,W=this.decryptionPromise;if(W)return W.then(function(){return d.flush(f)});var T=[],M=j.timeOffset;if(E){var m=E.flush();m&&T.push(this.push(m,null,f))}var v=w.dataLength;w.reset();var K=this.demuxer,X=this.remuxer;if(!K||!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=h(),[D(f)];var q=K.flush(M);return A(q)?q.then(function(re){return d.flushRemux(T,re,f),T}):(this.flushRemux(T,q,f),T)},g.flushRemux=function(f,d,C){var E=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(E,w,j,W,m,M,!0,this.id);f.push({remuxResult:v,chunkMeta:C}),C.transmuxing.executeEnd=h()},g.resetInitialTimestamp=function(f){var d=this.demuxer,C=this.remuxer;if(!d||!C)return;d.resetTimeStamp(f),C.resetTimeStamp(f)},g.resetContiguity=function(){var f=this.demuxer,d=this.remuxer;if(!f||!d)return;f.resetContiguity(),d.resetNextTimestamp()},g.resetInitSegment=function(f,d,C,E){var w=this.demuxer,j=this.remuxer;if(!w||!j)return;w.resetInitSegment(d,C,E),j.resetInitSegment(f,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(f,d,C,E,w){var j;return d&&d.method==="SAMPLE-AES"?j=this.transmuxSampleAes(f,d,C,E,w):j=this.transmuxUnencrypted(f,C,E,w),j},g.transmuxUnencrypted=function(f,d,C,E){var w=this.demuxer.demux(f,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:E}},g.transmuxSampleAes=function(f,d,C,E,w){var j=this;return this.demuxer.demuxSampleAes(f,d,C).then(function(W){var T=j.remuxer.remux(W.audioTrack,W.avcTrack,W.id3Track,W.textTrack,C,E,!1,j.id);return{remuxResult:T,chunkMeta:w}})},g.configureTransmuxer=function(f,d){for(var C=this.config,E=this.observer,w=this.typeSupported,j=this.vendor,W=d.audioCodec,T=d.defaultInitPts,M=d.duration,m=d.initSegmentData,v=d.videoCodec,K,X=0,q=l.length;X<q;X++)if(l[X].demux.probe(f)){K=l[X];break}K||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),K={demux:H.default,remux:p.default});var re=this.demuxer,ye=this.remuxer,pe=K.remux,ue=K.demux;(!ye||!(ye instanceof pe))&&(this.remuxer=new pe(E,C,w,j)),(!re||!(re instanceof ue))&&(this.demuxer=new ue(E,C,w),this.probe=ue.probe),this.resetInitSegment(m,W,v,M),this.resetInitialTimestamp(T)},g.needsProbing=function(f,d,C){return!this.demuxer||!this.remuxer||d||C},g.getDecrypter=function(){var f=this.decrypter;return f||(f=this.decrypter=new F.default(this.observer,this.config)),f},R}();function i(R,g){var b=null;return R.byteLength>0&&g!=null&&g.key!=null&&g.iv!==null&&g.method!=null&&(b=g),b}var D=function(g){return{remuxResult:{},chunkMeta:g}};function A(R){return"then"in R&&R.then instanceof Function}var S=function(g,b,f,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=b,this.initSegmentData=f,this.duration=d,this.defaultInitPts=C},O=function(g,b,f,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=b,this.accurateTimeOffset=f,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"),H=N("./src/demux/sample-aes.ts"),n=N("./src/events.ts"),I=N("./src/utils/mp4-tools.ts"),x=N("./src/utils/logger.ts"),p=N("./src/errors.ts"),_={video:1,audio:2,id3:3,text:4},c=function(){function A(O,R,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=O,this.config=R,this.typeSupported=g}A.probe=function(R){var g=A.syncOffset(R);return g<0?!1:(g&&x.logger.warn("MPEG2-TS detected but first sync word found @ offset "+g+", junk ahead ?"),!0)},A.syncOffset=function(R){for(var g=Math.min(1e3,R.length-3*188),b=0;b<g;){if(R[b]===71&&R[b+188]===71&&R[b+2*188]===71)return b;b++}return-1},A.createTrack=function(R,g){return{container:R==="video"||R==="audio"?"video/mp2t":void 0,type:R,id:_[R],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:R==="audio"?g:void 0}};var S=A.prototype;return S.resetInitSegment=function(R,g,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=A.createTrack("video",b),this._audioTrack=A.createTrack("audio",b),this._id3Track=A.createTrack("id3",b),this._txtTrack=A.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=R,this.videoCodec=g,this._duration=b},S.resetTimeStamp=function(){},S.resetContiguity=function(){var R=this._audioTrack,g=this._avcTrack,b=this._id3Track;R&&(R.pesData=null),g&&(g.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(R,g,b,f){b===void 0&&(b=!1),f===void 0&&(f=!1),b||(this.sampleAes=null);var d,C=this._avcTrack,E=this._audioTrack,w=this._id3Track,j=C.pid,W=C.pesData,T=E.pid,M=w.pid,m=E.pesData,v=w.pesData,K=!1,X=this.pmtParsed,q=this._pmtId,re=R.length;if(this.remainderData&&(R=Object(I.appendUint8Array)(this.remainderData,R),re=R.length,this.remainderData=null),re<188&&!f)return this.remainderData=R,{audioTrack:E,avcTrack:C,id3Track:w,textTrack:this._txtTrack};var ye=Math.max(0,A.syncOffset(R));re-=(re+ye)%188,re<R.byteLength&&!f&&(this.remainderData=new Uint8Array(R.buffer,re,R.buffer.byteLength-re));for(var pe=ye;pe<re;pe+=188)if(R[pe]===71){var ue=!!(R[pe+1]&64),fe=((R[pe+1]&31)<<8)+R[pe+2],Ee=(R[pe+3]&48)>>4,se=void 0;if(Ee>1){if(se=pe+5+R[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(R.subarray(se,pe+188)),W.size+=pe+188-se);break;case T:ue&&(m&&(d=u(m))&&(E.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),m={data:[],size:0}),m&&(m.data.push(R.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(R.subarray(se,pe+188)),v.size+=pe+188-se);break;case 0:ue&&(se+=R[se]+1),q=this._pmtId=h(R,se);break;case q:{ue&&(se+=R[se]+1);var ae=l(R,se,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);j=ae.avc,j>0&&(C.pid=j),T=ae.audio,T>0&&(E.pid=T,E.isAAC=ae.isAAC),M=ae.id3,M>0&&(w.pid=M),K&&!X&&(x.logger.log("reparse from beginning"),K=!1,pe=ye-188),X=this.pmtParsed=!0;break}case 17:case 8191:break;default:K=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});C.pesData=W,E.pesData=m,w.pesData=v;var Oe={audioTrack:E,avcTrack:C,id3Track:w,textTrack:this._txtTrack};return f&&this.extractRemainingSamples(Oe),Oe},S.flush=function(){var R=this.remainderData;this.remainderData=null;var g;return R?g=this.demux(R,-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(R){var g=R.audioTrack,b=R.avcTrack,f=R.id3Track,d=b.pesData,C=g.pesData,E=f.pesData,w;d&&(w=u(d))?(this.parseAVCPES(w,!0),b.pesData=null):b.pesData=d,C&&(w=u(C))?(g.isAAC?this.parseAACPES(w):this.parseMPEGPES(w),g.pesData=null):(C!=null&&C.size&&x.logger.log("last AAC PES packet truncated,might overlap between fragments"),g.pesData=C),E&&(w=u(E))?(this.parseID3PES(w),f.pesData=null):f.pesData=E},S.demuxSampleAes=function(R,g,b){var f=this.demux(R,b,!0,!this.config.progressive),d=this.sampleAes=new H.default(this.observer,this.config,g);return this.decrypt(f,d)},S.decrypt=function(R,g){return new Promise(function(b){var f=R.audioTrack,d=R.avcTrack;f.samples&&f.isAAC?g.decryptAacSamples(f.samples,0,function(){d.samples?g.decryptAvcSamples(d.samples,0,0,function(){b(R)}):b(R)}):d.samples&&g.decryptAvcSamples(d.samples,0,0,function(){b(R)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(R,g){var b=this,f=this._avcTrack,d=this.parseAVCNALu(R.data),C=!1,E=this.avcSample,w,j=!1;R.data=null,E&&d.length&&!f.audFound&&(s(E,f),E=this.avcSample=a(!1,R.pts,R.dts,"")),d.forEach(function(W){switch(W.type){case 1:{w=!0,E||(E=b.avcSample=a(!0,R.pts,R.dts,"")),C&&(E.debug+="NDR "),E.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)&&(E.key=!0)}break}case 5:w=!0,E||(E=b.avcSample=a(!0,R.pts,R.dts,"")),C&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{w=!0,C&&E&&(E.debug+="SEI ");var m=new F.default(D(W.data));m.readUByte();for(var v=0,K=0,X=!1,q=0;!X&&m.bytesAvailable>1;){v=0;do q=m.readUByte(),v+=q;while(q===255);K=0;do q=m.readUByte(),K+=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(),Ee=m.readUByte(),se=31&fe,ae=[fe,Ee],Oe=0;Oe<se;Oe++)ae.push(m.readUByte()),ae.push(m.readUByte()),ae.push(m.readUByte());i(b._txtTrack.samples,{type:3,pts:R.pts,bytes:ae})}}}}}else if(v===5&&m.bytesAvailable!==0){if(X=!0,K>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=K-16,Xe=new Uint8Array(He),We=0;We<He;We++)Xe[We]=m.readUByte();i(b._txtTrack.samples,{pts:R.pts,payloadType:v,uuid:ze.join(""),userData:Object(G.utf8ArrayToStr)(Xe),userDataBytes:Xe})}}else if(K<m.bytesAvailable)for(var Ke=0;Ke<K;Ke++)m.readUByte()}break}case 7:if(w=!0,j=!0,C&&E&&(E.debug+="SPS "),!f.sps){var nt=new F.default(W.data),de=nt.readSPS();f.width=de.width,f.height=de.height,f.pixelRatio=de.pixelRatio,f.sps=[W.data],f.duration=b._duration;for(var De=W.data.subarray(1,4),Ne="avc1.",Be=0;Be<3;Be++){var at=De[Be].toString(16);at.length<2&&(at="0"+at),Ne+=at}f.codec=Ne}break;case 8:w=!0,C&&E&&(E.debug+="PPS "),f.pps||(f.pps=[W.data]);break;case 9:w=!1,f.audFound=!0,E&&s(E,f),E=b.avcSample=a(!1,R.pts,R.dts,C?"AUD ":"");break;case 12:w=!1;break;default:w=!1,E&&(E.debug+="unknown NAL "+W.type+" ");break}if(E&&w){var lt=E.units;lt.push(W)}}),g&&E&&(s(E,f),this.avcSample=null)},S.getLastNalUnit=function(){var R,g=this.avcSample,b;if(!g||g.units.length===0){var f=this._avcTrack.samples;g=f[f.length-1]}if((R=g)!==null&&R!==void 0&&R.units){var d=g.units;b=d[d.length-1]}return b},S.parseAVCNALu=function(R){var g=R.byteLength,b=this._avcTrack,f=b.naluState||0,d=f,C=[],E=0,w,j,W,T=-1,M=0;for(f===-1&&(T=0,M=R[0]&31,f=0,E=1);E<g;){if(w=R[E++],!f){f=w?0:1;continue}if(f===1){f=w?0:2;continue}if(!w)f=3;else if(w===1){if(T>=0){var m={data:R.subarray(T,E-f-1),type:M};C.push(m)}else{var v=this.getLastNalUnit();if(v&&(d&&E<=4-d&&(v.state&&(v.data=v.data.subarray(0,v.data.byteLength-d))),j=E-f-1,j>0)){var K=new Uint8Array(v.data.byteLength+j);K.set(v.data,0),K.set(R.subarray(0,j),v.data.byteLength),v.data=K,v.state=0}}E<g?(W=R[E]&31,T=E,M=W,f=0):f=-1}else f=0}if(T>=0&&f>=0){var X={data:R.subarray(T,g),type:M,state:f};C.push(X)}if(C.length===0){var q=this.getLastNalUnit();if(q){var re=new Uint8Array(q.data.byteLength+R.byteLength);re.set(q.data,0),re.set(R,q.data.byteLength),q.data=re}}return b.naluState=f,C},S.parseAACPES=function(R){var g=0,b=this._audioTrack,f=this.aacOverFlow,d=R.data;if(f){this.aacOverFlow=null;var C=f.sample.unit.byteLength,E=Math.min(f.missing,C),w=C-E;f.sample.unit.set(d.subarray(0,E),w),b.samples.push(f.sample),g=f.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),x.logger.warn("parsing error:"+T),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:M,reason:T}),M)return}z.initTrackConfig(b,this.observer,d,j,this.audioCodec);var m;if(R.pts!==void 0)m=R.pts;else if(f){var v=z.getFrameDuration(b.samplerate);m=f.sample.pts+v}else{x.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var K=0;j<W;)if(z.isHeader(d,j)){if(j+5<W){var X=z.appendFrame(b,d,j,m,K);if(X)if(X.missing)this.aacOverFlow=X;else{j+=X.length,K++;continue}}break}else j++},S.parseMPEGPES=function(R){var g=R.data,b=g.length,f=0,d=0,C=R.pts;if(C===void 0){x.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<b;)if(P.isHeader(g,d)){var E=P.appendFrame(this._audioTrack,g,d,C,f);if(E)d+=E.length,f++;else break}else d++},S.parseID3PES=function(R){if(R.pts===void 0){x.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(R)},A}();c.minProbeByteLength=188;function a(A,S,O,R){return{key:A,frame:!1,pts:S,dts:O,units:[],debug:R,length:0}}function h(A,S){return(A[S+10]&31)<<8|A[S+11]}function l(A,S,O,R){var g={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(A[S+1]&15)<<8|A[S+2],f=S+3+b-4,d=(A[S+10]&15)<<8|A[S+11];for(S+=12+d;S<f;){var C=(A[S+1]&31)<<8|A[S+2];switch(A[S]){case 207:if(!R){x.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(!R){x.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:O?g.audio===-1&&(g.audio=C,g.isAAC=!1):x.logger.log("MPEG audio found, not supported in this browser");break;case 36:x.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,O,R,g,b,f,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)}O=d[0];var E=(O[0]<<16)+(O[1]<<8)+O[2];if(E===1){if(R=(O[4]<<8)+O[5],R&&R>A.size-6)return null;var w=O[7];w&192&&(b=(O[9]&14)*536870912+(O[10]&255)*4194304+(O[11]&254)*16384+(O[12]&255)*128+(O[13]&254)/2,w&64?(f=(O[14]&14)*536870912+(O[15]&255)*4194304+(O[16]&254)*16384+(O[17]&255)*128+(O[18]&254)/2,b-f>60*9e4&&(x.logger.warn(Math.round((b-f)/9e4)+"s delta between PTS and DTS, align them"),b=f)):f=b),g=O[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++){O=d[T];var m=O.byteLength;if(j)if(j>m){j-=m;continue}else O=O.subarray(j),m-=j,j=0;W.set(O,S),S+=m}return R&&(R-=g+3),{data:W,pts:b,dts:f,len:R}}return null}function s(A,S){if(A.units.length&&A.frame){if(A.pts===void 0){var O=S.samples,R=O.length;if(R){var g=O[R-1];A.pts=g.pts,A.dts=g.dts}else{S.dropped++;return}}S.samples.push(A)}A.debug.length&&x.logger.log(A.pts+"/"+A.dts+":"+A.debug)}function i(A,S){var O=A.length;if(O>0){if(S.pts>=A[O-1].pts)A.push(S);else for(var R=O-1;R>=0;R--)if(S.pts<A[R].pts){A.splice(R,0,S);break}}else A.push(S)}function D(A){for(var S=A.byteLength,O=[],R=1;R<S-2;)A[R]===0&&A[R+1]===0&&A[R+2]===3?(O.push(R+2),R+=2):R++;if(O.length===0)return A;var g=S-O.length,b=new Uint8Array(g),f=0;for(R=0;R<g;f++,R++)f===O[0]&&(f++,O.shift()),b[R]=A[f];return b}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"),H=N("./src/controller/id3-track-controller.ts"),n=N("./src/controller/latency-controller.ts"),I=N("./src/controller/level-controller.ts"),x=N("./src/controller/fragment-tracker.ts"),p=N("./src/controller/stream-controller.ts"),_=N("./src/is-supported.ts"),c=N("./src/utils/logger.ts"),a=N("./src/config.ts"),h=N("./node_modules/eventemitter3/index.js"),l=N.n(h),u=N("./src/events.ts"),s=N("./src/errors.ts");function i(S,O){for(var R=0;R<O.length;R++){var g=O[R];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(S,g.key,g)}}function D(S,O,R){return O&&i(S.prototype,O),R&&i(S,R),S}var A=function(){S.isSupported=function(){return Object(_.isSupported)()};function S(R){R===void 0&&(R={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new h.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,R);this.userConfig=R,Object(c.enableLogs)(g.debug),this._autoLevelCapping=-1,g.progressive&&Object(a.enableStreamingMode)(g);var b=g.abrController,f=g.bufferController,d=g.capLevelController,C=g.fpsController,E=this.abrController=new b(this),w=this.bufferController=new f(this),j=this.capLevelController=new d(this),W=new C(this),T=new F.default(this),M=new G.default(this),m=new H.default(this),v=this.levelController=new I.default(this),K=new x.FragmentTracker(this),X=this.streamController=new p.default(this,K);j.setStreamController(X),W.setStreamController(X);var q=[v,X];this.networkControllers=q;var re=[T,M,E,w,j,W,m,K];this.audioTrackController=this.createController(g.audioTrackController,null,q),this.createController(g.audioStreamController,K,q),this.subtitleTrackController=this.createController(g.subtitleTrackController,null,q),this.createController(g.subtitleStreamController,K,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 O=S.prototype;return O.createController=function(g,b,f){if(g){var d=b?new g(this,b):new g(this);return f&&f.push(d),d}return null},O.on=function(g,b,f){f===void 0&&(f=this),this._emitter.on(g,b,f)},O.once=function(g,b,f){f===void 0&&(f=this),this._emitter.once(g,b,f)},O.removeAllListeners=function(g){this._emitter.removeAllListeners(g)},O.off=function(g,b,f,d){f===void 0&&(f=this),this._emitter.off(g,b,f,d)},O.listeners=function(g){return this._emitter.listeners(g)},O.emit=function(g,b,f){return this._emitter.emit(g,b,f)},O.trigger=function(g,b){if(this.config.debug)return this.emit(g,g,b);try{return this.emit(g,g,b)}catch(f){c.logger.error("An internal error happened while handling event "+g+'. Error message: "'+f.message+'". Here is a stacktrace:',f),this.trigger(u.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:g,error:f})}return!1},O.listenerCount=function(g){return this._emitter.listenerCount(g)},O.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},O.attachMedia=function(g){c.logger.log("attachMedia"),this._media=g,this.trigger(u.Events.MEDIA_ATTACHING,{media:g})},O.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},O.loadSource=function(g){this.stopLoad();var b=this.media,f=this.url,d=this.url=z.buildAbsoluteURL(self.location.href,g,{alwaysNormalize:!0});c.logger.log("loadSource:"+d),b&&f&&f!==d&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(u.Events.MANIFEST_LOADING,{url:g})},O.startLoad=function(g){g===void 0&&(g=-1),c.logger.log("startLoad("+g+")"),this.networkControllers.forEach(function(b){b.startLoad(g)})},O.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(g){g.stopLoad()})},O.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},O.recoverMediaError=function(){c.logger.log("recoverMediaError");var g=this._media;this.detachMedia(),g&&this.attachMedia(g)},O.removeLevel=function(g,b){b===void 0&&(b=0),this.levelController.removeLevel(g,b)},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 b=!!g;b!==this.config.capLevelToPlayerSize&&(b?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=b)}},{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,b=this.config.minAutoBitrate;if(!g)return 0;for(var f=g.length,d=0;d<f;d++)if(g[d].maxBitrate>b)return d;return 0}},{key:"maxAutoLevel",get:function(){var g=this.levels,b=this.autoLevelCapping,f;return b===-1&&g&&g.length?f=g.length-1:f=b,f}},{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 b=this.audioTrackController;b&&(b.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 b=this.subtitleTrackController;b&&(b.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 b=this.subtitleTrackController;b&&(b.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 H=Object(z.getMediaSource)();if(!H)return!1;var n=P(),I=H&&typeof H.isTypeSupported=="function"&&H.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),x=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!I&&!!x}function G(){var H,n=P();return typeof(n==null||((H=n.prototype)===null||H===void 0)?void 0:H.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 h});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,x(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 H(i,arguments,p(this).constructor)}return D.prototype=Object.create(i.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),x(D,i)},G(l)}function H(l,u,s){return n()?H=Reflect.construct:H=function(D,A,S){var O=[null];O.push.apply(O,A);var R=Function.bind.apply(D,O),g=new R;return S&&x(g,S.prototype),g},H.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 x(l,u){return x=Object.setPrototypeOf||function(i,D){return i.__proto__=D,i},x(l,u)}function p(l){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},p(l)}var _=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 h({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 O=this.config,R=O.fLoader,g=O.loader;return new Promise(function(b,f){A.loader&&A.loader.destroy();var d=A.loader=i.loader=R?new R(O):new g(O),C=a(i),E={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:_};i.stats=d.stats,d.load(C,E,{onSuccess:function(j,W,T,M){A.resetLoader(i,d),b({frag:i,part:null,payload:j.data,networkDetails:M})},onError:function(j,W,T){A.resetLoader(i,d),f(new h({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),f(new h({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),f(new h({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 O=this.config,R=O.fLoader,g=O.loader;return new Promise(function(b,f){S.loader&&S.loader.destroy();var d=S.loader=i.loader=R?new R(O):new g(O),C=a(i,D),E={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:_};D.stats=d.stats,d.load(C,E,{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),b(m)},onError:function(j,W,T){S.resetLoader(i,d),f(new h({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),f(new h({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),f(new h({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,O=S.total;if(A.loaded+=S.loaded,O){var R=Math.round(i.duration/D.duration),g=Math.min(Math.round(A.loaded/O),R),b=R-g,f=b*Math.round(A.loaded/g);A.total=A.loaded+f}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 h=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 h}),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"),H=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,x(u,s)}function x(u,s){return x=Object.setPrototypeOf||function(D,A){return D.__proto__=A,D},x(u,s)}function p(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 _(u,s,i){return s&&p(u.prototype,s),i&&p(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),O=[];S.length===1?O[0]=A?A.byteRangeEndOffset:0:O[0]=parseInt(S[1]),O[1]=parseInt(S[0])+O[0],this._byteRange=O},_(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}(),h=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),O=12;O<16;O++)S[O]=A>>8*(15-O)&255;return S},i.setDecryptDataFromLevelKey=function(A,S){var O=A;return(A==null?void 0:A.method)==="AES-128"&&A.uri&&!A.iv&&(O=H.LevelKey.fromURI(A.uri),O.method=A.method,O.iv=this.createInitializationVector(S),O.keyFormat="identity"),O},i.setElementaryStreamInfo=function(A,S,O,R,g,b){b===void 0&&(b=!1);var f=this.elementaryStreams,d=f[A];if(!d){f[A]={startPTS:S,endPTS:O,startDTS:R,endDTS:g,partial:b};return}d.startPTS=Math.min(d.startPTS,S),d.endPTS=Math.max(d.endPTS,O),d.startDTS=Math.min(d.startDTS,R),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},_(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,O){var R;R=u.call(this,A)||this,R.fragOffset=0,R.duration=0,R.gap=!1,R.independent=!1,R.relurl=void 0,R.fragment=void 0,R.index=void 0,R.stats=new n.LoadStats,R.duration=i.decimalFloatingPoint("DURATION"),R.gap=i.bool("GAP"),R.independent=i.bool("INDEPENDENT"),R.relurl=i.enumeratedString("URI"),R.fragment=D,R.index=S;var g=i.enumeratedString("BYTERANGE");return g&&R.setByteRange(g,O),O&&(R.fragOffset=O.fragOffset+O.duration),R}return _(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 H(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var n=H.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 x in this.loaders){var p=this.loaders[x];p&&p.destroy()}this.loaders={}},n.onKeyLoading=function(x,p){var _=p.frag,c=_.type,a=this.loaders[c];if(!_.decryptdata){F.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var h=_.decryptdata.uri;if(h!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(a&&(F.logger.warn("abort previous key loader for type:"+c),a.abort()),!h){F.logger.warn("key uri is falsy");return}var u=l.loader,s=_.loader=this.loaders[c]=new u(l);this.decrypturl=h,this.decryptkey=null;var i={url:h,frag:_,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&&(_.decryptdata.key=this.decryptkey,this.hls.trigger(z.Events.KEY_LOADED,{frag:_}))},n.loadsuccess=function(x,p,_){var c=_.frag;if(!c.decryptdata){F.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(x.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(z.Events.KEY_LOADED,{frag:c})},n.loaderror=function(x,p){var _=p.frag,c=_.loader;c&&c.abort(),delete this.loaders[_.type],this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:_,response:x})},n.loadtimeout=function(x,p){var _=p.frag,c=_.loader;c&&c.abort(),delete this.loaders[_.type],this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:_})},H}()},"./src/loader/level-details.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"LevelDetails",function(){return H});var z=N("./src/polyfills/number.ts");function P(n,I){for(var x=0;x<I.length;x++){var p=I[x];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function F(n,I,x){return I&&P(n.prototype,I),x&&P(n,x),n}var G=10,H=function(){function n(x){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=x}var I=n.prototype;return I.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var _=this.lastPartSn-p.lastPartSn,c=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!c||!!_,this.advanced=this.endSN>p.endSN||_>0||_===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.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 p=this.driftEndTime-this.driftStartTime;if(p>0){var _=this.driftEnd-this.driftStart;return _*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.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 p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.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 H});var z=N("./node_modules/url-toolkit/src/url-toolkit.js"),P=N.n(z);function F(n,I){for(var x=0;x<I.length;x++){var p=I[x];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function G(n,I,x){return I&&F(n.prototype,I),x&&F(n,x),n}var H=function(){n.fromURL=function(x,p){return new n(x,p)},n.fromURI=function(x){return new n(x)};function n(I,x){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,x?this._uri=Object(z.buildAbsoluteURL)(I,x,{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"),H=N("./src/loader/level-details.ts"),n=N("./src/loader/level-key.ts"),I=N("./src/utils/attr-list.ts"),x=N("./src/utils/logger.ts"),p=N("./src/utils/codecs.ts"),_=/#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"),h=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(O){var R,g;return l.test((R=(g=P.parseURL(O))===null||g===void 0?void 0:g.path)!=null?R:"")}var s=function(){function O(){}return O.findGroup=function(g,b){for(var f=0;f<g.length;f++){var d=g[f];if(d.id===b)return d}},O.convertAVC1ToAVCOTI=function(g){var b=g.split(".");if(b.length>2){var f=b.shift()+".";return f+=parseInt(b.shift()).toString(16),f+=("000"+parseInt(b.shift()).toString(16)).substr(-4),f}return g},O.resolve=function(g,b){return P.buildAbsoluteURL(b,g,{alwaysNormalize:!0})},O.parseMasterPlaylist=function(g,b){var f=[],d={},C=!1;_.lastIndex=0;for(var E;(E=_.exec(g))!=null;)if(E[1]){var w=new I.AttrList(E[1]),j={attrs:w,bitrate:w.decimalInteger("AVERAGE-BANDWIDTH")||w.decimalInteger("BANDWIDTH"),name:w.NAME,url:O.resolve(E[2],b)},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=O.convertAVC1ToAVCOTI(j.videoCodec)),f.push(j)}else if(E[3]){var T=new I.AttrList(E[3]);T["DATA-ID"]&&(C=!0,d[T["DATA-ID"]]=T)}return{levels:f,sessionData:C?d:null}},O.parseMasterPlaylistMedia=function(g,b,f,d){d===void 0&&(d=[]);var C,E=[],w=0;for(c.lastIndex=0;(C=c.exec(g))!==null;){var j=new I.AttrList(C[1]);if(j.TYPE===f){var W={attrs:j,bitrate:0,id:w++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:f,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?O.resolve(j.URI,b):""};if(d.length){var T=O.findGroup(d,W.groupId)||d[0];D(W,T,"audioCodec"),D(W,T,"textCodec")}E.push(W)}}return E},O.parseLevelPlaylist=function(g,b,f,d,C){var E=new H.LevelDetails(b),w=E.fragments,j=null,W=0,T=0,M=0,m=0,v=null,K=new G.Fragment(d,b),X,q,re,ye=-1,pe=!1;for(a.lastIndex=0,E.m3u8=g;(X=a.exec(g))!==null;){pe&&(pe=!1,K=new G.Fragment(d,b),K.start=M,K.sn=W,K.cc=m,K.level=f,j&&(K.initSegment=j,K.rawProgramDateTime=j.rawProgramDateTime));var ue=X[1];if(ue){K.duration=parseFloat(ue);var fe=(" "+X[2]).slice(1);K.title=fe||null,K.tagList.push(fe?["INF",ue,fe]:["INF",ue])}else if(X[3])Object(z.isFiniteNumber)(K.duration)&&(K.start=M,re&&(K.levelkey=re),K.sn=W,K.level=f,K.cc=m,K.urlId=C,w.push(K),K.relurl=(" "+X[3]).slice(1),S(K,v),v=K,M+=K.duration,W++,T=0,pe=!0);else if(X[4]){var Ee=(" "+X[4]).slice(1);v?K.setByteRange(Ee,v):K.setByteRange(Ee)}else if(X[5])K.rawProgramDateTime=(" "+X[5]).slice(1),K.tagList.push(["PROGRAM-DATE-TIME",K.rawProgramDateTime]),ye===-1&&(ye=w.length);else{if(X=X[0].match(h),!X){x.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),Oe=X[q+2]?(" "+X[q+2]).slice(1):"";switch(se){case"PLAYLIST-TYPE":E.type=ae.toUpperCase();break;case"MEDIA-SEQUENCE":W=E.startSN=parseInt(ae);break;case"SKIP":{var ze=new I.AttrList(ae),Ye=ze.decimalInteger("SKIPPED-SEGMENTS");if(Object(z.isFiniteNumber)(Ye)){E.skippedSegments=Ye;for(var He=Ye;He--;)w.unshift(null);W+=Ye}var Xe=ze.enumeratedString("RECENTLY-REMOVED-DATERANGES");Xe&&(E.recentlyRemovedDateranges=Xe.split(" "));break}case"TARGETDURATION":E.targetduration=parseFloat(ae);break;case"VERSION":E.version=parseInt(ae);break;case"EXTM3U":break;case"ENDLIST":E.live=!1;break;case"#":(ae||Oe)&&K.tagList.push(Oe?[ae,Oe]:[ae]);break;case"DIS":m++;case"GAP":K.tagList.push([se]);break;case"BITRATE":K.tagList.push([se,ae]);break;case"DISCONTINUITY-SEQ":m=parseInt(ae);break;case"KEY":{var We,Ke=new I.AttrList(ae),nt=Ke.enumeratedString("METHOD"),de=Ke.URI,De=Ke.hexadecimalInteger("IV"),Ne=Ke.enumeratedString("KEYFORMATVERSIONS"),Be=Ke.enumeratedString("KEYID"),at=(We=Ke.enumeratedString("KEYFORMAT"))!=null?We:"identity",lt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(lt.indexOf(at)>-1){x.logger.warn("Keyformat "+at+" is not supported from the manifest");continue}else if(at!=="identity")continue;nt&&(re=n.LevelKey.fromURL(b,de),de&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(nt)>=0&&(re.method=nt,re.keyFormat=at,Be&&(re.keyID=Be),Ne&&(re.keyFormatVersions=Ne),re.iv=De));break}case"START":{var pt=new I.AttrList(ae),ot=pt.decimalFloatingPoint("TIME-OFFSET");Object(z.isFiniteNumber)(ot)&&(E.startTimeOffset=ot);break}case"MAP":{var bt=new I.AttrList(ae);K.relurl=bt.URI,bt.BYTERANGE&&K.setByteRange(bt.BYTERANGE),K.level=f,K.sn="initSegment",re&&(K.levelkey=re),K.initSegment=null,j=K,pe=!0;break}case"SERVER-CONTROL":{var yt=new I.AttrList(ae);E.canBlockReload=yt.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=yt.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&yt.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=yt.optionalFloat("PART-HOLD-BACK",0),E.holdBack=yt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var xt=new I.AttrList(ae);E.partTarget=xt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ze=E.partList;Ze||(Ze=E.partList=[]);var kt=T>0?Ze[Ze.length-1]:void 0,Ot=T++,qe=new G.Part(new I.AttrList(ae),K,b,Ot,kt);Ze.push(qe),K.duration+=qe.duration;break}case"PRELOAD-HINT":{var st=new I.AttrList(ae);E.preloadHint=st;break}case"RENDITION-REPORT":{var xe=new I.AttrList(ae);E.renditionReports=E.renditionReports||[],E.renditionReports.push(xe);break}default:x.logger.warn("line parsed but not handled: "+X);break}}}v&&!v.relurl?(w.pop(),M-=v.duration,E.partList&&(E.fragmentHint=v)):E.partList&&(S(K,v),K.cc=m,E.fragmentHint=K);var we=w.length,me=w[0],ce=w[we-1];if(M+=E.skippedSegments*E.targetduration,M>0&&we&&ce){E.averagetargetduration=M/we;var he=ce.sn;E.endSN=he!=="initSegment"?he:0,me&&(E.startCC=me.cc,me.initSegment||E.fragments.every(function(Te){return Te.relurl&&u(Te.relurl)})&&(x.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),K=new G.Fragment(d,b),K.relurl=ce.relurl,K.level=f,K.sn="initSegment",me.initSegment=K,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(M+=E.fragmentHint.duration),E.totalduration=M,E.endCC=m,ye>0&&A(w,ye),E},O}();function i(O,R){["video","audio","text"].forEach(function(g){var b=O.filter(function(d){return Object(p.isCodecType)(d,g)});if(b.length){var f=b.filter(function(d){return d.lastIndexOf("avc1",0)===0||d.lastIndexOf("mp4a",0)===0});R[g+"Codec"]=f.length>0?f[0]:b[0],O=O.filter(function(d){return b.indexOf(d)===-1})}}),R.unknownCodecs=O}function D(O,R,g){var b=R[g];b&&(O[g]=b)}function A(O,R){for(var g=O[R],b=R;b--;){var f=O[b];if(!f)return;f.programDateTime=g.programDateTime-f.duration*1e3,g=f}}function S(O,R){O.rawProgramDateTime?O.programDateTime=Date.parse(O.rawProgramDateTime):R!=null&&R.programDateTime&&(O.programDateTime=R.endProgramDateTime),Object(z.isFiniteNumber)(O.programDateTime)||(O.programDateTime=null,O.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"),H=N("./src/utils/mp4-tools.ts"),n=N("./src/loader/m3u8-parser.ts"),I=N("./src/types/loader.ts"),x=N("./src/utils/attr-list.ts");function p(a){var h=a.type;switch(h){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function _(a,h){var l=a.url;return(l===void 0||l.indexOf("data:")===0)&&(l=h.url),l}var c=function(){function a(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var h=a.prototype;return h.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)},h.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)},h.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},h.getInternalLoader=function(u){return this.loaders[u.type]},h.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},h.destroyInternalLoaders=function(){for(var u in this.loaders){var s=this.loaders[u];s&&s.destroy(),this.resetInternalLoader(u)}},h.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},h.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})},h.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})},h.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})},h.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})},h.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,O,R,g;switch(u.type){case I.PlaylistContextType.MANIFEST:S=i.manifestLoadingMaxRetry,O=i.manifestLoadingTimeOut,R=i.manifestLoadingRetryDelay,g=i.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:S=0,O=i.levelLoadingTimeOut;break;default:S=i.levelLoadingMaxRetry,O=i.levelLoadingTimeOut,R=i.levelLoadingRetryDelay,g=i.levelLoadingMaxRetryTimeout;break}if(D=this.createInternalLoader(u),(s=u.deliveryDirectives)!==null&&s!==void 0&&s.part){var b;if(u.type===I.PlaylistContextType.LEVEL&&u.level!==null?b=this.hls.levels[u.level].details:u.type===I.PlaylistContextType.AUDIO_TRACK&&u.id!==null?b=this.hls.audioTracks[u.id].details:u.type===I.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(b=this.hls.subtitleTracks[u.id].details),b){var f=b.partTarget,d=b.targetduration;f&&d&&(O=Math.min(Math.max(f*3,d*.8)*1e3,O))}}var C={timeout:O,maxRetry:S,retryDelay:R,maxRetryDelay:g,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};D.load(u,C,E)},h.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)},h.loaderror=function(u,s,i){i===void 0&&(i=null),this.handleNetworkError(s,i,!1,u)},h.loadtimeout=function(u,s,i){i===void 0&&(i=null),this.handleNetworkError(s,i,!0)},h.handleMasterPlaylist=function(u,s,i,D){var A=this.hls,S=u.data,O=_(u,i),R=n.default.parseMasterPlaylist(S,O),g=R.levels,b=R.sessionData;if(!g.length){this.handleManifestParsingError(u,i,"no level found in manifest",D);return}var f=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,O,"AUDIO",f),E=n.default.parseMasterPlaylistMedia(S,O,"SUBTITLES",d),w=n.default.parseMasterPlaylistMedia(S,O,"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 x.AttrList({}),bitrate:0,url:""}))}A.trigger(P.Events.MANIFEST_LOADED,{levels:g,audioTracks:C,subtitles:E,captions:w,url:O,stats:s,networkDetails:D,sessionData:b})},h.handleTrackOrLevelPlaylist=function(u,s,i,D){var A=this.hls,S=i.id,O=i.level,R=i.type,g=_(u,i),b=Object(z.isFiniteNumber)(S)?S:0,f=Object(z.isFiniteNumber)(O)?O:b,d=p(i),C=n.default.parseLevelPlaylist(u.data,g,f,d,b);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(R===I.PlaylistContextType.MANIFEST){var E={attrs:new x.AttrList({}),bitrate:0,details:C,name:"",url:g};A.trigger(P.Events.MANIFEST_LOADED,{levels:[E],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:R,level:O,levelDetails:C,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}i.levelDetails=C,this.handlePlaylistLoaded(u,s,i,D)},h.handleSidxRequest=function(u,s){var i=Object(H.parseSegmentIndex)(new Uint8Array(u.data));if(!i)return;var D=i.references,A=s.levelDetails;D.forEach(function(S,O){var R=S.info,g=A.fragments[O];g.byteRange.length===0&&g.setByteRange(String(1+R.end-R.start)+"@"+String(R.start)),g.initSegment&&g.initSegment.setByteRange(String(i.moovEndOffset)+"@0")})},h.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})},h.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,O=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}O&&this.resetInternalLoader(u.type);var R={type:F.ErrorTypes.NETWORK_ERROR,details:A,fatal:S,url:u.url,loader:O,context:u,networkDetails:s};D&&(R.response=D),this.hls.trigger(P.Events.ERROR,R)},h.handlePlaylistLoaded=function(u,s,i,D){var A=i.type,S=i.level,O=i.id,R=i.groupId,g=i.loader,b=i.levelDetails,f=i.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(u,i,"invalid target duration",D);return}if(!g)return;b.live&&(g.getCacheAge&&(b.ageHeader=g.getCacheAge()||0),(!g.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(A){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:b,level:S||0,id:O||0,stats:s,networkDetails:D,deliveryDirectives:f});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:b,id:O||0,groupId:R||"",stats:s,networkDetails:D,deliveryDirectives:f});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:b,id:O||0,groupId:R||"",stats:s,networkDetails:D,deliveryDirectives:f});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,H){switch(G){case"mp4a.40.2":if(H===1)return new Uint8Array([0,200,0,128,35,128]);if(H===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(H===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(H===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(H===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(H===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(H===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(H===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(H===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},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 H;for(H in F.types)F.types.hasOwnProperty(H)&&(F.types[H]=[H.charCodeAt(0),H.charCodeAt(1),H.charCodeAt(2),H.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 x=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);F.STTS=F.STSC=F.STCO=p,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 _=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,_,a,_,c),F.DINF=F.box(F.types.dinf,F.box(F.types.dref,x))},F.box=function(H){for(var n=8,I=arguments.length,x=new Array(I>1?I-1:0),p=1;p<I;p++)x[p-1]=arguments[p];for(var _=x.length,c=_;_--;)n+=x[_].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(H,4),_=0,n=8;_<c;_++)a.set(x[_],n),n+=x[_].byteLength;return a},F.hdlr=function(H){return F.box(F.types.hdlr,F.HDLR_TYPES[H])},F.mdat=function(H){return F.box(F.types.mdat,H)},F.mdhd=function(H,n){n*=H;var I=Math.floor(n/(z+1)),x=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,H>>24&255,H>>16&255,H>>8&255,H&255,I>>24,I>>16&255,I>>8&255,I&255,x>>24,x>>16&255,x>>8&255,x&255,85,196,0,0]))},F.mdia=function(H){return F.box(F.types.mdia,F.mdhd(H.timescale,H.duration),F.hdlr(H.type),F.minf(H))},F.mfhd=function(H){return F.box(F.types.mfhd,new Uint8Array([0,0,0,0,H>>24,H>>16&255,H>>8&255,H&255]))},F.minf=function(H){return H.type==="audio"?F.box(F.types.minf,F.box(F.types.smhd,F.SMHD),F.DINF,F.stbl(H)):F.box(F.types.minf,F.box(F.types.vmhd,F.VMHD),F.DINF,F.stbl(H))},F.moof=function(H,n,I){return F.box(F.types.moof,F.mfhd(H),F.traf(I,n))},F.moov=function(H){for(var n=H.length,I=[];n--;)I[n]=F.trak(H[n]);return F.box.apply(null,[F.types.moov,F.mvhd(H[0].timescale,H[0].duration)].concat(I).concat(F.mvex(H)))},F.mvex=function(H){for(var n=H.length,I=[];n--;)I[n]=F.trex(H[n]);return F.box.apply(null,[F.types.mvex].concat(I))},F.mvhd=function(H,n){n*=H;var I=Math.floor(n/(z+1)),x=Math.floor(n%(z+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,H>>24&255,H>>16&255,H>>8&255,H&255,I>>24,I>>16&255,I>>8&255,I&255,x>>24,x>>16&255,x>>8&255,x&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,p)},F.sdtp=function(H){var n=H.samples||[],I=new Uint8Array(4+n.length),x,p;for(x=0;x<n.length;x++)p=n[x].flags,I[x+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return F.box(F.types.sdtp,I)},F.stbl=function(H){return F.box(F.types.stbl,F.stsd(H),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(H){var n=[],I=[],x,p,_;for(x=0;x<H.sps.length;x++)p=H.sps[x],_=p.byteLength,n.push(_>>>8&255),n.push(_&255),n=n.concat(Array.prototype.slice.call(p));for(x=0;x<H.pps.length;x++)p=H.pps[x],_=p.byteLength,I.push(_>>>8&255),I.push(_&255),I=I.concat(Array.prototype.slice.call(p));var c=F.box(F.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|H.sps.length].concat(n).concat([H.pps.length]).concat(I))),a=H.width,h=H.height,l=H.pixelRatio[0],u=H.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,h>>8&255,h&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(H){var n=H.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(H.config).concat([6,1,2]))},F.mp4a=function(H){var n=H.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,H.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),F.box(F.types.esds,F.esds(H)))},F.mp3=function(H){var n=H.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,H.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},F.stsd=function(H){return H.type==="audio"?!H.isAAC&&H.codec==="mp3"?F.box(F.types.stsd,F.STSD,F.mp3(H)):F.box(F.types.stsd,F.STSD,F.mp4a(H)):F.box(F.types.stsd,F.STSD,F.avc1(H))},F.tkhd=function(H){var n=H.id,I=H.duration*H.timescale,x=H.width,p=H.height,_=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,_>>24,_>>16&255,_>>8&255,_&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,x>>8&255,x&255,0,0,p>>8&255,p&255,0,0]))},F.traf=function(H,n){var I=F.sdtp(H),x=H.id,p=Math.floor(n/(z+1)),_=Math.floor(n%(z+1));return F.box(F.types.traf,F.box(F.types.tfhd,new Uint8Array([0,0,0,0,x>>24,x>>16&255,x>>8&255,x&255])),F.box(F.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,_>>24,_>>16&255,_>>8&255,_&255])),F.trun(H,I.length+16+20+8+16+8+8),I)},F.trak=function(H){return H.duration=H.duration||4294967295,F.box(F.types.trak,F.tkhd(H),F.mdia(H))},F.trex=function(H){var n=H.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(H,n){var I=H.samples||[],x=I.length,p=12+16*x,_=new Uint8Array(p),c,a,h,l,u,s;for(n+=8+p,_.set([0,0,15,1,x>>>24&255,x>>>16&255,x>>>8&255,x&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),c=0;c<x;c++)a=I[c],h=a.duration,l=a.size,u=a.flags,s=a.cts,_.set([h>>>24&255,h>>>16&255,h>>>8&255,h&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,_)},F.initSegment=function(H){F.types||F.init();var n=F.moov(H),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"),H=N("./src/errors.ts"),n=N("./src/utils/logger.ts"),I=N("./src/types/loader.ts"),x=N("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(O){for(var R=1;R<arguments.length;R++){var g=arguments[R];for(var b in g)Object.prototype.hasOwnProperty.call(g,b)&&(O[b]=g[b])}return O},p.apply(this,arguments)}var _=10*1e3,c=1024,a=1152,h=null,l=null,u=!1,s=function(){function O(g,b,f,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=b,this.typeSupported=f,this.ISGenerated=!1,h===null){var C=navigator.userAgent||"",E=C.match(/Chrome\/(\d+)/i);h=E?parseInt(E[1]):0}if(l===null){var w=navigator.userAgent.match(/Safari\/(\d+)/i);l=w?parseInt(w[1]):0}u=!!h&&h<75||!!l&&l<600}var R=O.prototype;return R.destroy=function(){},R.resetTimeStamp=function(b){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},R.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},R.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},R.getVideoStartPts=function(b){var f=!1,d=b.reduce(function(C,E){var w=E.pts-C;return w<-4294967296?(f=!0,i(C,E.pts)):w>0?C:E.pts},b[0].pts);return f&&n.logger.debug("PTS rollover detected"),d},R.remux=function(b,f,d,C,E,w,j,W){var T,M,m,v,K,X,q=E,re=E,ye=b.pid>-1,pe=f.pid>-1,ue=f.samples.length,fe=b.samples.length>0,Ee=ue>1,se=(!ye||fe)&&(!pe||Ee)||this.ISGenerated||j;if(se){this.ISGenerated||(m=this.generateIS(b,f,E));var ae=this.isVideoContiguous,Oe=-1;if(Ee&&(Oe=D(f.samples),!ae&&this.config.forceKeyFrameOnDiscontinuity))if(X=!0,Oe>0){n.logger.warn("[mp4-remuxer]: Dropped "+Oe+" out of "+ue+" video samples due to a missing keyframe");var ze=this.getVideoStartPts(f.samples);f.samples=f.samples.slice(Oe),f.dropped+=Oe,re+=(f.samples[0].pts-ze)/(f.timescale||9e4)}else Oe===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+ue+" video samples"),X=!1);if(this.ISGenerated){if(fe&&Ee){var Ye=this.getVideoStartPts(f.samples),He=i(b.samples[0].pts,Ye)-Ye,Xe=He/f.inputTimeScale;q+=Math.max(0,Xe),re+=Math.max(0,-Xe)}if(fe){if(b.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),m=this.generateIS(b,f,E)),M=this.remuxAudio(b,q,this.isAudioContiguous,w,pe||Ee||W===I.PlaylistLevelType.AUDIO?re:void 0),Ee){var We=M?M.endPTS-M.startPTS:0;f.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),m=this.generateIS(b,f,E)),T=this.remuxVideo(f,re,ae,We)}}else Ee&&(T=this.remuxVideo(f,re,ae,0));T&&(T.firstKeyFrame=Oe,T.independent=Oe!==-1)}}return this.ISGenerated&&(d.samples.length&&(K=this.remuxID3(d,E)),C.samples.length&&(v=this.remuxText(C,E))),{audio:M,video:T,initSegment:m,independent:X,text:v,id3:K}},R.generateIS=function(b,f,d){var C=b.samples,E=f.samples,w=this.typeSupported,j={},W=!Object(z.isFiniteNumber)(this._initPTS),T="audio/mp4",M,m,v;if(W&&(M=m=Infinity),b.config&&C.length&&(b.timescale=b.samplerate,b.isAAC||(w.mpeg?(T="audio/mpeg",b.codec=""):w.mp3&&(b.codec="mp3")),j.audio={id:"audio",container:T,codec:b.codec,initSegment:!b.isAAC&&w.mpeg?new Uint8Array(0):F.default.initSegment([b]),metadata:{channelCount:b.channelCount}},W&&(v=b.inputTimeScale,M=m=C[0].pts-Math.round(v*d))),f.sps&&f.pps&&E.length&&(f.timescale=f.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:f.codec,initSegment:F.default.initSegment([f]),metadata:{width:f.width,height:f.height}},W)){v=f.inputTimeScale;var K=this.getVideoStartPts(E),X=Math.round(v*d);m=Math.min(m,i(E[0].dts,K)-X),M=Math.min(M,K-X)}if(Object.keys(j).length)return this.ISGenerated=!0,W&&(this._initPTS=M,this._initDTS=m),{tracks:j,initPTS:M,timescale:v}},R.remuxVideo=function(b,f,d,C){var E=b.inputTimeScale,w=b.samples,j=[],W=w.length,T=this._initPTS,M=this.nextAvcDts,m=8,v,K,X,q=Number.POSITIVE_INFINITY,re=Number.NEGATIVE_INFINITY,ye=0,pe=!1;if(!d||M===null){var ue=f*E,fe=w[0].pts-i(w[0].dts,w[0].pts);M=ue-fe}for(var Ee=0;Ee<W;Ee++){var se=w[Ee];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[Ee>0?Ee-1:Ee].dts&&(pe=!0)}pe&&w.sort(function(mn,En){var $t=mn.dts-En.dts,rr=mn.pts-En.pts;return $t||rr}),K=w[0].dts,X=w[w.length-1].dts;var Oe=Math.round((X-K)/(W-1));if(ye<0){if(ye<Oe*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(x.toMsFromMpegTsClock)(-Oe,!0)+" ms");for(var ze=ye,Ye=0;Ye<W;Ye++)w[Ye].dts=ze=Math.max(ze,w[Ye].pts-Oe),w[Ye].pts=Math.max(ze,w[Ye].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(x.toMsFromMpegTsClock)(ye,!0)+" ms to overcome this issue");for(var He=0;He<W;He++)w[He].dts=w[He].dts+ye}K=w[0].dts}if(d){var Xe=K-M,We=Xe>Oe,Ke=Xe<-1;if(We||Ke){We?n.logger.warn("AVC: "+Object(x.toMsFromMpegTsClock)(Xe,!0)+" ms ("+Xe+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(x.toMsFromMpegTsClock)(-Xe,!0)+" ms ("+Xe+"dts) overlapping between fragments detected"),K=M;var nt=w[0].pts-Xe;w[0].dts=K,w[0].pts=nt,n.logger.log("Video: First PTS/DTS adjusted: "+Object(x.toMsFromMpegTsClock)(nt,!0)+"/"+Object(x.toMsFromMpegTsClock)(K,!0)+", delta: "+Object(x.toMsFromMpegTsClock)(Xe,!0)+" ms")}}u&&(K=Math.max(0,K));for(var de=0,De=0,Ne=0;Ne<W;Ne++){for(var Be=w[Ne],at=Be.units,lt=at.length,pt=0,ot=0;ot<lt;ot++)pt+=at[ot].data.length;De+=pt,de+=lt,Be.length=pt,Be.dts=Math.max(Be.dts,K),Be.pts=Math.max(Be.pts,Be.dts,0),q=Math.min(Be.pts,q),re=Math.max(Be.pts,re)}X=w[W-1].dts;var bt=De+4*de+8,yt;try{yt=new Uint8Array(bt)}catch(mn){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:bt,reason:"fail allocating video mdat "+bt});return}var xt=new DataView(yt.buffer);xt.setUint32(0,bt),yt.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,yt.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*E),ke=(C?q+C*E:this.nextAudioPts)-kt.pts;ke>Re?(v=ke-Te,v<0&&(v=Te),n.logger.log("[mp4-remuxer]: It is approximately "+ke/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&&h&&h<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(b.sequenceNumber++,K,p({},b,{samples:j})),nn="video",en={data1:Ut,data2:yt,startPTS:q/E,endPTS:(re+v)/E,startDTS:K/E,endDTS:M/E,type:nn,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(yt.length,"MDAT length must not be zero"),en},R.remuxAudio=function(b,f,d,C,E){var w=b.inputTimeScale,j=b.samplerate?b.samplerate:w,W=w/j,T=b.isAAC?c:a,M=T*W,m=this._initPTS,v=!b.isAAC&&this.typeSupported.mpeg,K=[],X=b.samples,q=v?0:8,re=this.nextAudioPts||-1,ye=f*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;E===0?re=0:C?re=Math.max(0,ye):re=X[0].pts}if(b.isAAC)for(var pe=E!==void 0,ue=this.config.maxAudioFramesDrift,fe=0,Ee=re;fe<X.length;fe++){var se=X[fe],ae=se.pts,Oe=ae-Ee,ze=Math.abs(1e3*Oe/w);if(Oe<=-ue*M&&pe)fe===0&&(n.logger.warn("Audio frame @ "+(ae/w).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Oe/w)+" ms."),this.nextAudioPts=re=Ee=ae);else if(Oe>=ue*M&&ze<_&&pe){var Ye=Math.round(Oe/M);Ee=ae-Ye*M,Ee<0&&(Ye--,Ee+=M),fe===0&&(this.nextAudioPts=re=Ee),n.logger.warn("[mp4-remuxer]: Injecting "+Ye+" audio frame @ "+(Ee/w).toFixed(3)+"s due to "+Math.round(1e3*Oe/w)+" ms gap.");for(var He=0;He<Ye;He++){var Xe=Math.max(Ee,0),We=P.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);We||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),We=se.unit.subarray()),X.splice(fe,0,{unit:We,pts:Xe}),Ee+=M,fe++}}se.pts=Ee,Ee+=M}for(var Ke=null,nt=null,de,De=0,Ne=X.length;Ne--;)De+=X[Ne].unit.byteLength;for(var Be=0,at=X.length;Be<at;Be++){var lt=X[Be],pt=lt.unit,ot=lt.pts;if(nt!==null){var bt=K[Be-1];bt.duration=Math.round((ot-nt)/W)}else if(d&&b.isAAC&&(ot=re),Ke=ot,De>0){De+=q;try{de=new Uint8Array(De)}catch(me){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:De,reason:"fail allocating audio mdat "+De});return}if(!v){var yt=new DataView(de.buffer);yt.setUint32(0,De),de.set(F.default.types.mdat,4)}}else return;de.set(pt,q);var xt=pt.byteLength;q+=xt,K.push(new A(!0,T,xt,0)),nt=ot}var Ze=K.length;if(!Ze)return;var kt=K[K.length-1];this.nextAudioPts=re=nt+W*kt.duration;var Ot=v?new Uint8Array(0):F.default.moof(b.sequenceNumber++,Ke/W,p({},b,{samples:K}));b.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},R.remuxEmptyAudio=function(b,f,d,C){var E=b.inputTimeScale,w=b.samplerate?b.samplerate:E,j=E/w,W=this.nextAudioPts,T=(W!==null?W:C.startDTS*E)+this._initDTS,M=C.endDTS*E+this._initDTS,m=j*c,v=Math.ceil((M-T)/m),K=P.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!K){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var X=[],q=0;q<v;q++){var re=T+q*m;X.push({unit:K,pts:re,dts:re})}return b.samples=X,this.remuxAudio(b,f,d,!1)},R.remuxID3=function(b,f){var d=b.samples.length;if(!d)return;for(var C=b.inputTimeScale,E=this._initPTS,w=this._initDTS,j=0;j<d;j++){var W=b.samples[j];W.pts=i(W.pts-E,f*C)/C,W.dts=i(W.dts-w,f*C)/C}var T=b.samples;return b.samples=[],{samples:T}},R.remuxText=function(b,f){var d=b.samples.length;if(!d)return;for(var C=b.inputTimeScale,E=this._initPTS,w=0;w<d;w++){var j=b.samples[w];j.pts=i(j.pts-E,f*C)/C}b.samples.sort(function(T,M){return T.pts-M.pts});var W=b.samples;return b.samples=[],{samples:W}},O}();function i(O,R){var g;if(R===null)return O;for(R<O?g=-8589934592:g=8589934592;Math.abs(O-R)>4294967296;)O+=g;return O}function D(O){for(var R=0;R<O.length;R++)if(O[R].key)return R;return-1}var A=function(R,g,b,f){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=g,this.size=b,this.cts=f,this.flags=new S(R)},S=function(R){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=R?2:1,this.isNonSync=R?0:1}},"./src/remux/passthrough-remuxer.ts":function(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"),H=function(){function x(){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 p=x.prototype;return p.destroy=function(){},p.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(c,a,h){this.audioCodec=a,this.videoCodec=h,this.generateInitSegment(c),this.emitInitSegment=!0},p.generateInitSegment=function(c){var a=this.audioCodec,h=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)),h||(h=I(l.video,F.ElementaryStreamTypes.VIDEO));var u={};l.audio&&l.video?u.audiovideo={container:"video/mp4",codec:a+","+h,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:h,initSegment:c,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},p.remux=function(c,a,h,l,u){var s=this.initPTS,i=this.lastEndDTS,D={audio:void 0,video:void 0,text:l,id3:h,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},O=this.initData;if((!O||!O.length)&&(this.generateInitSegment(A),O=this.initData),!O||!O.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(O,A,i));var R=Object(P.getDuration)(A,O),g=i,b=R+g;Object(P.offsetStartDTS)(O,A,s),R>0?this.lastEndDTS=b:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var f=!!O.audio,d=!!O.video,C="";f&&(C+="audio"),d&&(C+="video");var E={data1:A,startPTS:g,startDTS:g,endPTS:b,endDTS:b,type:C,hasAudio:f,hasVideo:d,nb:1,dropped:0};return D.audio=E.type==="audio"?E:void 0,D.video=E.type!=="audio"?E:void 0,D.text=l,D.id3=h,D.initSegment=S,D},x}(),n=function(p,_,c){return Object(P.getStartDTS)(p,_)-c};function I(x,p){var _=x==null?void 0:x.codec;return _&&_.length>4?_:_==="hvc1"?"hvc1.1.c.L120.90":_==="av01"?"av01.0.04M.08":_==="avc1"||p===F.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=H},"./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(H){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,H),!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(H){H.MANIFEST="m",H.AUDIO="a",H.VIDEO="v",H.MUXED="av",H.INIT="i",H.CAPTION="c",H.TIMED_TEXT="tt",H.KEY="k",H.OTHER="o"})(P||(P={}));var F;(function(H){H.DASH="d",H.HLS="h",H.SMOOTH="s",H.OTHER="o"})(F||(F={}));var G;(function(H){H.VOD="v",H.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 H}),N.d(Y,"Level",function(){return n});function z(I,x){for(var p=0;p<x.length;p++){var _=x[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(I,_.key,_)}}function P(I,x,p){return x&&z(I.prototype,x),p&&z(I,p),I}var F;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(F||(F={}));function G(I,x){var p=I.canSkipUntil,_=I.canSkipDateRanges,c=I.endSN,a=x!==void 0?x-c:0;return p&&a<p?_?F.v2:F.Yes:F.No}var H=function(){function I(p,_,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=_,this.skip=c}var x=I.prototype;return x.addDirectives=function(_){var c=new self.URL(_);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(x){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=[x.url],this.attrs=x.attrs,this.bitrate=x.bitrate,x.details&&(this.details=x.details),this.id=x.id||0,this.name=x.name,this.width=x.width||0,this.height=x.height||0,this.audioCodec=x.audioCodec,this.videoCodec=x.videoCodec,this.unknownCodecs=x.unknownCodecs,this.codecSet=[x.videoCodec,x.audioCodec].filter(function(p){return p}).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(p){var _=p%this.url.length;this._urlId!==_&&(this.details=void 0,this._urlId=_)}}]),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,H,n,I,x,p){I===void 0&&(I=0),x===void 0&&(x=-1),p===void 0&&(p=!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=H,this.id=n,this.size=I,this.part=x,this.partial=p};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 H=G.prototype;return H.decimalInteger=function(I){var x=parseInt(this[I],10);return x>Number.MAX_SAFE_INTEGER?Infinity:x},H.hexadecimalInteger=function(I){if(this[I]){var x=(this[I]||"0x").slice(2);x=(x.length&1?"0":"")+x;for(var p=new Uint8Array(x.length/2),_=0;_<x.length/2;_++)p[_]=parseInt(x.slice(_*2,_*2+2),16);return p}else return null},H.hexadecimalIntegerAsNumber=function(I){var x=parseInt(this[I],16);return x>Number.MAX_SAFE_INTEGER?Infinity:x},H.decimalFloatingPoint=function(I){return parseFloat(this[I])},H.optionalFloat=function(I,x){var p=this[I];return p?parseFloat(p):x},H.enumeratedString=function(I){return this[I]},H.bool=function(I){return this[I]==="YES"},H.decimalResolution=function(I){var x=z.exec(this[I]);return x===null?void 0:{width:parseInt(x[1],10),height:parseInt(x[2],10)}},G.parseAttrList=function(I){var x,p={},_='"';for(P.lastIndex=0;(x=P.exec(I))!==null;){var c=x[2];c.indexOf(_)===0&&c.lastIndexOf(_)===c.length-1&&(c=c.slice(1,-1)),p[x[1]]=c}return p},G}()},"./src/utils/binary-search.ts":function(te,Y,N){"use strict";N.r(Y);var z={search:function(F,G){for(var H=0,n=F.length-1,I=null,x=null;H<=n;){I=(H+n)/2|0,x=F[I];var p=G(x);if(p>0)H=I+1;else if(p<0)n=I-1;else return x}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 x=G.getBuffered(n),p=0;p<x.length;p++)if(I>=x.start(p)&&I<=x.end(p))return!0}}catch(_){}return!1},G.bufferInfo=function(n,I,x){try{if(n){var p=G.getBuffered(n),_=[],c;for(c=0;c<p.length;c++)_.push({start:p.start(c),end:p.end(c)});return this.bufferedInfo(_,I,x)}}catch(a){}return{len:0,start:I,end:I,nextStart:void 0}},G.bufferedInfo=function(n,I,x){I=Math.max(0,I),n.sort(function(S,O){var R=S.start-O.start;return R||O.end-S.end});var p=[];if(x)for(var _=0;_<n.length;_++){var c=p.length;if(c){var a=p[c-1].end;n[_].start-a<x?n[_].end>a&&(p[c-1].end=n[_].end):p.push(n[_])}else p.push(n[_])}else p=n;for(var h=0,l,u=I,s=I,i=0;i<p.length;i++){var D=p[i].start,A=p[i].end;if(I+x>=D&&I<A)u=D,s=A,h=s-I;else if(I+x<D){l=D;break}}return{len:h,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(b){var f=b;return P.hasOwnProperty(b)&&(f=P[b]),String.fromCharCode(f)},G=15,H=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},x={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},_=["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 b=g.prototype;return b.log=function(d,C){this.verboseLevel>=d&&z.logger.log(this.time+" ["+d+"] "+C)},g}(),h=function(b){for(var f=[],d=0;d<b.length;d++)f.push(b[d].toString(16));return f},l=function(){function g(f,d,C,E,w){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=f||"white",this.underline=d||!1,this.italics=C||!1,this.background=E||"black",this.flash=w||!1}var b=g.prototype;return b.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},b.setStyles=function(d){for(var C=["foreground","underline","italics","background","flash"],E=0;E<C.length;E++){var w=C[E];d.hasOwnProperty(w)&&(this[w]=d[w])}},b.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},b.equals=function(d){return this.foreground===d.foreground&&this.underline===d.underline&&this.italics===d.italics&&this.background===d.background&&this.flash===d.flash},b.copy=function(d){this.foreground=d.foreground,this.underline=d.underline,this.italics=d.italics,this.background=d.background,this.flash=d.flash},b.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},g}(),u=function(){function g(f,d,C,E,w,j){this.uchar=void 0,this.penState=void 0,this.uchar=f||" ",this.penState=new l(d,C,E,w,j)}var b=g.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(d,C){this.uchar=d,this.penState.copy(C)},b.setPenState=function(d){this.penState.copy(d)},b.equals=function(d){return this.uchar===d.uchar&&this.penState.equals(d.penState)},b.copy=function(d){this.uchar=d.uchar,this.penState.copy(d.penState)},b.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},g}(),s=function(){function g(f){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<H;d++)this.chars.push(new u);this.logger=f,this.pos=0,this.currPenState=new l}var b=g.prototype;return b.equals=function(d){for(var C=!0,E=0;E<H;E++)if(!this.chars[E].equals(d.chars[E])){C=!1;break}return C},b.copy=function(d){for(var C=0;C<H;C++)this.chars[C].copy(d.chars[C])},b.isEmpty=function(){for(var d=!0,C=0;C<H;C++)if(!this.chars[C].isEmpty()){d=!1;break}return d},b.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>H&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=H)},b.moveCursor=function(d){var C=this.pos+d;if(d>1)for(var E=this.pos+1;E<C+1;E++)this.chars[E].setPenState(this.currPenState);this.setCursor(C)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(d){d>=144&&this.backSpace();var C=F(d);if(this.pos>=H){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)},b.clearFromPos=function(d){var C;for(C=d;C<H;C++)this.chars[C].reset()},b.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},b.clearToEndOfRow=function(){this.clearFromPos(this.pos)},b.getTextString=function(){for(var d=[],C=!0,E=0;E<H;E++){var w=this.chars[E].uchar;w!==" "&&(C=!1),d.push(w)}return C?"":d.join("")},b.setPenStyles=function(d){this.currPenState.setStyles(d);var C=this.chars[this.pos];C.setPenState(this.currPenState)},g}(),i=function(){function g(f){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(f));this.logger=f,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=g.prototype;return b.reset=function(){for(var d=0;d<G;d++)this.rows[d].clear();this.currRow=G-1},b.equals=function(d){for(var C=!0,E=0;E<G;E++)if(!this.rows[E].equals(d.rows[E])){C=!1;break}return C},b.copy=function(d){for(var C=0;C<G;C++)this.rows[C].copy(d.rows[C])},b.isEmpty=function(){for(var d=!0,C=0;C<G;C++)if(!this.rows[C].isEmpty()){d=!1;break}return d},b.backSpace=function(){var d=this.rows[this.currRow];d.backSpace()},b.clearToEndOfRow=function(){var d=this.rows[this.currRow];d.clearToEndOfRow()},b.insertChar=function(d){var C=this.rows[this.currRow];C.insertChar(d)},b.setPen=function(d){var C=this.rows[this.currRow];C.setPenStyles(d)},b.moveCursor=function(d){var C=this.rows[this.currRow];C.moveCursor(d)},b.setCursor=function(d){this.logger.log(c.INFO,"setCursor: "+d);var C=this.rows[this.currRow];C.setCursor(d)},b.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 E=0;E<G;E++)this.rows[E].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,K=Math.max(v-1,0);m.setCursor(d.indent),d.color=m.chars[K].penState.foreground}var X={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen(X)},b.setBkgData=function(d){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(d)),this.backSpace(),this.setPen(d),this.insertChar(32)},b.setRollUpRows=function(d){this.nrRollUpRows=d},b.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")},b.getDisplayText=function(d){d=d||!1;for(var C=[],E="",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?E="["+C.join(" | ")+"]":E=C.join(`
|
|
`)),E},b.getTextAndFormat=function(){return this.rows},g}(),D=function(){function g(f,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=f,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 b=g.prototype;return b.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},b.getHandler=function(){return this.outputFilter},b.setHandler=function(d){this.outputFilter=d},b.setPAC=function(d){this.writeScreen.setPAC(d)},b.setBkgData=function(d){this.writeScreen.setBkgData(d)},b.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},b.insertChars=function(d){for(var C=0;C<d.length;C++)this.writeScreen.insertChar(d[C]);var E=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,E+": "+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())},b.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},b.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},b.ccAOF=function(){},b.ccAON=function(){},b.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},b.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)},b.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},b.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},b.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},b.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},b.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},b.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},b.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},b.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)},b.ccTO=function(d){this.logger.log(c.INFO,"TO("+d+") - Tab Offset"),this.writeScreen.moveCursor(d)},b.ccMIDROW=function(d){var C={flash:!1};if(C.underline=d%2===1,C.italics=d>=46,C.italics)C.foreground="white";else{var E=Math.floor(d/2)-16,w=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=w[E]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},b.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))},b.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(f,d,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new a;this.channels=[null,new D(f,d,E),new D(f+1,C,E)],this.cmdHistory=R(),this.logger=E}var b=g.prototype;return b.getHandler=function(d){return this.channels[d].getHandler()},b.setHandler=function(d,C){this.channels[d].setHandler(C)},b.addData=function(d,C){var E,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,"["+h([C[T],C[T+1]])+"] -> ("+h([w,j])+")"),E=this.parseCmd(w,j),E||(E=this.parseMidrow(w,j)),E||(E=this.parsePAC(w,j)),E||(E=this.parseBackgroundAttributes(w,j)),!E&&(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?")}!E&&!W&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+h([w,j])+" orig: "+h([C[T],C[T+1]]))}},b.parseCmd=function(d,C){var E=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(O(d,C,E))return S(null,null,E),this.logger.log(c.DEBUG,"Repeated command ("+h([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,E),this.currentChannel=W,!0},b.parseMidrow=function(d,C){var E=0;if((d===17||d===25)&&C>=32&&C<=47){if(d===17?E=1:E=2,E!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var w=this.channels[E];return w?(w.ccMIDROW(C),this.logger.log(c.DEBUG,"MIDROW ("+h([d,C])+")"),!0):!1}return!1},b.parsePAC=function(d,C){var E,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(O(d,C,w))return S(null,null,w),!0;var T=d<=23?1:2;C>=64&&C<=95?E=T===1?n[d]:x[d]:E=T===1?I[d]:p[d];var M=this.channels[T];return M?(M.setPAC(this.interpretPAC(E,C)),S(d,C,w),this.currentChannel=T,!0):!1},b.interpretPAC=function(d,C){var E,w={color:null,italics:!1,indent:null,underline:!1,row:d};return C>95?E=C-96:E=C-64,w.underline=(E&1)===1,E<=13?w.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(E/2)]:E<=15?(w.italics=!0,w.color="white"):w.indent=Math.floor((E-16)/2)*4,w},b.parseChars=function(d,C){var E,w=null,j=null;if(d>=25?(E=2,j=d-8):(E=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 "+E),w=[W]}else d>=32&&d<=127&&(w=C===0?[d]:[d,C]);if(w){var T=h(w);this.logger.log(c.DEBUG,"Char codes = "+T.join(",")),S(d,C,this.cmdHistory)}return w},b.parseBackgroundAttributes=function(d,C){var E=(d===16||d===24)&&C>=32&&C<=47,w=(d===23||d===31)&&C>=45&&C<=47;if(!(E||w))return!1;var j,W={};d===16||d===24?(j=Math.floor((C-32)/2),W.background=_[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},b.reset=function(){for(var d=0;d<Object.keys(this.channels).length;d++){var C=this.channels[d];C&&C.reset()}this.cmdHistory=R()},b.cueSplitAtTime=function(d){for(var C=0;C<this.channels.length;C++){var E=this.channels[C];E&&E.cueSplitAtTime(d)}},g}();function S(g,b,f){f.a=g,f.b=b}function O(g,b,f){return f.a===g&&f.b===b}function R(){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,H){var n=z[H];return!!n&&n[G.slice(0,4)]===!0}function F(G,H){return MediaSource.isTypeSupported((H||"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/,H={newCue:function(I,x,p,_){for(var c=[],a,h,l,u,s,i=self.VTTCue||self.TextTrackCue,D=0;D<_.rows.length;D++)if(a=_.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=x,x===p&&(p+=1e-4),u>=16?u--:u++;var S=Object(z.fixLineBreaks)(s.trim()),O=Object(P.generateCueId)(x,p,S);(!I||!I.cues||!I.cues.getCueById(O))&&(h=new i(x,p,S),h.id=O,h.line=D+1,h.align="left",h.position=10+Math.min(80,Math.floor(u*8/32)*10),c.push(h))}return I&&c.length&&(c.sort(function(R,g){return R.line==="auto"||g.line==="auto"?0:R.line>8&&g.line>8?g.line-R.line:R.line-g.line}),c.forEach(function(R){return Object(F.addCueToTrack)(I,R)})),c}};Y.default=H},"./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 H}),N.d(Y,"findDiscontinuousReferenceFrag",function(){return n}),N.d(Y,"adjustSlidingStart",function(){return x}),N.d(Y,"alignStream",function(){return p}),N.d(Y,"alignPDT",function(){return c}),N.d(Y,"alignFragmentByPDTDelta",function(){return a}),N.d(Y,"alignMediaPlaylistByPDT",function(){return h});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 H(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 x(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 p(l,u,s){if(!u)return;_(l,s,u),!s.alignedSliding&&u.details&&c(s,u.details),!s.alignedSliding&&u.details&&!s.skippedSegments&&Object(F.adjustSliding)(u.details,s)}function _(l,u,s){if(H(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),x(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+" "),x(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 h(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(H,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(H),this.fast_=new z.default(n)}var G=F.prototype;return G.update=function(n,I){var x=this.slow_,p=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new z.default(n,x.getEstimate(),x.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new z.default(I,p.getEstimate(),p.getTotalWeight()))},G.sample=function(n,I){n=Math.max(n,this.minDelayMs_);var x=8*I,p=n/1e3,_=x/p;this.fast_.sample(p,_),this.slow_.sample(p,_)},G.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},F}();Y.default=P},"./src/utils/ewma.ts":function(te,Y,N){"use strict";N.r(Y);var z=function(){function P(G,H,n){H===void 0&&(H=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_=H,this.totalWeight_=n}var F=P.prototype;return F.sample=function(H,n){var I=Math.pow(this.alpha_,H);this.estimate_=n*(1-I)+I*this.estimate_,this.totalWeight_+=H},F.getTotalWeight=function(){return this.totalWeight_},F.getEstimate=function(){if(this.alpha_){var H=1-Math.pow(this.alpha_,this.totalWeight_);if(H)return this.estimate_/H}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,p(i,D)}function H(i){var D=typeof Map=="function"?new Map:void 0;return H=function(S){if(S===null||!x(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,O)}function O(){return n(S,arguments,_(this).constructor)}return O.prototype=Object.create(S.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),p(O,S)},H(i)}function n(i,D,A){return I()?n=Reflect.construct:n=function(O,R,g){var b=[null];b.push.apply(b,R);var f=Function.bind.apply(O,b),d=new f;return g&&p(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 x(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function p(i,D){return p=Object.setPrototypeOf||function(S,O){return S.__proto__=O,S},p(i,D)}function _(i){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},_(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 h=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,O,R){var g=this,b=this.stats;if(b.loading.start)throw new Error("Loader can only be used once.");b.loading.start=self.performance.now();var f=l(S,this.controller.signal),d=R.onProgress,C=S.responseType==="arraybuffer",E=C?"byteLength":"length";this.context=S,this.config=O,this.callbacks=R,this.request=this.fetchSetup(S,f),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){g.abortInternal(),R.onTimeout(b,S,g.response)},O.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 b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(w.headers.get("Content-Length")||"0"),d&&Object(z.isFiniteNumber)(O.highWaterMark)?g.loadProgressively(w,b,S,O.highWaterMark,d):C?w.arrayBuffer():w.text()}).then(function(w){var j=g.response;self.clearTimeout(g.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=w[E];var W={url:j.url,data:w};d&&!Object(z.isFiniteNumber)(O.highWaterMark)&&d(b,S,w,j),R.onSuccess(W,b,S,j)}).catch(function(w){if(self.clearTimeout(g.requestTimeout),b.aborted)return;var j=w.code||0;R.onError({code:j,text:w.message},S,w.details)})},D.getCacheAge=function(){var S=null;if(this.response){var O=this.response.headers.get("age");S=O?parseFloat(O):null}return S},D.loadProgressively=function(S,O,R,g,b){g===void 0&&(g=0);var f=new F.default,d=S.body.getReader(),C=function E(){return d.read().then(function(w){if(w.done)return f.dataLength&&b(O,R,f.flush(),S),Promise.resolve(new ArrayBuffer(0));var j=w.value,W=j.length;return O.loaded+=W,W<g||f.dataLength?(f.push(j),f.dataLength>=g&&b(O,R,f.flush(),S)):b(O,R,j,S),E()}).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,O){var R;return R=i.call(this,A)||this,R.code=void 0,R.details=void 0,R.code=S,R.details=O,R}return D}(H(Error));Y.default=h},"./src/utils/imsc1-ttml-parser.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"IMSC1_CODEC",function(){return x}),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"),H=N("./src/utils/timescale-conversion.ts"),n=N("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(g){for(var b=1;b<arguments.length;b++){var f=arguments[b];for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(g[d]=f[d])}return g},I.apply(this,arguments)}var x="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,_=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(g,b,f,d,C){var E=Object(z.findBox)(new Uint8Array(g),["mdat"]);if(E.length===0){C(new Error("Could not parse IMSC1 mdat"));return}var w=E[0],j=Object(G.utf8ArrayToStr)(new Uint8Array(g,w.start,w.end-w.start)),W=Object(H.toTimescaleFromScale)(b,1,f);try{d(h(j,W))}catch(T){C(T)}}function h(g,b){var f=new DOMParser,d=f.parseFromString(g,"text/xml"),C=d.getElementsByTagName("tt")[0];if(!C)throw new Error("Invalid ttml");var E={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},w=Object.keys(E).reduce(function(m,v){return m[v]=C.getAttribute("ttp:"+v)||E[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 K=S(m.getAttribute("begin"),w),X=S(m.getAttribute("dur"),w),q=S(m.getAttribute("end"),w);if(K===null)throw A(m);if(q===null){if(X===null)throw A(m);q=K+X}var re=new F.default(K-b,q-b,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 Ee=c[fe];Ee&&(re.lineAlign=Ee),re.align=fe}return I(re,ue),re}).filter(function(m){return m!==null})}function l(g,b,f){var d=g.getElementsByTagName(b)[0];return d?[].slice.call(d.querySelectorAll(f)):[]}function u(g){return g.reduce(function(b,f){var d=f.getAttribute("xml:id");return d&&(b[d]=f),b},{})}function s(g,b){return[].slice.call(g.childNodes).reduce(function(f,d,C){var E;return d.nodeName==="br"&&C?f+`
|
|
`:(E=d.childNodes)!==null&&E!==void 0&&E.length?s(d,b):b?f+d.textContent.trim().replace(/\s+/g," "):f+d.textContent},"")}function i(g,b){var f="http://www.w3.org/ns/ttml#styling",d=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return d.reduce(function(C,E){var w=D(b,f,E)||D(g,f,E);return w&&(C[E]=w),C},{})}function D(g,b,f){return g.hasAttributeNS(b,f)?g.getAttributeNS(b,f):null}function A(g){return new Error("Could not parse ttml timestamp "+g)}function S(g,b){if(!g)return null;var f=Object(P.parseTimeStamp)(g);return f===null&&(p.test(g)?f=O(g,b):_.test(g)&&(f=R(g,b))),f}function O(g,b){var f=p.exec(g),d=(f[4]|0)+(f[5]|0)/b.subFrameRate;return(f[1]|0)*3600+(f[2]|0)*60+(f[3]|0)+d/b.frameRate}function R(g,b){var f=_.exec(g),d=Number(f[1]),C=f[2];switch(C){case"h":return d*3600;case"m":return d*60;case"ms":return d*1e3;case"f":return d/b.frameRate;case"t":return d/b.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(x){var p=self.console[x];return p?p.bind(self.console,"["+x+"] >"):z}function H(x){for(var p=arguments.length,_=new Array(p>1?p-1:0),c=1;c<p;c++)_[c-1]=arguments[c];_.forEach(function(a){F[a]=x[a]?x[a].bind(x):G(a)})}function n(x){if(self.console&&x===!0||typeof x=="object"){H(x,"debug","log","info","warn","error");try{F.log()}catch(p){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 H}),N.d(Y,"readUint16",function(){return n}),N.d(Y,"readUint32",function(){return I}),N.d(Y,"writeUint32",function(){return x}),N.d(Y,"findBox",function(){return p}),N.d(Y,"parseSegmentIndex",function(){return _}),N.d(Y,"parseInitSegment",function(){return c}),N.d(Y,"getStartDTS",function(){return a}),N.d(Y,"getDuration",function(){return h}),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 H(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 x(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 p(D,A){var S=[];if(!A.length)return S;var O,R,g;"data"in D?(O=D.data,R=D.start,g=D.end):(O=D,R=0,g=O.byteLength);for(var b=R;b<g;){var f=I(O,b),d=H(O.subarray(b+4,b+8)),C=f>1?b+f:g;if(d===A[0])if(A.length===1)S.push({data:O,start:b+8,end:C});else{var E=p({data:O,start:b+8,end:C},A.slice(1));E.length&&G.apply(S,E)}b=C}return S}function _(D){var A=p(D,["moov"]),S=A[0],O=S?S.end:null,R=p(D,["sidx"]);if(!R||!R[0])return null;var g=[],b=R[0],f=b.data[0],d=f===0?8:16,C=I(b,d);d+=4;var E=0,w=0;f===0?d+=8:d+=16,d+=2;var j=b.end+w,W=n(b,d);d+=2;for(var T=0;T<W;T++){var M=d,m=I(b,M);M+=4;var v=m&2147483647,K=(m&2147483648)>>>31;if(K===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var X=I(b,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:E,timescale:C,version:f,referencesCount:W,references:g,moovEndOffset:O}}function c(D){for(var A=[],S=p(D,["moov","trak"]),O=0;O<S.length;O++){var R=S[O],g=p(R,["tkhd"])[0];if(g){var b=g.data[g.start],f=b===0?12:20,d=I(g,f),C=p(R,["mdia","mdhd"])[0];if(C){b=C.data[C.start],f=b===0?12:20;var E=I(C,f),w=p(R,["mdia","hdlr"])[0];if(w){var j=H(w.data.subarray(w.start+8,w.start+12)),W={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[j];if(W){var T=p(R,["mdia","minf","stbl","stsd"])[0],M=void 0;T&&(M=H(T.data.subarray(T.start+12,T.start+16))),A[d]={timescale:E,type:W},A[W]={timescale:E,id:d,codec:M}}}}}}var m=p(D,["moov","mvex","trex"]);return m.forEach(function(v){var K=I(v,4),X=A[K];X&&(X.default={duration:I(v,12),flags:I(v,20)})}),A}function a(D,A){return p(A,["moof","traf"]).reduce(function(S,O){var R=p(O,["tfdt"])[0],g=R.data[R.start],b=p(O,["tfhd"]).reduce(function(f,d){var C=I(d,4),E=D[C];if(E){var w=I(R,4);g===1&&(w*=Math.pow(2,32),w+=I(R,8));var j=E.timescale||9e4,W=w/j;if(isFinite(W)&&(f===null||W<f))return W}return f},null);return b!==null&&isFinite(b)&&(S===null||b<S)?b:S},null)||0}function h(D,A){for(var S=0,O=0,R=0,g=p(D,["moof","traf"]),b=0;b<g.length;b++){var f=g[b],d=p(f,["tfhd"])[0],C=I(d,4),E=A[C];if(!E)continue;var w=E.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=E.timescale||9e4,M=p(f,["trun"]),m=0;m<M.length;m++){if(W){var v=I(M[m],4);S=W*v}else S=l(M[m]);E.type===P.ElementaryStreamTypes.VIDEO?O+=S/T:E.type===P.ElementaryStreamTypes.AUDIO&&(R+=S/T)}}if(O===0&&R===0){var K=_(D);if(K!=null&&K.references)return K.references.reduce(function(X,q){return X+q.info.duration||0},0)}return O||R}function l(D){var A=I(D,0),S=8;A&1&&(S+=4),A&4&&(S+=4);for(var O=0,R=I(D,4),g=0;g<R;g++){if(A&256){var b=I(D,S);O+=b,S+=4}A&512&&(S+=4),A&1024&&(S+=4),A&2048&&(S+=4)}return O}function u(D,A,S){p(A,["moof","traf"]).forEach(function(O){p(O,["tfhd"]).forEach(function(R){var g=I(R,4),b=D[g];if(!b)return;var f=b.timescale||9e4;p(O,["tfdt"]).forEach(function(d){var C=d.data[d.start],E=I(d,4);if(C===0)x(d,4,E-S*f);else{E*=Math.pow(2,32),E+=I(d,8),E-=S*f,E=Math.max(E,0);var w=Math.floor(E/(F+1)),j=Math.floor(E%(F+1));x(d,4,w),x(d,8,j)}})})})}function s(D){var A={valid:null,remainder:null},S=p(D,["moof"]);if(S){if(S.length<2)return A.remainder=D,A}else return A;var O=S[S.length-1];return A.valid=Object(z.sliceUint8)(D,0,O.start-8),A.remainder=Object(z.sliceUint8)(D,O.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,H){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=H}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(H,n,I){(this.startTime===null||this.startTime>H)&&(this.startTime=H),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 H}),N.d(Y,"getCuesInRange",function(){return I});var z=N("./src/utils/logger.ts");function P(x,p){var _;try{_=new Event("addtrack")}catch(c){_=document.createEvent("Event"),_.initEvent("addtrack",!1,!1)}_.track=x,p.dispatchEvent(_)}function F(x,p){var _=x.mode;if(_==="disabled"&&(x.mode="hidden"),x.cues&&!x.cues.getCueById(p.id))try{if(x.addCue(p),!x.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(a){z.logger.debug("[texttrack-utils]: "+a);var c=new self.TextTrackCue(p.startTime,p.endTime,p.text);c.id=p.id,x.addCue(c)}_==="disabled"&&(x.mode=_)}function G(x){var p=x.mode;if(p==="disabled"&&(x.mode="hidden"),x.cues)for(var _=x.cues.length;_--;)x.removeCue(x.cues[_]);p==="disabled"&&(x.mode=p)}function H(x,p,_){var c=x.mode;if(c==="disabled"&&(x.mode="hidden"),x.cues&&x.cues.length>0)for(var a=I(x.cues,p,_),h=0;h<a.length;h++)x.removeCue(a[h]);c==="disabled"&&(x.mode=c)}function n(x,p){if(p<x[0].startTime)return 0;var _=x.length-1;if(p>x[_].endTime)return-1;for(var c=0,a=_;c<=a;){var h=Math.floor((a+c)/2);if(p<x[h].startTime)a=h-1;else if(p>x[h].startTime&&c<_)c=h+1;else return h}return x[c].startTime-p<p-x[a].startTime?c:a}function I(x,p,_){var c=[],a=n(x,p);if(a>-1)for(var h=a,l=x.length;h<l;h++){var u=x[h];if(u.startTime>=p&&u.endTime<=_)c.push(u);else if(u.startTime>_)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="",H=F.length,n=0;n<H;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 H});var z=9e4;function P(n,I,x,p){x===void 0&&(x=1),p===void 0&&(p=!1);var _=n*I*x;return p?Math.round(_):_}function F(n,I,x,p){return x===void 0&&(x=1),p===void 0&&(p=!1),P(n,I,1/x,p)}function G(n,I){return I===void 0&&(I=!1),P(n,1e3,1/z,I)}function H(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(x,p){if(typeof p!="string")return!1;if(!Array.isArray(x))return!1;var _=p.toLowerCase();return~x.indexOf(_)?_:!1}function G(x){return F(z,x)}function H(x){return F(P,x)}function n(x){for(var p=arguments.length,_=new Array(p>1?p-1:0),c=1;c<p;c++)_[c-1]=arguments[c];for(var a=1;a<arguments.length;a++){var h=arguments[a];for(var l in h)x[l]=h[l]}return x}function I(x,p,_){var c=this,a={enumerable:!0};c.hasBeenReset=!1;var h="",l=!1,u=x,s=p,i=_,D=null,A="",S=!0,O="auto",R="start",g=50,b="middle",f=50,d="middle";Object.defineProperty(c,"id",n({},a,{get:function(){return h},set:function(E){h=""+E}})),Object.defineProperty(c,"pauseOnExit",n({},a,{get:function(){return l},set:function(E){l=!!E}})),Object.defineProperty(c,"startTime",n({},a,{get:function(){return u},set:function(E){if(typeof E!="number")throw new TypeError("Start time must be set to a number.");u=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},a,{get:function(){return s},set:function(E){if(typeof E!="number")throw new TypeError("End time must be set to a number.");s=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},a,{get:function(){return i},set:function(E){i=""+E,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},a,{get:function(){return D},set:function(E){D=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},a,{get:function(){return A},set:function(E){var w=G(E);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(E){S=!!E,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},a,{get:function(){return O},set:function(E){if(typeof E!="number"&&E!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");O=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},a,{get:function(){return R},set:function(E){var w=H(E);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");R=w,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},a,{get:function(){return g},set:function(E){if(E<0||E>100)throw new Error("Position must be between 0 and 100.");g=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",n({},a,{get:function(){return b},set:function(E){var w=H(E);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");b=w,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},a,{get:function(){return f},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");f=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},a,{get:function(){return d},set:function(E){var w=H(E);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 x=self.WebVTT;return x.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 p}),N.d(Y,"VTTParser",function(){return _});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 h=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return h?parseFloat(h[2])>59?a(h[2],h[3],0,h[4]):a(h[1],h[2],h[3],h[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 H(c,a,h,l){var u=l?c.split(l):[c];for(var s in u){if(typeof u[s]!="string")continue;var i=u[s].split(h);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 x(c,a,h){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;H(D,function(g,b){var f;switch(g){case"region":for(var d=h.length-1;d>=0;d--)if(h[d].id===b){S.set(g,h[d].region);break}break;case"vertical":S.alt(g,b,["rl","lr"]);break;case"line":f=b.split(","),S.integer(g,f[0]),S.percent(g,f[0])&&S.set("snapToLines",!1),S.alt(g,f[0],["auto"]),f.length===2&&S.alt("lineAlign",f[1],["start",I,"end"]);break;case"position":f=b.split(","),S.percent(g,f[0]),f.length===2&&S.alt("positionAlign",f[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":S.percent(g,b);break;case"align":S.alt(g,b,["start",I,"end","left","right"]);break}},/:/,/\s/),A.region=S.get("region",null),A.vertical=S.get("vertical","");var O=S.get("line","auto");O==="auto"&&n.line===-1&&(O=-1),A.line=O,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 R=S.get("position","auto");R==="auto"&&n.position===50&&(R=A.align==="start"||A.align==="left"?0:A.align==="end"||A.align==="right"?100:50),A.position=R}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 p(c){return c.replace(/<br(?: \/)?>/gi,`
|
|
`)}var _=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 R=u.buffer,g=0;for(R=p(R);g<R.length&&R[g]!=="\r"&&R[g]!==`
|
|
`;)++g;var b=R.substr(0,g);return R[g]==="\r"&&++g,R[g]===`
|
|
`&&++g,u.buffer=R.substr(g),b}function i(R){H(R,function(g,b){},/:/)}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{x(D,u.cue,u.regionList)}catch(R){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var O=D.indexOf("-->")!==-1;if(!D||O&&(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(R){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 _}),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"),H=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},x=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},p=function(l){for(var u=5381,s=l.length;s;)u=u*33^l.charCodeAt(--s);return(u>>>0).toString()};function _(h,l,u){return p(h.toString())+p(l.toString())+p(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(h,l,u,s,i,D,A,S){var O=new P.VTTParser,R=Object(F.utf8ArrayToStr)(new Uint8Array(h)).trim().replace(n,`
|
|
`).split(`
|
|
`),g=[],b=Object(G.toMpegTsClockFromTimescale)(l,u),f="00:00.000",d=0,C=0,E,w=!0,j=!1;O.oncue=function(W){var T=s[i],M=s.ccOffset,m=(d-b)/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,K=Object(H.normalizePts)((W.startTime+M-C)*9e4,D*9e4)/9e4;W.startTime=K,W.endTime=K+v}var X=W.text.trim();W.text=decodeURIComponent(encodeURIComponent(X)),W.id||(W.id=_(W.startTime,W.endTime,X)),W.endTime>0&&g.push(W)},O.onparsingerror=function(W){E=W},O.onflush=function(){if(E){S(E);return}A(g)},R.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:")?f=T.substr(6):I(T,"MPEGTS:")&&(d=parseInt(T.substr(7)))});try{C=x(f)/1e3}catch(T){j=!1,E=T}return}else W===""&&(w=!1);O.parse(W+`
|
|
`)}),O.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 H(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=H.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var x=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),x&&(x.onreadystatechange=null,x.onprogress=null,x.readyState!==4&&(this.stats.aborted=!0,x.abort()))},n.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(x,p,_){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=x,this.config=p,this.callbacks=_,this.retryDelay=p.retryDelay,this.loadInternal()},n.loadInternal=function(){var x=this.config,p=this.context;if(!x)return;var _=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var a=this.xhrSetup;try{if(a)try{a(_,p.url)}catch(u){_.open("GET",p.url,!0),a(_,p.url)}_.readyState||_.open("GET",p.url,!0);var h=this.context.headers;if(h)for(var l in h)_.setRequestHeader(l,h[l])}catch(u){this.callbacks.onError({code:_.status,text:u.message},p,_);return}p.rangeEnd&&_.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),_.onreadystatechange=this.readystatechange.bind(this),_.onprogress=this.loadprogress.bind(this),_.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),x.timeout),_.send()},n.readystatechange=function(){var x=this.context,p=this.loader,_=this.stats;if(!x||!p)return;var c=p.readyState,a=this.config;if(_.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),_.loading.first===0&&(_.loading.first=Math.max(self.performance.now(),_.loading.start)),c===4){p.onreadystatechange=null,p.onprogress=null;var h=p.status;if(h>=200&&h<300){_.loading.end=Math.max(self.performance.now(),_.loading.first);var l,u;if(x.responseType==="arraybuffer"?(l=p.response,u=l.byteLength):(l=p.responseText,u=l.length),_.loaded=_.total=u,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(_,x,l,p),!this.callbacks)return;var i={url:p.responseURL,data:l};this.callbacks.onSuccess(i,_,x,p)}else _.retry>=a.maxRetry||h>=400&&h<499?(z.logger.error(h+" while loading "+x.url),this.callbacks.onError({code:h,text:p.statusText},x,p)):(z.logger.warn(h+" while loading "+x.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),_.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 x=this.callbacks;x&&(this.abortInternal(),x.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(x){var p=this.stats;p.loaded=x.loaded,x.lengthComputable&&(p.total=x.total)},n.getCacheAge=function(){var x=null;if(this.loader&&F.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");x=p?parseFloat(p):null}return x},H}();Y.default=G}}).default})},vHTk:function(ut,ge,U){ut.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vkP9:function(ut,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"),H=U("q1tI"),n=U.n(H),I=U("a+yL"),x=U.n(I),p=function(c){var a=c.value,h=c.onChange,l=F.a.useForm(),u=Object(G.a)(l,1),s=u[0];Object(H.useEffect)(function(){a&&s.setFieldsValue(a)},a);var i=function(A){h(A)};return n.a.createElement("div",{className:x.a.search},n.a.createElement(F.a,{className:x.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:x.a.btn,type:"primary",htmlType:"submit"},"\u641C\u7D22")))};ge.a=p},wNkr:function(ut,ge){ut.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(ut,ge){ut.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(ut,ge,U){ut.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(ut,ge,U){ut.exports=U.p+"static/AssistantCode3.fdd8db3c.jpeg"}}]);
|