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.
443 lines
1.5 MiB
443 lines
1.5 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[107,3,4,7,8,15],{"+92d":function(Lt,ve,k){Lt.exports=k.p+"static/b1.8d46544a.svg"},"+NIl":function(Lt,ve,k){(function(ne){ne(k("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function(V,I){"use strict";function z(c,a){c.cmdState.push(a)}function L(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function D(c){var a=c.cmdState.pop();a&&a.closeBracket()}function K(c){for(var a=c.cmdState,s=a.length-1;s>=0;s--){var d=a[s];if(d.name=="DEFAULT")continue;return d}return{styleIdentifier:function(){return null}}}function M(c,a,s){return function(){this.name=c,this.bracketNo=0,this.style=a,this.styles=s,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=M("importmodule","tag",["string","builtin"]),r.documentclass=M("documentclass","tag",["","atom"]),r.usepackage=M("usepackage","tag",["atom"]),r.begin=M("begin","tag",["atom"]),r.end=M("end","tag",["atom"]),r.label=M("label","tag",["atom"]),r.ref=M("ref","tag",["atom"]),r.eqref=M("eqref","tag",["atom"]),r.cite=M("cite","tag",["atom"]),r.bibitem=M("bibitem","tag",["atom"]),r.Bibitem=M("Bibitem","tag",["atom"]),r.RBibitem=M("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function P(c,a){c.f=a}function x(c,a){var s;if(c.match(/^\\[a-zA-Z@]+/)){var d=c.current().slice(1);return s=r.hasOwnProperty(d)?r[d]:r.DEFAULT,s=new s,z(a,s),P(a,m),s.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return P(a,function(i,n){return p(i,n,"\\]")}),"keyword";if(c.match("\\("))return P(a,function(i,n){return p(i,n,"\\)")}),"keyword";if(c.match("$$"))return P(a,function(i,n){return p(i,n,"$$")}),"keyword";if(c.match("$"))return P(a,function(i,n){return p(i,n,"$")}),"keyword";var l=c.next();if(l=="%")return c.skipToEnd(),"comment";if(l=="}"||l=="]"){if(s=L(a),s)s.closeBracket(l),P(a,m);else return"error";return"bracket"}else return l=="{"||l=="["?(s=r.DEFAULT,s=new s,z(a,s),"bracket"):/\d/.test(l)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),s=K(a),s.name=="begin"&&(s.argument=c.current()),s.styleIdentifier())}function p(c,a,s){if(c.eatSpace())return null;if(s&&c.match(s))return P(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 d=c.next();return d=="{"||d=="}"||d=="["||d=="]"||d=="("||d==")"?"bracket":d=="%"?(c.skipToEnd(),"comment"):"error"}function m(c,a){var s=c.peek(),d;return s=="{"||s=="["?(d=L(a),d.openBracket(s),c.eat(s),P(a,x),"bracket"):/[ \t\r]/.test(s)?(c.eat(s),null):(P(a,x),D(a),x(c,a))}return{startState:function(){var c=I.inMathMode?function(a,s){return p(a,s)}: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:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"+ua5":function(Lt,ve,k){},"/cxE":function(Lt,ve,k){"use strict";k.d(ve,"f",function(){return I}),k.d(ve,"g",function(){return z}),k.d(ve,"h",function(){return L}),k.d(ve,"e",function(){return K}),k.d(ve,"b",function(){return M}),k.d(ve,"c",function(){return r}),k.d(ve,"d",function(){return P}),k.d(ve,"a",function(){return x});class ne{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
|
|
|
|
`+p.stack):p},0)}}emit(p){this.listeners.forEach(m=>{m(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const V=new ne;function I(p){K(p)||V.onUnexpectedError(p);return}function z(p){K(p)||V.onUnexpectedExternalError(p);return}function L(p){if(p instanceof Error){let{name:m,message:c}=p;const a=p.stacktrace||p.stack;return{$isError:!0,name:m,message:c,stack:a}}return p}const D="Canceled";function K(p){return p instanceof Error&&p.name===D&&p.message===D}function M(){const p=new Error(D);return p.name=p.message,p}function r(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function P(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(Lt,ve,k){(function(ne){ne(k("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(M,r,P){var x=P&&P!=ne.Init;if(r&&!x)M.on("blur",L),M.on("change",D),M.on("swapDoc",D),ne.on(M.getInputField(),"compositionupdate",M.state.placeholderCompose=function(){z(M)}),D(M);else if(!r&&x){M.off("blur",L),M.off("change",D),M.off("swapDoc",D),ne.off(M.getInputField(),"compositionupdate",M.state.placeholderCompose),V(M);var p=M.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}r&&!M.hasFocus()&&L(M)});function V(M){M.state.placeholder&&(M.state.placeholder.parentNode.removeChild(M.state.placeholder),M.state.placeholder=null)}function I(M){V(M);var r=M.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=M.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var P=M.getOption("placeholder");typeof P=="string"&&(P=document.createTextNode(P)),r.appendChild(P),M.display.lineSpace.insertBefore(r,M.display.lineSpace.firstChild)}function z(M){setTimeout(function(){var r=!1,P=M.getInputField();P.nodeName=="TEXTAREA"?r=!P.value:M.lineCount()==1&&(r=!/[^\u200b]/.test(P.querySelector(".CodeMirror-line").textContent)),r?I(M):V(M)},20)}function L(M){K(M)&&I(M)}function D(M){var r=M.getWrapperElement(),P=K(M);r.className=r.className.replace(" CodeMirror-empty","")+(P?" CodeMirror-empty":""),P?I(M):V(M)}function K(M){return M.lineCount()===1&&M.getLine(0)===""}})},"1eCo":function(Lt,ve,k){(function(ne){ne(k("VrN/"))})(function(ne){"use strict";var V={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},I={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ne.defineMode("xml",function(z,L){var D=z.indentUnit,K={},M=L.htmlMode?V:I;for(var r in M)K[r]=M[r];for(var r in L)K[r]=L[r];var P,x;function p(h,v){function g(H){return v.tokenize=H,H(h,v)}var b=h.next();if(b=="<")return h.eat("!")?h.eat("[")?h.match("CDATA[")?g(a("atom","]]>")):null:h.match("--")?g(a("comment","-->")):h.match("DOCTYPE",!0,!0)?(h.eatWhile(/[\w\._\-]/),g(s(1))):null:h.eat("?")?(h.eatWhile(/[\w\._\-]/),v.tokenize=a("meta","?>"),"meta"):(P=h.eat("/")?"closeTag":"openTag",v.tokenize=m,"tag bracket");if(b=="&"){var N;return h.eat("#")?h.eat("x")?N=h.eatWhile(/[a-fA-F\d]/)&&h.eat(";"):N=h.eatWhile(/[\d]/)&&h.eat(";"):N=h.eatWhile(/[\w\.\-:]/)&&h.eat(";"),N?"atom":"error"}else return h.eatWhile(/[^&<]/),null}p.isInText=!0;function m(h,v){var g=h.next();if(g==">"||g=="/"&&h.eat(">"))return v.tokenize=p,P=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return P="equals",null;if(g=="<"){v.tokenize=p,v.state=n,v.tagName=v.tagStart=null;var b=v.tokenize(h,v);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(g)?(v.tokenize=c(g),v.stringStartCol=h.column(),v.tokenize(h,v)):(h.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(h){var v=function(g,b){for(;!g.eol();)if(g.next()==h){b.tokenize=m;break}return"string"};return v.isInAttribute=!0,v}function a(h,v){return function(g,b){for(;!g.eol();){if(g.match(v)){b.tokenize=p;break}g.next()}return h}}function s(h){return function(v,g){for(var b;(b=v.next())!=null;){if(b=="<")return g.tokenize=s(h+1),g.tokenize(v,g);if(b==">")if(h==1){g.tokenize=p;break}else return g.tokenize=s(h-1),g.tokenize(v,g)}return"meta"}}function d(h,v,g){this.prev=h.context,this.tagName=v,this.indent=h.indented,this.startOfLine=g,(K.doNotIndent.hasOwnProperty(v)||h.context&&h.context.noIndent)&&(this.noIndent=!0)}function l(h){h.context&&(h.context=h.context.prev)}function i(h,v){for(var g;;){if(!h.context)return;if(g=h.context.tagName,!K.contextGrabbers.hasOwnProperty(g)||!K.contextGrabbers[g].hasOwnProperty(v))return;l(h)}}function n(h,v,g){return h=="openTag"?(g.tagStart=v.column(),O):h=="closeTag"?C:n}function O(h,v,g){return h=="word"?(g.tagName=v.current(),x="tag",S):K.allowMissingTagName&&h=="endTag"?(x="tag bracket",S(h,v,g)):(x="error",O)}function C(h,v,g){if(h=="word"){var b=v.current();return g.context&&g.context.tagName!=b&&K.implicitlyClosed.hasOwnProperty(g.context.tagName)&&l(g),g.context&&g.context.tagName==b||K.matchClosing===!1?(x="tag",T):(x="tag error",R)}else return K.allowMissingTagName&&h=="endTag"?(x="tag bracket",T(h,v,g)):(x="error",R)}function T(h,v,g){return h!="endTag"?(x="error",T):(l(g),n)}function R(h,v,g){return x="error",T(h,v,g)}function S(h,v,g){if(h=="word")return x="attribute",y;if(h=="endTag"||h=="selfcloseTag"){var b=g.tagName,N=g.tagStart;return g.tagName=g.tagStart=null,h=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(b)?i(g,b):(i(g,b),g.context=new d(g,b,N==g.indented)),n}return x="error",S}function y(h,v,g){return h=="equals"?E:(K.allowMissing||(x="error"),S(h,v,g))}function E(h,v,g){return h=="string"?f:h=="word"&&K.allowUnquoted?(x="string",S):(x="error",S(h,v,g))}function f(h,v,g){return h=="string"?f:S(h,v,g)}return{startState:function(h){var v={tokenize:p,state:n,indented:h||0,tagName:null,tagStart:null,context:null};return h!=null&&(v.baseIndent=h),v},token:function(h,v){if(!v.tagName&&h.sol()&&(v.indented=h.indentation()),h.eatSpace())return null;P=null;var g=v.tokenize(h,v);return(g||P)&&g!="comment"&&(x=null,v.state=v.state(P||g,h,v),x&&(g=x=="error"?g+" error":x)),g},indent:function(h,v,g){var b=h.context;if(h.tokenize.isInAttribute)return h.tagStart==h.indented?h.stringStartCol+1:h.indented+D;if(b&&b.noIndent)return ne.Pass;if(h.tokenize!=m&&h.tokenize!=p)return g?g.match(/^(\s*)/)[0].length:0;if(h.tagName)return K.multilineTagIndentPastTag!==!1?h.tagStart+h.tagName.length+2:h.tagStart+D*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(v))return 0;var N=v&&/^<(\/)?([\w_:\.-]*)/.exec(v);if(N&&N[1])for(;b;)if(b.tagName==N[2]){b=b.prev;break}else if(K.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(N)for(;b;){var H=K.contextGrabbers[b.tagName];if(H&&H.hasOwnProperty(N[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+D:h.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(h){h.state==E&&(h.state=S)},xmlCurrentTag:function(h){return h.tagName?{name:h.tagName,close:h.type=="closeTag"}:null},xmlCurrentContext:function(h){for(var v=[],g=h.context;g;g=g.prev)g.tagName&&v.push(g.tagName);return v.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return V});class ne{constructor(I){this.element=I,this.next=ne.Undefined,this.prev=ne.Undefined}}ne.Undefined=new ne(void 0);class V{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let I=this._first;for(;I!==ne.Undefined;){const z=I.next;I.prev=ne.Undefined,I.next=ne.Undefined,I=z}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(I){return this._insert(I,!1)}push(I){return this._insert(I,!0)}_insert(I,z){const L=new ne(I);if(this._first===ne.Undefined)this._first=L,this._last=L;else if(z){const K=this._last;this._last=L,L.prev=K,K.next=L}else{const K=this._first;this._first=L,L.next=K,K.prev=L}this._size+=1;let D=!1;return()=>{D||(D=!0,this._remove(L))}}shift(){if(this._first===ne.Undefined)return;{const I=this._first.element;return this._remove(this._first),I}}pop(){if(this._last===ne.Undefined)return;{const I=this._last.element;return this._remove(this._last),I}}_remove(I){if(I.prev!==ne.Undefined&&I.next!==ne.Undefined){const z=I.prev;z.next=I.next,I.next.prev=z}else I.prev===ne.Undefined&&I.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):I.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):I.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let I=this._first;for(;I!==ne.Undefined;)yield I.element,I=I.next}}},"3/fG":function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return V});function ne(I,z){let L;return z.length===0?L=I:L=I.replace(/\{(\d+)\}/g,function(D,K){const M=K[0];return typeof z[M]!="undefined"?z[M]:D}),L}function V(I,z,...L){return ne(z,L)}},"4wi7":function(Lt,ve,k){"use strict";var ne=k("14J3"),V=k("BMrR"),I=k("sRBo"),z=k("kaz8"),L=k("5NDa"),D=k("5rEg"),K=k("9og8"),M=k("tJVT"),r=k("WmNS"),P=k.n(r),x=k("q1tI"),p=k.n(x),m=k("oOBs"),c=k.n(m),a=k("xOL1"),s=k.n(a),d=k("BdwD"),l=function(n){var O=n.data,C=n.value,T=C===void 0?[]:C,R=n.handleChangePage,S=n.setSelectedRowKeys,y=n.selectedRowKeys,E=n.onChange,f=E===void 0?function(){}:E,h=Object(x.useState)([]),v=Object(M.a)(h,2),g=v[0],b=v[1],N=Object(x.useState)([]),H=Object(M.a)(N,2),A=H[0],F=H[1],U=Object(x.useState)([]),w=Object(M.a)(U,2),Y=w[0],Z=w[1],ce=Object(x.useState)(1),be=Object(M.a)(ce,2),Ze=be[0],Ce=be[1],We=Object(x.useState)(),Ve=Object(M.a)(We,2),Ye=Ve[0],we=Ve[1];return Object(x.useEffect)(function(){b(O),F([]),Z([])},[O]),Object(x.useEffect)(function(){S&&(F(y),Z(y))},[y]),p.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},p.a.createElement("div",{className:c.a.leftdiv},p.a.createElement(D.a.Search,{size:"large",onChange:function(){var X=Object(K.a)(P.a.mark(function j(W){return P.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:b(O.filter(function(G){var xe;return G==null||((xe=G.name)===null||xe===void 0)?void 0:xe.includes(W.target.value)}));case 1:case"end":return re.stop()}},j)}));return function(j){return X.apply(this,arguments)}}(),placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),g.length===0&&p.a.createElement(d.a,{styles:{margin:"70px auto"},customText:"\u6682\u65E0\u5206\u73ED"}),p.a.createElement("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"}},p.a.createElement(z.a.Group,{value:A.map(function(X){return"".concat(X.id)}),onChange:function(j){S(g.filter(function(W){return j.includes("".concat(W.id))}))},style:{marginTop:"10px"}},g.map(function(X,j){return p.a.createElement(V.a,{key:X.id,style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200}},p.a.createElement(z.a,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:X.is_published,value:"".concat(X.id)},p.a.createElement("div",{className:c.a.listClass},p.a.createElement("span",{className:c.a.spantitle,style:{width:X.is_published?"108px":"170px"}},X.name),X.is_published&&p.a.createElement("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"}},"\u5DF2\u53D1\u5E03"))))})))),p.a.createElement("div",{className:c.a.rightdiv},p.a.createElement(D.a.Search,{onChange:function(j){Z(A.filter(function(W){return W.name.includes(j.target.value)}))},size:"large",placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),Y.length===0&&p.a.createElement(d.a,{styles:{margin:"70px auto"},customText:"\u6682\u672A\u9009\u62E9\u5206\u73ED"}),Y.length>0&&p.a.createElement("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"}},p.a.createElement("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0}},Y.map(function(X,j){return p.a.createElement(V.a,{justify:"space-between",style:{marginTop:"10px"},key:X.id},p.a.createElement("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"}},X.name),p.a.createElement("img",{src:s.a,style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){S(A.filter(function(Q){return"".concat(Q.id)!="".concat(X.id)}))}}))})))))};ve.a=l},"55Ip":function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return i});var ne=k("Ty5D"),V=k("dI71"),I=k("q1tI"),z=k.n(I),L=k("YS25"),D=k("17x9"),K=k.n(D),M=k("wx14"),r=k("zLVn"),P=k("9R94"),x=function(E){Object(V.a)(f,E);function f(){for(var v,g=arguments.length,b=new Array(g),N=0;N<g;N++)b[N]=arguments[N];return v=E.call.apply(E,[this].concat(b))||this,v.history=Object(L.a)(v.props),v}var h=f.prototype;return h.render=function(){return z.a.createElement(ne.c,{history:this.history,children:this.props.children})},f}(z.a.Component),p=function(E){Object(V.a)(f,E);function f(){for(var v,g=arguments.length,b=new Array(g),N=0;N<g;N++)b[N]=arguments[N];return v=E.call.apply(E,[this].concat(b))||this,v.history=Object(L.b)(v.props),v}var h=f.prototype;return h.render=function(){return z.a.createElement(ne.c,{history:this.history,children:this.props.children})},f}(z.a.Component),m=function(f,h){return typeof f=="function"?f(h):f},c=function(f,h){return typeof f=="string"?Object(L.c)(f,null,null,h):f},a=function(f){return f},s=z.a.forwardRef;typeof s=="undefined"&&(s=a);function d(E){return!!(E.metaKey||E.altKey||E.ctrlKey||E.shiftKey)}var l=s(function(E,f){var h=E.innerRef,v=E.navigate,g=E.onClick,b=Object(r.a)(E,["innerRef","navigate","onClick"]),N=b.target,H=Object(M.a)({},b,{onClick:function(F){try{g&&g(F)}catch(U){throw F.preventDefault(),U}!F.defaultPrevented&&F.button===0&&(!N||N==="_self")&&!d(F)&&(F.preventDefault(),v())}});return a!==s?H.ref=f||h:H.ref=h,z.a.createElement("a",H)}),i=s(function(E,f){var h=E.component,v=h===void 0?l:h,g=E.replace,b=E.to,N=E.innerRef,H=Object(r.a)(E,["component","replace","to","innerRef"]);return z.a.createElement(ne.e.Consumer,null,function(A){A||Object(P.a)(!1);var F=A.history,U=c(m(b,A.location),A.location),w=U?F.createHref(U):"",Y=Object(M.a)({},H,{href:w,navigate:function(){var ce=m(b,A.location),be=g?F.replace:F.push;be(ce)}});return a!==s?Y.ref=f||N:Y.innerRef=N,z.a.createElement(v,Y)})});if(!1)var n,O;var C=function(f){return f},T=z.a.forwardRef;typeof T=="undefined"&&(T=C);function R(){for(var E=arguments.length,f=new Array(E),h=0;h<E;h++)f[h]=arguments[h];return f.filter(function(v){return v}).join(" ")}var S=T(function(E,f){var h=E["aria-current"],v=h===void 0?"page":h,g=E.activeClassName,b=g===void 0?"active":g,N=E.activeStyle,H=E.className,A=E.exact,F=E.isActive,U=E.location,w=E.sensitive,Y=E.strict,Z=E.style,ce=E.to,be=E.innerRef,Ze=Object(r.a)(E,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return z.a.createElement(ne.e.Consumer,null,function(Ce){Ce||Object(P.a)(!1);var We=U||Ce.location,Ve=c(m(ce,We),We),Ye=Ve.pathname,we=Ye&&Ye.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),X=we?Object(ne.f)(We.pathname,{path:we,exact:A,sensitive:w,strict:Y}):null,j=!!(F?F(X,We):X),W=j?R(H,b):H,Q=j?Object(M.a)({},Z,{},N):Z,re=Object(M.a)({"aria-current":j&&v||null,className:W,style:Q,to:Ve},Ze);return C!==T?re.ref=f||be:re.innerRef=be,z.a.createElement(i,re)})});if(!1)var y},"5VLF":function(Lt,ve,k){"use strict";var ne,V;function I(z,L,D){var K=function(M,r){return z.js_beautify(M,r)};return K.js=z.js_beautify,K.css=L.css_beautify,K.html=D.html_beautify,K.js_beautify=z.js_beautify,K.css_beautify=L.css_beautify,K.html_beautify=D.html_beautify,K}!(ne=[k("6UM0"),k("TXwP"),k("psGv")],V=function(z,L,D){return I(z,L,D)}.apply(ve,ne),V!==void 0&&(Lt.exports=V))},"5Y4S":function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return I});var ne=k("MNsG");const V=ne.b.performance&&typeof ne.b.performance.now=="function";class I{constructor(z){this._highResolution=V&&z,this._startTime=this._now(),this._stopTime=-1}static create(z=!0){return new I(z)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ne.b.performance.now():Date.now()}}},"6+eU":function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return T});var ne=k("wx14"),V=k("rePB"),I=k("VTBJ"),z=k("1OyB"),L=k("vuIU"),D=k("Ji7U"),K=k("LK+K"),M=k("q1tI"),r=k.n(M),P=k("TSYQ"),x=k.n(P),p=function(S){var y,E="".concat(S.rootPrefixCls,"-item"),f=x()(E,"".concat(E,"-").concat(S.page),(y={},Object(V.a)(y,"".concat(E,"-active"),S.active),Object(V.a)(y,S.className,!!S.className),Object(V.a)(y,"".concat(E,"-disabled"),!S.page),y)),h=function(){S.onClick(S.page)},v=function(b){S.onKeyPress(b,S.onClick,S.page)};return r.a.createElement("li",{title:S.showTitle?S.page:null,className:f,onClick:h,onKeyPress:v,tabIndex:"0"},S.itemRender(S.page,"page",r.a.createElement("a",{rel:"nofollow"},S.page)))},m=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(R){Object(D.a)(y,R);var S=Object(K.a)(y);function y(){var E;Object(z.a)(this,y);for(var f=arguments.length,h=new Array(f),v=0;v<f;v++)h[v]=arguments[v];return E=S.call.apply(S,[this].concat(h)),E.state={goInputText:""},E.buildOptionText=function(g){return"".concat(g," ").concat(E.props.locale.items_per_page)},E.changeSize=function(g){E.props.changeSize(Number(g))},E.handleChange=function(g){E.setState({goInputText:g.target.value})},E.handleBlur=function(g){var b=E.props,N=b.goButton,H=b.quickGo,A=b.rootPrefixCls,F=E.state.goInputText;if(N||F==="")return;if(g.relatedTarget&&(g.relatedTarget.className.indexOf("".concat(A,"-prev"))>=0||g.relatedTarget.className.indexOf("".concat(A,"-next"))>=0))return;E.setState({goInputText:""}),H(E.getValidValue())},E.go=function(g){var b=E.state.goInputText;if(b==="")return;(g.keyCode===c.ENTER||g.type==="click")&&(E.setState({goInputText:""}),E.props.quickGo(E.getValidValue()))},E}return Object(L.a)(y,[{key:"getValidValue",value:function(){var f=this.state,h=f.goInputText,v=f.current;return!h||isNaN(h)?v:Number(h)}},{key:"getPageSizeOptions",value:function(){var f=this.props,h=f.pageSize,v=f.pageSizeOptions;return v.some(function(g){return g.toString()===h.toString()})?v:v.concat([h.toString()]).sort(function(g,b){var N=isNaN(Number(g))?0:Number(g),H=isNaN(Number(b))?0:Number(b);return N-H})}},{key:"render",value:function(){var f=this,h=this.props,v=h.pageSize,g=h.locale,b=h.rootPrefixCls,N=h.changeSize,H=h.quickGo,A=h.goButton,F=h.selectComponentClass,U=h.buildOptionText,w=h.selectPrefixCls,Y=h.disabled,Z=this.state.goInputText,ce="".concat(b,"-options"),be=F,Ze=null,Ce=null,We=null;if(!N&&!H)return null;var Ve=this.getPageSizeOptions();if(N&&be){var Ye=Ve.map(function(we,X){return r.a.createElement(be.Option,{key:X,value:we.toString()},(U||f.buildOptionText)(we))});Ze=r.a.createElement(be,{disabled:Y,prefixCls:w,showSearch:!1,className:"".concat(ce,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(v||Ve[0]).toString(),onChange:this.changeSize,getPopupContainer:function(X){return X.parentNode}},Ye)}return H&&(A&&(We=typeof A=="boolean"?r.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:Y,className:"".concat(ce,"-quick-jumper-button")},g.jump_to_confirm):r.a.createElement("span",{onClick:this.go,onKeyUp:this.go},A)),Ce=r.a.createElement("div",{className:"".concat(ce,"-quick-jumper")},g.jump_to,r.a.createElement("input",{disabled:Y,type:"text",value:Z,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,We)),r.a.createElement("li",{className:"".concat(ce)},Ze,Ce)}}]),y}(r.a.Component);a.defaultProps={pageSizeOptions:["10","20","50","100"]};var s=a,d=k("N2Kk");function l(){}function i(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function n(R,S,y){return y}function O(R,S,y){var E=typeof R=="undefined"?S.pageSize:R;return Math.floor((y.total-1)/E)+1}var C=function(R){Object(D.a)(y,R);var S=Object(K.a)(y);function y(E){var f;Object(z.a)(this,y),f=S.call(this,E),f.getJumpPrevPage=function(){return Math.max(1,f.state.current-(f.props.showLessItems?3:5))},f.getJumpNextPage=function(){return Math.min(O(void 0,f.state,f.props),f.state.current+(f.props.showLessItems?3:5))},f.getItemIcon=function(N,H){var A=f.props.prefixCls,F=N||r.a.createElement("button",{type:"button","aria-label":H,className:"".concat(A,"-item-link")});return typeof N=="function"&&(F=r.a.createElement(N,Object(I.a)({},f.props))),F},f.savePaginationNode=function(N){f.paginationNode=N},f.isValid=function(N){return i(N)&&N!==f.state.current},f.shouldDisplayQuickJumper=function(){var N=f.props,H=N.showQuickJumper,A=N.pageSize,F=N.total;return F<=A?!1:H},f.handleKeyDown=function(N){(N.keyCode===c.ARROW_UP||N.keyCode===c.ARROW_DOWN)&&N.preventDefault()},f.handleKeyUp=function(N){var H=f.getValidValue(N),A=f.state.currentInputValue;H!==A&&f.setState({currentInputValue:H}),N.keyCode===c.ENTER?f.handleChange(H):N.keyCode===c.ARROW_UP?f.handleChange(H-1):N.keyCode===c.ARROW_DOWN&&f.handleChange(H+1)},f.changePageSize=function(N){var H=f.state.current,A=O(N,f.state,f.props);H=H>A?A:H,A===0&&(H=f.state.current),typeof N=="number"&&("pageSize"in f.props||f.setState({pageSize:N}),"current"in f.props||f.setState({current:H,currentInputValue:H})),f.props.onShowSizeChange(H,N),"onChange"in f.props&&f.props.onChange&&f.props.onChange(H,N)},f.handleChange=function(N){var H=f.props.disabled,A=N;if(f.isValid(A)&&!H){var F=O(void 0,f.state,f.props);A>F?A=F:A<1&&(A=1),"current"in f.props||f.setState({current:A,currentInputValue:A});var U=f.state.pageSize;return f.props.onChange(A,U),A}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<O(void 0,f.state,f.props)},f.runIfEnter=function(N,H){if(N.key==="Enter"||N.charCode===13){for(var A=arguments.length,F=new Array(A>2?A-2:0),U=2;U<A;U++)F[U-2]=arguments[U];H.apply(void 0,F)}},f.runIfEnterPrev=function(N){f.runIfEnter(N,f.prev)},f.runIfEnterNext=function(N){f.runIfEnter(N,f.next)},f.runIfEnterJumpPrev=function(N){f.runIfEnter(N,f.jumpPrev)},f.runIfEnterJumpNext=function(N){f.runIfEnter(N,f.jumpNext)},f.handleGoTO=function(N){(N.keyCode===c.ENTER||N.type==="click")&&f.handleChange(f.state.currentInputValue)};var h=E.onChange!==l,v="current"in E;v&&!h&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var g=E.defaultCurrent;"current"in E&&(g=E.current);var b=E.defaultPageSize;return"pageSize"in E&&(b=E.pageSize),g=Math.min(g,O(b,void 0,E)),f.state={current:g,currentInputValue:g,pageSize:b},f}return Object(L.a)(y,[{key:"componentDidUpdate",value:function(f,h){var v=this.props.prefixCls;if(h.current!==this.state.current&&this.paginationNode){var g=this.paginationNode.querySelector(".".concat(v,"-item-").concat(h.current));g&&document.activeElement===g&&g.blur()}}},{key:"getValidValue",value:function(f){var h=f.target.value,v=O(void 0,this.state,this.props),g=this.state.currentInputValue,b;return h===""?b=h:isNaN(Number(h))?b=g:h>=v?b=v:b=Number(h),b}},{key:"getShowSizeChanger",value:function(){var f=this.props,h=f.showSizeChanger,v=f.total,g=f.totalBoundaryShowSizeChanger;return typeof h!="undefined"?h:v>g}},{key:"renderPrev",value:function(f){var h=this.props,v=h.prevIcon,g=h.itemRender,b=g(f,"prev",this.getItemIcon(v,"prev page")),N=!this.hasPrev();return Object(M.isValidElement)(b)?Object(M.cloneElement)(b,{disabled:N}):b}},{key:"renderNext",value:function(f){var h=this.props,v=h.nextIcon,g=h.itemRender,b=g(f,"next",this.getItemIcon(v,"next page")),N=!this.hasNext();return Object(M.isValidElement)(b)?Object(M.cloneElement)(b,{disabled:N}):b}},{key:"render",value:function(){var f=this,h=this.props,v=h.prefixCls,g=h.className,b=h.style,N=h.disabled,H=h.hideOnSinglePage,A=h.total,F=h.locale,U=h.showQuickJumper,w=h.showLessItems,Y=h.showTitle,Z=h.showTotal,ce=h.simple,be=h.itemRender,Ze=h.showPrevNextJumpers,Ce=h.jumpPrevIcon,We=h.jumpNextIcon,Ve=h.selectComponentClass,Ye=h.selectPrefixCls,we=h.pageSizeOptions,X=this.state,j=X.current,W=X.pageSize,Q=X.currentInputValue;if(H===!0&&A<=W)return null;var re=O(void 0,this.state,this.props),G=[],xe=null,Ie=null,tt=null,le=null,Se=null,je=U&&U.goButton,ze=w?1:2,yt=j-1>0?j-1:0,Ot=j+1<re?j+1:re,Ut=Object.keys(this.props).reduce(function(ae,ie){return(ie.substr(0,5)==="data-"||ie.substr(0,5)==="aria-"||ie==="role")&&(ae[ie]=f.props[ie]),ae},{});if(ce)return je&&(typeof je=="boolean"?Se=r.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},F.jump_to_confirm):Se=r.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},je),Se=r.a.createElement("li",{title:Y?"".concat(F.jump_to).concat(j,"/").concat(re):null,className:"".concat(v,"-simple-pager")},Se)),r.a.createElement("ul",Object(ne.a)({className:x()(v,"".concat(v,"-simple"),Object(V.a)({},"".concat(v,"-disabled"),N),g),style:b,ref:this.savePaginationNode},Ut),r.a.createElement("li",{title:Y?F.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:x()("".concat(v,"-prev"),Object(V.a)({},"".concat(v,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(yt)),r.a.createElement("li",{title:Y?"".concat(j,"/").concat(re):null,className:"".concat(v,"-simple-pager")},r.a.createElement("input",{type:"text",value:Q,disabled:N,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),r.a.createElement("span",{className:"".concat(v,"-slash")},"/"),re),r.a.createElement("li",{title:Y?F.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:x()("".concat(v,"-next"),Object(V.a)({},"".concat(v,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Ot)),Se);if(re<=3+ze*2){var Qe={locale:F,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:Y,itemRender:be};re||G.push(r.a.createElement(m,Object(ne.a)({},Qe,{key:"noPager",page:re,className:"".concat(v,"-disabled")})));for(var Bt=1;Bt<=re;Bt+=1){var ln=j===Bt;G.push(r.a.createElement(m,Object(ne.a)({},Qe,{key:Bt,page:Bt,active:ln})))}}else{var Ke=w?F.prev_3:F.prev_5,He=w?F.next_3:F.next_5;Ze&&(xe=r.a.createElement("li",{title:Y?Ke:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:x()("".concat(v,"-jump-prev"),Object(V.a)({},"".concat(v,"-jump-prev-custom-icon"),!!Ce))},be(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Ce,"prev page"))),Ie=r.a.createElement("li",{title:Y?He:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:x()("".concat(v,"-jump-next"),Object(V.a)({},"".concat(v,"-jump-next-custom-icon"),!!We))},be(this.getJumpNextPage(),"jump-next",this.getItemIcon(We,"next page")))),le=r.a.createElement(m,{locale:F,last:!0,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:re,page:re,active:!1,showTitle:Y,itemRender:be}),tt=r.a.createElement(m,{locale:F,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:Y,itemRender:be});var ct=Math.max(1,j-ze),bt=Math.min(j+ze,re);j-1<=ze&&(bt=1+ze*2),re-j<=ze&&(ct=re-ze*2);for(var de=ct;de<=bt;de+=1){var q=j===de;G.push(r.a.createElement(m,{locale:F,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:de,page:de,active:q,showTitle:Y,itemRender:be}))}j-1>=ze*2&&j!==1+2&&(G[0]=Object(M.cloneElement)(G[0],{className:"".concat(v,"-item-after-jump-prev")}),G.unshift(xe)),re-j>=ze*2&&j!==re-2&&(G[G.length-1]=Object(M.cloneElement)(G[G.length-1],{className:"".concat(v,"-item-before-jump-next")}),G.push(Ie)),ct!==1&&G.unshift(tt),bt!==re&&G.push(le)}var te=null;Z&&(te=r.a.createElement("li",{className:"".concat(v,"-total-text")},Z(A,[A===0?0:(j-1)*W+1,j*W>A?A:j*W])));var se=!this.hasPrev()||!re,pe=!this.hasNext()||!re;return r.a.createElement("ul",Object(ne.a)({className:x()(v,g,Object(V.a)({},"".concat(v,"-disabled"),N)),style:b,unselectable:"unselectable",ref:this.savePaginationNode},Ut),te,r.a.createElement("li",{title:Y?F.prev_page:null,onClick:this.prev,tabIndex:se?null:0,onKeyPress:this.runIfEnterPrev,className:x()("".concat(v,"-prev"),Object(V.a)({},"".concat(v,"-disabled"),se)),"aria-disabled":se},this.renderPrev(yt)),G,r.a.createElement("li",{title:Y?F.next_page:null,onClick:this.next,tabIndex:pe?null:0,onKeyPress:this.runIfEnterNext,className:x()("".concat(v,"-next"),Object(V.a)({},"".concat(v,"-disabled"),pe)),"aria-disabled":pe},this.renderNext(Ot)),r.a.createElement(s,{disabled:N,locale:F,rootPrefixCls:v,selectComponentClass:Ve,selectPrefixCls:Ye,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:j,pageSize:W,pageSizeOptions:we,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:je}))}}],[{key:"getDerivedStateFromProps",value:function(f,h){var v={};if("current"in f&&(v.current=f.current,f.current!==h.current&&(v.currentInputValue=v.current)),"pageSize"in f&&f.pageSize!==h.pageSize){var g=h.current,b=O(f.pageSize,h,f);g=g>b?b:g,"current"in f||(v.current=g,v.currentInputValue=g),v.pageSize=f.pageSize}return v}}]),y}(r.a.Component);C.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:l,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:l,locale:d.a,style:{},itemRender:n,totalBoundaryShowSizeChanger:50};var T=C},"6RRn":function(Lt,ve,k){"use strict";var ne=k("wCXF"),V=k("n6Qo");k.d(ve,"b",function(){return V.a});var I=k("IBYe"),z=k("6eGT"),L=k("hW8S");k.d(ve,"a",function(){return L.a}),ve.c=ne.b},"6UM0":function(Lt,ve,k){var ne,V;(function(){var I;(function(){"use strict";var L=[function(r,P,x){var p=x(1).Beautifier,m=x(5).Options;function c(a,s){var d=new p(a,s);return d.beautify()}r.exports=c,r.exports.defaultOptions=function(){return new m}},function(r,P,x){var p=x(2).Output,m=x(3).Token,c=x(4),a=x(5).Options,s=x(7).Tokenizer,d=x(7).line_starters,l=x(7).positionable_operators,i=x(7).TOKEN;function n(w,Y){return Y.indexOf(w)!==-1}function O(w){return w.replace(/^\s+/g,"")}function C(w){for(var Y={},Z=0;Z<w.length;Z++)Y[w[Z].replace(/-/g,"_")]=w[Z];return Y}function T(w,Y){return w&&w.type===i.RESERVED&&w.text===Y}function R(w,Y){return w&&w.type===i.RESERVED&&n(w.text,Y)}var S=["case","return","do","if","throw","else","await","break","continue","async"],y=["before-newline","after-newline","preserve-newline"],E=C(y),f=[E.before_newline,E.preserve_newline],h={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function v(w,Y){if(Y.multiline_frame||Y.mode===h.ForInitializer||Y.mode===h.Conditional)return;w.remove_indent(Y.start_line_index)}function g(w){w=w.replace(c.allLineBreaks,`
|
|
`);for(var Y=[],Z=w.indexOf(`
|
|
`);Z!==-1;)Y.push(w.substring(0,Z)),w=w.substring(Z+1),Z=w.indexOf(`
|
|
`);return w.length&&Y.push(w),Y}function b(w){return w===h.ArrayLiteral}function N(w){return n(w,[h.Expression,h.ForInitializer,h.Conditional])}function H(w,Y){for(var Z=0;Z<w.length;Z++){var ce=w[Z].trim();if(ce.charAt(0)!==Y)return!1}return!0}function A(w,Y){for(var Z=0,ce=w.length,be;Z<ce;Z++)if(be=w[Z],be&&be.indexOf(Y)!==0)return!1;return!0}function F(w,Y){Y=Y||{},this._source_text=w||"",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(Y)}F.prototype.create_flags=function(w,Y){var Z=0;w&&(Z=w.indentation_level,!this._output.just_added_newline()&&w.line_indent_level>Z&&(Z=w.line_indent_level));var ce={mode:Y,parent:w,last_token:w?w.last_token:new m(i.START_BLOCK,""),last_word:w?w.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:Z,alignment:0,line_indent_level:w?w.line_indent_level:Z,start_line_index:this._output.get_line_number(),ternary_depth:0};return ce},F.prototype._reset=function(w){var Y=w.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,Y),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(h.BlockStatement);var Z=new s(w,this._options);return this._tokens=Z.tokenize(),w},F.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w,Y=this._reset(this._source_text),Z=this._options.eol;this._options.eol==="auto"&&(Z=`
|
|
`,Y&&c.lineBreak.test(Y||"")&&(Z=Y.match(c.lineBreak)[0]));for(var ce=this._tokens.next();ce;)this.handle_token(ce),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ce,ce=this._tokens.next();return w=this._output.get_code(Z),w},F.prototype.handle_token=function(w,Y){w.type===i.START_EXPR?this.handle_start_expr(w):w.type===i.END_EXPR?this.handle_end_expr(w):w.type===i.START_BLOCK?this.handle_start_block(w):w.type===i.END_BLOCK?this.handle_end_block(w):w.type===i.WORD?this.handle_word(w):w.type===i.RESERVED?this.handle_word(w):w.type===i.SEMICOLON?this.handle_semicolon(w):w.type===i.STRING?this.handle_string(w):w.type===i.EQUALS?this.handle_equals(w):w.type===i.OPERATOR?this.handle_operator(w):w.type===i.COMMA?this.handle_comma(w):w.type===i.BLOCK_COMMENT?this.handle_block_comment(w,Y):w.type===i.COMMENT?this.handle_comment(w,Y):w.type===i.DOT?this.handle_dot(w):w.type===i.EOF?this.handle_eof(w):w.type===i.UNKNOWN?this.handle_unknown(w,Y):this.handle_unknown(w,Y)},F.prototype.handle_whitespace_and_comments=function(w,Y){var Z=w.newlines,ce=this._options.keep_array_indentation&&b(this._flags.mode);if(w.comments_before)for(var be=w.comments_before.next();be;)this.handle_whitespace_and_comments(be,Y),this.handle_token(be,Y),be=w.comments_before.next();if(ce)for(var Ze=0;Ze<Z;Ze+=1)this.print_newline(Ze>0,Y);else if(this._options.max_preserve_newlines&&Z>this._options.max_preserve_newlines&&(Z=this._options.max_preserve_newlines),this._options.preserve_newlines&&Z>1){this.print_newline(!1,Y);for(var Ce=1;Ce<Z;Ce+=1)this.print_newline(!0,Y)}};var U=["async","break","continue","return","throw","yield"];F.prototype.allow_wrap_or_preserved_newline=function(w,Y){if(Y=Y===void 0?!1:Y,this._output.just_added_newline())return;var Z=this._options.preserve_newlines&&w.newlines||Y,ce=n(this._flags.last_token.text,l)||n(w.text,l);if(ce){var be=n(this._flags.last_token.text,l)&&n(this._options.operator_position,f)||n(w.text,l);Z=Z&&be}if(Z)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,U))return;this._output.set_wrap_point()}},F.prototype.print_newline=function(w,Y){if(!Y&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Z=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&T(Z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(w)&&(this._flags.multiline_frame=!0)},F.prototype.print_token_line_indentation=function(w){this._output.just_added_newline()&&(this._options.keep_array_indentation&&w.newlines&&(w.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(w.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))},F.prototype.print_token=function(w){if(this._output.raw){this._output.add_raw_token(w);return}if(this._options.comma_first&&w.previous&&w.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var Y=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(Y),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(w),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(w),this._output.non_breaking_space=!0,this._output.add_token(w.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},F.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},F.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))},F.prototype.set_mode=function(w){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,w),this._flags=this.create_flags(this._previous_flags,w),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},F.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===h.Statement&&v(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},F.prototype.start_of_object_property=function(){return this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},F.prototype.start_of_statement=function(w){var Y=!1;return Y=Y||R(this._flags.last_token,["var","let","const"])&&w.type===i.WORD,Y=Y||T(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement)&&R(this._flags.last_token,U)&&!w.newlines,Y=Y||T(this._flags.last_token,"else")&&!(T(w,"if")&&!w.comments_before),Y=Y||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===h.ForInitializer||this._previous_flags.mode===h.Conditional),Y=Y||this._flags.last_token.type===i.WORD&&this._flags.mode===h.BlockStatement&&!this._flags.in_case&&!(w.text==="--"||w.text==="++")&&this._last_last_text!=="function"&&w.type!==i.WORD&&w.type!==i.RESERVED,Y=Y||this._flags.mode===h.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),Y?(this.set_mode(h.Statement),this.indent(),this.handle_whitespace_and_comments(w,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w,R(w,["do","for","if","while"])),!0):!1},F.prototype.handle_start_expr=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w);var Y=h.Expression;if(w.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,d)&&(this._output.space_before_token=!0),this.print_token(w),this.set_mode(Y),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}Y=h.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),n(this._flags.last_token.type,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,Y=h.ForInitializer):n(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=h.Conditional):n(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&w.whitespace_before===""?this._output.space_before_token=!1:(n(this._flags.last_token.text,d)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var Z=this._tokens.peek(-3);if(this._options.space_after_named_function&&Z){var ce=this._tokens.peek(-4);R(Z,["async","function"])||Z.text==="*"&&R(ce,["async","function"])?this._output.space_before_token=!0:this._flags.mode===h.ObjectLiteral?(Z.text==="{"||Z.text===","||Z.text==="*"&&(ce.text==="{"||ce.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(w);(this._flags.last_token.type===i.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(n(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&n(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(w,w.newlines),this.print_token(w),this.set_mode(Y),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},F.prototype.handle_end_expr=function(w){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(w),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(w,w.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(w),this.restore_mode(),v(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===h.Conditional&&(this._previous_flags.mode=h.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},F.prototype.handle_start_block=function(w){this.handle_whitespace_and_comments(w);var Y=this._tokens.peek(),Z=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(h.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(h.BlockStatement):Z&&(n(Z.text,[":",","])&&n(Y.type,[i.STRING,i.WORD,i.RESERVED])||n(Y.text,["get","set","..."])&&n(Z.type,[i.WORD,i.RESERVED]))?n(this._last_last_text,["class","interface"])&&!n(Z.text,[":",","])?this.set_mode(h.BlockStatement):this.set_mode(h.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(h.BlockStatement):n(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(h.ObjectLiteral):this.set_mode(h.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ce=!Y.comments_before&&Y.text==="}",be=ce&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var Ze=0,Ce=null;this._flags.inline_frame=!0;do if(Ze+=1,Ce=this._tokens.peek(Ze-1),Ce.newlines){this._flags.inline_frame=!1;break}while(Ce.type!==i.EOF&&!(Ce.type===i.END_BLOCK&&Ce.opened===w))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&w.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(be||this._flags.last_token.type===i.EQUALS||R(this._flags.last_token,S)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(w),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(w),this.indent(),!ce&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},F.prototype.handle_end_block=function(w){for(this.handle_whitespace_and_comments(w);this._flags.mode===h.Statement;)this.restore_mode();var Y=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!Y?this._output.space_before_token=!0:this._options.brace_style==="expand"?Y||this.print_newline():Y||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(w)},F.prototype.handle_word=function(w){if(w.type===i.RESERVED){if(n(w.text,["set","get"])&&this._flags.mode!==h.ObjectLiteral)w.type=i.WORD;else if(w.text==="import"&&n(this._tokens.peek().text,["(","."]))w.type=i.WORD;else if(n(w.text,["as","from"])&&!this._flags.import_block)w.type=i.WORD;else if(this._flags.mode===h.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(w.type=i.WORD)}}if(this.start_of_statement(w)?R(this._flags.last_token,["var","let","const"])&&w.type===i.WORD&&(this._flags.declaration_statement=!0):w.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(w),this.print_newline()):this.handle_whitespace_and_comments(w),this._flags.do_block&&!this._flags.do_while)if(T(w,"while")){this._output.space_before_token=!0,this.print_token(w),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&&T(w,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===h.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(w,["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(w),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w)),T(w,"function")){(n(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(n(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!w.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,U)?this._output.space_before_token=!0:T(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(w),this._flags.last_word=w.text;return}var Z="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?Z="SPACE":R(w,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&w.newlines?Z="NEWLINE":(Z="SPACE",this._output.space_before_token=!0):Z="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===h.BlockStatement?Z="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&N(this._flags.mode)?Z="SPACE":this._flags.last_token.type===i.STRING?Z="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(n(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&n(this._last_last_text,["{",","]))?Z="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?Z="SPACE":Z="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,Z="NEWLINE"),R(w,d)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Z="SPACE":Z="NEWLINE"),R(w,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===h.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&w.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ce=this._output.current_line;ce.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Z==="NEWLINE"?R(this._flags.last_token,S)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(w,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!R(w,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(w,"if")&&T(w.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(w,d)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Z==="SPACE"&&(this._output.space_before_token=!0);w.previous&&(w.previous.type===i.WORD||w.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(w),this._flags.last_word=w.text,w.type===i.RESERVED&&(w.text==="do"?this._flags.do_block=!0:w.text==="if"?this._flags.if_block=!0:w.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(w,"from")&&(this._flags.import_block=!1))},F.prototype.handle_semicolon=function(w){this.start_of_statement(w)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(w);for(var Y=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&T(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(w)},F.prototype.handle_string=function(w){w.text.startsWith("`")&&w.newlines===0&&w.whitespace_before===""&&(w.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(w)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(w),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w):w.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(w.previous.text==="]"||w.previous.text===")")&&w.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(w)},F.prototype.handle_equals=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0},F.prototype.handle_comma=function(w){this.handle_whitespace_and_comments(w,!0),this.print_token(w),this._output.space_before_token=!0,this._flags.declaration_statement?(N(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(w)):this._flags.mode===h.ObjectLiteral||this._flags.mode===h.Statement&&this._flags.parent.mode===h.ObjectLiteral?(this._flags.mode===h.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(w)},F.prototype.handle_operator=function(w){var Y=w.text==="*"&&(R(this._flags.last_token,["function","yield"])||n(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),Z=n(w.text,["-","+"])&&(n(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||n(this._flags.last_token.text,d)||this._flags.last_token.text===",");if(!this.start_of_statement(w)){var ce=!Y;this.handle_whitespace_and_comments(w,ce)}if(w.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(w);return}if(w.text==="::"){this.print_token(w);return}if(this._flags.last_token.type===i.OPERATOR&&n(this._options.operator_position,f)&&this.allow_wrap_or_preserved_newline(w),w.text===":"&&this._flags.in_case){this.print_token(w),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var be=!0,Ze=!0,Ce=!1;if(w.text===":"?this._flags.ternary_depth===0?be=!1:(this._flags.ternary_depth-=1,Ce=!0):w.text==="?"&&(this._flags.ternary_depth+=1),!Z&&!Y&&this._options.preserve_newlines&&n(w.text,l)){var We=w.text===":",Ve=We&&Ce,Ye=We&&!Ce;switch(this._options.operator_position){case E.before_newline:this._output.space_before_token=!Ye,this.print_token(w),(!We||Ve)&&this.allow_wrap_or_preserved_newline(w),this._output.space_before_token=!0;return;case E.after_newline:this._output.space_before_token=!0,!We||Ve?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(w):this._output.space_before_token=!1,this.print_token(w),this._output.space_before_token=!0;return;case E.preserve_newline:Ye||this.allow_wrap_or_preserved_newline(w),be=!(this._output.just_added_newline()||Ye),this._output.space_before_token=be,this.print_token(w),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(w),be=!1;var we=this._tokens.peek();Ze=we&&n(we.type,[i.WORD,i.RESERVED])}else if(w.text==="...")this.allow_wrap_or_preserved_newline(w),be=this._flags.last_token.type===i.START_BLOCK,Ze=!1;else if(n(w.text,["--","++","!","~"])||Z){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(w),be=!1,Ze=!1,w.newlines&&(w.text==="--"||w.text==="++"||w.text==="~")){var X=R(this._flags.last_token,S)&&w.newlines;X&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(X,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(be=!0),this._flags.last_token.type===i.RESERVED?be=!0:this._flags.last_token.type===i.END_EXPR?be=!(this._flags.last_token.text==="]"&&(w.text==="--"||w.text==="++")):this._flags.last_token.type===i.OPERATOR&&(be=n(w.text,["--","-","++","+"])&&n(this._flags.last_token.text,["--","-","++","+"]),n(w.text,["+","-"])&&n(this._flags.last_token.text,["--","++"])&&(Ze=!0)),(this._flags.mode===h.BlockStatement&&!this._flags.inline_frame||this._flags.mode===h.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||be,this.print_token(w),this._output.space_before_token=Ze},F.prototype.handle_block_comment=function(w,Y){if(this._output.raw){this._output.add_raw_token(w),w.directives&&w.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(w.directives){this.print_newline(!1,Y),this.print_token(w),w.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(w.text)&&!w.newlines){this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0;return}else this.print_block_commment(w,Y)},F.prototype.print_block_commment=function(w,Y){var Z=g(w.text),ce,be=!1,Ze=!1,Ce=w.whitespace_before,We=Ce.length;if(this.print_newline(!1,Y),this.print_token_line_indentation(w),this._output.add_token(Z[0]),this.print_newline(!1,Y),Z.length>1){for(Z=Z.slice(1),be=H(Z,"*"),Ze=A(Z,Ce),be&&(this._flags.alignment=1),ce=0;ce<Z.length;ce++)be?(this.print_token_line_indentation(w),this._output.add_token(O(Z[ce]))):Ze&&Z[ce]?(this.print_token_line_indentation(w),this._output.add_token(Z[ce].substring(We))):(this._output.current_line.set_indent(-1),this._output.add_token(Z[ce])),this.print_newline(!1,Y);this._flags.alignment=0}},F.prototype.handle_comment=function(w,Y){w.newlines?this.print_newline(!1,Y):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(w),this.print_newline(!1,Y)},F.prototype.handle_dot=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,S)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(w,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(w)},F.prototype.handle_unknown=function(w,Y){this.print_token(w),w.text[w.text.length-1]===`
|
|
`&&this.print_newline(!1,Y)},F.prototype.handle_eof=function(w){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(w)},r.exports.Beautifier=F},function(r){function P(m){this.__parent=m,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 m=new P(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},P.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},P.prototype.has_match=function(m){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(m))return!0;return!1},P.prototype.set_indent=function(m,c){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=c||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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__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(m){this.__items.push(m);var c=m.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=m.length-c:this.__character_count+=m.length},P.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function x(m,c){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),c=c||"",m.indent_level>0&&(c=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}x.prototype.get_indent_size=function(m,c){var a=this.__base_string_length;return c=c||0,m<0&&(a=0),a+=m*this.__indent_size,a+=c,a},x.prototype.get_indent_string=function(m,c){var a=this.__base_string;return c=c||0,m<0&&(m=0,a=""),c+=m*this.__indent_size,this.__ensure_cache(c),a+=this.__cache[c],a},x.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var m=this.__cache.length,c=0,a="";this.__indent_size&&m>=this.__indent_size&&(c=Math.floor(m/this.__indent_size),m-=c*this.__indent_size,a=new Array(c+1).join(this.__indent_string)),m&&(a+=new Array(m+1).join(" ")),this.__cache.push(a)};function p(m,c){this.__indent_cache=new x(m,c),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.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()}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(m,c){return this.__indent_cache.get_indent_string(m,c)},p.prototype.get_indent_size=function(m,c){return this.__indent_cache.get_indent_size(m,c)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(m){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 m!==`
|
|
`&&(a=a.replace(/[\n]/g,m)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(m,c){return m=m||0,c=c||0,this.next_line.set_indent(m,c),this.__lines.length>1?(this.current_line.set_indent(m,c),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var c=0;c<m.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),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(m){for(var c=this.__lines.length;m<c;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&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(m,c){for(var a=this.__lines.length-2;a>=0;){var s=this.__lines[a];if(s.is_empty())break;if(s.item(0).indexOf(m)!==0&&s.item(-1)!==c){this.__lines.splice(a+1,0,new P(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},r.exports.Output=p},function(r){function P(x,p,m,c){this.type=x,this.text=p,this.comments_before=null,this.newlines=m||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=P},function(r,P){var x="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\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+m+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+p+m+c+"])*";P.identifier=new RegExp(a+s,"g"),P.identifierStart=new RegExp(a),P.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+m+c+"])+");var d=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;P.newline=/[\n\r\u2028\u2029]/,P.lineBreak=new RegExp(`\r
|
|
|`+P.newline.source),P.allLineBreaks=new RegExp(P.lineBreak.source,"g")},function(r,P,x){var p=x(6).Options,m=["before-newline","after-newline","preserve-newline"];function c(a){p.call(this,a,"js");var s=this.raw_options.brace_style||null;s==="expand-strict"?this.raw_options.brace_style="expand":s==="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 d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var l=0;l<d.length;l++)d[l]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=d[l];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new p,r.exports.Options=c},function(r){function P(m,c){this.raw_options=x(m,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"])}P.prototype._get_array=function(m,c){var a=this.raw_options[m],s=c||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(s=a.concat()):typeof a=="string"&&(s=a.split(/[^a-zA-Z0-9_\/\-]+/)),s},P.prototype._get_boolean=function(m,c){var a=this.raw_options[m],s=a===void 0?!!c:!!a;return s},P.prototype._get_characters=function(m,c){var a=this.raw_options[m],s=c||"";return typeof a=="string"&&(s=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),s},P.prototype._get_number=function(m,c){var a=this.raw_options[m];c=parseInt(c,10),isNaN(c)&&(c=0);var s=parseInt(a,10);return isNaN(s)&&(s=c),s},P.prototype._get_selection=function(m,c,a){var s=this._get_selection_list(m,c,a);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[m]+"'");return s[0]},P.prototype._get_selection_list=function(m,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 s=this._get_array(m,a);if(!this._is_valid_selection(s,c))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[m]+"'");return s},P.prototype._is_valid_selection=function(m,c){return m.length&&c.length&&!m.some(function(a){return c.indexOf(a)===-1})};function x(m,c){var a={};m=p(m);var s;for(s in m)s!==c&&(a[s]=m[s]);if(c&&m[c])for(s in m[c])a[s]=m[c][s];return a}function p(m){var c={},a;for(a in m){var s=a.replace(/-/g,"_");c[s]=m[a]}return c}r.exports.Options=P,r.exports.normalizeOpts=p,r.exports.mergeOpts=x},function(r,P,x){var p=x(8).InputScanner,m=x(9).Tokenizer,c=x(9).TOKEN,a=x(13).Directives,s=x(4),d=x(12).Pattern,l=x(14).TemplatablePattern;function i(H,A){return A.indexOf(H)!==-1}var n={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},O=new a(/\/\*/,/\*\//),C=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[0-9]/,R=/[^\d\.]/,S=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),y=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";y=y.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),y="\\?\\.(?!\\d) "+y,y=y.replace(/ /g,"|");var E=new RegExp(y),f="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),h=f.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),v=new RegExp("^(?:"+h.join("|")+")$"),g,b=function(H,A){m.call(this,H,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var F=new d(this._input),U=new l(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(s.identifier).matching(s.identifierMatch),number:F.matching(C),punct:F.matching(E),comment:F.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:F.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:F.matching(/<!--/),html_comment_end:F.matching(/-->/),include:F.starting_with(/#include/).until_after(s.lineBreak),shebang:F.starting_with(/#!/).until_after(s.lineBreak),xml:F.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:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};b.prototype=new m,b.prototype._is_comment=function(H){return H.type===n.COMMENT||H.type===n.BLOCK_COMMENT||H.type===n.UNKNOWN},b.prototype._is_opening=function(H){return H.type===n.START_BLOCK||H.type===n.START_EXPR},b.prototype._is_closing=function(H,A){return(H.type===n.END_BLOCK||H.type===n.END_EXPR)&&A&&(H.text==="]"&&A.text==="["||H.text===")"&&A.text==="("||H.text==="}"&&A.text==="{")},b.prototype._reset=function(){g=!1},b.prototype._get_next_token=function(H,A){var F=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(n.EOF,""):(F=F||this._read_non_javascript(U),F=F||this._read_string(U),F=F||this._read_word(H),F=F||this._read_singles(U),F=F||this._read_comment(U),F=F||this._read_regexp(U,H),F=F||this._read_xml(U,H),F=F||this._read_punctuation(),F=F||this._create_token(n.UNKNOWN,this._input.next()),F)},b.prototype._read_word=function(H){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(s.allLineBreaks,`
|
|
`),!(H.type===n.DOT||H.type===n.RESERVED&&(H.text==="set"||H.text==="get"))&&v.test(A)?(A==="in"||A==="of")&&(H.type===n.WORD||H.type===n.STRING)?this._create_token(n.OPERATOR,A):this._create_token(n.RESERVED,A):this._create_token(n.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(n.WORD,A)},b.prototype._read_singles=function(H){var A=null;return H==="("||H==="["?A=this._create_token(n.START_EXPR,H):H===")"||H==="]"?A=this._create_token(n.END_EXPR,H):H==="{"?A=this._create_token(n.START_BLOCK,H):H==="}"?A=this._create_token(n.END_BLOCK,H):H===";"?A=this._create_token(n.SEMICOLON,H):H==="."&&R.test(this._input.peek(1))?A=this._create_token(n.DOT,H):H===","&&(A=this._create_token(n.COMMA,H)),A&&this._input.next(),A},b.prototype._read_punctuation=function(){var H=this.__patterns.punct.read();if(H!=="")return H==="="?this._create_token(n.EQUALS,H):H==="?."?this._create_token(n.DOT,H):this._create_token(n.OPERATOR,H)},b.prototype._read_non_javascript=function(H){var A="";if(H==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(n.UNKNOWN,A.trim()+`
|
|
`);if(A=this.__patterns.include.read(),A)return this._create_token(n.UNKNOWN,A.trim()+`
|
|
`);H=this._input.next();var F="#";if(this._input.hasNext()&&this._input.testChar(T)){do H=this._input.next(),F+=H;while(this._input.hasNext()&&H!=="#"&&H!=="=");return H==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(F+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(F+="{}",this._input.next(),this._input.next())),this._create_token(n.WORD,F)}this._input.back()}else if(H==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)A+=this._input.next();return g=!0,this._create_token(n.COMMENT,A)}}else if(g&&H==="-"&&(A=this.__patterns.html_comment_end.read(),A))return g=!1,this._create_token(n.COMMENT,A);return null},b.prototype._read_comment=function(H){var A=null;if(H==="/"){var F="";if(this._input.peek(1)==="*"){F=this.__patterns.block_comment.read();var U=O.get_directives(F);U&&U.ignore==="start"&&(F+=O.readIgnored(this._input)),F=F.replace(s.allLineBreaks,`
|
|
`),A=this._create_token(n.BLOCK_COMMENT,F),A.directives=U}else this._input.peek(1)==="/"&&(F=this.__patterns.comment.read(),A=this._create_token(n.COMMENT,F))}return A},b.prototype._read_string=function(H){if(H==="`"||H==="'"||H==='"'){var A=this._input.next();return this.has_char_escapes=!1,H==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(H),this.has_char_escapes&&this._options.unescape_strings&&(A=N(A)),this._input.peek()===H&&(A+=this._input.next()),A=A.replace(s.allLineBreaks,`
|
|
`),this._create_token(n.STRING,A)}return null},b.prototype._allow_regexp_or_xml=function(H){return H.type===n.RESERVED&&i(H.text,["return","case","throw","else","do","typeof","yield"])||H.type===n.END_EXPR&&H.text===")"&&H.opened.previous.type===n.RESERVED&&i(H.opened.previous.text,["if","while","for"])||i(H.type,[n.COMMENT,n.START_EXPR,n.START_BLOCK,n.START,n.END_BLOCK,n.OPERATOR,n.EQUALS,n.EOF,n.SEMICOLON,n.COMMA])},b.prototype._read_regexp=function(H,A){if(H==="/"&&this._allow_regexp_or_xml(A)){for(var F=this._input.next(),U=!1,w=!1;this._input.hasNext()&&(U||w||this._input.peek()!==H)&&!this._input.testChar(s.newline);)F+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?w=!0:this._input.peek()==="]"&&(w=!1)),this._input.next();return this._input.peek()===H&&(F+=this._input.next(),F+=this._input.read(s.identifier)),this._create_token(n.STRING,F)}return null},b.prototype._read_xml=function(H,A){if(this._options.e4x&&H==="<"&&this._allow_regexp_or_xml(A)){var F="",U=this.__patterns.xml.read_match();if(U){for(var w=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),Y=w.indexOf("{")===0,Z=0;U;){var ce=!!U[1],be=U[2],Ze=!!U[U.length-1]||be.slice(0,8)==="![CDATA[";if(!Ze&&(be===w||Y&&be.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ce?--Z:++Z),F+=U[0],Z<=0)break;U=this.__patterns.xml.read_match()}return U||(F+=this._input.match(/[\s\S]*/g)[0]),F=F.replace(s.allLineBreaks,`
|
|
`),this._create_token(n.STRING,F)}}return null};function N(H){for(var A="",F=0,U=new p(H),w=null;U.hasNext();)if(w=U.match(/([\s]|[^\\]|\\\\)+/g),w&&(A+=w[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")w=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")w=U.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",U.hasNext()&&(A+=U.next());continue}if(!w)return H;if(F=parseInt(w[1],16),F>126&&F<=255&&w[0].indexOf("x")===0)return H;if(F>=0&&F<32){A+="\\"+w[0];continue}else F===34||F===39||F===92?A+="\\"+String.fromCharCode(F):A+=String.fromCharCode(F)}return A}b.prototype._read_string_recursive=function(H,A,F){var U,w;H==="'"?w=this.__patterns.single_quote:H==='"'?w=this.__patterns.double_quote:H==="`"?w=this.__patterns.template_text:H==="}"&&(w=this.__patterns.template_expression);for(var Y=w.read(),Z="";this._input.hasNext();){if(Z=this._input.next(),Z===H||!A&&s.newline.test(Z)){this._input.back();break}else Z==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),Z+=this._input.next()):F&&(F==="${"&&Z==="$"&&this._input.peek()==="{"&&(Z+=this._input.next()),F===Z&&(H==="`"?Z+=this._read_string_recursive("}",A,"`"):Z+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(Z+=this._input.next())));Z+=w.read(),Y+=Z}return Y},r.exports.Tokenizer=b,r.exports.TOKEN=n,r.exports.positionable_operators=S.slice(),r.exports.line_starters=f.slice()},function(r){var P=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 m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(m=this.__input.charAt(p)),m},x.prototype.__match=function(p,m){p.lastIndex=m;var c=p.exec(this.__input);return c&&!(P&&p.sticky)&&(c.index!==m&&(c=null)),c},x.prototype.test=function(p,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(p,m):!1},x.prototype.testChar=function(p,m){var c=this.peek(m);return p.lastIndex=0,c!==null&&p.test(c)},x.prototype.match=function(p){var m=this.__match(p,this.__position);return m?this.__position+=m[0].length:m=null,m},x.prototype.read=function(p,m,c){var a="",s;return p&&(s=this.match(p),s&&(a+=s[0])),m&&(s||!p)&&(a+=this.readUntil(m,c)),a},x.prototype.readUntil=function(p,m){var c="",a=this.__position;p.lastIndex=this.__position;var s=p.exec(this.__input);return s?(a=s.index,m&&(a+=s[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,m){var c=null,a="g";return m&&P&&(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 m=this.__position,c=this.readUntilAfter(p);return this.__position=m,c},x.prototype.lookBack=function(p){var m=this.__position-1;return m>=p.length&&this.__input.substring(m-p.length,m).toLowerCase()===p},r.exports.InputScanner=x},function(r,P,x){var p=x(8).InputScanner,m=x(3).Token,c=x(10).TokenStream,a=x(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},d=function(l,i){this._input=new p(l),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};d.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var l,i=new m(s.START,""),n=null,O=[],C=new c;i.type!==s.EOF;){for(l=this._get_next_token(i,n);this._is_comment(l);)C.add(l),l=this._get_next_token(i,n);C.isEmpty()||(l.comments_before=C,C=new c),l.parent=n,this._is_opening(l)?(O.push(n),n=l):n&&this._is_closing(l,n)&&(l.opened=n,n.closed=l,n=O.pop(),l.parent=n),l.previous=i,i.next=l,this.__tokens.add(l),i=l}return this.__tokens},d.prototype._is_first_token=function(){return this.__tokens.isEmpty()},d.prototype._reset=function(){},d.prototype._get_next_token=function(l,i){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(s.RAW,n):this._create_token(s.EOF,"")},d.prototype._is_comment=function(l){return!1},d.prototype._is_opening=function(l){return!1},d.prototype._is_closing=function(l,i){return!1},d.prototype._create_token=function(l,i){var n=new m(l,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n},d.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=d,r.exports.TOKEN=s},function(r){function P(x){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=x}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 x=null;return this.hasNext()&&(x=this.__tokens[this.__position],this.__position+=1),x},P.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},P.prototype.add=function(x){this.__parent_token&&(x.parent=this.__parent_token),this.__tokens.push(x),this.__tokens_length+=1},r.exports.TokenStream=P},function(r,P,x){var p=x(12).Pattern;function m(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=""}m.prototype=new p,m.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+"]")},m.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},m.prototype.matching=function(c,a){var s=this._create();return s.__set_whitespace_patterns(c,a),s._update(),s},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(c,a){c.lastIndex=0;for(var s=0,d=[],l=c.exec(a);l;)d.push(a.substring(s,l.index)),s=l.index+l[0].length,l=c.exec(a);return s<a.length?d.push(a.substring(s,a.length)):d.push(""),d},r.exports.WhitespacePattern=m},function(r){function P(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)}P.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},P.prototype.read_match=function(){return this._input.match(this._match_pattern)},P.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},P.prototype.until=function(x){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(x),p._update(),p},P.prototype.starting_with=function(x){var p=this._create();return p._starting_pattern=this._input.get_regexp(x,!0),p._update(),p},P.prototype.matching=function(x){var p=this._create();return p._match_pattern=this._input.get_regexp(x,!0),p._update(),p},P.prototype._create=function(){return new P(this._input,this)},P.prototype._update=function(){},r.exports.Pattern=P},function(r){function P(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")}P.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(x);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(x);return p},P.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=P},function(r,P,x){var p=x(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(a,s){p.call(this,a,s),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var d=new p(a);this.__patterns={handlebars_comment:d.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:d.starting_with(/{{{/).until_after(/}}}/),handlebars:d.starting_with(/{{/).until_after(/}}/),php:d.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:d.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:d.starting_with(/{%/).until_after(/%}/),django_value:d.starting_with(/{{/).until_after(/}}/),django_comment:d.starting_with(/{#/).until_after(/#}/),smarty:d.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:d.starting_with(/{\*/).until_after(/\*}/),smarty_literal:d.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 s=this._create();return s._disabled[a]=!0,s._update(),s},c.prototype.read_options=function(a){var s=this._create();for(var d in m)s._disabled[d]=a.templating.indexOf(d)===-1;return s._update(),s},c.prototype.exclude=function(a){var s=this._create();return s._excluded[a]=!0,s._update(),s},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 s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),a+=s,s=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="",s=this._input.peek();if(s==="<"){var d=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&d==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&d==="%"&&(a=a||this.__patterns.erb.read())}else s==="{"&&(!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},r.exports.TemplatablePattern=c}],D={};function K(r){var P=D[r];if(P!==void 0)return P.exports;var x=D[r]={exports:{}};return L[r](x,x.exports,K),x.exports}var M=K(0);I=M})();var z=I;!(ne=[],V=function(){return{js_beautify:z}}.apply(ve,ne),V!==void 0&&(Lt.exports=V))})()},"6eGT":function(Lt,ve,k){"use strict";function ne(V){return null}ve.a=ne},"746U":function(Lt,ve,k){"use strict";k.d(ve,"f",function(){return ne}),k.d(ve,"l",function(){return V}),k.d(ve,"k",function(){return I}),k.d(ve,"j",function(){return z}),k.d(ve,"g",function(){return L}),k.d(ve,"m",function(){return D}),k.d(ve,"h",function(){return K}),k.d(ve,"n",function(){return M}),k.d(ve,"c",function(){return r}),k.d(ve,"a",function(){return P}),k.d(ve,"i",function(){return x}),k.d(ve,"o",function(){return p}),k.d(ve,"e",function(){return a}),k.d(ve,"d",function(){return s}),k.d(ve,"p",function(){return d}),k.d(ve,"b",function(){return l});function ne(i){return Array.isArray(i)}function V(i){return typeof i=="string"}function I(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function z(i){return typeof i=="number"&&!isNaN(i)}function L(i){return i===!0||i===!1}function D(i){return typeof i=="undefined"}function K(i){return!M(i)}function M(i){return D(i)||i===null}function r(i,n){if(!i)throw new Error(n?`Unexpected type, expected '${n}'`:"Unexpected type")}function P(i){if(M(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function x(i){return typeof i=="function"}function p(i,n){const O=Math.min(i.length,n.length);for(let C=0;C<O;C++)m(i[C],n[C])}function m(i,n){if(V(n)){if(typeof i!==n)throw new Error(`argument does not match constraint: typeof ${n}`)}else if(x(n)){try{if(i instanceof n)return}catch(O){}if(!M(i)&&i.constructor===n)return;if(n.length===1&&n.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function c(i){let n=[],O=Object.getPrototypeOf(i);for(;Object.prototype!==O;)n=n.concat(Object.getOwnPropertyNames(O)),O=Object.getPrototypeOf(O);return n}function a(i){const n=[];for(const O of c(i))typeof i[O]=="function"&&n.push(O);return n}function s(i,n){const O=T=>function(){const R=Array.prototype.slice.call(arguments,0);return n(T,R)};let C={};for(const T of i)C[T]=O(T);return C}function d(i){return i===null?void 0:i}function l(i,n="Unreachable"){throw new Error(n)}},"7Cbv":function(Lt,ve,k){"use strict";var ne=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function I(){if(!ne)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(V)}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 L(m){return typeof m=="string"&&z.test(m)}for(var D=L,K=[],M=0;M<256;++M)K.push((M+256).toString(16).substr(1));function r(m){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(K[m[c+0]]+K[m[c+1]]+K[m[c+2]]+K[m[c+3]]+"-"+K[m[c+4]]+K[m[c+5]]+"-"+K[m[c+6]]+K[m[c+7]]+"-"+K[m[c+8]]+K[m[c+9]]+"-"+K[m[c+10]]+K[m[c+11]]+K[m[c+12]]+K[m[c+13]]+K[m[c+14]]+K[m[c+15]]).toLowerCase();if(!D(a))throw TypeError("Stringified UUID is invalid");return a}var P=r;function x(m,c,a){m=m||{};var s=m.random||(m.rng||I)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,c){a=a||0;for(var d=0;d<16;++d)c[a+d]=s[d];return c}return P(s)}var p=ve.a=x},"7ahc":function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return O});var ne=k("k1fw"),V=k("0Owb"),I=k("+L6B"),z=k("2/Rp"),L=k("y8nQ"),D=k("Vl3Y"),K=k("tJVT"),M=k("OaEy"),r=k("2fM7"),P=k("q1tI"),x=k.n(P),p=k("VrN/"),m=k.n(p),c=k("p77/"),a=k.n(c),s=k("c5Ni"),d=k.n(s),l=r.a.Option,i={labelCol:{span:4},wrapperCol:{span:20}},n={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"]};ve.b=function(C){var T=C.callback,R=C.onCancel,S=Object(P.useState)("python"),y=Object(K.a)(S,2),E=y[0],f=y[1];function h(g){f(n[g][1])}function v(g){T(g)}return x.a.createElement(D.a,Object(V.a)({},i,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:v}),x.a.createElement(D.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},x.a.createElement(r.a,{onChange:h},Object.keys(n).map(function(g){return x.a.createElement(l,{key:g,value:g},n[g][0])}))),x.a.createElement(D.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},x.a.createElement(O,{mode:E})),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:R},"\u53D6\u6D88")))};function O(C){var T=C.value,R=C.onChange,S=C.mode,y=C.options,E=y===void 0?{}:y,f=Object(P.useRef)(),h=Object(P.useState)(),v=Object(K.a)(h,2),g=v[0],b=v[1];return Object(P.useEffect)(function(){if(g){function N(H){var A=H.getValue();R&&R(A)}return g.on("change",N),function(){g.off("change",N)}}},[g,R]),Object(P.useEffect)(function(){g&&g.setOption("mode",S)},[g,S]),Object(P.useEffect)(function(){g&&((T!==g.getValue()||T==="")&&setTimeout(function(){g.setValue(T||" ")},300))},[g,T]),Object(P.useEffect)(function(){if(f.current&&!g){var N=m.a.fromTextArea(f.current,Object(ne.a)({mode:S,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));b(N)}},[f.current,g]),x.a.createElement("div",{className:"my-codemirror-container"},x.a.createElement("textarea",{ref:f}))}},"815F":function(Lt,ve,k){"use strict";k.d(ve,"e",function(){return K}),k.d(ve,"c",function(){return r}),k.d(ve,"d",function(){return P}),k.d(ve,"a",function(){return p}),k.d(ve,"f",function(){return m}),k.d(ve,"b",function(){return c});var ne=k("KQm4"),V=k("VTBJ"),I=k("Ff2n"),z=k("Zm9Q"),L=k("Kwbf"),D=k("OZM5");function K(a,s){return a!=null?a:s}function M(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=new Map;function d(l){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(l||[]).forEach(function(n){var O=n.key,C=n.children;Object(L.a)(O!=null,"Tree node must have a certain key: [".concat(i).concat(O,"]"));var T=String(O);Object(L.a)(!s.has(T)||O===null||O===void 0,"Same 'key' exist in the Tree: ".concat(T)),s.set(T,!0),d(C,"".concat(i).concat(T," > "))})}d(a)}function r(a){function s(d){var l=Object(z.a)(d);return l.map(function(i){if(!Object(D.i)(i))return Object(L.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var n=i.key,O=i.props,C=O.children,T=Object(I.a)(O,["children"]),R=Object(V.a)({key:n},T),S=s(C);return S.length&&(R.children=S),R}).filter(function(i){return i})}return s(a)}function P(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],d=new Set(s===!0?[]:s),l=[];function i(n){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return n.map(function(C,T){var R=Object(D.h)(O?O.pos:"0",T),S=K(C.key,R),y=Object(V.a)(Object(V.a)({},C),{},{parent:O,pos:R,children:null,data:C,isStart:[].concat(Object(ne.a)(O?O.isStart:[]),[T===0]),isEnd:[].concat(Object(ne.a)(O?O.isEnd:[]),[T===n.length-1])});return l.push(y),s===!0||d.has(S)?y.children=i(C.children||[],y):y.children=[],y})}return i(a),l}function x(a,s,d){var l;d?typeof d=="string"?l=function(O){return O[d]}:typeof d=="function"&&(l=function(O){return d(O)}):l=function(O,C){return K(O.key,C)};function i(n,O,C){var T=n?n.children:a,R=n?Object(D.h)(C.pos,O):"0";if(n){var S=l(n,R),y={node:n,index:O,pos:R,key:S,parentPos:C.node?C.pos:null,level:C.level+1};s(y)}T&&T.forEach(function(E,f){i(E,f,{node:n,pos:R,level:C?C.level+1:-1})})}i(null)}function p(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=s.initWrapper,l=s.processEntity,i=s.onProcessFinished,n=arguments.length>2?arguments[2]:void 0,O={},C={},T={posEntities:O,keyEntities:C};return d&&(T=d(T)||T),x(a,function(R){var S=R.node,y=R.index,E=R.pos,f=R.key,h=R.parentPos,v=R.level,g={node:S,index:y,key:f,pos:E,level:v},b=K(f,E);O[E]=g,C[b]=g,g.parent=O[h],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),l&&l(g,T)},n),i&&i(T),T}function m(a,s){var d=s.expandedKeys,l=s.selectedKeys,i=s.loadedKeys,n=s.loadingKeys,O=s.checkedKeys,C=s.halfCheckedKeys,T=s.dragOverNodeKey,R=s.dropPosition,S=s.keyEntities,y=S[a],E={eventKey:a,expanded:d.indexOf(a)!==-1,selected:l.indexOf(a)!==-1,loaded:i.indexOf(a)!==-1,loading:n.indexOf(a)!==-1,checked:O.indexOf(a)!==-1,halfChecked:C.indexOf(a)!==-1,pos:String(y?y.pos:""),dragOver:T===a&&R===0,dragOverGapTop:T===a&&R===-1,dragOverGapBottom:T===a&&R===1};return E}function c(a){var s=a.data,d=a.expanded,l=a.selected,i=a.checked,n=a.loaded,O=a.loading,C=a.halfChecked,T=a.dragOver,R=a.dragOverGapTop,S=a.dragOverGapBottom,y=a.pos,E=a.active,f=Object(V.a)(Object(V.a)({},s),{},{expanded:d,selected:l,checked:i,loaded:n,loading:O,halfChecked:C,dragOver:T,dragOverGapTop:R,dragOverGapBottom:S,pos:y,active:E});return"props"in f||Object.defineProperty(f,"props",{get:function(){return Object(L.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(Lt,ve,k){(function(ne){ne(k("VrN/"))})(function(ne){"use strict";ne.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var V=0;V<ne.modeInfo.length;V++){var I=ne.modeInfo[V];I.mimes&&(I.mime=I.mimes[0])}ne.findModeByMIME=function(z){z=z.toLowerCase();for(var L=0;L<ne.modeInfo.length;L++){var D=ne.modeInfo[L];if(D.mime==z)return D;if(D.mimes){for(var K=0;K<D.mimes.length;K++)if(D.mimes[K]==z)return D}}if(/\+xml$/.test(z))return ne.findModeByMIME("application/xml");if(/\+json$/.test(z))return ne.findModeByMIME("application/json")},ne.findModeByExtension=function(z){z=z.toLowerCase();for(var L=0;L<ne.modeInfo.length;L++){var D=ne.modeInfo[L];if(D.ext){for(var K=0;K<D.ext.length;K++)if(D.ext[K]==z)return D}}},ne.findModeByFileName=function(z){for(var L=0;L<ne.modeInfo.length;L++){var D=ne.modeInfo[L];if(D.file&&D.file.test(z))return D}var K=z.lastIndexOf("."),M=K>-1&&z.substring(K+1,z.length);if(M)return ne.findModeByExtension(M)},ne.findModeByName=function(z){z=z.toLowerCase();for(var L=0;L<ne.modeInfo.length;L++){var D=ne.modeInfo[L];if(D.name.toLowerCase()==z)return D;if(D.alias){for(var K=0;K<D.alias.length;K++)if(D.alias[K].toLowerCase()==z)return D}}}})},"8HAY":function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return L}),k.d(ve,"b",function(){return D}),k.d(ve,"d",function(){return K}),k.d(ve,"e",function(){return M}),k.d(ve,"c",function(){return r});var ne=k("MI8n"),V=k("pmY6"),I=k("3/fG"),z=function(P,x,p,m){function c(a){return a instanceof p?a:new p(function(s){s(a)})}return new(p||(p=Promise))(function(a,s){function d(n){try{i(m.next(n))}catch(O){s(O)}}function l(n){try{i(m.throw(n))}catch(O){s(O)}}function i(n){n.done?a(n.value):c(n.value).then(d,l)}i((m=m.apply(P,x||[])).next())})};class L extends V.a{constructor(P,x="",p="",m=!0,c){super();this._onDidChange=this._register(new ne.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=P,this._label=x,this._cssClass=p,this._enabled=m,this._actionCallback=c}get id(){return this._id}get label(){return this._label}set label(P){this._setLabel(P)}_setLabel(P){this._label!==P&&(this._label=P,this._onDidChange.fire({label:P}))}get tooltip(){return this._tooltip||""}set tooltip(P){this._setTooltip(P)}_setTooltip(P){this._tooltip!==P&&(this._tooltip=P,this._onDidChange.fire({tooltip:P}))}get class(){return this._cssClass}set class(P){this._setClass(P)}_setClass(P){this._cssClass!==P&&(this._cssClass=P,this._onDidChange.fire({class:P}))}get enabled(){return this._enabled}set enabled(P){this._setEnabled(P)}_setEnabled(P){this._enabled!==P&&(this._enabled=P,this._onDidChange.fire({enabled:P}))}get checked(){return this._checked}set checked(P){this._setChecked(P)}_setChecked(P){this._checked!==P&&(this._checked=P,this._onDidChange.fire({checked:P}))}run(P,x){return z(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(P))})}}class D extends V.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ne.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ne.b),this.onDidRun=this._onDidRun.event}run(P,x){return z(this,void 0,void 0,function*(){if(!P.enabled)return;this._onBeforeRun.fire({action:P});let p;try{yield this.runAction(P,x)}catch(m){p=m}this._onDidRun.fire({action:P,error:p})})}runAction(P,x){return z(this,void 0,void 0,function*(){yield P.run(x)})}}class K extends L{constructor(P){super(K.ID,P,P?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class M{constructor(P,x,p,m){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=P,this.label=x,this.class=m,this._actions=p}get actions(){return this._actions}dispose(){}run(){return z(this,void 0,void 0,function*(){})}}class r extends L{constructor(){super(r.ID,I.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(Lt,ve,k){Lt.exports={button:"button___1wy9m"}},"9Bee":function(Lt,ve,k){"use strict";var ne=k("DYRE"),V=k("zeV3"),I=k("+L6B"),z=k("2/Rp"),L=k("k1fw"),D=k("9og8"),K=k("tJVT"),M=k("WmNS"),r=k.n(M),P=k("q1tI"),x=k.n(P),p=k("vg9a"),m=k("DlQD"),c=k.n(m),a=k("rUJ1");function s(de,q){var te=de.match(/^(\s+)(?:```)/);if(te===null)return q;var se=te[1];return q.split(`
|
|
`).map(function(pe){var ae=pe.match(/^\s+/);if(ae===null)return pe;var ie=Object(K.a)(ae,1),me=ie[0];return me.length>=se.length?pe.slice(se.length):pe}).join(`
|
|
`)}var d=[],l=["<ul>"],i=new c.a.Renderer,n=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){d.length=0,l=["<ul>"]}var C={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(de,q,te,se){if(q>=de.length||de[q].level<=te)return q;var pe=de[q];se.push("<li><a href='#"+pe.anchor+"'>"+pe.text+"</a>"),q++;var ae=[];return q=T(de,q,pe.level,ae),ae.length>0&&(se.push("<ul>"),ae.forEach(function(ie){se.push(ie)}),se.push("</ul>")),se.push("</li>"),q=T(de,q,te,se),q}function R(){return T(d,0,0,l),l.push("</ul>"),l.join("")}var S={heading:function(q){var te=n.exec(q);if(te)return{type:"heading",raw:te[0],depth:te[1].length,text:te[2]}},fences:function(q){var te=this.rules.block.fences.exec(q);if(te){var se=te[0],pe=s(se,te[3]||""),ae=te[2]?te[2].trim():te[2];if(["latex","katex","math"].indexOf(ae)>=0){var ie=f(),me=pe;pe=ie,h[ie]={type:"block",expression:me}}return{type:"code",raw:se,lang:ae,text:pe}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,f=function(){return"__special_katext_id_".concat(E++,"__")},h={};function v(){return h}function g(){E=0,h={}}function b(de){return de=de.replace(y,function(q,te){var se=f();return h[se]={type:"inline",expression:te},se}),de}var N=i.listitem;i.listitem=function(de){return N(b(de))};var H=i.paragraph;i.paragraph=function(de){return H(b(de))};var A=i.tablecell;i.tablecell=function(de,q){return A(b(de),q)},i.code=function(de,q,te){var se=(q||"").match(/\S*/)[0];return se?["latex","katex","math"].indexOf(se)>=0?"<p class='editormd-tex'>".concat(de,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(q,'">').concat(te?de:Object(a.escape)(de,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(te?de:Object(a.escape)(de,!0))+"</code></pre>"},i.heading=function(de,q,te){var se=this.options.headerPrefix+te.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return d.push({anchor:se,level:q,text:de}),"<h"+q+' id="'+se+'">'+de+"</h"+q+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:S,renderer:i});var F=c.a,U=k("SJMd"),w=k("ulZh"),Y=k.n(w),Z=k("m3rI"),ce=k("Oy/b"),be=k("p5ED"),Ze=k("ErOA"),Ce=k("STEk");/* **********************************
|
|
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 We=function(de,q){return(We=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(te,se){te.__proto__=se}||function(te,se){for(var pe in se)Object.prototype.hasOwnProperty.call(se,pe)&&(te[pe]=se[pe])})(de,q)};function Ve(de,q){if(typeof q!="function"&&q!==null)throw new TypeError("Class extends value "+String(q)+" is not a constructor or null");function te(){this.constructor=de}We(de,q),de.prototype=q===null?Object.create(q):(te.prototype=q.prototype,new te)}function Ye(de,q,te,se){return new(te||(te=Promise))(function(pe,ae){function ie(Ee){try{_e(se.next(Ee))}catch(Le){ae(Le)}}function me(Ee){try{_e(se.throw(Ee))}catch(Le){ae(Le)}}function _e(Ee){var Le;Ee.done?pe(Ee.value):(Le=Ee.value,Le instanceof te?Le:new te(function(at){at(Le)})).then(ie,me)}_e((se=se.apply(de,q||[])).next())})}function we(de,q){var te,se,pe,ae,ie={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return ae={next:me(0),throw:me(1),return:me(2)},typeof Symbol=="function"&&(ae[Symbol.iterator]=function(){return this}),ae;function me(_e){return function(Ee){return function(Le){if(te)throw new TypeError("Generator is already executing.");for(;ie;)try{if(te=1,se&&(pe=2&Le[0]?se.return:Le[0]?se.throw||((pe=se.return)&&pe.call(se),0):se.next)&&!(pe=pe.call(se,Le[1])).done)return pe;switch(se=0,pe&&(Le=[2&Le[0],pe.value]),Le[0]){case 0:case 1:pe=Le;break;case 4:return ie.label++,{value:Le[1],done:!1};case 5:ie.label++,se=Le[1],Le=[0];continue;case 7:Le=ie.ops.pop(),ie.trys.pop();continue;default:if(!(pe=ie.trys,(pe=pe.length>0&&pe[pe.length-1])||Le[0]!==6&&Le[0]!==2)){ie=0;continue}if(Le[0]===3&&(!pe||Le[1]>pe[0]&&Le[1]<pe[3])){ie.label=Le[1];break}if(Le[0]===6&&ie.label<pe[1]){ie.label=pe[1],pe=Le;break}if(pe&&ie.label<pe[2]){ie.label=pe[2],ie.ops.push(Le);break}pe[2]&&ie.ops.pop(),ie.trys.pop();continue}Le=q.call(de,ie)}catch(at){Le=[6,at],se=0}finally{te=pe=0}if(5&Le[0])throw Le[1];return{value:Le[0]?Le[1]:void 0,done:!0}}([_e,Ee])}}}var X=function(){function de(){}return de.addKey=function(q){de.key=q},Object.defineProperty(de,"isLicensed",{get:function(){return!!de.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(de.key)},enumerable:!1,configurable:!0}),de}(),j=function(){function de(){}return de.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},de.setAttributes=function(q,te){for(var se=0,pe=te;se<pe.length;se++){var ae=pe[se],ie=ae[0],me=ae[1];q.setAttribute(ie,me)}},de.createRect=function(q,te,se){var pe=document.createElementNS("http://www.w3.org/2000/svg","rect");return pe.setAttribute("width",q.toString()),pe.setAttribute("height",te.toString()),se&&de.setAttributes(pe,se),pe},de.createLine=function(q,te,se,pe,ae){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",q.toString()),ie.setAttribute("y1",te.toString()),ie.setAttribute("x2",se.toString()),ie.setAttribute("y2",pe.toString()),ae&&de.setAttributes(ie,ae),ie},de.createPolygon=function(q,te){var se=document.createElementNS("http://www.w3.org/2000/svg","polygon");return se.setAttribute("points",q),te&&de.setAttributes(se,te),se},de.createCircle=function(q,te){var se=document.createElementNS("http://www.w3.org/2000/svg","circle");return se.setAttribute("cx",(q/2).toString()),se.setAttribute("cy",(q/2).toString()),se.setAttribute("r",q.toString()),te&&de.setAttributes(se,te),se},de.createEllipse=function(q,te,se){var pe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return pe.setAttribute("cx",(q/2).toString()),pe.setAttribute("cy",(te/2).toString()),pe.setAttribute("rx",(q/2).toString()),pe.setAttribute("ry",(te/2).toString()),se&&de.setAttributes(pe,se),pe},de.createGroup=function(q){var te=document.createElementNS("http://www.w3.org/2000/svg","g");return q&&de.setAttributes(te,q),te},de.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},de.createMarker=function(q,te,se,pe,ae,ie,me){var _e=document.createElementNS("http://www.w3.org/2000/svg","marker");return de.setAttributes(_e,[["id",q],["orient",te],["markerWidth",se.toString()],["markerHeight",pe.toString()],["refX",ae.toString()],["refY",ie.toString()]]),_e.appendChild(me),_e},de.createText=function(q){var te=document.createElementNS("http://www.w3.org/2000/svg","text");return te.setAttribute("x","0"),te.setAttribute("y","0"),q&&de.setAttributes(te,q),te},de.createTSpan=function(q,te){var se=document.createElementNS("http://www.w3.org/2000/svg","tspan");return se.textContent=q,te&&de.setAttributes(se,te),se},de.createImage=function(q){var te=document.createElementNS("http://www.w3.org/2000/svg","image");return q&&de.setAttributes(te,q),te},de.createPoint=function(q,te){var se=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return se.x=q,se.y=te,se},de.createPath=function(q,te){var se=document.createElementNS("http://www.w3.org/2000/svg","path");return se.setAttribute("d",q),te&&de.setAttributes(se,te),se},de.createElement=function(q,te){var se=document.createElementNS("http://www.w3.org/2000/svg",q);return te&&de.setAttributes(se,te),se},de.getHollowRectanglePath=function(q,te,se,pe,ae,ie,me,_e){return"M"+q+","+te+"V"+(te+pe)+"H"+(q+se)+"V"+te+"H"+ae+"V"+ie+"H"+(ae+me)+"V"+(ie+_e)+"H"+ae+"V"+te+"Z"},de}(),W=function(){function de(q){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+q+"_"}return Object.defineProperty(de.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(de.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(de.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),de.prototype.addClass=function(q){return this.styleSheet===void 0&&this.addStyleSheet(),q.name=""+this.classNamePrefix+q.localName,this.classes.push(q),this.styleSheet.sheet.insertRule("."+q.name+" {"+q.style+"}",this.styleSheet.sheet.cssRules.length),q},de.prototype.addRule=function(q){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(q),this.styleSheet.sheet.insertRule(q.selector+" {"+q.style+"}",this.styleSheet.sheet.cssRules.length)},de.prototype.addStyleSheet=function(){var q;this.styleSheet=document.createElement("style"),((q=this.styleSheetRoot)!==null&&q!==void 0?q:document.head).appendChild(this.styleSheet),this.addRule(new Q("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Q("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Q("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new re("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new re("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},de.prototype.removeStyleSheet=function(){var q;this.styleSheet&&(((q=this.styleSheetRoot)!==null&&q!==void 0?q:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},de}(),Q=function(de,q){this.selector=de,this.style=q},re=function(de,q){this.localName=de,this.style=q},G=function(){function de(){this.blocks=[],this.display=""}return de.prototype.addButtonBlock=function(q){q.className=this.blockClassName,q.buttonClassName=this.buttonClassName,q.buttonColorsClassName=this.buttonColorsClassName,q.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(q)},de.prototype.addElementBlock=function(q){q.className===void 0&&(q.className=this.blockClassName),this.blocks.push(q)},de.prototype.getUI=function(){var q=document.createElement("div");return q.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,q.style.display=this.display,this.blocks.forEach(function(te){return q.appendChild(te.getUI())}),q},de}(),xe=function(){function de(){}return de.prototype.getUI=function(){var q=document.createElement("div");if(q.className=this.className,this.minWidth!==void 0&&(q.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":q.style.justifyContent="flex-start";break;case"center":q.style.justifyContent="center";break;case"end":q.style.justifyContent="flex-end"}return q.style.whiteSpace="nowrap",q},de}(),Ie=function(de){function q(){var te=de!==null&&de.apply(this,arguments)||this;return te.buttons=[],te}return Ve(q,de),q.prototype.addButton=function(te){te.className=this.buttonClassName,te.colorsClassName=this.buttonColorsClassName,te.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(te)},q.prototype.getUI=function(){var te=de.prototype.getUI.call(this);return this.buttons.forEach(function(se){return te.appendChild(se.getUI())}),te},q}(xe),tt=function(){function de(q,te){this._isActive=!1,this._isHidden=!1,this._icon=q,this.title=te,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(de.prototype,"icon",{get:function(){return this._icon},set:function(q){this._icon=q,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"isActive",{get:function(){return this._isActive},set:function(q){this._isActive=q,this.adjustClassName()},enumerable:!1,configurable:!0}),de.prototype.getUI=function(){var q=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 q.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},de.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,"")))},de.prototype.hide=function(){this._isHidden=!0},de}(),le=function(de){function q(){var te=de!==null&&de.apply(this,arguments)||this;return te.elements=[],te}return Ve(q,de),q.prototype.addElement=function(te){this.elements.push(te)},q.prototype.getUI=function(){var te=de.prototype.getUI.call(this);return this.elements.forEach(function(se){return te.appendChild(se)}),te},q}(xe),Se=function(){function de(q,te){this.horizontal=q,this.vertical=te}return Object.defineProperty(de.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),de.prototype.getVerticalLength=function(q){return q/this.ratio},de.prototype.getHorizontalLength=function(q){return q*this.ratio},de}(),je=function(){function de(){}return de.getIcon=function(q,te){if(q>0&&te>0){var se=new Se(q,te),pe=se.ratio>=1?20:se.getHorizontalLength(20),ae=se.ratio<1?20:se.getVerticalLength(20),ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ie);var me=j.createDefs();ie.appendChild(me);var _e=j.createElement("clipPath",[["id","text-bg-clip"]]);me.appendChild(_e);var Ee=j.createPath(j.getHollowRectanglePath((24-pe)/2,(24-ae)/2,pe,ae,(24-pe)/2+2,(24-ae)/2+2,pe-4,ae-4));ie.appendChild(Ee);var Le=j.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Le.appendChild(j.createTSpan(q+":"+te)),ie.appendChild(Le);var at=Le.getBBox();j.setAttributes(Le,[["x",((24-at.width)/2).toString()],["y",((24-at.height)/2-at.y).toString()]]);var Ct=j.createPath(j.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(at.width))/2,(24-Math.ceil(at.height))/2,Math.ceil(at.width),Math.ceil(at.height)));return _e.appendChild(Ct),j.setAttributes(Ee,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ie),ie.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>'},de}(),ze=function(de){function q(te,se,pe){var ae=de.call(this,te,se)||this;return ae.isDropdownOpen=!1,ae.onClick=ae.dropdownButtonClicked,ae.dropdownButtons=pe,ae}return Ve(q,de),q.prototype.setupDropdown=function(){var te=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(se){se.className=te.className,se.colorsClassName=te.colorsClassName,te.dropdownBlock.appendChild(se.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},q.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},q.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},q.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},q.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},q.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},q}(tt),yt=function(){function de(q,te){this.GRIP_SIZE=10,this.color=q,this.fillColor=te,this.visual=j.createGroup(),this.visual.appendChild(j.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(j.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return de.prototype.ownsTarget=function(q){return q===this.visual||q===this.visual.childNodes[0]||q===this.visual.childNodes[1]},de.prototype.setCenter=function(q,te){this.visual.childNodes.forEach(function(se){return j.setAttributes(se,[["cx",q.toString()],["cy",te.toString()]])})},de}(),Ot=function(){function de(q,te,se,pe){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=q,this.canvasHeight=te,this.margin=se,this.container=pe,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(de.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(q){this._aspectRatio=q,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(q){this._isGridVisible=q,this.gridContainer&&j.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(q){this._zoomFactor=q,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),de.prototype.open=function(){var q=this;this.cropShadeElement=j.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=j.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var te=0;te<this.numberOfGridLines;te++)this.horizontalGridLines.push(j.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(j.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(se){return q.gridContainer.appendChild(se)}),this.verticalGridLines.forEach(function(se){return q.gridContainer.appendChild(se)}),this.cropRectElement=j.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new yt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new yt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new yt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new yt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},de.prototype.setCropRectangle=function(q){this.cropRect=q;var te=Object.assign({},this.cropRect);this.zoomFactor!==1&&(te.width=this.cropRect.width*this.zoomFactor,te.height=this.cropRect.height*this.zoomFactor,te.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-te.width/2,te.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-te.height/2),j.setAttributes(this.cropRectElement,[["x",te.x.toString()],["y",te.y.toString()],["width",te.width.toString()],["height",te.height.toString()]]);var se=te.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ae,ie){var me=te.y+se*(ie+1);j.setAttributes(ae,[["x1",""+te.x],["y1",""+me],["x2",""+(te.x+te.width)],["y2",""+me]])});var pe=te.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ae,ie){var me=te.x+pe*(ie+1);j.setAttributes(ae,[["x1",""+me],["y1",""+te.y],["x2",""+me],["y2",""+(te.y+te.height)]])}),j.setAttributes(this.cropShadeElement,[["d",j.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,te.x,te.y,te.width,te.height)]]),this.topLeftGrip.setCenter(te.x,te.y),this.topRightGrip.setCenter(te.x+te.width,te.y),this.bottomLeftGrip.setCenter(te.x,te.y+te.height),this.bottomRightGrip.setCenter(te.x+te.width,te.y+te.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},de.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)},de.prototype.clientToLocalCoordinates=function(q,te){var se=this.container.getBoundingClientRect();return{x:q-se.left+this.margin,y:te-se.top+this.margin}},de.prototype.onPointerDown=function(q){this.container.setPointerCapture(q.pointerId),this.previousPoint=this.clientToLocalCoordinates(q.clientX,q.clientY),this.cropRectElement===q.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(q.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(q.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(q.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(q.target)&&(this.activeGrip=this.bottomRightGrip)},de.prototype.onPointerMove=function(q){if(this.isMoving)this.move(this.clientToLocalCoordinates(q.clientX,q.clientY));else if(this.activeGrip){var te=this.clientToLocalCoordinates(q.clientX,q.clientY);this.resize(te)}q.preventDefault()},de.prototype.onPointerUp=function(q){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(q.pointerId)},de.prototype.move=function(q){var te=q.x-this.previousPoint.x,se=q.y-this.previousPoint.y;this.zoomFactor!==1&&(te=-te/this.zoomFactor,se=-se/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+te),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+se),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=q},de.prototype.resize=function(q){var te=Object.assign({},this.cropRect),se=q.x-this.previousPoint.x,pe=q.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:te.x+se<this.margin&&(se=this.margin-te.x),te.x+=se,te.width=this.cropRect.x+this.cropRect.width-te.x;break;case this.bottomRightGrip:case this.topRightGrip:te.width+se>this.canvasWidth*this.zoomFactor&&(se=this.canvasWidth*this.zoomFactor-te.width),te.width+=se}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(te.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(se),te.height=this.aspectRatio.getVerticalLength(te.width)):(te.y+=pe,te.height=this.cropRect.y+this.cropRect.height-te.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?te.height=this.aspectRatio.getVerticalLength(te.width):te.height+=pe}te.width<10&&(te.x=this.cropRect.x,te.width=10),te.height<10&&(te.y=this.cropRect.y,te.height=10),this.previousPoint=q,te.x>=this.margin&&te.y>=this.margin&&te.x-this.margin+te.width<=this.canvasWidth&&te.y-this.margin+te.height<=this.canvasHeight&&(this.cropRect=te,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},de.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var q=this.cropRect.x+this.cropRect.width/2,te=this.cropRect.y+this.cropRect.height/2,se=this.aspectRatio.getHorizontalLength(this.cropRect.height),pe=this.aspectRatio.getVerticalLength(this.cropRect.width);se/this.canvasWidth<pe/this.canvasHeight?this.cropRect.width=se:this.cropRect.height=pe,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=q-this.cropRect.width/2,this.cropRect.y=te-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)}},de.prototype.getRescaledRect=function(q,te,se,pe,ae,ie){var me=se/q,_e=pe/te;return{x:(ae.x-ie)*me+ie,y:(ae.y-ie)*_e+ie,width:ae.width*me,height:ae.height*_e}},de.prototype.scaleCanvas=function(q,te){var se=this.getRescaledRect(this.canvasWidth,this.canvasHeight,q,te,this.cropRect,this.margin);this.canvasWidth=q,this.canvasHeight=te,this.onCropChange&&this.onCropChange(se),this.setCropRectangle(se)},de}(),Ut=function(){function de(q){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=q,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(de.prototype,"angle",{get:function(){return this._angle},set:function(q){this._angle=q,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),de.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},de.prototype.onPointerDown=function(q){this.controlContainer.setPointerCapture(q.pointerId),this.isDragging=!0,this.previousPoint={x:q.clientX,y:q.clientY}},de.prototype.onPointerMove=function(q){this.isDragging&&(this.onAngleChange&&this.onAngleChange((q.clientX-this.previousPoint.x)/5),this.previousPoint.x=q.clientX)},de.prototype.onPointerUp=function(q){this.isDragging&&this.onAngleChange&&this.onAngleChange((q.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(q.pointerId)},de.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var q=this.angleLabelText.getBBox();j.setAttributes(this.angleLabelElement,[["x",((this.width-q.width)/2).toString()],["y",(this.height/2).toString()]])}},de.prototype.positionScaleShape=function(){if(this.scaleShape){var q=this.scaleShape.transform.baseVal.getItem(0);q.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(q,0)}},de.prototype.getVisual=function(){var q=document.createElementNS("http://www.w3.org/2000/svg","svg");q.setAttribute("xmlns","http://www.w3.org/2000/svg"),q.setAttribute("width",this.width+"px"),q.setAttribute("height",this.height+"px"),q.setAttribute("viewBox","0 0 "+this.width+" "+this.height),q.style.flexShrink="0",document.body.appendChild(q);for(var te="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,se=1;se<=this.width/5+10;se++){var pe=se%5==0?this.height/3:this.height/6;te+="h4v"+-pe+"h1v"+pe}te+="v1H0Z",this.scaleShape=j.createPath(te);var ae=j.createTransform();this.scaleShape.transform.baseVal.appendItem(ae),q.appendChild(this.scaleShape),this.angleLabelElement=j.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=j.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ie=j.createTSpan("");return ie.innerHTML="°",this.angleLabelElement.appendChild(ie),q.appendChild(this.angleLabelElement),document.body.removeChild(q),q},de}(),Qe=function(){function de(){this.naturalSize=!1,this.imageType="image/png"}return de.prototype.rasterize=function(q,te,se,pe,ae,ie,me){var _e=this;return new Promise(function(Ee){var Le=document.createElement("canvas");Le.width=q.width.baseVal.value-2*pe,Le.height=q.height.baseVal.value-2*pe;var at=1,Ct=1;_e.naturalSize===!0?(at=te.naturalWidth/(q.width.baseVal.value-2*pe)/ie,Ct=te.naturalHeight/(q.height.baseVal.value-2*pe)/me,Le.width=te.naturalWidth/ie,Le.height=te.naturalHeight/me):_e.width!==void 0&&_e.height!==void 0&&(at=_e.width/se.width,Ct=_e.height/se.height,Le.width*=at,Le.height*=Ct);var Jt=Le.getContext("2d");Jt.translate(Le.width/2,Le.height/2),Jt.rotate(ae*Math.PI/180),Jt.scale(ie,me),Jt.translate(-Le.width/2,-Le.height/2),Jt.drawImage(te,0,0,Le.width,Le.height);var lt=document.createElement("canvas");lt.width=se.width*at,lt.height=se.height*Ct,lt.getContext("2d").putImageData(Jt.getImageData((se.x-pe)*at,(se.y-pe)*Ct,se.width*at,se.height*Ct),0,0),Ee(lt.toDataURL(_e.imageType,_e.imageQuality))})},de}(),Bt=function(){function de(q){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=de.instanceCounter++,this.styles=new W(this.instanceNo),this.target=q,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(de.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(q){this._zoomToCropEnabled=q,q?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(q){this._isGridVisible=q,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"gridLines",{get:function(){return this._gridLines},set:function(q){this._gridLines=q,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(q){this._rotationAngle=q,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"aspectRatio",{get:function(){var q;return(q=this._aspectRatio)!==null&&q!==void 0?q:this.aspectRatios[0]},set:function(q){this._aspectRatio=q},enumerable:!1,configurable:!0}),de.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},de.prototype.show=function(){this.showUI(),this.open()},de.prototype.close=function(q){q===void 0&&(q=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),q||this.closeEventListeners.forEach(function(te){return te()}),this._isOpen=!1)},de.prototype.addRenderEventListener=function(q){this.renderEventListeners.push(q)},de.prototype.removeRenderEventListener=function(q){this.renderEventListeners.indexOf(q)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(q),1)},de.prototype.addCloseEventListener=function(q){this.closeEventListeners.push(q)},de.prototype.removeCloseEventListener=function(q){this.closeEventListeners.indexOf(q)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(q),1)},de.prototype.setupResizeObserver=function(){var q=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){q.resize(q.target.clientWidth,q.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))},de.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var q=1*this.target.clientWidth/this.target.clientHeight,te=this.contentDiv.clientWidth/q>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*q:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,se=te+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/q;this.resize(te,se)}},de.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},de.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",j.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},de.prototype.resize=function(q,te){this.imageWidth=Math.round(q),this.imageHeight=Math.round(te),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()},de.prototype.setEditingTarget=function(){var q=document.createElement("canvas");q.width=this.target.naturalWidth,q.height=this.target.naturalHeight,q.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var te=q.toDataURL();j.setAttributes(this.editingTarget,[["href",te]]),this.setEditingTargetSize()},de.prototype.setTopLeft=function(){var q=this.target.getBoundingClientRect(),te=this.editorCanvas.getBoundingClientRect();this.left=q.left-te.left-this.CANVAS_MARGIN,this.top=q.top-te.top-this.CANVAS_MARGIN},de.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=j.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=j.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=j.createGroup(),this.editingTargetRotationScaleContainer=j.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var q=j.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(q);var te=j.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(te),this.editingTargetContainer=j.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)},de.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},de.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=j.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ot(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()},de.prototype.zoomToCrop=function(){if(this.cropRect){var q=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,te=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=q+"px "+te+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-q+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-te+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},de.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)},de.prototype.cropRectChanged=function(q){this.cropRect=q,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},de.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},de.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"},de.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},de.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 q=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,te=this.target.offsetTop>q+this.CANVAS_MARGIN?this.target.offsetTop-(q+this.CANVAS_MARGIN):0;this.coverDiv.style.top=te+"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},de.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},de.prototype.addTopToolbar=function(){var q=this;this.topToolbar=new G,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 te=new Ie;te.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(te);var se=[];this.aspectRatios.forEach(function(Ct){var Jt=new tt(je.getIcon(Ct.horizontal,Ct.vertical),Ct.horizontal===0&&Ct.vertical===0?"FREE":Ct.horizontal+":"+Ct.vertical);Jt.onClick=function(){return q.ratioButtonClicked(Ct)},se.push(Jt)}),this.aspectRatioButton=new ze(je.getIcon(0,0),"Aspect ratio",se),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,te.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var pe=new tt('<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");pe.isActive=this.isGridVisible,pe.onClick=function(){q.isGridVisible=!q.isGridVisible,pe.isActive=q.isGridVisible},te.addButton(pe);var ae=new tt('<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(ae.isActive=this.zoomToCropEnabled,ae.onClick=function(){q.zoomToCropEnabled=!q.zoomToCropEnabled,ae.isActive=q.zoomToCropEnabled},te.addButton(ae),!X.isLicensed){var ie=new le;this.topToolbar.addElementBlock(ie);var me=document.createElement("div");me.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var _e=document.createElement("a");_e.style.color="currentColor",_e.href="https://markerjs.com/products/cropro",_e.target="_blank",_e.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>',me.appendChild(_e),ie.addElement(me)}var Ee=new Ie;Ee.minWidth=3*this.toolbarHeight+"px",Ee.contentAlign="end",this.topToolbar.addButtonBlock(Ee);var Le=new tt('<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");Le.onClick=this.startRenderAndClose,Ee.addButton(Le),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Le.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var at=new tt('<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");at.onClick=this.close,Ee.addButton(at),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(at.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},de.prototype.addBottomToolbar=function(){var q=this;this.bottomToolbar=new G,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 te=new Ie;te.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(te);var se=new tt('<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");se.onClick=this.rotateLeftButtonClicked,te.addButton(se);var pe=new tt('<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");pe.onClick=this.rotateRightButtonClicked,te.addButton(pe);var ae=new le;ae.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ae),this.straightener=new Ut("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(Ee){q.rotateBy(Ee),q.straightener.angle=q.rotationAngle},ae.addElement(this.straightener.getUI());var ie=new Ie;ie.minWidth=2*this.toolbarHeight+"px",ie.contentAlign="end",this.bottomToolbar.addButtonBlock(ie);var me=new tt('<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");me.onClick=this.flipHorizontallyButtonClicked,ie.addButton(me);var _e=new tt('<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");_e.onClick=this.flipVerticallyButtonClicked,ie.addButton(_e)},de.prototype.ratioButtonClicked=function(q){this.aspectRatio=q,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},de.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=je.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},de.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Se(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},de.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},de.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},de.prototype.restoreState=function(q){if(q){var te=this.cropLayer.getRescaledRect(q.width,q.height,this.imageWidth,this.imageHeight,q.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(te),this.cropRectChanged(te),this.flippedHorizontally=q.flippedHorizontally,this.flippedVertically=q.flippedVertically,this.applyFlip(),this.rotationAngle=q.rotationAngle,this.applyRotation()}},de.prototype.clientToLocalCoordinates=function(q,te){var se=this.cropImage.getBoundingClientRect();return{x:q-se.left,y:te-se.top}},de.prototype.onWindowResize=function(){this.positionUI()},de.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var q=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=q+"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()},de.prototype.rotateLeftButtonClicked=function(){var q=this.rotationAngle-90;this.rotationAngle%90!=0&&(q+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(q)},de.prototype.rotateRightButtonClicked=function(){var q=this.rotationAngle+90;this.rotationAngle%90!=0&&(q-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(q)},de.prototype.rotateTo=function(q){q=(q=q>180?q-360:q)<=-180?q+360:q,this.rotationAngle=q,this.applyRotation()},de.prototype.rotateBy=function(q){this.rotateTo((this.rotationAngle+q)%360)},de.prototype.applyRotation=function(){var q=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var te=this.editingTargetRotationContainer.transform.baseVal.getItem(0);te.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(te,0);var se=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/se.width,this.imageHeight/se.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=q},de.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},de.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},de.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},de.prototype.startRenderAndClose=function(){return Ye(this,void 0,void 0,function(){var q,te;return we(this,function(se){switch(se.label){case 0:return[4,this.render()];case 1:return q=se.sent(),te=this.getState(),this.renderEventListeners.forEach(function(pe){return pe(q,te)}),this.close(!0),[2]}})})},de.prototype.render=function(){return Ye(this,void 0,void 0,function(){var q;return we(this,function(te){switch(te.label){case 0:return(q=new Qe).naturalSize=this.renderAtNaturalSize,q.imageType=this.renderImageType,q.imageQuality=this.renderImageQuality,q.width=this.renderWidth,q.height=this.renderHeight,this.unzoomFromCrop(),j.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,q.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 te.sent(),[4,q.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,te.sent()]}})})},de.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new re("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 re("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new re("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var q=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new re("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*q)+`px;
|
|
height: `+(this.toolbarHeight-2*q)+`px;
|
|
padding: `+q+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new re("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new re("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new Q("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Q("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new re("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 re("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new re("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 re("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*q)+`px;
|
|
padding: `+q+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new re("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},de.instanceCounter=0,de}(),ln=k("8hTe"),Ke=k.n(ln),He=/<pre[^>]*>/g;function ct(de){var q=document.createElement("div");return q.innerHTML=de,q.childNodes.length===0?"":q.childNodes[0].nodeValue}var bt=ve.a=function(de){var q=de.value,te=q===void 0?"":q,se=de.edit,pe=se===void 0?!1:se,ae=de.className,ie=de.showTextOnly,me=de.showLines,_e=de.replaces,Ee=de.zoomImg,Le=de.hasMask,at=de.style,Ct=at===void 0?{}:at,Jt=de.stylesPrev,lt=Jt===void 0?{}:Jt,Un=String(te),Cn=Object(P.useRef)(),vn=Object(P.useRef)(),er=Object(P.useState)(""),kn=Object(K.a)(er,2),Yn=kn[0],vr=kn[1],Mn=Object(P.useState)("office"),Zn=Object(K.a)(Mn,2),dr=Zn[0],jt=Zn[1],Ft=function(){var Hn=new Bt(vn.current);Hn.displayMode="popup",Hn.addRenderEventListener(function(){var lr=Object(D.a)(r.a.mark(function Sn(zn){var tr;return r.a.wrap(function(Ar){for(;;)switch(Ar.prev=Ar.next){case 0:return Cn.current.style.display="none",Ar.next=3,Object(Ze.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:zn}});case 3:tr=Ar.sent,tr!=null&&tr.id&&_e(vn.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(tr==null?void 0:tr.id,"?type=").concat(tr.content_type));case 5:case"end":return Ar.stop()}},Sn)}));return function(Sn){return lr.apply(this,arguments)}}()),Hn.show()},zt=function(){var Hn=new Ce.a(vn.current);Hn.settings.displayMode="popup",Hn.addEventListener("render",function(){var lr=Object(D.a)(r.a.mark(function Sn(zn){var tr;return r.a.wrap(function(Ar){for(;;)switch(Ar.prev=Ar.next){case 0:if(Cn.current.style.display="none",!vn.current){Ar.next=6;break}return Ar.next=4,Object(Ze.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:zn.dataUrl}});case 4:tr=Ar.sent,tr!=null&&tr.id&&_e(vn.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(tr==null?void 0:tr.id,"?type=").concat(tr.content_type));case 6:case"end":return Ar.stop()}},Sn)}));return function(Sn){return lr.apply(this,arguments)}}()),Hn.show(),window.markerArea=Hn},dn=Object(P.useMemo)(function(){Cn.current&&(Cn.current.style.zIndex=-1);try{var Qt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Hn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,lr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Un=Un.replace(Qt,"("+Z.a.API_SERVER+"/api/attachments/").replace(Hn,'"'+Z.a.API_SERVER+"/api/attachments/").replace(lr,'"'+Z.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(Gr){}var Sn=F(Un),zn=v();if(Un.match(/\[TOC\]/)&&(Sn=Sn.replace("<p>[TOC]</p>",R()),O()),Sn=Sn.replace(/(__special_katext_id_\d+__)/g,function(Gr,Ar){var Yt=zn[Ar],Vn=Yt.type,vi=Yt.expression;return Object(ce.renderToString)(ct(vi)||"",{displayMode:Vn==="block",throwOnError:!1,output:"html"})}),Sn=Sn.replace(/▁/g,"\u2581\u2581\u2581"),g(),ie){var tr=document.createElement("div");return tr.innerHTML=Sn,tr.innerText}return setTimeout(function(){return _r()},500),Sn},[Un]),yn=Object(P.useRef)();C.WebkitLineClamp=me,me&&(Ct=Object(L.a)(Object(L.a)({},Ct),C));function bn(Qt){var Hn=Qt.target;if(Hn.tagName.toUpperCase()==="IMG"){if(Ee){var lr=Hn.getAttribute("src");vr(lr),jt("image")}}else if(Hn.tagName.toUpperCase()==="A"){var Sn=Hn.getAttribute("href");if(Sn.indexOf("office")>-1)Qt.preventDefault(),vr(Sn),jt("office");else if(Sn.indexOf("application/pdf")>-1)Qt.preventDefault(),vr(Sn),jt("pdf");else if(Sn.indexOf("text/html")>-1)Qt.preventDefault(),vr(Sn),jt("html");else if(Sn.startsWith("#")){Qt.preventDefault();var zn=document.getElementById(Sn.replace("#",""));zn&&zn.scrollIntoView(!0)}}}var _r=function(){var Hn,lr=(Hn=yn.current)===null||Hn===void 0?void 0:Hn.querySelectorAll("video");lr==null||lr.forEach(function(Sn){if(Sn.oncontextmenu=function(){return!1},Sn.src.indexOf(".m3u8")>-1&&!Sn.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var zn=new Y.a;zn.loadSource(Sn.src),zn.attachMedia(Sn)}}})};Object(P.useEffect)(function(){if(yn.current&&dn&&(dn.match(He)&&window.PR.prettyPrint()),yn.current)return yn.current.addEventListener("click",bn),function(){yn.current.removeEventListener("click",bn),g(),O()}},[dn,yn.current,bn]);var Bn=function(Hn){if(!pe)return;Hn.target.nodeName==="IMG"?(Cn.current.style.zIndex=1,Cn.current.style.display="flex",Cn.current.style.width=Hn.target.clientWidth+"px",Cn.current.style.height=Hn.target.clientHeight+"px",Cn.current.style.top=Hn.target.offsetTop+"px",Cn.current.style.left=Hn.target.offsetLeft+"px",vn.current.src=Hn.target.getAttribute("src")):Cn.current.style.display="none"};return x.a.createElement("div",{style:{position:"relative"}},x.a.createElement("div",{ref:yn,style:Object(L.a)({},Ct),className:"".concat(ae||""," markdown-body ").concat(Ke.a.mdBody),onMouseOver:Bn,dangerouslySetInnerHTML:{__html:dn}}),x.a.createElement("div",{ref:Cn,className:Ke.a.button},x.a.createElement(V.a,null,x.a.createElement(z.a,{onClick:function(){return Ft()}},"\u88C1\u526A"),x.a.createElement(z.a,{onClick:function(){return zt()}},"\u7F16\u8F91"))),x.a.createElement("img",{ref:vn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),x.a.createElement(be.a,{close:!0,data:Yn,type:Yn!=null&&Yn.length?dr:"",style:Object(L.a)({},lt),onClose:function(){return vr("")}}))}},"9VGf":function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return I});var ne=k("q1tI"),V=k.n(ne);function I(z,L){var D=Object(ne.useRef)();Object(ne.useEffect)(function(){D.current=z}),Object(ne.useEffect)(function(){function K(){D.current()}if(L!==null){var M=setInterval(K,L);return function(){return clearInterval(M)}}},[L])}},AHFd:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return M});var ne=k("giR+"),V=k("fyUT"),I=k("OaEy"),z=k("2fM7"),L=k("tJVT"),D=k("q1tI"),K=k.n(D),M;(function(P){P[P.Number=1]="Number",P[P.Percent=2]="Percent"})(M||(M={}));var r=function(x){var p=x.value,m=x.onChange,c=x.disabled,a=x.hidePercentOption,s=a===void 0?!1:a,d=Object(D.useMemo)(function(){return s?M.Number:M.Percent},[s]),l=Object(D.useState)(d),i=Object(L.a)(l,2),n=i[0],O=i[1],C=Object(D.useCallback)(function(R){return n===M.Number?"".concat(R,"\u5206"):"".concat(R,"%")},[n]),T=Object(D.useCallback)(function(R){if(n===M.Number){var S=R.replace("\u5206","");return isNaN(parseInt(S,10))?0:S}else{var y=R.replace("%","");return y}},[n]);return Object(D.useEffect)(function(){O(p.type)},[p]),K.a.createElement("div",{style:{display:"inline-block"}},K.a.createElement(z.a,{onChange:function(S){O(S),m({type:S,inputValue:S===M.Number?5:20})},value:n||d,style:{width:100},options:s?[{label:"\u5206\u503C",value:M.Number}]:[{label:"\u767E\u5206\u6BD4",value:M.Percent},{label:"\u5206\u503C",value:M.Number}],disabled:c}),K.a.createElement(V.a,{disabled:c,value:p.inputValue,formatter:C,parser:T,max:n===M.Percent?100:Number.MAX_SAFE_INTEGER,min:0,precision:0,onChange:function(S){m({type:n,inputValue:S})}}))};ve.b=r},BU3w:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return D});var ne=k("MNnm"),V="rc-util-key";function I(K){if(K.attachTo)return K.attachTo;var M=document.querySelector("head");return M||document.body}function z(K){var M,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var P=document.createElement("style");if((M=r.csp)===null||M===void 0?void 0:M.nonce){var x;P.nonce=(x=r.csp)===null||x===void 0?void 0:x.nonce}P.innerHTML=K;var p=I(r),m=p.firstChild;return r.prepend&&p.prepend?p.prepend(P):r.prepend&&m?p.insertBefore(P,m):p.appendChild(P),P}var L=new Map;function D(K,M){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=I(r);if(!L.has(P)){var x=z("",r),p=x.parentNode;L.set(P,p),p.removeChild(x)}var m=Array.from(L.get(P).children).find(function(l){return l.tagName==="STYLE"&&l[V]===M});if(m){var c,a;if(((c=r.csp)===null||c===void 0?void 0:c.nonce)&&m.nonce!==((a=r.csp)===null||a===void 0?void 0:a.nonce)){var s;m.nonce=(s=r.csp)===null||s===void 0?void 0:s.nonce}return m.innerHTML!==K&&(m.innerHTML=K),m}var d=z(K,r);return d[V]=M,d}},Bd2K:function(Lt,ve,k){(function(ne){ne(k("VrN/"),k("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(r,P,x){if(x!=ne.Init&&x&&r.removeKeyMap("autoCloseTags"),!P)return;var p={name:"autoCloseTags"};(typeof P!="object"||P.whenClosing!==!1)&&(p["'/'"]=function(m){return D(m)}),(typeof P!="object"||P.whenOpening!==!1)&&(p["'>'"]=function(m){return z(m)}),r.addKeyMap(p)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],I=["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(r){if(r.getOption("disableInput"))return ne.Pass;for(var P=r.listSelections(),x=[],p=r.getOption("autoCloseTags"),m=0;m<P.length;m++){if(!P[m].empty())return ne.Pass;var c=P[m].head,a=r.getTokenAt(c),s=ne.innerMode(r.getMode(),a.state),d=s.state,l=s.mode.xmlCurrentTag&&s.mode.xmlCurrentTag(d),i=l&&l.name;if(!i)return ne.Pass;var n=s.mode.configuration=="html",O=typeof p=="object"&&p.dontCloseTags||n&&V,C=typeof p=="object"&&p.indentTags||n&&I;a.end>c.ch&&(i=i.slice(0,i.length-a.end+c.ch));var T=i.toLowerCase();if(!i||a.type=="string"&&(a.end!=c.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||a.string.length==1)||a.type=="tag"&&l.close||a.string.indexOf("/")==c.ch-a.start-1||O&&K(O,T)>-1||M(r,s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(d)||[],i,c,!0))return ne.Pass;var R=typeof p=="object"&&p.emptyTags;if(R&&K(R,i)>-1){x[m]={text:"/>",newPos:ne.Pos(c.line,c.ch+2)};continue}var S=C&&K(C,T)>-1;x[m]={indent:S,text:">"+(S?`
|
|
|
|
`:"")+"</"+i+">",newPos:S?ne.Pos(c.line+1,0):ne.Pos(c.line,c.ch+1)}}for(var y=typeof p=="object"&&p.dontIndentOnAutoClose,m=P.length-1;m>=0;m--){var E=x[m];r.replaceRange(E.text,P[m].head,P[m].anchor,"+insert");var f=r.listSelections().slice(0);f[m]={head:E.newPos,anchor:E.newPos},r.setSelections(f),!y&&E.indent&&(r.indentLine(E.newPos.line,null,!0),r.indentLine(E.newPos.line+1,null,!0))}}function L(r,P){for(var x=r.listSelections(),p=[],m=P?"/":"</",c=r.getOption("autoCloseTags"),a=typeof c=="object"&&c.dontIndentOnSlash,s=0;s<x.length;s++){if(!x[s].empty())return ne.Pass;var d=x[s].head,l=r.getTokenAt(d),i=ne.innerMode(r.getMode(),l.state),n=i.state;if(P&&(l.type=="string"||l.string.charAt(0)!="<"||l.start!=d.ch-1))return ne.Pass;var O,C=i.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(C&&i.mode.name=="javascript")O=m+"script";else if(C&&i.mode.name=="css")O=m+"style";else{var T=i.mode.xmlCurrentContext&&i.mode.xmlCurrentContext(n);if(!T||T.length&&M(r,T,T[T.length-1],d))return ne.Pass;O=m+T[T.length-1]}r.getLine(d.line).charAt(l.end)!=">"&&(O+=">"),p[s]=O}if(r.replaceSelections(p),x=r.listSelections(),!a)for(var s=0;s<x.length;s++)(s==x.length-1||x[s].head.line<x[s+1].head.line)&&r.indentLine(x[s].head.line)}function D(r){return r.getOption("disableInput")?ne.Pass:L(r,!0)}ne.commands.closeTag=function(r){return L(r)};function K(r,P){if(r.indexOf)return r.indexOf(P);for(var x=0,p=r.length;x<p;++x)if(r[x]==P)return x;return-1}function M(r,P,x,p,m){if(!ne.scanForClosingTag)return!1;var c=Math.min(r.lastLine()+1,p.line+500),a=ne.scanForClosingTag(r,p,null,c);if(!a||a.tag!=x)return!1;for(var s=m?1:0,d=P.length-1;d>=0&&P[d]==x;d--)++s;p=a.to;for(var d=1;d<s;d++){var l=ne.scanForClosingTag(r,p,null,c);if(!l||l.tag!=x)return!1;p=l.to}return!0}})},BdwD:function(Lt,ve,k){"use strict";var ne=k("+L6B"),V=k("2/Rp"),I=k("0Owb"),z=k("k1fw"),L=k("q1tI"),D=k.n(L),K=k("FOrL"),M=k.n(K),r=function(x){var p=x.buttonProps,m=p===void 0?{}:p,c=x.styles,a=c===void 0?{}:c,s=x.imgStyles,d=s===void 0?{}:s,l=x.customText,i=x.ButtonText,n=x.ButtonClick,O=x.Buttonclass,C=x.ButtonTwo;return D.a.createElement("section",{className:"tc animated fadeIn",style:Object(z.a)(Object(z.a)({},{color:"#999",margin:"0 auto",padding:"100px 0"}),a)},D.a.createElement("img",{src:M.a,style:Object(z.a)(Object(z.a)({},{width:"200px",height:"150px"}),d)}),D.a.createElement("p",{className:"mt10 font14"},l||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),i&&D.a.createElement(V.a,Object(I.a)({className:O,onClick:n},m),i),C&&C)};ve.a=r},BjJ7:function(Lt,ve,k){"use strict";k.d(ve,"d",function(){return V}),k.d(ve,"c",function(){return I}),k.d(ve,"e",function(){return z}),k.d(ve,"b",function(){return L}),k.d(ve,"a",function(){return K});var ne=k("m3rI");function V(M){var r=!0;if(M.length>0){for(var P=0;P<M.length;P++)if(M[P].compile_success==0||!M[P].compile_success){r=!1;break}}else r=!1;return r}function I(M){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",P=[],x=0;x<M.length;x++){var p=M[x],m=r?"".concat(r,"/").concat(p.name):"".concat(p.name);P.push({title:p.name,isLeaf:!(p.type==="tree"),key:m})}return P}function z(M,r,P){for(var x=0;x<M.length;x++){var p=M[x];if(p.key===r){p.children=P;break}p.children&&z(p.children,r,P)}return M}function L(M,r,P){var x;return function(){var p=this,m=arguments,c=function(){x=null,P||M.apply(p,m)},a=P&&!x;clearTimeout(x),x=setTimeout(c,r),a&&M.apply(p,m)}}var D=!0,K=ne.a.API_SERVER},"C+DQ":function(Lt,ve,k){},"C/vA":function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return ne});function ne(V){const I=this;let z=!1,L;return function(){return z||(z=!0,L=V.apply(I,arguments)),L}}},"Cg/j":function(Lt,ve,k){"use strict";k.d(ve,"b",function(){return ne}),k.d(ve,"a",function(){return V}),k.d(ve,"c",function(){return z}),k.d(ve,"d",function(){return L});var ne;(function(D){D.serviceIds=new Map,D.DI_TARGET="$di$target",D.DI_DEPENDENCIES="$di$dependencies";function K(M){return M[D.DI_DEPENDENCIES]||[]}D.getServiceDependencies=K})(ne||(ne={}));const V=z("instantiationService");function I(D,K,M,r){K[ne.DI_TARGET]===K?K[ne.DI_DEPENDENCIES].push({id:D,index:M,optional:r}):(K[ne.DI_DEPENDENCIES]=[{id:D,index:M,optional:r}],K[ne.DI_TARGET]=K)}function z(D){if(ne.serviceIds.has(D))return ne.serviceIds.get(D);const K=function(M,r,P){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");I(K,M,P,!1)};return K.toString=()=>D,ne.serviceIds.set(D,K),K}function L(D){return function(K,M,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");I(D,K,r,!0)}}},DlQD:function(Lt,ve,k){(function(ne,V){Lt.exports=V()})(this,function(){"use strict";function ne(te,se){for(var pe=0;pe<se.length;pe++){var ae=se[pe];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(te,ae.key,ae)}}function V(te,se,pe){return se&&ne(te.prototype,se),pe&&ne(te,pe),te}function I(te,se){if(!te)return;if(typeof te=="string")return z(te,se);var pe=Object.prototype.toString.call(te).slice(8,-1);if(pe==="Object"&&te.constructor&&(pe=te.constructor.name),pe==="Map"||pe==="Set")return Array.from(te);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return z(te,se)}function z(te,se){(se==null||se>te.length)&&(se=te.length);for(var pe=0,ae=new Array(se);pe<se;pe++)ae[pe]=te[pe];return ae}function L(te,se){var pe;if(typeof Symbol=="undefined"||te[Symbol.iterator]==null){if(Array.isArray(te)||(pe=I(te))||se&&te&&typeof te.length=="number"){pe&&(te=pe);var ae=0;return function(){return ae>=te.length?{done:!0}:{done:!1,value:te[ae++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return pe=te[Symbol.iterator](),pe.next.bind(pe)}function D(te,se){return se={exports:{}},te(se,se.exports),se.exports}var K=D(function(te){function se(){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 pe(ae){te.exports.defaults=ae}te.exports={defaults:se(),getDefaults:se,changeDefaults:pe}}),M=K.defaults,r=K.getDefaults,P=K.changeDefaults,x=/[&<>"']/,p=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,a={"&":"&","<":"<",">":">",'"':""","'":"'"},s=function(se){return a[se]};function d(te,se){if(se){if(x.test(te))return te.replace(p,s)}else if(m.test(te))return te.replace(c,s);return te}var l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(te){return te.replace(l,function(se,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var n=/(^|[^\[])\^/g;function O(te,se){te=te.source||te,se=se||"";var pe={replace:function(ie,me){return me=me.source||me,me=me.replace(n,"$1"),te=te.replace(ie,me),pe},getRegex:function(){return new RegExp(te,se)}};return pe}var C=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(te,se,pe){if(te){var ae;try{ae=decodeURIComponent(i(pe)).replace(C,"").toLowerCase()}catch(ie){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}se&&!T.test(pe)&&(pe=h(se,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch(ie){return null}return pe}var S={},y=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(te,se){S[" "+te]||(y.test(te)?S[" "+te]=te+"/":S[" "+te]=N(te,"/",!0)),te=S[" "+te];var pe=te.indexOf(":")===-1;return se.substring(0,2)==="//"?pe?se:te.replace(E,"$1")+se:se.charAt(0)==="/"?pe?se:te.replace(f,"$1")+se:te+se}var v={exec:function(){}};function g(te){for(var se=1,pe,ae;se<arguments.length;se++){pe=arguments[se];for(ae in pe)Object.prototype.hasOwnProperty.call(pe,ae)&&(te[ae]=pe[ae])}return te}function b(te,se){var pe=te.replace(/\|/g,function(me,_e,Ee){for(var Le=!1,at=_e;--at>=0&&Ee[at]==="\\";)Le=!Le;return Le?"|":" |"}),ae=pe.split(/ \|/),ie=0;if(ae.length>se)ae.splice(se);else for(;ae.length<se;)ae.push("");for(;ie<ae.length;ie++)ae[ie]=ae[ie].trim().replace(/\\\|/g,"|");return ae}function N(te,se,pe){var ae=te.length;if(ae===0)return"";for(var ie=0;ie<ae;){var me=te.charAt(ae-ie-1);if(me===se&&!pe)ie++;else if(me!==se&&pe)ie++;else break}return te.substr(0,ae-ie)}function H(te,se){if(te.indexOf(se[1])===-1)return-1;for(var pe=te.length,ae=0,ie=0;ie<pe;ie++)if(te[ie]==="\\")ie++;else if(te[ie]===se[0])ae++;else if(te[ie]===se[1]&&(ae--,ae<0))return ie;return-1}function A(te){te&&te.sanitize&&!te.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var F={escape:d,unescape:i,edit:O,cleanUrl:R,resolveUrl:h,noopTest:v,merge:g,splitCells:b,rtrim:N,findClosingBracket:H,checkSanitizeDeprecation:A},U=K.defaults,w=F.rtrim,Y=F.splitCells,Z=F.escape,ce=F.findClosingBracket;function be(te,se,pe){var ae=se.href,ie=se.title?Z(se.title):null,me=te[1].replace(/\\([\[\]])/g,"$1");return te[0].charAt(0)!=="!"?{type:"link",raw:pe,href:ae,title:ie,text:me}:{type:"image",raw:pe,href:ae,title:ie,text:Z(me)}}function Ze(te,se){var pe=te.match(/^(\s+)(?:```)/);if(pe===null)return se;var ae=pe[1];return se.split(`
|
|
`).map(function(ie){var me=ie.match(/^\s+/);if(me===null)return ie;var _e=me[0];return _e.length>=ae.length?ie.slice(ae.length):ie}).join(`
|
|
`)}var Ce=function(){function te(pe){this.options=pe||U}var se=te.prototype;return se.space=function(ae){var ie=this.rules.block.newline.exec(ae);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
|
|
`}},se.code=function(ae,ie){var me=this.rules.block.code.exec(ae);if(me){var _e=ie[ie.length-1];if(_e&&_e.type==="paragraph")return{raw:me[0],text:me[0].trimRight()};var Ee=me[0].replace(/^ {4}/gm,"");return{type:"code",raw:me[0],codeBlockStyle:"indented",text:this.options.pedantic?Ee:w(Ee,`
|
|
`)}}},se.fences=function(ae){var ie=this.rules.block.fences.exec(ae);if(ie){var me=ie[0],_e=Ze(me,ie[3]||"");return{type:"code",raw:me,lang:ie[2]?ie[2].trim():ie[2],text:_e}}},se.heading=function(ae){var ie=this.rules.block.heading.exec(ae);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},se.nptable=function(ae){var ie=this.rules.block.nptable.exec(ae);if(ie){var me={type:"table",header:Y(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ie[0]};if(me.header.length===me.align.length){var _e=me.align.length,Ee;for(Ee=0;Ee<_e;Ee++)/^ *-+: *$/.test(me.align[Ee])?me.align[Ee]="right":/^ *:-+: *$/.test(me.align[Ee])?me.align[Ee]="center":/^ *:-+ *$/.test(me.align[Ee])?me.align[Ee]="left":me.align[Ee]=null;for(_e=me.cells.length,Ee=0;Ee<_e;Ee++)me.cells[Ee]=Y(me.cells[Ee],me.header.length);return me}}},se.hr=function(ae){var ie=this.rules.block.hr.exec(ae);if(ie)return{type:"hr",raw:ie[0]}},se.blockquote=function(ae){var ie=this.rules.block.blockquote.exec(ae);if(ie){var me=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:me}}},se.list=function(ae){var ie=this.rules.block.list.exec(ae);if(ie){for(var me=ie[0],_e=ie[2],Ee=_e.length>1,Le=_e[_e.length-1]===")",at={type:"list",raw:me,ordered:Ee,start:Ee?+_e.slice(0,-1):"",loose:!1,items:[]},Ct=ie[0].match(this.rules.block.item),Jt=!1,lt,Un,Cn,vn,er,kn,Yn,vr=Ct.length,Mn=0;Mn<vr;Mn++)lt=Ct[Mn],me=lt,Un=lt.length,lt=lt.replace(/^ *([*+-]|\d+[.)]) */,""),~lt.indexOf(`
|
|
`)&&(Un-=lt.length,lt=this.options.pedantic?lt.replace(/^ {1,4}/gm,""):lt.replace(new RegExp("^ {1,"+Un+"}","gm"),"")),Mn!==vr-1&&(Cn=this.rules.block.bullet.exec(Ct[Mn+1])[0],(Ee?Cn.length===1||!Le&&Cn[Cn.length-1]===")":Cn.length>1||this.options.smartLists&&Cn!==_e)&&(vn=Ct.slice(Mn+1).join(`
|
|
`),at.raw=at.raw.substring(0,at.raw.length-vn.length),Mn=vr-1)),er=Jt||/\n\n(?!\s*$)/.test(lt),Mn!==vr-1&&(Jt=lt.charAt(lt.length-1)===`
|
|
`,er||(er=Jt)),er&&(at.loose=!0),kn=/^\[[ xX]\] /.test(lt),Yn=void 0,kn&&(Yn=lt[1]!==" ",lt=lt.replace(/^\[[ xX]\] +/,"")),at.items.push({type:"list_item",raw:me,task:kn,checked:Yn,loose:er,text:lt});return at}},se.html=function(ae){var ie=this.rules.block.html.exec(ae);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):Z(ie[0]):ie[0]}},se.def=function(ae){var ie=this.rules.block.def.exec(ae);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var me=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:me,raw:ie[0],href:ie[2],title:ie[3]}}},se.table=function(ae){var ie=this.rules.block.table.exec(ae);if(ie){var me={type:"table",header:Y(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[]};if(me.header.length===me.align.length){me.raw=ie[0];var _e=me.align.length,Ee;for(Ee=0;Ee<_e;Ee++)/^ *-+: *$/.test(me.align[Ee])?me.align[Ee]="right":/^ *:-+: *$/.test(me.align[Ee])?me.align[Ee]="center":/^ *:-+ *$/.test(me.align[Ee])?me.align[Ee]="left":me.align[Ee]=null;for(_e=me.cells.length,Ee=0;Ee<_e;Ee++)me.cells[Ee]=Y(me.cells[Ee].replace(/^ *\| *| *\| *$/g,""),me.header.length);return me}}},se.lheading=function(ae){var ie=this.rules.block.lheading.exec(ae);if(ie)return{type:"heading",raw:ie[0],depth:ie[2].charAt(0)==="="?1:2,text:ie[1]}},se.paragraph=function(ae){var ie=this.rules.block.paragraph.exec(ae);if(ie)return{type:"paragraph",raw:ie[0],text:ie[1].charAt(ie[1].length-1)===`
|
|
`?ie[1].slice(0,-1):ie[1]}},se.text=function(ae,ie){var me=this.rules.block.text.exec(ae);if(me){var _e=ie[ie.length-1];return _e&&_e.type==="text"?{raw:me[0],text:me[0]}:{type:"text",raw:me[0],text:me[0]}}},se.escape=function(ae){var ie=this.rules.inline.escape.exec(ae);if(ie)return{type:"escape",raw:ie[0],text:Z(ie[1])}},se.tag=function(ae,ie,me){var _e=this.rules.inline.tag.exec(ae);if(_e)return!ie&&/^<a /i.test(_e[0])?ie=!0:ie&&/^<\/a>/i.test(_e[0])&&(ie=!1),!me&&/^<(pre|code|kbd|script)(\s|>)/i.test(_e[0])?me=!0:me&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(_e[0])&&(me=!1),{type:this.options.sanitize?"text":"html",raw:_e[0],inLink:ie,inRawBlock:me,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_e[0]):Z(_e[0]):_e[0]}},se.link=function(ae){var ie=this.rules.inline.link.exec(ae);if(ie){var me=ce(ie[2],"()");if(me>-1){var _e=ie[0].indexOf("!")===0?5:4,Ee=_e+ie[1].length+me;ie[2]=ie[2].substring(0,me),ie[0]=ie[0].substring(0,Ee).trim(),ie[3]=""}var Le=ie[2],at="";if(this.options.pedantic){var Ct=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);Ct?(Le=Ct[1],at=Ct[3]):at=""}else at=ie[3]?ie[3].slice(1,-1):"";Le=Le.trim().replace(/^<([\s\S]*)>$/,"$1");var Jt=be(ie,{href:Le&&Le.replace(this.rules.inline._escapes,"$1"),title:at&&at.replace(this.rules.inline._escapes,"$1")},ie[0]);return Jt}},se.reflink=function(ae,ie){var me;if((me=this.rules.inline.reflink.exec(ae))||(me=this.rules.inline.nolink.exec(ae))){var _e=(me[2]||me[1]).replace(/\s+/g," ");if(_e=ie[_e.toLowerCase()],!_e||!_e.href){var Ee=me[0].charAt(0);return{type:"text",raw:Ee,text:Ee}}var Le=be(me,_e,me[0]);return Le}},se.strong=function(ae,ie,me){me===void 0&&(me="");var _e=this.rules.inline.strong.start.exec(ae);if(_e&&(!_e[1]||_e[1]&&(me===""||this.rules.inline.punctuation.exec(me)))){ie=ie.slice(-1*ae.length);var Ee=_e[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ee.lastIndex=0;for(var Le;(_e=Ee.exec(ie))!=null;)if(Le=this.rules.inline.strong.middle.exec(ie.slice(0,_e.index+3)),Le)return{type:"strong",raw:ae.slice(0,Le[0].length),text:ae.slice(2,Le[0].length-2)}}},se.em=function(ae,ie,me){me===void 0&&(me="");var _e=this.rules.inline.em.start.exec(ae);if(_e&&(!_e[1]||_e[1]&&(me===""||this.rules.inline.punctuation.exec(me)))){ie=ie.slice(-1*ae.length);var Ee=_e[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ee.lastIndex=0;for(var Le;(_e=Ee.exec(ie))!=null;)if(Le=this.rules.inline.em.middle.exec(ie.slice(0,_e.index+2)),Le)return{type:"em",raw:ae.slice(0,Le[0].length),text:ae.slice(1,Le[0].length-1)}}},se.codespan=function(ae){var ie=this.rules.inline.code.exec(ae);if(ie){var me=ie[2].replace(/\n/g," "),_e=/[^ ]/.test(me),Ee=me.startsWith(" ")&&me.endsWith(" ");return _e&&Ee&&(me=me.substring(1,me.length-1)),me=Z(me,!0),{type:"codespan",raw:ie[0],text:me}}},se.br=function(ae){var ie=this.rules.inline.br.exec(ae);if(ie)return{type:"br",raw:ie[0]}},se.del=function(ae){var ie=this.rules.inline.del.exec(ae);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},se.autolink=function(ae,ie){var me=this.rules.inline.autolink.exec(ae);if(me){var _e,Ee;return me[2]==="@"?(_e=Z(this.options.mangle?ie(me[1]):me[1]),Ee="mailto:"+_e):(_e=Z(me[1]),Ee=_e),{type:"link",raw:me[0],text:_e,href:Ee,tokens:[{type:"text",raw:_e,text:_e}]}}},se.url=function(ae,ie){var me;if(me=this.rules.inline.url.exec(ae)){var _e,Ee;if(me[2]==="@")_e=Z(this.options.mangle?ie(me[0]):me[0]),Ee="mailto:"+_e;else{var Le;do Le=me[0],me[0]=this.rules.inline._backpedal.exec(me[0])[0];while(Le!==me[0]);_e=Z(me[0]),me[1]==="www."?Ee="http://"+_e:Ee=_e}return{type:"link",raw:me[0],text:_e,href:Ee,tokens:[{type:"text",raw:_e,text:_e}]}}},se.inlineText=function(ae,ie,me){var _e=this.rules.inline.text.exec(ae);if(_e){var Ee;return ie?Ee=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_e[0]):Z(_e[0]):_e[0]:Ee=Z(this.options.smartypants?me(_e[0]):_e[0]),{type:"text",raw:_e[0],text:Ee}}},te}(),We=F.noopTest,Ve=F.edit,Ye=F.merge,we={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:We,table:We,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};we._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,we._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,we.def=Ve(we.def).replace("label",we._label).replace("title",we._title).getRegex(),we.bullet=/(?:[*+-]|\d{1,9}[.)])/,we.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,we.item=Ve(we.item,"gm").replace(/bull/g,we.bullet).getRegex(),we.list=Ve(we.list).replace(/bull/g,we.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+we.def.source+")").getRegex(),we._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",we._comment=/<!--(?!-?>)[\s\S]*?-->/,we.html=Ve(we.html,"i").replace("comment",we._comment).replace("tag",we._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),we.paragraph=Ve(we._paragraph).replace("hr",we.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",we._tag).getRegex(),we.blockquote=Ve(we.blockquote).replace("paragraph",we.paragraph).getRegex(),we.normal=Ye({},we),we.gfm=Ye({},we.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*|$)"}),we.gfm.nptable=Ve(we.gfm.nptable).replace("hr",we.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",we._tag).getRegex(),we.gfm.table=Ve(we.gfm.table).replace("hr",we.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",we._tag).getRegex(),we.pedantic=Ye({},we.normal,{html:Ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",we._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:We,paragraph:Ve(we.normal._paragraph).replace("hr",we.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",we.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var X={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:We,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:We,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};X._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",X.punctuation=Ve(X.punctuation).replace(/punctuation/g,X._punctuation).getRegex(),X._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",X._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",X.em.start=Ve(X.em.start).replace(/punctuation/g,X._punctuation).getRegex(),X.em.middle=Ve(X.em.middle).replace(/punctuation/g,X._punctuation).replace(/overlapSkip/g,X._overlapSkip).getRegex(),X.em.endAst=Ve(X.em.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.em.endUnd=Ve(X.em.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.start=Ve(X.strong.start).replace(/punctuation/g,X._punctuation).getRegex(),X.strong.middle=Ve(X.strong.middle).replace(/punctuation/g,X._punctuation).replace(/blockSkip/g,X._blockSkip).getRegex(),X.strong.endAst=Ve(X.strong.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.endUnd=Ve(X.strong.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.blockSkip=Ve(X._blockSkip,"g").getRegex(),X.overlapSkip=Ve(X._overlapSkip,"g").getRegex(),X._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,X._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,X._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])?)+(?![-_])/,X.autolink=Ve(X.autolink).replace("scheme",X._scheme).replace("email",X._email).getRegex(),X._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,X.tag=Ve(X.tag).replace("comment",we._comment).replace("attribute",X._attribute).getRegex(),X._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,X._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,X._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,X.link=Ve(X.link).replace("label",X._label).replace("href",X._href).replace("title",X._title).getRegex(),X.reflink=Ve(X.reflink).replace("label",X._label).getRegex(),X.reflinkSearch=Ve(X.reflinkSearch,"g").replace("reflink",X.reflink).replace("nolink",X.nolink).getRegex(),X.normal=Ye({},X),X.pedantic=Ye({},X.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:Ve(/^!?\[(label)\]\((.*?)\)/).replace("label",X._label).getRegex(),reflink:Ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X._label).getRegex()}),X.gfm=Ye({},X.normal,{escape:Ve(X.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),X.gfm.url=Ve(X.gfm.url,"i").replace("email",X.gfm._extended_email).getRegex(),X.breaks=Ye({},X.gfm,{br:Ve(X.br).replace("{2,}","*").getRegex(),text:Ve(X.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var j={block:we,inline:X},W=K.defaults,Q=j.block,re=j.inline;function G(te){return te.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function xe(te){var se="",pe,ae,ie=te.length;for(pe=0;pe<ie;pe++)ae=te.charCodeAt(pe),Math.random()>.5&&(ae="x"+ae.toString(16)),se+="&#"+ae+";";return se}var Ie=function(){function te(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||W,this.options.tokenizer=this.options.tokenizer||new Ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:Q.normal,inline:re.normal};this.options.pedantic?(ae.block=Q.pedantic,ae.inline=re.pedantic):this.options.gfm&&(ae.block=Q.gfm,this.options.breaks?ae.inline=re.breaks:ae.inline=re.gfm),this.tokenizer.rules=ae}te.lex=function(ae,ie){var me=new te(ie);return me.lex(ae)};var se=te.prototype;return se.lex=function(ae){return ae=ae.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ae,this.tokens,!0),this.inline(this.tokens),this.tokens},se.blockTokens=function(ae,ie,me){ie===void 0&&(ie=[]),me===void 0&&(me=!0),ae=ae.replace(/^ +$/gm,"");for(var _e,Ee,Le,at;ae;){if(_e=this.tokenizer.space(ae)){ae=ae.substring(_e.raw.length),_e.type&&ie.push(_e);continue}if(_e=this.tokenizer.code(ae,ie)){ae=ae.substring(_e.raw.length),_e.type?ie.push(_e):(at=ie[ie.length-1],at.raw+=`
|
|
`+_e.raw,at.text+=`
|
|
`+_e.text);continue}if(_e=this.tokenizer.fences(ae)){ae=ae.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.heading(ae)){ae=ae.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.nptable(ae)){ae=ae.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.hr(ae)){ae=ae.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.blockquote(ae)){ae=ae.substring(_e.raw.length),_e.tokens=this.blockTokens(_e.text,[],me),ie.push(_e);continue}if(_e=this.tokenizer.list(ae)){for(ae=ae.substring(_e.raw.length),Le=_e.items.length,Ee=0;Ee<Le;Ee++)_e.items[Ee].tokens=this.blockTokens(_e.items[Ee].text,[],!1);ie.push(_e);continue}if(_e=this.tokenizer.html(ae)){ae=ae.substring(_e.raw.length),ie.push(_e);continue}if(me&&(_e=this.tokenizer.def(ae))){ae=ae.substring(_e.raw.length),this.tokens.links[_e.tag]||(this.tokens.links[_e.tag]={href:_e.href,title:_e.title});continue}if(_e=this.tokenizer.table(ae)){ae=ae.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.lheading(ae)){ae=ae.substring(_e.raw.length),ie.push(_e);continue}if(me&&(_e=this.tokenizer.paragraph(ae))){ae=ae.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.text(ae,ie)){ae=ae.substring(_e.raw.length),_e.type?ie.push(_e):(at=ie[ie.length-1],at.raw+=`
|
|
`+_e.raw,at.text+=`
|
|
`+_e.text);continue}if(ae){var Ct="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(Ct);break}else throw new Error(Ct)}}return ie},se.inline=function(ae){var ie,me,_e,Ee,Le,at,Ct=ae.length;for(ie=0;ie<Ct;ie++){at=ae[ie];switch(at.type){case"paragraph":case"text":case"heading":{at.tokens=[],this.inlineTokens(at.text,at.tokens);break}case"table":{for(at.tokens={header:[],cells:[]},Ee=at.header.length,me=0;me<Ee;me++)at.tokens.header[me]=[],this.inlineTokens(at.header[me],at.tokens.header[me]);for(Ee=at.cells.length,me=0;me<Ee;me++)for(Le=at.cells[me],at.tokens.cells[me]=[],_e=0;_e<Le.length;_e++)at.tokens.cells[me][_e]=[],this.inlineTokens(Le[_e],at.tokens.cells[me][_e]);break}case"blockquote":{this.inline(at.tokens);break}case"list":{for(Ee=at.items.length,me=0;me<Ee;me++)this.inline(at.items[me].tokens);break}}}return ae},se.inlineTokens=function(ae,ie,me,_e,Ee){ie===void 0&&(ie=[]),me===void 0&&(me=!1),_e===void 0&&(_e=!1),Ee===void 0&&(Ee="");var Le,at=ae,Ct;if(this.tokens.links){var Jt=Object.keys(this.tokens.links);if(Jt.length>0)for(;(Ct=this.tokenizer.rules.inline.reflinkSearch.exec(at))!=null;)Jt.includes(Ct[0].slice(Ct[0].lastIndexOf("[")+1,-1))&&(at=at.slice(0,Ct.index)+"["+"a".repeat(Ct[0].length-2)+"]"+at.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ct=this.tokenizer.rules.inline.blockSkip.exec(at))!=null;)at=at.slice(0,Ct.index)+"["+"a".repeat(Ct[0].length-2)+"]"+at.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(Le=this.tokenizer.escape(ae)){ae=ae.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.tag(ae,me,_e)){ae=ae.substring(Le.raw.length),me=Le.inLink,_e=Le.inRawBlock,ie.push(Le);continue}if(Le=this.tokenizer.link(ae)){ae=ae.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,_e)),ie.push(Le);continue}if(Le=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,_e)),ie.push(Le);continue}if(Le=this.tokenizer.strong(ae,at,Ee)){ae=ae.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],me,_e),ie.push(Le);continue}if(Le=this.tokenizer.em(ae,at,Ee)){ae=ae.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],me,_e),ie.push(Le);continue}if(Le=this.tokenizer.codespan(ae)){ae=ae.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.br(ae)){ae=ae.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.del(ae)){ae=ae.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],me,_e),ie.push(Le);continue}if(Le=this.tokenizer.autolink(ae,xe)){ae=ae.substring(Le.raw.length),ie.push(Le);continue}if(!me&&(Le=this.tokenizer.url(ae,xe))){ae=ae.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.inlineText(ae,_e,G)){ae=ae.substring(Le.raw.length),Ee=Le.raw.slice(-1),ie.push(Le);continue}if(ae){var lt="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(lt);break}else throw new Error(lt)}}return ie},V(te,null,[{key:"rules",get:function(){return{block:Q,inline:re}}}]),te}(),tt=K.defaults,le=F.cleanUrl,Se=F.escape,je=function(){function te(pe){this.options=pe||tt}var se=te.prototype;return se.code=function(ae,ie,me){var _e=(ie||"").match(/\S*/)[0];if(this.options.highlight){var Ee=this.options.highlight(ae,_e);Ee!=null&&Ee!==ae&&(me=!0,ae=Ee)}return _e?'<pre><code class="'+this.options.langPrefix+Se(_e,!0)+'">'+(me?ae:Se(ae,!0))+`</code></pre>
|
|
`:"<pre><code>"+(me?ae:Se(ae,!0))+`</code></pre>
|
|
`},se.blockquote=function(ae){return`<blockquote>
|
|
`+ae+`</blockquote>
|
|
`},se.html=function(ae){return ae},se.heading=function(ae,ie,me,_e){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+_e.slug(me)+'">'+ae+"</h"+ie+`>
|
|
`:"<h"+ie+">"+ae+"</h"+ie+`>
|
|
`},se.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},se.list=function(ae,ie,me){var _e=ie?"ol":"ul",Ee=ie&&me!==1?' start="'+me+'"':"";return"<"+_e+Ee+`>
|
|
`+ae+"</"+_e+`>
|
|
`},se.listitem=function(ae){return"<li>"+ae+`</li>
|
|
`},se.checkbox=function(ae){return"<input "+(ae?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},se.paragraph=function(ae){return"<p>"+ae+`</p>
|
|
`},se.table=function(ae,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ae+`</thead>
|
|
`+ie+`</table>
|
|
`},se.tablerow=function(ae){return`<tr>
|
|
`+ae+`</tr>
|
|
`},se.tablecell=function(ae,ie){var me=ie.header?"th":"td",_e=ie.align?"<"+me+' align="'+ie.align+'">':"<"+me+">";return _e+ae+"</"+me+`>
|
|
`},se.strong=function(ae){return"<strong>"+ae+"</strong>"},se.em=function(ae){return"<em>"+ae+"</em>"},se.codespan=function(ae){return"<code>"+ae+"</code>"},se.br=function(){return this.options.xhtml?"<br/>":"<br>"},se.del=function(ae){return"<del>"+ae+"</del>"},se.link=function(ae,ie,me){if(ae=le(this.options.sanitize,this.options.baseUrl,ae),ae===null)return me;var _e='<a href="'+Se(ae)+'"';return ie&&(_e+=' title="'+ie+'"'),_e+=">"+me+"</a>",_e},se.image=function(ae,ie,me){if(ae=le(this.options.sanitize,this.options.baseUrl,ae),ae===null)return me;var _e='<img src="'+ae+'" alt="'+me+'"';return ie&&(_e+=' title="'+ie+'"'),_e+=this.options.xhtml?"/>":">",_e},se.text=function(ae){return ae},te}(),ze=function(){function te(){}var se=te.prototype;return se.strong=function(ae){return ae},se.em=function(ae){return ae},se.codespan=function(ae){return ae},se.del=function(ae){return ae},se.html=function(ae){return ae},se.text=function(ae){return ae},se.link=function(ae,ie,me){return""+me},se.image=function(ae,ie,me){return""+me},se.br=function(){return""},te}(),yt=function(){function te(){this.seen={}}var se=te.prototype;return se.slug=function(ae){var ie=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var me=ie;do this.seen[me]++,ie=me+"-"+this.seen[me];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},te}(),Ot=K.defaults,Ut=F.unescape,Qe=function(){function te(pe){this.options=pe||Ot,this.options.renderer=this.options.renderer||new je,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ze,this.slugger=new yt}te.parse=function(ae,ie){var me=new te(ie);return me.parse(ae)};var se=te.prototype;return se.parse=function(ae,ie){ie===void 0&&(ie=!0);var me="",_e,Ee,Le,at,Ct,Jt,lt,Un,Cn,vn,er,kn,Yn,vr,Mn,Zn,dr,jt,Ft=ae.length;for(_e=0;_e<Ft;_e++){vn=ae[_e];switch(vn.type){case"space":continue;case"hr":{me+=this.renderer.hr();continue}case"heading":{me+=this.renderer.heading(this.parseInline(vn.tokens),vn.depth,Ut(this.parseInline(vn.tokens,this.textRenderer)),this.slugger);continue}case"code":{me+=this.renderer.code(vn.text,vn.lang,vn.escaped);continue}case"table":{for(Un="",lt="",at=vn.header.length,Ee=0;Ee<at;Ee++)lt+=this.renderer.tablecell(this.parseInline(vn.tokens.header[Ee]),{header:!0,align:vn.align[Ee]});for(Un+=this.renderer.tablerow(lt),Cn="",at=vn.cells.length,Ee=0;Ee<at;Ee++){for(Jt=vn.tokens.cells[Ee],lt="",Ct=Jt.length,Le=0;Le<Ct;Le++)lt+=this.renderer.tablecell(this.parseInline(Jt[Le]),{header:!1,align:vn.align[Le]});Cn+=this.renderer.tablerow(lt)}me+=this.renderer.table(Un,Cn);continue}case"blockquote":{Cn=this.parse(vn.tokens),me+=this.renderer.blockquote(Cn);continue}case"list":{for(er=vn.ordered,kn=vn.start,Yn=vn.loose,at=vn.items.length,Cn="",Ee=0;Ee<at;Ee++)Mn=vn.items[Ee],Zn=Mn.checked,dr=Mn.task,vr="",Mn.task&&(jt=this.renderer.checkbox(Zn),Yn?Mn.tokens.length>0&&Mn.tokens[0].type==="text"?(Mn.tokens[0].text=jt+" "+Mn.tokens[0].text,Mn.tokens[0].tokens&&Mn.tokens[0].tokens.length>0&&Mn.tokens[0].tokens[0].type==="text"&&(Mn.tokens[0].tokens[0].text=jt+" "+Mn.tokens[0].tokens[0].text)):Mn.tokens.unshift({type:"text",text:jt}):vr+=jt),vr+=this.parse(Mn.tokens,Yn),Cn+=this.renderer.listitem(vr,dr,Zn);me+=this.renderer.list(Cn,er,kn);continue}case"html":{me+=this.renderer.html(vn.text);continue}case"paragraph":{me+=this.renderer.paragraph(this.parseInline(vn.tokens));continue}case"text":{for(Cn=vn.tokens?this.parseInline(vn.tokens):vn.text;_e+1<Ft&&ae[_e+1].type==="text";)vn=ae[++_e],Cn+=`
|
|
`+(vn.tokens?this.parseInline(vn.tokens):vn.text);me+=ie?this.renderer.paragraph(Cn):Cn;continue}default:{var zt='Token with "'+vn.type+'" type was not found.';if(this.options.silent){console.error(zt);return}else throw new Error(zt)}}}return me},se.parseInline=function(ae,ie){ie=ie||this.renderer;var me="",_e,Ee,Le=ae.length;for(_e=0;_e<Le;_e++){Ee=ae[_e];switch(Ee.type){case"escape":{me+=ie.text(Ee.text);break}case"html":{me+=ie.html(Ee.text);break}case"link":{me+=ie.link(Ee.href,Ee.title,this.parseInline(Ee.tokens,ie));break}case"image":{me+=ie.image(Ee.href,Ee.title,Ee.text);break}case"strong":{me+=ie.strong(this.parseInline(Ee.tokens,ie));break}case"em":{me+=ie.em(this.parseInline(Ee.tokens,ie));break}case"codespan":{me+=ie.codespan(Ee.text);break}case"br":{me+=ie.br();break}case"del":{me+=ie.del(this.parseInline(Ee.tokens,ie));break}case"text":{me+=ie.text(Ee.text);break}default:{var at='Token with "'+Ee.type+'" type was not found.';if(this.options.silent){console.error(at);return}else throw new Error(at)}}}return me},te}(),Bt=F.merge,ln=F.checkSanitizeDeprecation,Ke=F.escape,He=K.getDefaults,ct=K.changeDefaults,bt=K.defaults;function de(te,se,pe){if(typeof te=="undefined"||te===null)throw new Error("marked(): input parameter is undefined or null");if(typeof te!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(te)+", string expected");if(typeof se=="function"&&(pe=se,se=null),se=Bt({},de.defaults,se||{}),ln(se),pe){var ae=se.highlight,ie;try{ie=Ie.lex(te,se)}catch(Le){return pe(Le)}var me=function(at){var Ct;if(!at)try{Ct=Qe.parse(ie,se)}catch(Jt){at=Jt}return se.highlight=ae,at?pe(at):pe(null,Ct)};if(!ae||ae.length<3)return me();if(delete se.highlight,!ie.length)return me();var _e=0;de.walkTokens(ie,function(Le){Le.type==="code"&&(_e++,setTimeout(function(){ae(Le.text,Le.lang,function(at,Ct){if(at)return me(at);Ct!=null&&Ct!==Le.text&&(Le.text=Ct,Le.escaped=!0),_e--,_e===0&&me()})},0))}),_e===0&&me();return}try{var Ee=Ie.lex(te,se);return se.walkTokens&&de.walkTokens(Ee,se.walkTokens),Qe.parse(Ee,se)}catch(Le){if(Le.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,se.silent)return"<p>An error occurred:</p><pre>"+Ke(Le.message+"",!0)+"</pre>";throw Le}}de.options=de.setOptions=function(te){return Bt(de.defaults,te),ct(de.defaults),de},de.getDefaults=He,de.defaults=bt,de.use=function(te){var se=Bt({},te);if(te.renderer&&function(){var ae=de.defaults.renderer||new je,ie=function(Ee){var Le=ae[Ee];ae[Ee]=function(){for(var at=arguments.length,Ct=new Array(at),Jt=0;Jt<at;Jt++)Ct[Jt]=arguments[Jt];var lt=te.renderer[Ee].apply(ae,Ct);return lt===!1&&(lt=Le.apply(ae,Ct)),lt}};for(var me in te.renderer)ie(me);se.renderer=ae}(),te.tokenizer&&function(){var ae=de.defaults.tokenizer||new Ce,ie=function(Ee){var Le=ae[Ee];ae[Ee]=function(){for(var at=arguments.length,Ct=new Array(at),Jt=0;Jt<at;Jt++)Ct[Jt]=arguments[Jt];var lt=te.tokenizer[Ee].apply(ae,Ct);return lt===!1&&(lt=Le.apply(ae,Ct)),lt}};for(var me in te.tokenizer)ie(me);se.tokenizer=ae}(),te.walkTokens){var pe=de.defaults.walkTokens;se.walkTokens=function(ae){te.walkTokens(ae),pe&&pe(ae)}}de.setOptions(se)},de.walkTokens=function(te,se){for(var pe=L(te),ae;!(ae=pe()).done;){var ie=ae.value;se(ie);switch(ie.type){case"table":{for(var me=L(ie.tokens.header),_e;!(_e=me()).done;){var Ee=_e.value;de.walkTokens(Ee,se)}for(var Le=L(ie.tokens.cells),at;!(at=Le()).done;)for(var Ct=at.value,Jt=L(Ct),lt;!(lt=Jt()).done;){var Un=lt.value;de.walkTokens(Un,se)}break}case"list":{de.walkTokens(ie.items,se);break}default:ie.tokens&&de.walkTokens(ie.tokens,se)}}},de.Parser=Qe,de.parser=Qe.parse,de.Renderer=je,de.TextRenderer=ze,de.Lexer=Ie,de.lexer=Ie.lex,de.Tokenizer=Ce,de.Slugger=yt,de.parse=de;var q=de;return q})},ELLl:function(Lt,ve,k){(function(ne){ne(k("VrN/"))})(function(ne){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},I=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(a,s,d){d&&d!=ne.Init&&(a.removeKeyMap(L),a.state.closeBrackets=null),s&&(D(z(s,"pairs")),a.state.closeBrackets=s,a.addKeyMap(L))});function z(a,s){return s=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[s]!=null?a[s]:V[s]}var L={Backspace:r,Enter:P};function D(a){for(var s=0;s<a.length;s++){var d=a.charAt(s),l="'"+d+"'";L[l]||(L[l]=K(d))}}D(V.pairs+"`");function K(a){return function(s){return p(s,a)}}function M(a){var s=a.state.closeBrackets;if(!s||s.override)return s;var d=a.getModeAt(a.getCursor());return d.closeBrackets||s}function r(a){var s=M(a);if(!s||a.getOption("disableInput"))return ne.Pass;for(var d=z(s,"pairs"),l=a.listSelections(),i=0;i<l.length;i++){if(!l[i].empty())return ne.Pass;var n=m(a,l[i].head);if(!n||d.indexOf(n)%2!=0)return ne.Pass}for(var i=l.length-1;i>=0;i--){var O=l[i].head;a.replaceRange("",I(O.line,O.ch-1),I(O.line,O.ch+1),"+delete")}}function P(a){var s=M(a),d=s&&z(s,"explode");if(!d||a.getOption("disableInput"))return ne.Pass;for(var l=a.listSelections(),i=0;i<l.length;i++){if(!l[i].empty())return ne.Pass;var n=m(a,l[i].head);if(!n||d.indexOf(n)%2!=0)return ne.Pass}a.operation(function(){var O=a.lineSeparator()||`
|
|
`;a.replaceSelection(O+O,null),a.execCommand("goCharLeft"),l=a.listSelections();for(var C=0;C<l.length;C++){var T=l[C].head.line;a.indentLine(T,null,!0),a.indentLine(T+1,null,!0)}})}function x(a){var s=ne.cmpPos(a.anchor,a.head)>0;return{anchor:new I(a.anchor.line,a.anchor.ch+(s?-1:1)),head:new I(a.head.line,a.head.ch+(s?1:-1))}}function p(a,s){var d=M(a);if(!d||a.getOption("disableInput"))return ne.Pass;var l=z(d,"pairs"),i=l.indexOf(s);if(i==-1)return ne.Pass;for(var n=z(d,"closeBefore"),O=z(d,"triples"),C=l.charAt(i+1)==s,T=a.listSelections(),R=i%2==0,S,y=0;y<T.length;y++){var E=T[y],f=E.head,h,v=a.getRange(f,I(f.line,f.ch+1));if(R&&!E.empty())h="surround";else if((C||!R)&&v==s)C&&c(a,f)?h="both":O.indexOf(s)>=0&&a.getRange(f,I(f.line,f.ch+3))==s+s+s?h="skipThree":h="skip";else if(C&&f.ch>1&&O.indexOf(s)>=0&&a.getRange(I(f.line,f.ch-2),f)==s+s){if(f.ch>2&&/\bstring/.test(a.getTokenTypeAt(I(f.line,f.ch-2))))return ne.Pass;h="addFour"}else if(C){var g=f.ch==0?" ":a.getRange(I(f.line,f.ch-1),f);if(!ne.isWordChar(v)&&g!=s&&!ne.isWordChar(g))h="both";else return ne.Pass}else if(R&&(v.length===0||/\s/.test(v)||n.indexOf(v)>-1))h="both";else return ne.Pass;if(!S)S=h;else if(S!=h)return ne.Pass}var b=i%2?l.charAt(i-1):s,N=i%2?s:l.charAt(i+1);a.operation(function(){if(S=="skip")a.execCommand("goCharRight");else if(S=="skipThree")for(var H=0;H<3;H++)a.execCommand("goCharRight");else if(S=="surround"){for(var A=a.getSelections(),H=0;H<A.length;H++)A[H]=b+A[H]+N;a.replaceSelections(A,"around"),A=a.listSelections().slice();for(var H=0;H<A.length;H++)A[H]=x(A[H]);a.setSelections(A)}else S=="both"?(a.replaceSelection(b+N,null),a.triggerElectric(b+N),a.execCommand("goCharLeft")):S=="addFour"&&(a.replaceSelection(b+b+b+b,"before"),a.execCommand("goCharRight"))})}function m(a,s){var d=a.getRange(I(s.line,s.ch-1),I(s.line,s.ch+1));return d.length==2?d:null}function c(a,s){var d=a.getTokenAt(I(s.line,s.ch+1));return/\bstring/.test(d.type)&&d.start==s.ch&&(s.ch==0||!/\bstring/.test(a.getTokenTypeAt(s)))}})},F0VM:function(Lt,ve,k){Lt.exports={flex_box_center:"flex_box_center___2fDN3",flex_space_between:"flex_space_between___BHBBv",flex_box_vertical_center:"flex_box_vertical_center___tpxsE",flex_box_center_end:"flex_box_center_end___rP7bQ",flex_box_column:"flex_box_column___1_rF-",md:"md___3SObb",title:"title___HfZ1b"}},FOrL:function(Lt,ve,k){Lt.exports=k.p+"static/nodata.a6b3f948.png"},FWmy:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return ne});function ne(V,I){if(!V)throw new Error(I?`Assertion failed (${I})`:"Assertion Failed")}},HmJG:function(Lt,ve,k){},IBYe:function(Lt,ve,k){"use strict";function ne(V){return null}ve.a=ne},J66h:function(Lt,ve,k){(function(ne){var V,I;(function(z,L){Lt.exports=L(z)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof ne!="undefined"?ne:this,function(z){"use strict";z=z||{};var L=z.Base64,D="2.6.4",K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",M=function(b){for(var N={},H=0,A=b.length;H<A;H++)N[b.charAt(H)]=H;return N}(K),r=String.fromCharCode,P=function(b){if(b.length<2){var N=b.charCodeAt(0);return N<128?b:N<2048?r(192|N>>>6)+r(128|N&63):r(224|N>>>12&15)+r(128|N>>>6&63)+r(128|N&63)}else{var N=65536+(b.charCodeAt(0)-55296)*1024+(b.charCodeAt(1)-56320);return r(240|N>>>18&7)+r(128|N>>>12&63)+r(128|N>>>6&63)+r(128|N&63)}},x=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,p=function(b){return b.replace(x,P)},m=function(b){var N=[0,2,1][b.length%3],H=b.charCodeAt(0)<<16|(b.length>1?b.charCodeAt(1):0)<<8|(b.length>2?b.charCodeAt(2):0),A=[K.charAt(H>>>18),K.charAt(H>>>12&63),N>=2?"=":K.charAt(H>>>6&63),N>=1?"=":K.charAt(H&63)];return A.join("")},c=z.btoa&&typeof z.btoa=="function"?function(b){return z.btoa(b)}:function(b){if(b.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return b.replace(/[\s\S]{1,3}/g,m)},a=function(b){return c(p(String(b)))},s=function(b){return b.replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).replace(/=/g,"")},d=function(b,N){return N?s(a(b)):a(b)},l=function(b){return d(b,!0)},i;z.Uint8Array&&(i=function(b,N){for(var H="",A=0,F=b.length;A<F;A+=3){var U=b[A],w=b[A+1],Y=b[A+2],Z=U<<16|w<<8|Y;H+=K.charAt(Z>>>18)+K.charAt(Z>>>12&63)+(typeof w!="undefined"?K.charAt(Z>>>6&63):"=")+(typeof Y!="undefined"?K.charAt(Z&63):"=")}return N?s(H):H});var n=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(b){switch(b.length){case 4:var N=(7&b.charCodeAt(0))<<18|(63&b.charCodeAt(1))<<12|(63&b.charCodeAt(2))<<6|63&b.charCodeAt(3),H=N-65536;return r((H>>>10)+55296)+r((H&1023)+56320);case 3:return r((15&b.charCodeAt(0))<<12|(63&b.charCodeAt(1))<<6|63&b.charCodeAt(2));default:return r((31&b.charCodeAt(0))<<6|63&b.charCodeAt(1))}},C=function(b){return b.replace(n,O)},T=function(b){var N=b.length,H=N%4,A=(N>0?M[b.charAt(0)]<<18:0)|(N>1?M[b.charAt(1)]<<12:0)|(N>2?M[b.charAt(2)]<<6:0)|(N>3?M[b.charAt(3)]:0),F=[r(A>>>16),r(A>>>8&255),r(A&255)];return F.length-=[0,0,2,1][H],F.join("")},R=z.atob&&typeof z.atob=="function"?function(b){return z.atob(b)}:function(b){return b.replace(/\S{1,4}/g,T)},S=function(b){return R(String(b).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(b){return C(R(b))},E=function(b){return String(b).replace(/[-_]/g,function(N){return N=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},f=function(b){return y(E(b))},h;z.Uint8Array&&(h=function(b){return Uint8Array.from(S(E(b)),function(N){return N.charCodeAt(0)})});var v=function(){var b=z.Base64;return z.Base64=L,b};if(z.Base64={VERSION:D,atob:S,btoa:c,fromBase64:f,toBase64:d,utob:p,encode:d,encodeURI:l,btou:C,decode:f,noConflict:v,fromUint8Array:i,toUint8Array:h},typeof Object.defineProperty=="function"){var g=function(b){return{value:b,enumerable:!1,writable:!0,configurable:!0}};z.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",g(function(){return f(this)})),Object.defineProperty(String.prototype,"toBase64",g(function(b){return d(this,b)})),Object.defineProperty(String.prototype,"toBase64URI",g(function(){return d(this,!0)}))}}return z.Meteor&&(Base64=z.Base64),Lt.exports?Lt.exports.Base64=z.Base64:!(V=[],I=function(){return z.Base64}.apply(ve,V),I!==void 0&&(Lt.exports=I)),{Base64:z.Base64}})}).call(this,k("IyRk"))},JYp7:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return ne});var ne;(function(V){function I(n){return n&&typeof n=="object"&&typeof n[Symbol.iterator]=="function"}V.is=I;const z=Object.freeze([]);function L(){return z}V.empty=L;function*D(n){yield n}V.single=D;function K(n){return n||z}V.from=K;function M(n){return!n||n[Symbol.iterator]().next().done===!0}V.isEmpty=M;function r(n){return n[Symbol.iterator]().next().value}V.first=r;function P(n,O){for(const C of n)if(O(C))return!0;return!1}V.some=P;function x(n,O){for(const C of n)if(O(C))return C;return}V.find=x;function*p(n,O){for(const C of n)O(C)&&(yield C)}V.filter=p;function*m(n,O){let C=0;for(const T of n)yield O(T,C++)}V.map=m;function*c(...n){for(const O of n)for(const C of O)yield C}V.concat=c;function*a(n){for(const O of n)for(const C of O)yield C}V.concatNested=a;function s(n,O,C){let T=C;for(const R of n)T=O(T,R);return T}V.reduce=s;function*d(n,O,C=n.length){for(O<0&&(O+=n.length),C<0?C+=n.length:C>n.length&&(C=n.length);O<C;O++)yield n[O]}V.slice=d;function l(n,O=Number.POSITIVE_INFINITY){const C=[];if(O===0)return[C,n];const T=n[Symbol.iterator]();for(let R=0;R<O;R++){const S=T.next();if(S.done)return[C,V.empty()];C.push(S.value)}return[C,{[Symbol.iterator](){return T}}]}V.consume=l;function i(n,O,C=(T,R)=>T===R){const T=n[Symbol.iterator](),R=O[Symbol.iterator]();for(;;){const S=T.next(),y=R.next();if(S.done!==y.done)return!1;if(S.done)return!0;if(!C(S.value,y.value))return!1}}V.equals=i})(ne||(ne={}))},LSTS:function(Lt,ve,k){"use strict";Object.defineProperty(ve,"__esModule",{value:!0});var ne=function(){function p(m,c){for(var a=0;a<c.length;a++){var s=c[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(m,s.key,s)}}return function(m,c,a){return c&&p(m.prototype,c),a&&p(m,a),m}}(),V=k("q1tI"),I=D(V),z=k("17x9"),L=D(z);function D(p){return p&&p.__esModule?p:{default:p}}function K(p,m){var c={};for(var a in p){if(m.indexOf(a)>=0)continue;if(!Object.prototype.hasOwnProperty.call(p,a))continue;c[a]=p[a]}return c}function M(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function r(p,m){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:p}function P(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);p.prototype=Object.create(m&&m.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(p,m):p.__proto__=m)}var x=function(p){P(m,p);function m(c){M(this,m);var a=r(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,c));return a.scrollListener=a.scrollListener.bind(a),a.eventListenerOptions=a.eventListenerOptions.bind(a),a.mousewheelListener=a.mousewheelListener.bind(a),a}return ne(m,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var a=this.getParentElement(this.scrollComponent);a.scrollTop=a.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var a=!1,s={get passive(){a=!0}};try{document.addEventListener("test",null,s),document.removeEventListener("test",null,s)}catch(d){}return a}},{key:"eventListenerOptions",value:function(){var a=this.props.useCapture;return this.isPassiveSupported()&&(a={useCapture:this.props.useCapture,passive:!0}),a}},{key:"setDefaultLoader",value:function(a){this.defaultLoader=a}},{key:"detachMousewheelListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.scrollComponent.parentNode),a.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.getParentElement(this.scrollComponent)),a.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),a.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(a){var s=this.props.getScrollParent&&this.props.getScrollParent();return s!=null?s:a&&a.parentNode}},{key:"filterProps",value:function(a){return a}},{key:"attachScrollListener",value:function(){var a=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!a)return;var s=window;this.props.useWindow===!1&&(s=a),s.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),s.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),s.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(a){a.deltaY===1&&!this.isPassiveSupported()&&a.preventDefault()}},{key:"scrollListener",value:function(){var a=this.scrollComponent,s=window,d=this.getParentElement(a),l=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,n=s.pageYOffset!==void 0?s.pageYOffset:i.scrollTop;this.props.isReverse?l=n:l=this.calculateOffset(a,n)}else this.props.isReverse?l=d.scrollTop:l=a.scrollHeight-d.scrollTop-d.clientHeight;l<Number(this.props.threshold)&&a&&a.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=d.scrollHeight,this.beforeScrollTop=d.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(a,s){return a?this.calculateTopPosition(a)+(a.offsetHeight-s-window.innerHeight):0}},{key:"calculateTopPosition",value:function(a){return a?a.offsetTop+this.calculateTopPosition(a.offsetParent):0}},{key:"render",value:function(){var a=this,s=this.filterProps(this.props),d=s.children,l=s.element,i=s.hasMore,n=s.initialLoad,O=s.isReverse,C=s.loader,T=s.loadMore,R=s.pageStart,S=s.ref,y=s.threshold,E=s.useCapture,f=s.useWindow,h=s.getScrollParent,v=K(s,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);v.ref=function(b){a.scrollComponent=b,S&&S(b)};var g=[d];return i&&(C?O?g.unshift(C):g.push(C):this.defaultLoader&&(O?g.unshift(this.defaultLoader):g.push(this.defaultLoader))),I.default.createElement(l,v,g)}}]),m}(V.Component);x.propTypes={children:L.default.node.isRequired,element:L.default.node,hasMore:L.default.bool,initialLoad:L.default.bool,isReverse:L.default.bool,loader:L.default.node,loadMore:L.default.func.isRequired,pageStart:L.default.number,ref:L.default.func,getScrollParent:L.default.func,threshold:L.default.number,useCapture:L.default.bool,useWindow:L.default.bool},x.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},ve.default=x,Lt.exports=ve.default},LdHM:function(Lt,ve,k){"use strict";k.d(ve,"b",function(){return n}),k.d(ve,"a",function(){return C});var ne=k("1OyB"),V=k("vuIU"),I=k("Ji7U"),z=k("LK+K"),L=k("q1tI"),D=k("rePB"),K=k("Ff2n"),M=k("ODXe"),r=k("4IlW"),P=k("bX4T"),x=k("YrtM"),p=k("TSYQ"),m=k.n(p),c=k("+nKL"),a=k("8OUc"),s=function(Y,Z){var ce=Y.prefixCls,be=Y.id,Ze=Y.flattenOptions,Ce=Y.childrenAsData,We=Y.values,Ve=Y.searchValue,Ye=Y.multiple,we=Y.defaultActiveFirstOption,X=Y.height,j=Y.itemHeight,W=Y.notFoundContent,Q=Y.open,re=Y.menuItemSelectedIcon,G=Y.virtual,xe=Y.onSelect,Ie=Y.onToggleOpen,tt=Y.onActiveValue,le=Y.onScroll,Se=Y.onMouseEnter,je="".concat(ce,"-item"),ze=Object(x.a)(function(){return Ze},[Q,Ze],function(q,te){return te[0]&&q[1]!==te[1]}),yt=L.useRef(null),Ot=function(te){te.preventDefault()},Ut=function(te){yt.current&&yt.current.scrollTo({index:te})},Qe=function(te){for(var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,pe=ze.length,ae=0;ae<pe;ae+=1){var ie=(te+ae*se+pe)%pe,me=ze[ie],_e=me.group,Ee=me.data;if(!_e&&!Ee.disabled)return ie}return-1},Bt=L.useState(function(){return Qe(0)}),ln=Object(M.a)(Bt,2),Ke=ln[0],He=ln[1],ct=function(te){He(te);var se=ze[te];if(!se){tt(null,-1);return}tt(se.data.value,te)};L.useEffect(function(){ct(we!==!1?Qe(0):-1)},[ze.length,Ve]),L.useEffect(function(){var q=setTimeout(function(){if(!Ye&&Q&&We.size===1){var te=Array.from(We)[0],se=ze.findIndex(function(pe){var ae=pe.data;return ae.value===te});ct(se),Ut(se)}});return function(){return clearTimeout(q)}},[Q]);var bt=function(te){te!==void 0&&xe(te,{selected:!We.has(te)}),Ye||Ie(!1)};if(L.useImperativeHandle(Z,function(){return{onKeyDown:function(te){var se=te.which;switch(se){case r.a.UP:case r.a.DOWN:{var pe=0;if(se===r.a.UP?pe=-1:se===r.a.DOWN&&(pe=1),pe!==0){var ae=Qe(Ke+pe,pe);Ut(ae),ct(ae)}break}case r.a.ENTER:{var ie=ze[Ke];ie&&!ie.data.disabled?bt(ie.data.value):bt(void 0),Q&&te.preventDefault();break}case r.a.ESC:Ie(!1)}},onKeyUp:function(){},scrollTo:function(te){Ut(te)}}}),ze.length===0)return L.createElement("div",{role:"listbox",id:"".concat(be,"_list"),className:"".concat(je,"-empty"),onMouseDown:Ot},W);function de(q){var te=ze[q];if(!te)return null;var se=te.data||{},pe=se.value,ae=se.label,ie=se.children,me=Object(P.a)(se,!0),_e=Ce?ie:ae;return te?L.createElement("div",Object.assign({"aria-label":typeof _e=="string"?_e:null},me,{key:q,role:"option",id:"".concat(be,"_list_").concat(q),"aria-selected":We.has(pe)}),pe):null}return L.createElement(L.Fragment,null,L.createElement("div",{role:"listbox",id:"".concat(be,"_list"),style:{height:0,width:0,overflow:"hidden"}},de(Ke-1),de(Ke),de(Ke+1)),L.createElement(c.a,{itemKey:"key",ref:yt,data:ze,height:X,itemHeight:j,fullHeight:!1,onMouseDown:Ot,onScroll:le,virtual:G,onMouseEnter:Se},function(q,te){var se,pe=q.group,ae=q.groupOption,ie=q.data,me=ie.label,_e=ie.key;if(pe)return L.createElement("div",{className:m()(je,"".concat(je,"-group"))},me!==void 0?me:_e);var Ee=ie.disabled,Le=ie.value,at=ie.title,Ct=ie.children,Jt=ie.style,lt=ie.className,Un=Object(K.a)(ie,["disabled","value","title","children","style","className"]),Cn=We.has(Le),vn="".concat(je,"-option"),er=m()(je,vn,lt,(se={},Object(D.a)(se,"".concat(vn,"-grouped"),ae),Object(D.a)(se,"".concat(vn,"-active"),Ke===te&&!Ee),Object(D.a)(se,"".concat(vn,"-disabled"),Ee),Object(D.a)(se,"".concat(vn,"-selected"),Cn),se)),kn=Ce?Ct:me,Yn=!re||typeof re=="function"||Cn;return L.createElement("div",Object.assign({},Un,{"aria-selected":Cn,className:er,title:at,onMouseMove:function(){if(Ke===te||Ee)return;ct(te)},onClick:function(){Ee||bt(Le)},style:Jt}),L.createElement("div",{className:"".concat(vn,"-content")},kn||Le),L.isValidElement(re)||Cn,Yn&&L.createElement(a.a,{className:"".concat(je,"-option-state"),customizeIcon:re,customizeIconProps:{isSelected:Cn}},Cn?"\u2713":null))}))},d=L.forwardRef(s);d.displayName="OptionList";var l=d,i=function(){return null};i.isSelectOption=!0;var n=i,O=function(){return null};O.isSelectOptGroup=!0;var C=O,T=k("VTBJ"),R=k("Zm9Q");function S(w){var Y=w.key,Z=w.props,ce=Z.children,be=Z.value,Ze=Object(K.a)(Z,["children","value"]);return Object(T.a)({key:Y,value:be!==void 0?be:Y,children:ce},Ze)}function y(w){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(w).map(function(Z,ce){if(!L.isValidElement(Z)||!Z.type)return null;var be=Z.type.isSelectOptGroup,Ze=Z.key,Ce=Z.props,We=Ce.children,Ve=Object(K.a)(Ce,["children"]);return Y||!be?S(Z):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(Ze===null?ce:Ze,"__"),label:Ze},Ve),{},{options:y(We)})}).filter(function(Z){return Z})}var E=k("2Qr1"),f=k("qNPg"),h=k("U8pU"),v=k("Kwbf"),g=k("WKfj");function b(w){var Y=w.mode,Z=w.options,ce=w.children,be=w.backfill,Ze=w.allowClear,Ce=w.placeholder,We=w.getInputElement,Ve=w.showSearch,Ye=w.onSearch,we=w.defaultOpen,X=w.autoFocus,j=w.labelInValue,W=w.value,Q=w.inputValue,re=w.optionLabelProp,G=Y==="multiple"||Y==="tags",xe=Ve!==void 0?Ve:G||Y==="combobox",Ie=Z||y(ce);if(Object(v.a)(Y!=="tags"||Ie.every(function(je){return!je.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var tt=Ie.some(function(je){return je.options?je.options.some(function(ze){return typeof("value"in ze?ze.value:ze.key)=="number"}):typeof("value"in je?je.value:je.key)=="number"});Object(v.a)(!tt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(v.a)(Y!=="combobox"||!re,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(v.a)(Y==="combobox"||!be,"`backfill` only works with `combobox` mode."),Object(v.a)(Y==="combobox"||!We,"`getInputElement` only work with `combobox` mode."),Object(v.b)(Y!=="combobox"||!We||!Ze||!Ce,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ye&&!xe&&Y!=="combobox"&&Y!=="tags"&&Object(v.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(v.b)(!we||X,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),W!=null){var le=Object(g.d)(W);Object(v.a)(!j||le.every(function(je){return Object(h.a)(je)==="object"&&("key"in je||"value"in je)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(v.a)(!G||Array.isArray(W),"`value` should be array when `mode` is `multiple` or `tags`")}if(ce){var Se=null;Object(R.a)(ce).some(function(je){if(!L.isValidElement(je)||!je.type)return!1;var ze=je.type;if(ze.isSelectOption)return!1;if(ze.isSelectOptGroup){var yt=Object(R.a)(je.props.children).every(function(Ot){return!L.isValidElement(Ot)||!je.type||Ot.type.isSelectOption?!0:(Se=Ot.type,!1)});return!yt}return Se=ze,!0}),Se&&Object(v.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Se.displayName||Se.name||Se,"`.")),Object(v.a)(Q===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=b,H=Object(f.a)({prefixCls:"rc-select",components:{optionList:l},convertChildrenToData:y,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:N,fillOptionsWithMissingValue:E.a}),A=function(w){Object(I.a)(Z,w);var Y=Object(z.a)(Z);function Z(){var ce;return Object(ne.a)(this,Z),ce=Y.apply(this,arguments),ce.selectRef=L.createRef(),ce.focus=function(){ce.selectRef.current.focus()},ce.blur=function(){ce.selectRef.current.blur()},ce}return Object(V.a)(Z,[{key:"render",value:function(){return L.createElement(H,Object.assign({ref:this.selectRef},this.props))}}]),Z}(L.Component);A.Option=n,A.OptGroup=C;var F=A,U=ve.c=F},M8RZ:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return r});var ne=k("fWQN"),V=k("mtLc"),I=k("yKVA"),z=k("879j"),L=k("q1tI"),D=k.n(L),K=k("i8i4"),M=k.n(K),r=function(P){Object(I.a)(p,P);var x=Object(z.a)(p);function p(m){var c;Object(ne.a)(this,p),c=x.call(this,m);var a=window.document;return c.node=a.createElement("div"),a.body.appendChild(c.node),c}return Object(V.a)(p,[{key:"render",value:function(){var c=this.props.children;return Object(K.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(D.a.Component)},MI8n:function(Lt,ve,k){"use strict";k.d(ve,"c",function(){return L}),k.d(ve,"b",function(){return r}),k.d(ve,"e",function(){return P}),k.d(ve,"a",function(){return x}),k.d(ve,"d",function(){return p}),k.d(ve,"f",function(){return m});var ne=k("/cxE"),V=k("pmY6"),I=k("24hK"),z=k("5Y4S"),L;(function(c){c.None=()=>V.a.None;function a(b){return(N,H=null,A)=>{let F=!1,U;return U=b(w=>F?void 0:(U?U.dispose():F=!0,N.call(H,w)),null,A),F&&U.dispose(),U}}c.once=a;function s(b,N){return C((H,A=null,F)=>b(U=>H.call(A,N(U)),null,F))}c.map=s;function d(b,N){return C((H,A=null,F)=>b(U=>{N(U),H.call(A,U)},null,F))}c.forEach=d;function l(b,N){return C((H,A=null,F)=>b(U=>N(U)&&H.call(A,U),null,F))}c.filter=l;function i(b){return b}c.signal=i;function n(...b){return(N,H=null,A)=>Object(V.e)(...b.map(F=>F(U=>N.call(H,U),null,A)))}c.any=n;function O(b,N,H){let A=H;return s(b,F=>(A=N(A,F),A))}c.reduce=O;function C(b){let N;const H=new r({onFirstListenerAdd(){N=b(H.fire,H)},onLastListenerRemove(){N.dispose()}});return H.event}function T(b,N,H=100,A=!1,F){let U,w,Y,Z=0;const ce=new r({leakWarningThreshold:F,onFirstListenerAdd(){U=b(be=>{Z++,w=N(w,be),A&&!Y&&(ce.fire(w),w=void 0),clearTimeout(Y),Y=setTimeout(()=>{const Ze=w;w=void 0,Y=void 0,(!A||Z>1)&&ce.fire(Ze),Z=0},H)})},onLastListenerRemove(){U.dispose()}});return ce.event}c.debounce=T;function R(b,N=(H,A)=>H===A){let H=!0,A;return l(b,F=>{const U=H||!N(F,A);return H=!1,A=F,U})}c.latch=R;function S(b,N){return[c.filter(b,N),c.filter(b,H=>!N(H))]}c.split=S;function y(b,N=!1,H=[]){let A=H.slice(),F=b(Y=>{A?A.push(Y):w.fire(Y)});const U=()=>{A&&A.forEach(Y=>w.fire(Y)),A=null},w=new r({onFirstListenerAdd(){F||(F=b(Y=>w.fire(Y)))},onFirstListenerDidAdd(){A&&(N?setTimeout(U):U())},onLastListenerRemove(){F&&F.dispose(),F=null}});return w.event}c.buffer=y;class E{constructor(b){this.event=b}map(b){return new E(s(this.event,b))}forEach(b){return new E(d(this.event,b))}filter(b){return new E(l(this.event,b))}reduce(b,N){return new E(O(this.event,b,N))}latch(){return new E(R(this.event))}debounce(b,N=100,H=!1,A){return new E(T(this.event,b,N,H,A))}on(b,N,H){return this.event(b,N,H)}once(b,N,H){return a(this.event)(b,N,H)}}function f(b){return new E(b)}c.chain=f;function h(b,N,H=A=>A){const A=(...Y)=>w.fire(H(...Y)),F=()=>b.on(N,A),U=()=>b.removeListener(N,A),w=new r({onFirstListenerAdd:F,onLastListenerRemove:U});return w.event}c.fromNodeEventEmitter=h;function v(b,N,H=A=>A){const A=(...Y)=>w.fire(H(...Y)),F=()=>b.addEventListener(N,A),U=()=>b.removeEventListener(N,A),w=new r({onFirstListenerAdd:F,onLastListenerRemove:U});return w.event}c.fromDOMEventEmitter=v;function g(b){return new Promise(N=>a(b)(N))}c.toPromise=g})(L||(L={}));class D{constructor(c){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${c}_${D._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}}}D._idPool=0;let K=-1;class M{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=K;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||c<a)return;this._stacks||(this._stacks=new Map);const s=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),d=this._stacks.get(s)||0;if(this._stacks.set(s,d+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let l,i=0;for(const[n,O]of this._stacks)(!l||i<O)&&(l=n,i=O);console.warn(`[${this.name}] potential listener LEAK detected, having ${c} listeners already. MOST frequent listener (${i}):`),console.warn(l)}return()=>{const l=this._stacks.get(s)||0;this._stacks.set(s,l-1)}}}class r{constructor(c){var a;this._disposed=!1,this._options=c,this._leakageMon=K>0?new M(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((a=this._options)===null||a===void 0?void 0:a._profName)?new D(this._options._profName):void 0}get event(){return this._event||(this._event=(c,a,s)=>{var d;this._listeners||(this._listeners=new I.a);const l=this._listeners.isEmpty();l&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(a?[c,a]:c);l&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,c,a);const n=(d=this._leakageMon)===null||d===void 0?void 0:d.check(this._listeners.size),O=Object(V.i)(()=>{if(n&&n(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const C=this._listeners&&!this._listeners.isEmpty();C||this._options.onLastListenerRemove(this)}});return s instanceof V.b?s.add(O):Array.isArray(s)&&s.push(O),O}),this._event}fire(c){var a,s;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new I.a);for(let d of this._listeners)this._deliveryQueue.push([d,c]);for((a=this._perfMon)===null||a===void 0||a.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[d,l]=this._deliveryQueue.shift();try{typeof d=="function"?d.call(void 0,l):d[0].call(d[1],l)}catch(i){Object(ne.f)(i)}}(s=this._perfMon)===null||s===void 0||s.stop()}}dispose(){var c,a,s,d,l;this._disposed||(this._disposed=!0,(c=this._listeners)===null||c===void 0||c.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(d=(s=this._options)===null||s===void 0?void 0:s.onLastListenerRemove)===null||d===void 0||d.call(s),(l=this._leakageMon)===null||l===void 0||l.dispose())}}class P extends r{constructor(c){super(c);this._isPaused=0,this._eventQueue=new I.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 P{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,s,d)=>c(l=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>a.call(s,l)):a.call(s,l)},void 0,d)}bufferEvents(c){const a=[];this.buffers.push(a);const s=c();return this.buffers.pop(),a.forEach(d=>d()),s}}class m{constructor(){this.listening=!1,this.inputEvent=L.None,this.inputEventListener=V.a.None,this.emitter=new r({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(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(Lt,ve,k){"use strict";(function(ne,V){k.d(ve,"b",function(){return s}),k.d(ve,"i",function(){return n}),k.d(ve,"f",function(){return O}),k.d(ve,"d",function(){return C}),k.d(ve,"g",function(){return T}),k.d(ve,"h",function(){return R}),k.d(ve,"c",function(){return S}),k.d(ve,"k",function(){return y}),k.d(ve,"j",function(){return E}),k.d(ve,"a",function(){return f}),k.d(ve,"e",function(){return g});var I;const z="en";let L=!1,D=!1,K=!1,M=!1,r=!1,P=!1,x=!1,p,m=z,c,a;const s=typeof self=="object"?self:typeof ne=="object"?ne:{};let d;typeof s.vscode!="undefined"&&typeof s.vscode.process!="undefined"?d=s.vscode.process:typeof V!="undefined"&&(d=V);const l=typeof((I=d==null?void 0:d.versions)===null||I===void 0?void 0:I.electron)=="string"&&d.type==="renderer";if(typeof navigator=="object"&&!l)a=navigator.userAgent,L=a.indexOf("Windows")>=0,D=a.indexOf("Macintosh")>=0,x=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=a.indexOf("Linux")>=0,P=!0,p=navigator.language,m=p;else if(typeof d=="object"){L=d.platform==="win32",D=d.platform==="darwin",K=d.platform==="linux",M=K&&!!d.env.SNAP&&!!d.env.SNAP_REVISION,p=z,m=z;const b=d.env.VSCODE_NLS_CONFIG;if(b)try{const N=JSON.parse(b),H=N.availableLanguages["*"];p=N.locale,m=H||z,c=N._translationsConfigFile}catch(N){}r=!0}else console.error("Unable to resolve platform.");let i=0;D?i=1:L?i=3:K&&(i=2);const n=L,O=D,C=K,T=r,R=P,S=x,y=a,E=function(){if(s.setImmediate)return s.setImmediate.bind(s);if(typeof s.postMessage=="function"&&!s.importScripts){let H=[];s.addEventListener("message",F=>{if(F.data&&F.data.vscodeSetImmediateId)for(let U=0,w=H.length;U<w;U++){const Y=H[U];if(Y.id===F.data.vscodeSetImmediateId){H.splice(U,1),Y.callback();return}}});let A=0;return F=>{const U=++A;H.push({id:U,callback:F}),s.postMessage({vscodeSetImmediateId:U},"*")}}if(typeof(d==null?void 0:d.nextTick)=="function")return d.nextTick.bind(d);const N=Promise.resolve();return H=>N.then(H)}(),f=D||x?2:L?1:3;let h=!0,v=!1;function g(){if(!v){v=!0;const b=new Uint8Array(2);b[0]=1,b[1]=2;const N=new Uint16Array(b.buffer);h=N[0]===(2<<8)+1}return h}}).call(this,k("IyRk"),k("Q2Ig"))},N0LK:function(Lt,ve,k){"use strict";k.d(ve,"C",function(){return ne}),k.d(ve,"v",function(){return I}),k.d(ve,"s",function(){return z}),k.d(ve,"t",function(){return L}),k.d(ve,"U",function(){return D}),k.d(ve,"J",function(){return K}),k.d(ve,"O",function(){return M}),k.d(ve,"p",function(){return r}),k.d(ve,"T",function(){return P}),k.d(ve,"q",function(){return x}),k.d(ve,"N",function(){return p}),k.d(ve,"M",function(){return m}),k.d(ve,"Q",function(){return c}),k.d(ve,"u",function(){return a}),k.d(ve,"x",function(){return s}),k.d(ve,"I",function(){return d}),k.d(ve,"f",function(){return l}),k.d(ve,"h",function(){return i}),k.d(ve,"g",function(){return n}),k.d(ve,"i",function(){return O}),k.d(ve,"G",function(){return C}),k.d(ve,"H",function(){return T}),k.d(ve,"r",function(){return R}),k.d(ve,"R",function(){return S}),k.d(ve,"d",function(){return y}),k.d(ve,"e",function(){return E}),k.d(ve,"E",function(){return f}),k.d(ve,"F",function(){return h}),k.d(ve,"j",function(){return v}),k.d(ve,"z",function(){return g}),k.d(ve,"K",function(){return N}),k.d(ve,"L",function(){return H}),k.d(ve,"m",function(){return F}),k.d(ve,"k",function(){return w}),k.d(ve,"A",function(){return Z}),k.d(ve,"a",function(){return ce}),k.d(ve,"n",function(){return be}),k.d(ve,"l",function(){return Ze}),k.d(ve,"D",function(){return Ce}),k.d(ve,"B",function(){return We}),k.d(ve,"b",function(){return Ve}),k.d(ve,"S",function(){return Ye}),k.d(ve,"o",function(){return we}),k.d(ve,"P",function(){return X}),k.d(ve,"w",function(){return j}),k.d(ve,"c",function(){return W}),k.d(ve,"y",function(){return G});function ne(le){return!le||typeof le!="string"?!0:le.trim().length===0}const V=/{(\d+)}/g;function I(le,...Se){return Se.length===0?le:le.replace(V,function(je,ze){const yt=parseInt(ze,10);return isNaN(yt)||yt<0||yt>=Se.length?je:Se[yt]})}function z(le){return le.replace(/[<>&]/g,function(Se){switch(Se){case"<":return"<";case">":return">";case"&":return"&";default:return Se}})}function L(le){return le.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function D(le,Se=" "){const je=K(le,Se);return M(je,Se)}function K(le,Se){if(!le||!Se)return le;const je=Se.length;if(je===0||le.length===0)return le;let ze=0;for(;le.indexOf(Se,ze)===ze;)ze=ze+je;return le.substring(ze)}function M(le,Se){if(!le||!Se)return le;const je=Se.length,ze=le.length;if(je===0||ze===0)return le;let yt=ze,Ot=-1;for(;!(Ot=le.lastIndexOf(Se,yt-1),Ot===-1||Ot+je!==yt);){if(Ot===0)return"";yt=Ot}return le.substring(0,yt)}function r(le){return le.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function P(le){return le.replace(/\*/g,"")}function x(le,Se,je={}){if(!le)throw new Error("Cannot create regex from empty string");Se||(le=L(le)),je.wholeWord&&(/\B/.test(le.charAt(0))||(le="\\b"+le),/\B/.test(le.charAt(le.length-1))||(le=le+"\\b"));let ze="";return je.global&&(ze+="g"),je.matchCase||(ze+="i"),je.multiline&&(ze+="m"),je.unicode&&(ze+="u"),new RegExp(le,ze)}function p(le){if(le.source==="^"||le.source==="^$"||le.source==="$"||le.source==="^\\s*$")return!1;const Se=le.exec("");return!!(Se&&le.lastIndex===0)}function m(le){return(le.global?"g":"")+(le.ignoreCase?"i":"")+(le.multiline?"m":"")+(le.unicode?"u":"")}function c(le){return le.split(/\r\n|\r|\n/)}function a(le){for(let Se=0,je=le.length;Se<je;Se++){const ze=le.charCodeAt(Se);if(ze!==32&&ze!==9)return Se}return-1}function s(le,Se=0,je=le.length){for(let ze=Se;ze<je;ze++){const yt=le.charCodeAt(ze);if(yt!==32&&yt!==9)return le.substring(Se,ze)}return le.substring(Se,je)}function d(le,Se=le.length-1){for(let je=Se;je>=0;je--){const ze=le.charCodeAt(je);if(ze!==32&&ze!==9)return je}return-1}function l(le,Se){return le<Se?-1:le>Se?1:0}function i(le,Se,je=0,ze=le.length,yt=0,Ot=Se.length){for(;je<ze&&yt<Ot;je++,yt++){let Bt=le.charCodeAt(je),ln=Se.charCodeAt(yt);if(Bt<ln)return-1;if(Bt>ln)return 1}const Ut=ze-je,Qe=Ot-yt;return Ut<Qe?-1:Ut>Qe?1:0}function n(le,Se){return O(le,Se,0,le.length,0,Se.length)}function O(le,Se,je=0,ze=le.length,yt=0,Ot=Se.length){for(;je<ze&&yt<Ot;je++,yt++){let Bt=le.charCodeAt(je),ln=Se.charCodeAt(yt);if(Bt===ln)continue;if(Bt>=128||ln>=128)return i(le.toLowerCase(),Se.toLowerCase(),je,ze,yt,Ot);C(Bt)&&(Bt-=32),C(ln)&&(ln-=32);const Ke=Bt-ln;if(Ke===0)continue;return Ke}const Ut=ze-je,Qe=Ot-yt;return Ut<Qe?-1:Ut>Qe?1:0}function C(le){return le>=97&&le<=122}function T(le){return le>=65&&le<=90}function R(le,Se){return le.length===Se.length&&O(le,Se)===0}function S(le,Se){const je=Se.length;return Se.length>le.length?!1:O(le,Se,0,je)===0}function y(le,Se){let je,ze=Math.min(le.length,Se.length);for(je=0;je<ze;je++)if(le.charCodeAt(je)!==Se.charCodeAt(je))return je;return ze}function E(le,Se){let je,ze=Math.min(le.length,Se.length);const yt=le.length-1,Ot=Se.length-1;for(je=0;je<ze;je++)if(le.charCodeAt(yt-je)!==Se.charCodeAt(Ot-je))return je;return ze}function f(le){return 55296<=le&&le<=56319}function h(le){return 56320<=le&&le<=57343}function v(le,Se){return(le-55296<<10)+(Se-56320)+65536}function g(le,Se,je){const ze=le.charCodeAt(je);if(f(ze)&&je+1<Se){const yt=le.charCodeAt(je+1);if(h(yt))return v(ze,yt)}return ze}function b(le,Se){const je=le.charCodeAt(Se-1);if(h(je)&&Se>1){const ze=le.charCodeAt(Se-2);if(f(ze))return v(ze,je)}return je}function N(le,Se){const je=Q.getInstance(),ze=Se,yt=le.length,Ot=g(le,yt,Se);Se+=Ot>=65536?2:1;let Ut=je.getGraphemeBreakType(Ot);for(;Se<yt;){const Qe=g(le,yt,Se),Bt=je.getGraphemeBreakType(Qe);if(W(Ut,Bt))break;Se+=Qe>=65536?2:1,Ut=Bt}return Se-ze}function H(le,Se){const je=Q.getInstance(),ze=Se,yt=b(le,Se);Se-=yt>=65536?2:1;let Ot=je.getGraphemeBreakType(yt);for(;Se>0;){const Ut=b(le,Se),Qe=je.getGraphemeBreakType(Ut);if(W(Qe,Ot))break;Se-=Ut>=65536?2:1,Ot=Qe}return ze-Se}const A=/(?:[\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 F(le){return A.test(le)}const U=/(?:[\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 w(le){return U.test(le)}const Y=/^[\t\n\r\x20-\x7E]*$/;function Z(le){return Y.test(le)}const ce=/[\u2028\u2029]/;function be(le){return ce.test(le)}function Ze(le){for(let Se=0,je=le.length;Se<je;Se++)if(Ce(le.charCodeAt(Se)))return!0;return!1}function Ce(le){return le=+le,le>=11904&&le<=55215||le>=63744&&le<=64255||le>=65281&&le<=65374}function We(le){return le>=127462&&le<=127487||le===8986||le===8987||le===9200||le===9203||le>=9728&&le<=10175||le===11088||le===11093||le>=127744&&le<=128591||le>=128640&&le<=128764||le>=128992&&le<=129003||le>=129280&&le<=129535||le>=129648&&le<=129750}const Ve=String.fromCharCode(65279);function Ye(le){return!!(le&&le.length>0&&le.charCodeAt(0)===65279)}function we(le,Se=!1){return le?(Se&&(le=le.replace(/\\./g,"")),le.toLowerCase()!==le):!1}function X(le){const Se=90-65+1;return le=le%(2*Se),le<Se?String.fromCharCode(97+le):String.fromCharCode(65+le-Se)}function j(le){const Se=Q.getInstance();return Se.getGraphemeBreakType(le)}function W(le,Se){return le===0?Se!==5&&Se!==7:le===2&&Se===3?!1:le===4||le===2||le===3||(Se===4||Se===2||Se===3)?!0:le===8&&(Se===8||Se===9||Se===11||Se===12)||((le===11||le===9)&&(Se===9||Se===10)||((le===12||le===10)&&Se===10||(Se===5||Se===13||(Se===7||(le===1||le===13&&Se===14)))))?!1:!(le===6&&Se===6)}class Q{constructor(){this._data=re()}static getInstance(){return Q._INSTANCE||(Q._INSTANCE=new Q),Q._INSTANCE}getGraphemeBreakType(le){if(le<32)return le===10?3:le===13?2:4;if(le<127)return 0;const Se=this._data,je=Se.length/3;let ze=1;for(;ze<=je;)if(le<Se[3*ze])ze=2*ze;else if(le>Se[3*ze+1])ze=2*ze+1;else return Se[3*ze+2];return 0}}Q._INSTANCE=null;function re(){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 G(le,Se){if(le===0)return 0;const je=xe(le,Se);if(je!==void 0)return je;const ze=b(Se,le);return le-=Ie(ze),le}function xe(le,Se){let je=b(Se,le);for(le-=Ie(je);tt(je)||je===65039||je===8419;){if(le===0)return;je=b(Se,le),le-=Ie(je)}if(!We(je))return;if(le>=0){const ze=b(Se,le);ze===8205&&(le-=Ie(ze))}return le}function Ie(le){return le>=65536?2:1}function tt(le){return 127995<=le&&le<=127999}},NLgs:function(Lt,ve,k){"use strict";k.d(ve,"e",function(){return d}),k.d(ve,"f",function(){return l}),k.d(ve,"d",function(){return n}),k.d(ve,"c",function(){return O}),k.d(ve,"a",function(){return C}),k.d(ve,"b",function(){return T});var ne=k("miYZ"),V=k("tsqr"),I=k("9og8"),z=k("2qtc"),L=k("kLXV"),D=k("WmNS"),K=k.n(D),M=k("q1tI"),r=k.n(M),P=k("9kvl"),x=k("xKgJ"),p=k("1vsH"),m=k("RCxd"),c=k("yTi+"),a=k.n(c),s=k("m3rI"),d=function(S){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(l(S)&&i(y))},l=function(S){return Object(x.p)()?!0:(S({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},i=function(){var S,y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,E=Object(P.c)()._store.getState(),f=E.user;return(S=f.userInfo)!==null&&S!==void 0&&S.profile_completed?!0:(L.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:y?"\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(){P.d.push("/account/profile/edit")}}),!1)},n=function(){var S,y=Object(P.c)()._store.getState(),E=y.user;return(S=E.userInfo)!==null&&S!==void 0&&S.professional_certification?!0:(L.a.confirm({title:"\u63D0\u793A",centered:!0,content:r.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(){var S;if(Object(x.a)())return!0;var y=Object(P.c)()._store.getState(),E=y.user,f=y.globalSetting;return L.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("p",null,"\u626B\u7801\u6DFB\u52A0\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),r.a.createElement("img",{src:s.a.IMG_SERVER+(f==null||((S=f.setting)===null||S===void 0)?void 0:S.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},C=function(S,y){var E;if(S)return!0;var f=Object(P.c)()._store.getState(),h=f.user,v=f.globalSetting;return L.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("p",null,y||"\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"),r.a.createElement("div",{style:{marginLeft:"110px"}},r.a.createElement("img",{src:s.a.IMG_SERVER+(v==null||((E=v.setting)===null||E===void 0)?void 0:E.authority_qrcode_url),width:200}),r.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},T=function(S){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",E=Object(P.c)()._store.getState(),f=E.shixunsDetail.detail;return(f==null?void 0:f.public)===2||(f==null?void 0:f.public)===1||(f==null?void 0:f.shixun_status)===3?(L.a.info({centered:!0,icon:r.a.createElement(m.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(f==null?void 0:f.public)===2?"\u5DF2\u516C\u5F00":(f==null?void 0:f.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",y,"\u3002"),r.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),r.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):(f==null?void 0:f.shixun_status)===2?(L.a.confirm({centered:!0,icon:r.a.createElement(m.a,null),title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",y,"\u3002"),r.a.createElement("br",null),r.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(){L.a.confirm({width:440,centered:!0,icon:r.a.createElement(m.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 v=Object(I.a)(K.a.mark(function b(){var N;return K.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,S({type:"shixunsDetail/cancelRelease",payload:{id:f==null?void 0:f.identifier}});case 2:N=A.sent,N.status!==401&&(V.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),S({type:"shixunsDetail/getShixunsDetail",payload:{id:f==null?void 0:f.identifier}}),S({type:"practiceSetting/getCommonData",payload:{id:f==null?void 0:f.identifier}}));case 4:case"end":return A.stop()}},b)}));function g(){return v.apply(this,arguments)}return g}()})}}),!0):!1}},Nd3P:function(Lt,ve,k){Lt.exports={wrap:"wrap___h8kK3",maxWidth70:"maxWidth70___31ilo",maxWidth80:"maxWidth80___QYyBn",maxWidth100:"maxWidth100___1Caz0",maxWidth110:"maxWidth110___2Ikef",maxWidth120:"maxWidth120___1TY6-",reviewStatusTooltip:"reviewStatusTooltip___btvLr",color32C:"color32C___3168D",MdEditor:"MdEditor___1md-c",tr1:"tr1___33AUl"}},NvD2:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return D});var ne=k("Kwbf");function V(K,M){var r=new Set;return K.forEach(function(P){M.has(P)||r.add(P)}),r}function I(K){var M=K||{},r=M.disabled,P=M.disableCheckbox,x=M.checkable;return!!(r||P)||x===!1}function z(K,M,r,P){for(var x=new Set(K),p=new Set,m=0;m<=r;m+=1){var c=M.get(m)||new Set;c.forEach(function(l){var i=l.key,n=l.node,O=l.children,C=O===void 0?[]:O;x.has(i)&&!P(n)&&C.filter(function(T){return!P(T.node)}).forEach(function(T){x.add(T.key)})})}for(var a=new Set,s=r;s>=0;s-=1){var d=M.get(s)||new Set;d.forEach(function(l){var i=l.parent,n=l.node;if(P(n)||!l.parent||a.has(l.parent.key))return;if(P(l.parent.node)){a.add(i.key);return}var O=!0,C=!1;(i.children||[]).filter(function(T){return!P(T.node)}).forEach(function(T){var R=T.key,S=x.has(R);O&&!S&&(O=!1),!C&&(S||p.has(R))&&(C=!0)}),O&&x.add(i.key),C&&p.add(i.key),a.add(i.key)})}return{checkedKeys:Array.from(x),halfCheckedKeys:Array.from(V(p,x))}}function L(K,M,r,P,x){for(var p=new Set(K),m=new Set(M),c=0;c<=P;c+=1){var a=r.get(c)||new Set;a.forEach(function(i){var n=i.key,O=i.node,C=i.children,T=C===void 0?[]:C;!p.has(n)&&!m.has(n)&&!x(O)&&T.filter(function(R){return!x(R.node)}).forEach(function(R){p.delete(R.key)})})}m=new Set;for(var s=new Set,d=P;d>=0;d-=1){var l=r.get(d)||new Set;l.forEach(function(i){var n=i.parent,O=i.node;if(x(O)||!i.parent||s.has(i.parent.key))return;if(x(i.parent.node)){s.add(n.key);return}var C=!0,T=!1;(n.children||[]).filter(function(R){return!x(R.node)}).forEach(function(R){var S=R.key,y=p.has(S);C&&!y&&(C=!1),!T&&(y||m.has(S))&&(T=!0)}),C||p.delete(n.key),T&&m.add(n.key),s.add(n.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(V(m,p))}}function D(K,M,r,P){var x=[],p;P?p=P:p=I;var m=new Set(K.filter(function(d){var l=!!r[d];return l||x.push(d),l})),c=new Map,a=0;Object.keys(r).forEach(function(d){var l=r[d],i=l.level,n=c.get(i);n||(n=new Set,c.set(i,n)),n.add(l),a=Math.max(a,i)}),Object(ne.a)(!x.length,"Tree missing follow keys: ".concat(x.slice(0,100).map(function(d){return"'".concat(d,"'")}).join(", ")));var s;return M===!0?s=z(m,c,a,p):s=L(m,M.halfCheckedKeys,c,a,p),s}},OH33:function(Lt,ve,k){"use strict";k.r(ve);var ne=k("g9YV"),V=k("wCAj"),I=k("Znn+"),z=k("ZTPi"),L=k("5Dmo"),D=k("3S7+"),K=k("sPJy"),M=k("bE4q"),r=k("+L6B"),P=k("2/Rp"),x=k("miYZ"),p=k("tsqr"),m=k("9og8"),c=k("2qtc"),a=k("kLXV"),s=k("tJVT"),d=k("WmNS"),l=k.n(d),i=k("q1tI"),n=k.n(i),O=k("ErOA"),C=k("Ty5D"),T=k("55Ip"),R=k("9kvl"),S=k("jhfD"),y=k("1vsH"),E=k("T2oS"),f=k("W9HT"),h=k("DjyN"),v=k("NUBc"),g=k("k1fw"),b=k("9Bee"),N=function(qt){var fn=qt.shixunHomeworks,tn=qt.dispatch,Xn=Object(C.i)();return n.a.createElement(a.a,{centered:!0,title:"\u63D0\u793A",visible:fn.actionTabs.key==="\u5220\u9664",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(l.a.mark(function Qn(){var J;return l.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return Oe.next=2,tn({type:"shixunHomeworks/deleteReply",payload:{object_id:fn.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:J=Oe.sent,J.status===0&&(p.b.success("\u5220\u9664\u6210\u529F"),tn({type:"shixunHomeworks/setActionTabs",payload:{}}),tn({type:"shixunHomeworks/getReplyList",payload:Object(g.a)({},fn.actionTabs.params)}));case 4:case"end":return Oe.stop()}},Qn)})),onCancel:function(){tn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},H=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks;return{shixunHomeworks:qt}})(N),A=k("wd/R"),F=k.n(A),U=k("iF7n"),w=k.n(U),Y=k("xKgJ"),Z=k("BdwD");F.a.lang("ZH-cn");var ce=["","\u7B80\u5355","\u4E2D\u7B49","\u56F0\u96BE"],be=function(qt){var fn,tn,Xn=qt.shixunHomeworks,Qn=qt.classroomList,J=qt.globalSetting,ge=qt.user,Oe=qt.loading,Re=qt.dispatch,qe=Object(i.useState)(Object(g.a)(Object(g.a)({},Object(C.i)()),{},{per_page:10})),Ue=Object(s.a)(qe,2),Je=Ue[0],dt=Ue[1],wt=Object(i.useState)([]),Tt=Object(s.a)(wt,2),Be=Tt[0],ft=Tt[1],et=Object(i.useState)(-1),rt=Object(s.a)(et,2),ht=rt[0],_t=rt[1],st=Object(i.useState)(""),Pt=Object(s.a)(st,2),Wt=Pt[0],cn=Pt[1],On=Object(i.useState)(""),an=Object(s.a)(On,2),mn=an[0],hn=an[1],gt=Qn.detailLeftMenus,Kt=Object(C.h)(),St=Object(i.useState)({}),pt=Object(s.a)(St,2),gn=pt[0],on=pt[1],Dt=Xn.workDetail,it=Xn.workList,_n=Object(i.useState)("1"),Gt=Object(s.a)(_n,2),In=Gt[0],kt=Gt[1],sn=Object(i.useState)(!1),En=Object(s.a)(sn,2),$t=En[0],sr=En[1];Object(i.useEffect)(function(){it.homework_status&&un()},[it]);function un(){return nn.apply(this,arguments)}function nn(){return nn=Object(m.a)(l.a.mark(function mt(){var Xe,Et,vt;return l.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:return sr(!0),Rn.next=3,Object(O.a)("/api/courses/".concat(Je.coursesId,"/homework_commons/edit_hack_homework.json"),{method:"get",params:Object(g.a)(Object(g.a)({},Je),{},{id:Je.categoryId})});case 3:vt=Rn.sent,ft(vt),sr(!1),Je.defaultExpandedRowKeys=["".concat(vt==null||((Xe=vt.data)===null||Xe===void 0||((Et=Xe[0])===null||Et===void 0))?void 0:Et.identifier)],In!="2"&&kt(vt!=null&&vt.description?"1":"2"),dt(Object(g.a)({},Je));case 9:case"end":return Rn.stop()}},mt)})),nn.apply(this,arguments)}return n.a.createElement("section",{className:w.a.bg},n.a.createElement(f.a,{spinning:$t},n.a.createElement(z.a,{onChange:function(Xe){kt(Xe)},activeKey:In},n.a.createElement(z.a.TabPane,{key:1,tab:"\u8BF4\u660E"},n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},!(Be!=null&&Be.description)&&n.a.createElement(Z.a,{customText:"\u6682\u65E0\u8BF4\u660E"}),n.a.createElement(b.a,{value:(Be==null?void 0:Be.description)||""}))),n.a.createElement(z.a.TabPane,{key:2,tab:"\u9898\u76EE\u5217\u8868"},n.a.createElement("div",null,n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},Je.defaultExpandedRowKeys&&n.a.createElement(V.a,{dataSource:Be==null?void 0:Be.data,rowKey:function(Xe){return Xe==null?void 0:Xe.identifier},pagination:!1,expandable:{expandedRowRender:function(Xe){var Et,vt;return n.a.createElement("div",{style:{padding:"10px 48px",borderRadius:2}},n.a.createElement("p",null,"\u9898\u76EE\uFF1A",Xe==null?void 0:Xe.name),n.a.createElement("p",null,"\u63CF\u8FF0\uFF1A",Xe==null?void 0:Xe.description),n.a.createElement("div",{style:{width:"100%",textAlign:"end"}},Object(Y.c)()&&(Be==null||((Et=Be.homework_status)===null||Et===void 0)?void 0:Et.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(P.a,{type:"primary",ghost:!0,onClick:function(){window.open("/problems/".concat(Xe==null?void 0:Xe.identifier,"/edit?type=1")),localStorage.setItem("program_homework",[Je.coursesId,Je.categoryId])}},"\u7F16\u8F91"),Object(Y.c)()&&(Be==null||((vt=Be.homework_status)===null||vt===void 0)?void 0:vt.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(P.a,{type:"primary",style:{marginLeft:20},ghost:!0,onClick:function(){a.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Rn=Object(m.a)(l.a.mark(function Gn(){var jn;return l.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:return rr.next=2,Object(O.a)("/api/problems/".concat(Xe==null?void 0:Xe.identifier,".json"),{method:"delete"});case 2:jn=rr.sent,(jn==null?void 0:jn.status)===0&&(p.b.info("\u5220\u9664\u6210\u529F"),Je.page=1,un());case 4:case"end":return rr.stop()}},Gn)}));function pn(){return Rn.apply(this,arguments)}return pn}()})}},"\u5220\u9664")))},defaultExpandedRowKeys:Je.defaultExpandedRowKeys},columns:[{title:"\u9898\u76EE",dataIndex:"name",ellipsis:!0,width:"20%",key:"name"},{title:"\u96BE\u5EA6",dataIndex:"difficult",key:"difficult",render:function(Xe,Et,vt){return n.a.createElement("div",null,ce[Xe])}},{title:"\u901A\u8FC7\u7387",dataIndex:"pass_rate",key:"pass_rate"},{title:"\u901A\u8FC7\u4EBA\u6570",dataIndex:"submit_info",key:"submit_info"},{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline",ellipsis:!0,width:"10%",key:"tag_discipline"},{title:"\u64CD\u4F5C",dataIndex:"identifier",key:"identifier",render:function(Xe,Et,vt){return n.a.createElement("div",null,n.a.createElement("a",{href:"/classrooms/".concat(Je.coursesId,"/program_homework/").concat(Je.categoryId,"/").concat(Xe,"/ranking")},"\u6392\u884C"),n.a.createElement("a",{onClick:Object(m.a)(l.a.mark(function Ht(){var Rn;return l.a.wrap(function(Gn){for(;;)switch(Gn.prev=Gn.next){case 0:return Gn.next=2,Object(O.a)("/api/problems/".concat(Et==null?void 0:Et.identifier,"/start.json"),{method:"get"});case 2:Rn=Gn.sent,Rn&&(window.open("/myproblems/".concat(Rn==null?void 0:Rn.identifier,"?type=1")),localStorage.setItem("program_homework",[Je.coursesId,Je.categoryId]));case 4:case"end":return Gn.stop()}},Ht)})),style:{margin:"0px 20px"}},Object(Y.c)()?"\u4F53\u9A8C":"\u8FDB\u5165\u7B54\u9898"))}}]})),console.log("---",["".concat(Be==null||((fn=Be.data)===null||fn===void 0||((tn=fn[0])===null||tn===void 0))?void 0:tn.identifier)]),n.a.createElement("aside",{className:"tc mt30 pb30"},n.a.createElement(v.a,{defaultCurrent:1,total:Be==null?void 0:Be.count,hideOnSinglePage:!0,showTotal:function(Xe){return n.a.createElement("span",null,"\u5171",Xe,"\u6761")},current:Je.page||1,pageSize:Je.per_page||10,onChange:function(Xe,Et){Je.page=Xe,Je.per_page=Et,dt(Object(g.a)({},Je)),un()}})))))),n.a.createElement(H,null))},Ze=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks,fn=Tn.classroomList,tn=Tn.loading,Xn=Tn.user,Qn=Tn.globalSetting;return{shixunHomeworks:qt,globalSetting:Qn,classroomList:fn,user:Xn,loading:tn.effects}})(be),Ce=k("oBTY"),We=k("giR+"),Ve=k("fyUT"),Ye=k("7Kak"),we=k("9yH6"),X=k("qVdP"),j=k("jsC+"),W=k("5NDa"),Q=k("5rEg"),re=k("14J3"),G=k("BMrR"),xe=k("sRBo"),Ie=k("kaz8"),tt=k("jCWc"),le=k("kPKH"),Se=k("lUTK"),je=k("BvKs"),ze=k("jrin"),yt=k("y8nQ"),Ot=k("Vl3Y"),Ut=k("8Skl"),Qe=k("y3Kf"),Bt=k("Llu2"),ln=k("0NbB"),Ke=k("T7RX"),He=k("PpiC"),ct=k("IMoZ"),bt=function(qt){var fn=qt.shixunHomeworks,tn=qt.dispatch,Xn=Object(He.a)(qt,["shixunHomeworks","dispatch"]),Qn=Object(C.i)(),J=Object(i.useState)(!0),ge=Object(s.a)(J,2),Oe=ge[0],Re=ge[1],qe=Object(i.useState)(!1),Ue=Object(s.a)(qe,2),Je=Ue[0],dt=Ue[1],wt=Ot.a.useForm(),Tt=Object(s.a)(wt,1),Be=Tt[0],ft=function(){var et=Object(m.a)(l.a.mark(function rt(){var ht,_t;return l.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return ht=Be.getFieldValue(),Pt.next=3,Object(O.a)("/api/homework_commons/".concat(Qn.categoryId,"/batch_comment.json"),{method:"post",body:{student_work_ids:Object(Ce.a)(fn.actionTabs.selectArrs),cover_all:Oe,hidden_comment:ht.hidden_comment,comment:ht.comment}});case 3:_t=Pt.sent,_t.status===0&&(p.b.success("\u8BC4\u9605\u6210\u529F"),Be.resetFields(),tn({type:"shixunHomeworks/setActionTabs",payload:{}}),tn({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},fn.actionTabs.params)}));case 5:case"end":return Pt.stop()}},rt)}));return function(){return et.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(a.a,{centered:!0,title:"\u4E00\u952E\u70B9\u8BC4",visible:fn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(l.a.mark(function et(){var rt;return l.a.wrap(function(_t){for(;;)switch(_t.prev=_t.next){case 0:rt=Be.getFieldValue(),JSON.stringify(rt)==="{}"||rt.hidden_comment===""&&rt.comment===""?dt(!0):fn.workList.partial_comment?tn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",selectArrs:fn.actionTabs.selectArrs,params:fn.actionTabs.params}}):ft();case 2:case"end":return _t.stop()}},et)})),onCancel:function(){tn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Ot.a,{form:Be,onChange:function(){Je&&dt(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Ot.a.Item,{name:"comment"},n.a.createElement(Q.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8})),n.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Ot.a.Item,{name:"hidden_comment"},n.a.createElement(Q.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),Je&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")),n.a.createElement(a.a,{centered:!0,title:n.a.createElement("span",null,n.a.createElement(ct.a,{className:"c-orange mr20"}),"\u63D0\u793A"),visible:fn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",okText:"\u786E\u5B9A\u70B9\u8BC4",cancelText:"\u653E\u5F03\u70B9\u8BC4",onOk:function(){ft()},onCancel:function(){tn({type:"shixunHomeworks/setActionTabs",payload:{}})},width:400},n.a.createElement("div",{className:"tc"},n.a.createElement("p",null,"\u90E8\u5206\u5B66\u751F\u5DF2\u6709\u70B9\u8BC4\u5185\u5BB9\uFF0C\u662F\u5426\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4\u5185\u5BB9\uFF1F"),n.a.createElement("p",null,n.a.createElement(we.a.Group,{onChange:function(rt){Re(rt.target.value)},value:Oe},n.a.createElement(we.a,{value:!0},"\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4"),n.a.createElement(we.a,{value:!1},"\u8DF3\u8FC7\u5DF2\u6709\u70B9\u8BC4"))))))},de=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks;return{shixunHomeworks:qt}})(bt),q=k("XYT7"),te=k("Nd3P"),se=k.n(te),pe=function(qt){var fn,tn,Xn,Qn,J=qt.shixunHomeworks,ge=qt.dispatch,Oe=Object(He.a)(qt,["shixunHomeworks","dispatch"]),Re=Object(C.i)(),qe=Object(i.useState)(!1),Ue=Object(s.a)(qe,2),Je=Ue[0],dt=Ue[1],wt=Object(i.useState)((fn=J.actionTabs.selectArrs)===null||fn===void 0||((tn=fn.data)===null||tn===void 0)?void 0:tn.name),Tt=Object(s.a)(wt,2),Be=Tt[0],ft=Tt[1],et=Ot.a.useForm(),rt=Object(s.a)(et,1),ht=rt[0];Object(i.useEffect)(function(){var st,Pt,Wt,cn,On,an;J.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4"&&ht.setFieldsValue({comment:(st=J.actionTabs.selectArrs)===null||st===void 0||((Pt=st.data)===null||Pt===void 0)?void 0:Pt.work_comment,hidden_comment:(Wt=J.actionTabs.selectArrs)===null||Wt===void 0||((cn=Wt.data)===null||cn===void 0)?void 0:cn.work_comment_hidden}),ft((On=J.actionTabs.selectArrs)===null||On===void 0||((an=On.data)===null||an===void 0)?void 0:an.name)},[J.actionTabs.key]);var _t=function(){var st=Object(m.a)(l.a.mark(function Pt(){var Wt,cn,On,an;return l.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return On=ht.getFieldValue(),hn.next=3,Object(O.a)("/api/student_works/".concat((Wt=J.actionTabs.selectArrs)===null||Wt===void 0||((cn=Wt.data)===null||cn===void 0)?void 0:cn.homeworkId,"/shixun_work_comment.json"),{method:"post",body:{hidden_comment:On.hidden_comment,comment:On.comment}});case 3:if(an=hn.sent,!(an.status===0)){hn.next=9;break}return p.b.success("\u8BC4\u9605\u6210\u529F"),ht.resetFields(),ge({type:"shixunHomeworks/setActionTabs",payload:{}}),hn.abrupt("return",ge({type:"shixunHomeworks/getWorkList",payload:Re}));case 9:case"end":return hn.stop()}},Pt)}));return function(){return st.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(a.a,{centered:!0,title:(Xn=J.actionTabs.selectArrs)!==null&&Xn!==void 0&&(Qn=Xn.data)!==null&&Qn!==void 0&&Qn.work_comment_hidden?"\u66F4\u6539"+Be+"\u70B9\u8BC4":Be+"\u70B9\u8BC4",visible:J.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(l.a.mark(function st(){var Pt;return l.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:Pt=ht.getFieldValue(),JSON.stringify(Pt)==="{}"||Pt.hidden_comment===""&&Pt.comment===""?dt(!0):_t();case 2:case"end":return cn.stop()}},st)})),onCancel:function(){ge({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Ot.a,{form:ht,onChange:function(){Je&&dt(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Ot.a.Item,{name:"comment"},n.a.createElement(Q.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8})),n.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Ot.a.Item,{name:"hidden_comment"},n.a.createElement(Q.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),Je&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")))},ae=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks;return{shixunHomeworks:qt}})(pe),ie=function(qt){var fn=qt.shixunHomeworks,tn=qt.dispatch,Xn=Object(He.a)(qt,["shixunHomeworks","dispatch"]),Qn=Object(C.i)(),J=Object(i.useState)([]),ge=Object(s.a)(J,2),Oe=ge[0],Re=ge[1],qe=Object(i.useState)([]),Ue=Object(s.a)(qe,2),Je=Ue[0],dt=Ue[1];Object(i.useEffect)(function(){fn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B"&&wt()},[fn.actionTabs.key]);function wt(){return Tt.apply(this,arguments)}function Tt(){return Tt=Object(m.a)(l.a.mark(function ft(){var et;return l.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return ht.next=2,Object(O.a)("/api/homework_commons/".concat(Qn.categoryId,"/code_quality_analyses/group_list.json"),{method:"GET",params:{page:1,limit:200}});case 2:et=ht.sent,Re(et);case 4:case"end":return ht.stop()}},ft)})),Tt.apply(this,arguments)}var Be=[{title:"\u5206\u73ED\u60C5\u51B5",dataIndex:"name"},{title:"\u6709\u6548\u4F5C\u54C1\u6570",dataIndex:"works_count"},{title:"\u68C0\u6D4B\u8FDB\u5EA6",dataIndex:"status"},{title:"\u4E0A\u6B21\u8BC4\u5206\u65F6\u95F4",dataIndex:"last_analysis_time"}];return n.a.createElement(n.a.Fragment,null,n.a.createElement(a.a,{centered:!0,title:"\u4EE3\u7801\u8D28\u91CF\u8BC4\u5206",visible:fn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B",width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(l.a.mark(function ft(){var et;return l.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return ht.next=2,Object(O.a)("/api/homework_commons/".concat(Qn.categoryId,"/code_quality_analyses.json"),{method:"POST",body:{group_ids:Je}});case 2:et=ht.sent,(et==null?void 0:et.status)===0&&(R.d.replace("/classrooms/".concat(Qn.coursesId,"/shixun_homework/").concat(Qn.categoryId,"/detail?tabs=4")),window.location.reload(),tn({type:"shixunHomeworks/setActionTabs",payload:{}}),dt([]));case 4:case"end":return ht.stop()}},ft)})),onCancel:function(){dt([]),tn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(V.a,{rowSelection:{type:"checkbox",onChange:function(et,rt){dt(Object(Ce.a)(et))},selectedRowKeys:Je,getCheckboxProps:function(et){return{disabled:et.status==="\u8FDB\u884C\u4E2D"||et.works_count===0}}},rowKey:function(et){return et.key||et.id},scroll:{y:300},pagination:!1,columns:Be,dataSource:Oe==null?void 0:Oe.group_list})))},me=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks;return{shixunHomeworks:qt}})(ie),_e=k("Ot1p"),Ee=k("mgmH"),Le=function(qt){var fn,tn,Xn,Qn,J,ge,Oe,Re,qe,Ue=qt.shixunHomeworks,Je=qt.loading,dt=qt.dispatch,wt=qt.setExportParams,Tt=qt.user,Be=Object(C.i)(),ft=Object(i.useState)(Object(g.a)(Object(g.a)({},{page:1,limit:20,order:"work_score",b_order:"desc"}),Be)),et=Object(s.a)(ft,2),rt=et[0],ht=et[1],_t=Ot.a.useForm(),st=Object(s.a)(_t,1),Pt=st[0],Wt=Object(i.useState)(),cn=Object(s.a)(Wt,2),On=cn[0],an=cn[1],mn=Object(i.useState)({}),hn=Object(s.a)(mn,2),gt=hn[0],Kt=hn[1],St=Object(i.useState)([]),pt=Object(s.a)(St,2),gn=pt[0],on=pt[1],Dt=Object(i.useState)(!1),it=Object(s.a)(Dt,2),_n=it[0],Gt=it[1],In=Object(i.useState)([]),kt=Object(s.a)(In,2),sn=kt[0],En=kt[1],$t=Object(i.useState)(!1),sr=Object(s.a)($t,2),un=sr[0],nn=sr[1],mt=Object(i.useState)(),Xe=Object(s.a)(mt,2),Et=Xe[0],vt=Xe[1],Ht=Object(i.useState)(1),Rn=Object(s.a)(Ht,2),pn=Rn[0],Gn=Rn[1],jn=Object(i.useState)(),mr=Object(s.a)(jn,2),rr=mr[0],ur=mr[1],Hr=Object(i.useState)(),Nr=Object(s.a)(Hr,2),Fr=Nr[0],si=Nr[1],li=Object(i.useState)(),Te=Object(s.a)(li,2),Ne=Te[0],Ge=Te[1],Ae=Object(i.useState)(),ue=Object(s.a)(Ae,2),ye=ue[0],fe=ue[1],De=Object(i.useState)(),Pe=Object(s.a)(De,2),$e=Pe[0],Me=Pe[1],nt=Object(i.useState)(!1),xt=Object(s.a)(nt,2),It=xt[0],Vt=xt[1],xn=Object(C.h)();Object(i.useEffect)(function(){return An(!0),function(){Kt([]),on([])}},[rt.coursesId]),Object(i.useEffect)(function(){var Xt,Mt=JSON.parse(JSON.stringify(Ue.workList));!(Mt!=null&&(Xt=Mt.student_works)!==null&&Xt!==void 0&&Xt.length)&&Mt!==null&&Mt!==void 0&&Mt.id?(Mt.student_works=[Object(g.a)({},Mt)],Kt(Mt)):(Mt!=null&&Mt.id&&on([Object(g.a)(Object(g.a)({},Mt),{number:"\u6211"})]),Kt(Object(g.a)({},Mt)))},[Ue.workList]);var An=function(Mt){wt(Object(g.a)({},rt));var en=dt({type:"shixunHomeworks/getWorkList",payload:rt});return Mt&&en.then(function(Rt){var At,nr,xr;(Rt!=null&&(At=Rt.homework_status)!==null&&At!==void 0&&At.includes("\u8FDB\u884C\u4E2D")||Rt!=null&&(nr=Rt.homework_status)!==null&&nr!==void 0&&nr.includes("\u8865\u4EA4\u4E2D")||Rt!=null&&(xr=Rt.homework_status)!==null&&xr!==void 0&&xr.includes("\u63D0\u4EA4\u4E2D"))&&!Object(Y.t)()&&$n()}),en};Object(i.useEffect)(function(){qn()},[]);var qn=function(){var Xt=Object(m.a)(l.a.mark(function Mt(){var en;return l.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return At.next=2,Object(q.I)({categoryId:Be.categoryId});case 2:en=At.sent,an(en==null?void 0:en.update_score);case 4:case"end":return At.stop()}},Mt)}));return function(){return Xt.apply(this,arguments)}}(),$n=function(){var Xt=Object(m.a)(l.a.mark(function Mt(){var en;return l.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return dt({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6210\u7EE9\u8BA1\u7B97\u4E2D\uFF0C\u8BF7\u7A0D\u5019..."}}),At.next=3,Object(q.Z)({categoryId:Be.categoryId});case 3:en=At.sent,dt({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),(en==null?void 0:en.status)===0&&(p.b.success(en==null?void 0:en.message),An());case 6:case"end":return At.stop()}},Mt)}));return function(){return Xt.apply(this,arguments)}}(),cr=function(){rt.page=1;var Mt=Object.assign({},Pt.getFieldValue());delete rt.course_group,delete rt.teacher_comment,Object.keys(Mt).map(function(en){switch(en){case"task_status":Mt[en].includes("all")||!Mt[en].length?(delete rt.work_status,Pt.setFieldsValue(Object(ze.a)({},"task_status","all"))):(rt.work_status=Mt[en],Pt.setFieldsValue(Object(ze.a)({},"task_status",rt.work_status)));break;case"course_group_info":Mt[en].includes("all")||!Mt[en].length?(delete rt.course_group,Pt.setFieldsValue(Object(ze.a)({},"course_group_info","all"))):(rt.course_group=Mt[en],Pt.setFieldsValue(Object(ze.a)({},"course_group_info",rt.course_group)));break;case"teacher_comment":if(Mt[en].includes("all")||!Mt[en].length)delete rt.teacher_comment,Pt.setFieldsValue(Object(ze.a)({},"teacher_comment","all"));else{var Rt;rt.teacher_comment=((Rt=Mt[en])===null||Rt===void 0?void 0:Rt.length)===1?Number(Mt[en][0]):"",Pt.setFieldsValue(Object(ze.a)({},"teacher_comment",Mt[en]))}break}}),An()};Object(i.useEffect)(function(){if(document.getElementById("divhe")){var Xt=document.getElementById("divhe").scrollHeight;Xt>47&&(Me(47),Vt(!0))}},[document.getElementById("divhe")]);var gr=function(Mt,en){rt.page=Mt,rt.limit=20,An()};function ir(){Gn(1),ur(""),si(""),Ge(""),fe(""),En([])}var hr=[{title:"\u5E8F\u53F7",dataIndex:"number",align:"center",width:50,fixed:"left",ellipsis:{showTitle:!1},render:function(Mt,en,Rt){return rt.limit*(rt.page-1)+Rt+1}},{title:"\u59D3\u540D",dataIndex:"user_name",align:"center",width:110,fixed:"left",ellipsis:{showTitle:!1},render:function(Mt){return n.a.createElement(D.a,{placement:"bottomLeft",title:Mt},n.a.createElement("span",{className:"current"},Mt))}},!(gt!=null&>.is_excellent)&&!Object(Y.r)()&&{title:"\u5B66\u53F7",dataIndex:"student_id",align:"center",sorter:!0,fixed:"left",width:110,showSorterTooltip:!1,ellipsis:{showTitle:!1},sortOrder:rt.order==="student_id"?rt.b_order==="desc"?"descend":"ascend":null,render:function(Mt){return n.a.createElement(D.a,{placement:"bottomLeft",title:Mt||"--"},n.a.createElement("span",{className:"current"},Mt||"--"))}},{title:"\u5206\u73ED",dataIndex:"group_name",align:"center",width:180,fixed:"left",ellipsis:{showTitle:!1},render:function(Mt,en){return Mt?n.a.createElement(D.a,{placement:"bottom",title:Mt},n.a.createElement("span",{className:"current"},Mt)):"--"}},{title:"\u4F5C\u4E1A\u72B6\u6001",dataIndex:"work_status",align:"center",width:80,fixed:"left",sorter:!0,ellipsis:{showTitle:!1},showSorterTooltip:!1,sortOrder:rt.order==="work_status"?rt.b_order==="desc"?"descend":"ascend":null,render:function(Mt){return n.a.createElement(y.f,{status:Mt})}},{title:"\u5B8C\u6210\u65F6\u95F4",align:"center",dataIndex:"achieve_time",ellipsis:{showTitle:!1},render:function(Mt,en){return n.a.createElement(D.a,{placement:"bottomLeft",title:Mt},n.a.createElement("span",{className:"current"},Mt))}},{title:"\u901A\u8FC7\u60C5\u51B5",align:"center",dataIndex:"achieve_info",ellipsis:{showTitle:!1},render:function(Mt,en){return n.a.createElement("span",null,Mt||"- -")}},{title:"\u6700\u7EC8\u6210\u7EE9",align:"center",dataIndex:"score",ellipsis:{showTitle:!1},render:function(Mt,en){return n.a.createElement("span",null,Mt||"- -")}},{title:"\u5B8C\u6210\u65F6\u957F",dataIndex:"achieve_time_long",align:"center",render:function(Mt,en){return Mt&&Mt!="--"?n.a.createElement(D.a,{placement:"bottom",title:Mt},n.a.createElement("span",{className:"current"},Mt)):"--"}},{title:n.a.createElement("span",null,"\u8BC4\u9605\u72B6\u6001"),align:"center",dataIndex:"has_comment",width:90,fixed:"right",ellipsis:!0,render:function(Mt){return Mt?"\u5DF2\u8BC4\u9605":"\u672A\u8BC4\u9605"}},{title:"\u64CD\u4F5C",dataInex:"action",align:"center",width:70,fixed:"right",ellipsis:!0,className:"workListTable",render:function(Mt,en){return Object(Y.t)()?n.a.createElement("div",null,Object(y.B)(en==null?void 0:en.work_status)==="\u672A\u5F00\u542F"?n.a.createElement("span",null,"--"):n.a.createElement(T.a,{target:"_blank",onClick:function(At){At.stopPropagation()},to:"/classrooms/".concat(rt.coursesId,"/program_homework/").concat(rt.categoryId,"/").concat(en.id,"/").concat(en.user_id,"/comment")},"\u67E5\u770B")):n.a.createElement("a",{target:"_blank",onClick:function(At){var nr;if(At.stopPropagation(),(nr=Tt.userInfo)!==null&&nr!==void 0&&nr.professional_certification)window.open("/classrooms/".concat(rt.coursesId,"/program_homework/").concat(rt.categoryId,"/").concat(en.id,"/").concat(en.user_id,"/comment"),"_blank");else return a.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(y.S)("/account/certification")}}),!1}},"\u67E5\u770B\u4F5C\u4E1A")}}].filter(function(Xt){return!!Xt}),Er=function(){return n.a.createElement(je.a,null,n.a.createElement(je.a.Item,{onClick:function(){Object(Ee.h)(JSON.parse(sessionStorage.all_student_works_params),"shixun_work_list")},key:"1"},"\u5B66\u751F\u6210\u7EE9"),n.a.createElement(je.a.Item,{key:"2"},n.a.createElement(T.a,{to:"/classrooms/".concat(rt.coursesId,"/exportlist/shixun_work_list")},"\u5386\u53F2\u5BFC\u51FA")))};return n.a.createElement(n.a.Fragment,null,n.a.createElement("section",{className:"".concat(se.a.wrap," minH500 bg-white pl30 pr30 pt30")},((fn=gt.homework_status)===null||fn===void 0?void 0:fn.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(Z.a,null),!((tn=gt.homework_status)!==null&&tn!==void 0&&tn.includes("\u672A\u53D1\u5E03"))&&n.a.createElement("aside",null,!Object(Y.c)()&&n.a.createElement("div",{className:"c-light-black font12"},n.a.createElement("span",null,"\u53D1\u5E03\u65F6\u95F4 ",gt==null?void 0:gt.publish_time),n.a.createElement("span",{className:"ml5"},"\u622A\u6B62\u65F6\u95F4 ",gt==null?void 0:gt.end_time),n.a.createElement("span",{className:"ml5"},"\u8865\u4EA4\u65F6\u95F4 ",(gt==null?void 0:gt.late_time)||"- -")),Object(Y.c)()&&n.a.createElement(n.a.Fragment,null,n.a.createElement(Ot.a,{form:Pt,onChange:cr,initialValues:(Xn={},Object(ze.a)(Xn,"task_status","all"),Object(ze.a)(Xn,"course_group_info","all"),Object(ze.a)(Xn,"teacher_comment","all"),Xn)},((Qn=gt.task_status)===null||Qn===void 0?void 0:Qn.length)>0&&n.a.createElement(Ot.a.Item,{name:"task_status"},n.a.createElement(Ie.a.Group,{value:[],style:{width:"100%"}},n.a.createElement(G.a,null,n.a.createElement(le.a,{className:"font14",flex:"80px"},"\u4F5C\u4E1A\u72B6\u6001:"),n.a.createElement(le.a,{flex:"80px"},n.a.createElement(Ie.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(le.a,{flex:"1"},gt.task_status&>.task_status.map(function(Xt,Mt){return n.a.createElement(Ie.a,{name:"task_status",value:Xt.id},Xt.name,"(",Xt.count,")")}))))),((J=gt.course_group_info)===null||J===void 0?void 0:J.length)>0&&n.a.createElement(Ot.a.Item,{name:"course_group_info"},n.a.createElement(Ie.a.Group,{style:{width:"100%"}},n.a.createElement(G.a,null,n.a.createElement(le.a,{className:"font14",flex:"80px"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(le.a,{flex:"80px"},n.a.createElement(Ie.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(le.a,{flex:"1",id:"divhe",style:{height:$e+"px",overflow:"hidden"}},(ge=gt.course_group_info)===null||ge===void 0?void 0:ge.map(function(Xt,Mt){return n.a.createElement(Ie.a,{value:Xt.course_group_id},Xt.group_group_name,"(",Xt.count,")")})),It&&n.a.createElement("span",{onClick:function(){var Mt=document.getElementById("divhe").scrollHeight;$e>47?Me(47):Me(Mt)},style:{color:"rgb(76, 172, 255)",cursor:"pointer",alignItems:"flex-end",display:"flex"}},$e===47?"\u5C55\u5F00":"\u6536\u8D77",$e===47?n.a.createElement(Ut.a,{style:{marginBottom:"3px",marginLeft:"2px"}}):n.a.createElement(Qe.a,{style:{marginBottom:"3px",marginLeft:"2px"}}))))),((Oe=gt.teacher_comment)===null||Oe===void 0?void 0:Oe.length)>0&&n.a.createElement(Ot.a.Item,{name:"teacher_comment"},n.a.createElement(Ie.a.Group,{style:{width:"100%"}},n.a.createElement(G.a,null,n.a.createElement(le.a,{className:"font14",flex:"80px"},"\u8FFD\u52A0\u70B9\u8BC4:"),n.a.createElement(le.a,{flex:"80px"},n.a.createElement(Ie.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(le.a,{flex:"1"},gt.teacher_comment&>.teacher_comment.map(function(Xt,Mt){return n.a.createElement(Ie.a,{value:String(Xt.id)},Xt.name,"(",Xt.count,")")})))))),n.a.createElement(G.a,{align:"middle"},n.a.createElement(le.a,{flex:"1"},n.a.createElement(G.a,{align:"middle"},n.a.createElement(le.a,null,n.a.createElement(Q.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(Mt){rt.search=Mt,rt.page=1,An()},style:{width:240}})),n.a.createElement(le.a,null,n.a.createElement("span",{className:"ml5"},n.a.createElement("span",{className:"c-red"},gt.work_count),"\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08",gt.work_count,"\u4E2A\u5B66\u751F\uFF09")))),n.a.createElement(le.a,null,Object(Y.c)()&&n.a.createElement(P.a,{className:"ml10",onClick:function(){dt({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",selectArrs:gt.student_works.map(function(Mt){return Mt.id}),params:rt}})}},n.a.createElement("span",{className:"".concat(se.a.tr1," iconfont icon-daimachazhong")}),"\u4EE3\u7801\u67E5\u91CD"),Object(Y.c)()&&n.a.createElement(P.a,{className:"ml10",onClick:$n},n.a.createElement("i",{className:"iconfont icon-gengxinchengji font14 pr5"}),"\u66F4\u65B0\u6210\u7EE9"),Object(Y.c)()&&n.a.createElement(j.a,{overlay:Er,className:"ml10"},n.a.createElement(P.a,null,n.a.createElement(Bt.a,null),"\u5BFC\u51FA",n.a.createElement(ln.a,null)))))),n.a.createElement(G.a,{style:{justifyContent:"end",marginTop:"5px"}},Object(Y.c)()&&On&&n.a.createElement("span",null,n.a.createElement("span",{style:{color:"red"}},"*"),"\u5217\u8868\u4E2D\u4F5C\u4E1A\u8BB0\u5F55\u5B58\u5728\u5DEE\u5F02\uFF0C\u8BF7\u70B9\u51FB\u201C\u66F4\u65B0\u6210\u7EE9\u201D\u6309\u94AE")),n.a.createElement(V.a,{className:"mt30",loading:Je["shixunHomeworks/getWorkList"],pagination:!1,style:{cursor:"pointer"},onRow:function(Mt){return{onClick:function(Rt){window.open("/classrooms/".concat(rt.coursesId,"/program_homework/").concat(rt.categoryId,"/").concat(Mt.id,"/").concat(Mt.user_id,"/comment"),"_blank")}}},dataSource:gt.student_works,columns:hr,onChange:function(Mt,en,Rt){Rt.field&&(rt.order=Rt.field),Rt.order||(rt.b_order="asc"),Rt.order==="ascend"&&(rt.b_order="asc"),Rt.order==="descend"&&(rt.b_order="desc"),Rt.order||(rt.b_order="asc"),An()}}),n.a.createElement(de,null),n.a.createElement(ae,null),n.a.createElement(Ke.a,null)),n.a.createElement(a.a,{title:"\u4E00\u952E\u6253\u56DE\u91CD\u505A",visible:_n,centered:!0,destroyOnClose:!0,forceRender:!0,width:700,onOk:Object(m.a)(l.a.mark(function Xt(){var Mt,en;return l.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!(pn===2)){At.next=13;break}if(!(sn.length<=0)){At.next=4;break}return p.b.info("\u8BF7\u9009\u62E9\u4F5C\u4E1A\u72B6\u6001"),At.abrupt("return");case 4:if(ye){At.next=7;break}return p.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),At.abrupt("return");case 7:return At.next=9,Object(O.a)("/api/homework_commons/".concat(rt.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:rt.categoryId,comment:ye,status:sn}});case 9:Mt=At.sent,Mt.status===0&&(vt(Mt),Gt(!1),nn(!0)),At.next=32;break;case 13:if(!(Ne===0||Fr===0)){At.next=16;break}At.next=22;break;case 16:if(Ne){At.next=19;break}return p.b.info("\u6700\u4F4E\u5206\u4E0D\u80FD\u4E3A\u7A7A"),At.abrupt("return");case 19:if(Fr){At.next=22;break}return p.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u4E3A\u7A7A"),At.abrupt("return");case 22:if(!(Ne>Fr)){At.next=25;break}return p.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u5927\u4E8E\u6700\u4F4E\u5206"),At.abrupt("return");case 25:if(ye){At.next=28;break}return p.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),At.abrupt("return");case 28:return At.next=30,Object(O.a)("/api/homework_commons/".concat(rt.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:rt.categoryId,comment:ye,min_score:Ne,max_score:Fr}});case 30:en=At.sent,en.status===0&&(vt(en),Gt(!1),nn(!0));case 32:case"end":return At.stop()}},Xt)})),onCancel:function(){Gt(!1),ir()}},n.a.createElement("div",{style:{padding:"32px"}},n.a.createElement("div",null,n.a.createElement("div",null,n.a.createElement("span",{style:{width:"80px"}},"\u6253\u56DE\u65B9\u5F0F\uFF1A"),n.a.createElement(we.a.Group,{value:pn,onChange:function(Mt){Gn(Mt.target.value)}},n.a.createElement(we.a,{value:1},"\u6309\u6210\u7EE9\u6253\u56DE"),n.a.createElement(we.a,{value:2},"\u6309\u4F5C\u4E1A\u72B6\u6001\u6253\u56DE"))),pn===1&&n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"70px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u4F4E\u5206\uFF1A"),n.a.createElement(Ve.a,{min:0,max:100,value:Ne,onChange:function(Mt){return Ge(Mt)},style:{width:"100px"}}),n.a.createElement("span",{style:{width:"80px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u9AD8\u5206\uFF1A"),n.a.createElement(Ve.a,{min:0,max:100,value:Fr,onChange:function(Mt){return si(Mt)},style:{width:"100px"}})),pn===2&&n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"80px"}},"\u4F5C\u4E1A\u72B6\u6001\uFF1A"),n.a.createElement(Ie.a.Group,{onChange:function(Mt){En(Object(Ce.a)(Mt))},style:{width:"100%"}},(Re=gt.task_status)===null||Re===void 0?void 0:Re.map(function(Xt,Mt){return n.a.createElement(Ie.a,{name:"task_status",value:Xt.id},Xt.name,"(",Xt.count,")")}))),n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"70px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*")," \u8BC4\u8BED\uFF1A"),n.a.createElement(_e.a,{className:se.a.MdEditor,onChange:function(Mt){return fe(Mt)},placeholder:"\u8BF7\u586B\u5199\u8BC4\u8BED"}))))),n.a.createElement(a.a,{visible:un,title:"\u6253\u56DE\u786E\u8BA4",onOk:Object(m.a)(l.a.mark(function Xt(){var Mt,en;return l.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!(pn===2)){At.next=7;break}return At.next=3,Object(O.a)("/api/homework_commons/".concat(rt.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:rt.categoryId,comment:ye,status:sn}});case 3:Mt=At.sent,Mt.status===0&&(p.b.info("\u6253\u56DE\u6210\u529F"),ir(),An(),nn(!1)),At.next=11;break;case 7:return At.next=9,Object(O.a)("/api/homework_commons/".concat(rt.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:rt.categoryId,comment:ye,min_score:Ne,max_score:Fr}});case 9:en=At.sent,en.status===0&&(p.b.info("\u6253\u56DE\u6210\u529F"),ir(),An(),nn(!1));case 11:case"end":return At.stop()}},Xt)})),onCancel:function(){ir(),nn(!1)}},n.a.createElement("div",{style:{padding:"32px"}},pn===1&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u6210\u7EE9\u5728",Ne,"-",Fr,"\u7684\u5B66\u751F\u8FDB\u884C\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),pn===2&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u4F5C\u4E1A\u72B6\u6001\u4E3A",((qe=gt.task_status)===null||qe===void 0?void 0:qe.filter(function(Xt){return sn==null?void 0:sn.includes(Xt.id)}).map(function(Xt){return Xt.name}).toString())+",","\u7684\u5B66\u751F\u8FDB\u884C\u4F5C\u4E1A\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),n.a.createElement("br",null),n.a.createElement("span",null,"\u8BE5\u6761\u4EF6\u4E0B\u5171\u6709",Et==null?void 0:Et.count,"\u540D\u5B66\u751F")))),n.a.createElement(me,null),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(v.a,{showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,onChange:gr,current:rt.page||1,defaultPageSize:20,total:gt.work_count})))},at=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks,fn=Tn.loading,tn=Tn.user;return{shixunHomeworks:qt,loading:fn.effects,user:tn}})(Le),Ct=k("fOrg"),Jt=k("+KLJ"),lt=function(qt){var fn,tn=qt.shixunHomeworks,Xn=qt.loading,Qn=qt.dispatch,J=Object(C.i)(),ge=Object(i.useState)(Object(g.a)(Object(g.a)({},{page:1,limit:20,group_ids:[]}),J)),Oe=Object(s.a)(ge,2),Re=Oe[0],qe=Oe[1],Ue=Object(C.h)(),Je=tn.codeReview,dt=Object(i.useState)({}),wt=Object(s.a)(dt,2),Tt=wt[0],Be=wt[1],ft=Ot.a.useForm(),et=Object(s.a)(ft,1),rt=et[0];Re.order="code_rate",Re.sort="desc",Re.category=Re.categoryId,Object(i.useEffect)(function(){ht(),console.log("params",Re)},[Re]),Object(i.useEffect)(function(){tn.actionTabs.key==="\u6267\u884C\u4EE3\u7801\u67E5\u91CD"&&ht()},[tn.actionTabs.key]);var ht=function(){var Wt=Object(m.a)(l.a.mark(function cn(){var On;return l.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,Qn({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Re)});case 2:On=mn.sent,On.status===-2&&setTimeout(function(){return ht()},1500);case 4:case"end":return mn.stop()}},cn)}));return function(){return Wt.apply(this,arguments)}}(),_t=function(){},st=function(cn,On){Re.page=cn,Re.limit=20,Qn({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Re)})},Pt=[{title:"\u5E8F\u53F7",dataIndex:"number",render:function(cn,On,an){return Re.limit*(Re.page-1)+an+1}},{title:"\u59D3\u540D",dataIndex:"username"},{title:"\u5B66\u53F7",dataIndex:"student_id"},{title:"\u76F8\u4F3C\u5EA6",dataIndex:"code_rate",render:function(cn){return n.a.createElement("span",{className:"c-orange"},cn)}},{title:"\u64CD\u4F5C",dataInex:"action",render:function(cn,On){return n.a.createElement("div",null,n.a.createElement(T.a,{target:"_blank",to:"/classrooms/".concat(Re.coursesId,"/program_homework/").concat(Re.categoryId,"/review_detail/").concat(On.user_id)},"\u67E5\u770B"),n.a.createElement("br",null))}}];return n.a.createElement("section",{className:"minH500 bg-white pl30 pr30 pt10"},(Je==null?void 0:Je.status)===-2&&n.a.createElement(Jt.a,{message:"\u67E5\u91CD\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u2026\u2026",className:"mb10 font14",type:"error"}),n.a.createElement(G.a,null,n.a.createElement(le.a,{flex:"1"},n.a.createElement("p",{className:"mt10"},"\u67E5\u91CD\u65F6\u95F4\uFF1A",Je.last_review_time,n.a.createElement(P.a,{ghost:!0,danger:!0,style:{color:"#29BD8B",borderColor:"#29BD8B",marginLeft:10},onClick:function(){Qn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",params:Re}})}},"\u4EE3\u7801\u67E5\u91CD"))),n.a.createElement(le.a,null,n.a.createElement(Q.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(cn){Re.search=cn,Qn({type:"shixunHomeworks/getCodeReview",payload:Re})},style:{width:200}}),n.a.createElement("span",{className:"ml5 c-red"}))),((fn=Je.group_info)===null||fn===void 0?void 0:fn.length)>0&&n.a.createElement(n.a.Fragment,null,n.a.createElement(G.a,null,n.a.createElement(le.a,{flex:"80px",className:"font14"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(le.a,{flex:"80px"},n.a.createElement(Ie.a,{checked:Re.group_ids=="",value:"all",onChange:function(cn){delete Re.group_ids,Re.group_ids=[],Re.page=1,qe(Object(g.a)({},Re))}},"\u5168\u90E8")),n.a.createElement(le.a,{flex:"1"},Je.group_info&&Je.group_info.map(function(Wt,cn){return n.a.createElement(Ie.a,{style:{marginLeft:0},value:Wt.id,checked:Re.group_ids.includes(Wt.id),onChange:function(an){an.target.checked?Re.group_ids.push(Wt.id):Re.group_ids.splice(Re.group_ids.indexOf(Wt.id),1),Re.page=1,qe(Object(g.a)({},Re))}},Wt.name,"(",Wt.members_count,")")}))),n.a.createElement(G.a,{className:"font14 c-red mt5"},n.a.createElement(le.a,null,"\u672C\u9875\u4EC5\u663E\u793A\u5168\u90E8\u5DF2\u67E5\u91CD\u5206\u73ED"))),n.a.createElement("p",{className:"mt10"},n.a.createElement("span",{className:"c-red"},Je.copy_reviews_count),"\u4E2A\u7591\u4F3C\u6284\u88AD\u4F5C\u54C1\uFF08",Je.all_reviews_count,"\u4F5C\u54C1\uFF09"),n.a.createElement(V.a,{className:"mt30",loading:Xn["shixunHomeworks/getCodeReview"],pagination:!1,dataSource:Je.users_reviews,columns:Pt,onChange:function(cn,On,an){an.order==="ascend"&&(Re.b_order="asc"),an.order==="descend"&&(Re.b_order="desc"),an.order||delete Re.b_order,Qn({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Re)})}}),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(v.a,{showSizeChanger:!1,onChange:st,defaultCurrent:Re.page||1,current:Re.page||1,defaultPageSize:20,hideOnSinglePage:!0,total:Je.copy_reviews_count})))},Un=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks,fn=Tn.loading;return{shixunHomeworks:qt,loading:fn.effects}})(lt),Cn=k("OaEy"),vn=k("2fM7"),er=k("iQDF"),kn=k("+eQT"),Yn=k("/MfK"),vr=k("w5pM"),Mn=k("Lyp1"),Zn=k("LvDl"),dr=k("xb3X"),jt=k.n(dr),Ft=k("AHFd"),zt=k("eozf"),dn=kn.a.RangePicker,yn=vn.a.Option,bn=function(qt){var fn,tn,Xn,Qn,J,ge,Oe,Re,qe,Ue,Je=qt.shixunHomeworks,dt=qt.loading,wt=qt.dispatch,Tt=Object(C.i)(),Be=Je.workSetting,ft=Je.workList,et=Je.changeData,rt=Object(i.useState)(!0),ht=Object(s.a)(rt,2),_t=ht[0],st=ht[1],Pt=Object(i.useState)(!1),Wt=Object(s.a)(Pt,2),cn=Wt[0],On=Wt[1],an=Object(i.useState)([]),mn=Object(s.a)(an,2),hn=mn[0],gt=mn[1],Kt=Object(i.useState)([]),St=Object(s.a)(Kt,2),pt=St[0],gn=St[1],on=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_minus_score:0,penalty_type:Ft.a.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,send_type:void 0,difficult_count:[],difficult_settings:[],late_penalty:0}),Dt=Object(s.a)(on,2),it=Dt[0],_n=Dt[1];Object(i.useEffect)(function(){return Gt(),function(){gt([].concat())}},[]);var Gt=function(){wt({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},Tt)})};Object(i.useEffect)(function(){var mt;if(!(Be!=null&&Be.course_id))return;Object.keys(it).map(function(Xe){it[Xe]=Be[Xe]}),(!it.allow_late||!it.unified_late)&&(it.late_minus_score=20,it.penalty_type=Ft.a.Percent),it.unified_setting||(it.unified_late=!1,it.unified_anonymous_comment=!1,it.unified_anonymous_appeal=!1),hn=JSON.parse(JSON.stringify(Be.group_settings.map(function(Xe){return Object(g.a)(Object(g.a)({},Xe),{},{group_name:[Xe.group_name]})}).filter(function(Xe){return Xe.publish_time!==null}))),pt=JSON.parse(JSON.stringify(Be.allow_late_settings.map(function(Xe){return Object(g.a)(Object(g.a)({},Xe),{},{group_name:[Xe.group_name]})}).filter(function(Xe){return Xe.late_time!==null}))),it.difficult_settings.length===0&&(it.difficult_settings=[0,0,0]),_n(Object(g.a)({},it)),gt(Object(Ce.a)(hn)),((mt=pt)===null||mt===void 0?void 0:mt.length)<=0?gn([{late_minus_score:20}]):gn(Object(Ce.a)(pt))},[Be]);var In=function(){var Xe,Et=JSON.parse(JSON.stringify(it));if(Et.categoryId=Tt.categoryId,it.unified_setting||(hn=(Xe=hn)===null||Xe===void 0?void 0:Xe.map(function(Ht){var Rn;if(!Ht.publish_time||!Ht.end_time)throw p.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!Ht.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Ht.group_name=typeof(Ht==null?void 0:Ht.group_name)=="string"?[Ht==null?void 0:Ht.group_name]:Ht==null?void 0:Ht.group_name,Ht.group_id=(Rn=Be.group_settings)===null||Rn===void 0?void 0:Rn.filter(function(pn){var Gn;return Ht==null||((Gn=Ht.group_name)===null||Gn===void 0)?void 0:Gn.includes(pn.group_name)}).map(function(pn){return pn.group_id||pn.id}).toString().split(","),Ht})),Et.group_settings=hn,it.allow_late)if(it.unified_late){if(it.late_minus_score===null||it.late_minus_score===void 0||it.late_minus_score<0||it.late_minus_score>100)throw p.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!it.late_time)throw p.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574")}else{var vt;pt=(vt=pt)===null||vt===void 0?void 0:vt.map(function(Ht){var Rn,pn;if(Ht.late_minus_score===null||Ht.late_minus_score===void 0||Ht.late_minus_score<0||Ht.late_minus_score>100)throw p.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!Ht.late_time)throw p.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!Ht.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Ht.group_name=typeof(Ht==null?void 0:Ht.group_name)=="string"?[Ht==null?void 0:Ht.group_name]:Ht==null?void 0:Ht.group_name,Ht.group_id=Ht==null||((Rn=Ht.group_name)===null||Rn===void 0||((pn=Rn.map(function(Gn){var jn,mr,rr=(jn=Be.group_settings)===null||jn===void 0||((mr=jn.filter(function(ur){return(ur==null?void 0:ur.group_name)===Gn}))===null||mr===void 0)?void 0:mr[0];return rr==null?void 0:rr.group_id}))===null||pn===void 0))?void 0:pn.toString().split(","),Ht}),Et.allow_late_settings=pt}Et.send_type===1&&(Et.difficult_settings=Et.difficult_settings.map(function(Ht){return Ht||0})),kt(Et)},kt=function(Xe){var Et;if(Xe.total_score===null){p.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Xe!=null&&Xe.work_efficiency&&Xe.eff_score===null){p.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var vt={shixun_evaluation:Xe.shixun_evaluation,challenge_settings:Xe.challenge_settings},Ht=function(){var Rn=Object(m.a)(l.a.mark(function pn(){var Gn;return l.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return On(!0),mr.next=3,Object(O.a)("/api/homework_commons/".concat(Tt.categoryId,"/publish_setting.json"),{method:"post",body:Object(g.a)({},Xe)});case 3:Gn=mr.sent,Gn.status===0&&(p.b.success("\u66F4\u65B0\u6210\u529F"),st(!0),Gt(),wt({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Tt)})),On(!1);case 6:case"end":return mr.stop()}},pn)}));return function(){return Rn.apply(this,arguments)}}();!Object(Zn.isEqual)(et,vt)&&!(ft!=null&&(Et=ft.homework_status)!==null&&Et!==void 0&&Et.includes("\u672A\u53D1\u5E03"))?a.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5173\u5361\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:Ht}):Ht()},sn=function(Xe,Et){var vt,Ht=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return Et?Et.find(function(Rn){return Rn[Ht]===Xe}):Be==null||((vt=Be.group_settings)===null||vt===void 0)?void 0:vt.find(function(Rn){return Rn.group_id[0]===Xe})},En=(Be==null?void 0:Be.allow_late)||(Be==null?void 0:Be.anonymous_comment),$t=function(Xe){var Et=sn(Xe,Be==null?void 0:Be.allow_late_settings,"id"),vt=sn(Xe,Be==null?void 0:Be.anonymous_comment_settings);return(Be==null?void 0:Be.allow_late)&&Et&&(Et==null?void 0:Et.late_time)!==null||(Be==null?void 0:Be.anonymous_comment)&&vt&&(vt==null?void 0:vt.evaluation_start)!==null},sr=Object(i.useMemo)(function(){var mt;if(Be!=null&&Be.unified_setting){var Xe;return!(ft!=null&&(Xe=ft.homework_status)!==null&&Xe!==void 0&&Xe.includes("\u5DF2\u622A\u6B62"))||(Be==null?void 0:Be.allow_late)||(Be==null?void 0:Be.anonymous_comment)}var Et=Be==null||((mt=Be.group_settings)===null||mt===void 0)?void 0:mt.some(function(vt){return F()(vt.end_time)<=F()()});return!Et||(Be==null?void 0:Be.allow_late)||(Be==null?void 0:Be.all_group_late)},[Be,ft]),un=Be==null?void 0:Be.anonymous_comment,nn=function(Xe){if(!Xe)return!1;var Et=sn(Xe,Be==null?void 0:Be.anonymous_comment_settings);return(Be==null?void 0:Be.anonymous_comment)&&Et&&(Et==null?void 0:Et.evaluation_start)!==null};return n.a.createElement("section",{className:jt.a.form},n.a.createElement(G.a,{align:"middle"},n.a.createElement(le.a,{flex:"1"},n.a.createElement("div",{className:jt.a.title},"\u8BD5\u9898\u53D1\u5E03")),n.a.createElement(le.a,null,Object(Y.c)()&&n.a.createElement(P.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return st(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement("div",{className:"mt10"},n.a.createElement("label",{className:"mr20"},"\u53D1\u5E03\u65B9\u5F0F")," ",n.a.createElement(we.a.Group,{disabled:_t||!(ft!=null&&(fn=ft.homework_status)!==null&&fn!==void 0&&fn.includes("\u672A\u53D1\u5E03")),value:it.send_type,onChange:function(Xe){it.send_type=Xe.target.value,_n(Object.assign({},it))}},n.a.createElement(we.a,{value:0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),n.a.createElement(we.a,{className:"ml20",value:1},"\u968F\u673A\u62BD\u9898")),it.send_type===1&&n.a.createElement(G.a,{className:"mt20",style:{marginLeft:94}},n.a.createElement(le.a,null,"\u7B80\u5355\u9898\u6570",n.a.createElement(Ve.a,{precision:0,disabled:_t||!(ft!=null&&(tn=ft.homework_status)!==null&&tn!==void 0&&tn.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(it.difficult_count[0]||0),min:0,max:it.difficult_count[0]||0,value:it.difficult_settings[0],onChange:function(Xe){it.difficult_settings[0]=Xe,_n(Object.assign({},it))},className:"ml10 mr20"})),n.a.createElement(le.a,null,"\u9002\u4E2D\u9898\u6570",n.a.createElement(Ve.a,{precision:0,disabled:_t||!(ft!=null&&(Xn=ft.homework_status)!==null&&Xn!==void 0&&Xn.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(it.difficult_count[1]||0),min:0,max:it.difficult_count[1]||0,value:it.difficult_settings[1],onChange:function(Xe){it.difficult_settings[1]=Xe,_n(Object.assign({},it))},className:"ml10 mr20"})),n.a.createElement(le.a,null,"\u56F0\u96BE\u9898\u6570",n.a.createElement(Ve.a,{precision:0,disabled:_t||!(ft!=null&&(Qn=ft.homework_status)!==null&&Qn!==void 0&&Qn.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(it.difficult_count[2]||0),min:0,max:it.difficult_count[2]||0,value:it.difficult_settings[2],onChange:function(Xe){it.difficult_settings[2]=Xe,_n(Object.assign({},it))},className:"ml10 mr20"})))),n.a.createElement("div",{className:"mt30"},n.a.createElement("h1",{className:"mb10"},"\u53D1\u5E03\u8BBE\u7F6E"),n.a.createElement("label",{className:"mr20"},"\u53D1\u5E03\u65B9\u5F0F")," ",n.a.createElement(we.a.Group,{disabled:_t||!(ft!=null&&(J=ft.homework_status)!==null&&J!==void 0&&J.includes("\u672A\u53D1\u5E03")),value:it.unified_setting,onChange:function(Xe){var Et;if(!(ft!=null&&(Et=ft.homework_status)!==null&&Et!==void 0&&Et.includes("\u672A\u53D1\u5E03"))){p.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(it.unified_setting=!it.unified_setting,it.unified_setting||(it.unified_late=!1),_n(Object.assign({},it)),it.unified_setting===!1&&hn==""){gt(hn.concat({}));return}it.unified_setting&&(gt([]),gn([{late_minus_score:5}]))}},n.a.createElement(we.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),n.a.createElement(we.a,{className:"ml20",disabled:(Be==null||((ge=Be.group_settings)===null||ge===void 0)?void 0:ge.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(Be==null||((Oe=Be.group_settings)===null||Oe===void 0)?void 0:Oe.length)===0&&n.a.createElement("p",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},"\uFF08\u672C\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03\u201C\uFF09")),it.unified_setting&&n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(G.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(le.a,null,"\u53D1\u5E03\u65F6\u95F4"),n.a.createElement(le.a,{className:"ml10"},n.a.createElement(kn.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:function(Xe){return Object(zt.b)(Xe,Be==null?void 0:Be.course_end_date)},disabledTime:function(Xe){return Object(zt.c)(Xe)},disabled:_t||!(ft!=null&&(Re=ft.homework_status)!==null&&Re!==void 0&&Re.includes("\u672A\u53D1\u5E03")),value:it.publish_time?F()(it.publish_time):"",onChange:function(Xe,Et){it.publish_time=Et,(it.end_time==""||!it.end_time)&&it.unified_setting&&(it.end_time=F()(Xe).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),_n(Object.assign({},it))}})),n.a.createElement(le.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),n.a.createElement(G.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(le.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(le.a,{className:"ml10"},n.a.createElement(kn.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:F()(Object(y.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:_t||En,disabledDate:function(Xe){return Object(zt.b)(Xe,Be==null?void 0:Be.course_end_date,it.publish_time)},disabledTime:function(Xe){return Object(zt.c)(Xe,it.publish_time)},value:it.end_time?F()(it.end_time):"",onChange:function(Xe,Et){it.end_time=Et,_n(Object.assign({},it))}})),n.a.createElement(le.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!it.unified_setting&&((qe=hn)===null||qe===void 0?void 0:qe.length)>0&&n.a.createElement(G.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(le.a,{span:24},n.a.createElement(G.a,null,n.a.createElement(le.a,{span:10}),n.a.createElement(le.a,{span:10},n.a.createElement(G.a,{className:"c-grey-c ml30"},n.a.createElement(le.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),n.a.createElement(le.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),n.a.createElement(le.a,{span:4}))),hn&&hn.map(function(mt,Xe){var Et,vt,Ht,Rn,pn;return n.a.createElement(le.a,{span:24,key:Xe},n.a.createElement(G.a,{gutter:[8,16]},n.a.createElement(le.a,{span:10},n.a.createElement(G.a,{gutter:[8,16]},n.a.createElement(le.a,null,"\u53D1\u5E03\u89C4\u5219 ",Xe+1),n.a.createElement(le.a,{flex:"1",style:{maxWidth:300}},n.a.createElement(vn.a,{disabled:_t||!(ft!=null&&(Et=ft.homework_status)!==null&&Et!==void 0&&Et.includes("\u672A\u53D1\u5E03"))&&mt.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:mt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(jn){hn[Xe].group_name=jn,hn[Xe].group_id=mt.group_id;var mr=Object(Zn.flattenDeep)(hn.map(function(ur){return ur.group_name})),rr=pt.map(function(ur){var Hr=(ur==null?void 0:ur.group_name)||[];return Object(g.a)(Object(g.a)({},ur),{},{group_name:Object(Zn.remove)(Hr,function(Nr){return mr.includes(Nr)})})});gn(rr),gt(hn.slice())}},Be.group_settings&&Be.group_settings.map(function(Gn){if(!hn.map(function(jn){return jn.group_name}).toString().split(",").includes(String(Gn.group_name)))return n.a.createElement(yn,{value:Gn.group_name,key:Gn.id},Gn.group_name)}))))),n.a.createElement(le.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(dn,{allowClear:!1,ranges:{\u6B64\u523B:[mt.publish_time?F()(mt.publish_time):F()(),F()()]},disabled:_t||(F()()<=F()((vt=sn((Ht=mt.group_id)===null||Ht===void 0?void 0:Ht[0]))===null||vt===void 0?void 0:vt.publish_time)?!1:[!0,$t((Rn=mt.group_id)===null||Rn===void 0?void 0:Rn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(jn){return Object(zt.b)(jn,Be==null?void 0:Be.course_end_date)},disabledTime:function(jn){return Object(zt.c)(jn)},showTime:{format:"HH:mm",defaultValue:[F()(Object(y.d)(),"HH:mm"),F()(Object(y.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:mt.publish_time&&[F()(mt.publish_time),mt.end_time?F()(mt.end_time):void 0],onChange:function(jn,mr){hn[Xe].publish_time=mr[0],hn[Xe].end_time=mr[1],gt(Object(Ce.a)(hn))}}))),!_t&&n.a.createElement(le.a,{span:4},Xe>0&&!mt.id&&n.a.createElement(Yn.a,{onClick:function(){hn=hn.filter(function(jn,mr){return Xe!==mr}),gt(hn.slice()),setTimeout(function(){return gt(hn.slice())},10)}}),hn.length<(Be==null||((pn=Be.group_settings)===null||pn===void 0)?void 0:pn.length)&&n.a.createElement(vr.a,{className:"c-green ml20",onClick:function(){gt(hn.concat({}))}}))))})),n.a.createElement(G.a,{className:"mt30"},n.a.createElement(le.a,null,n.a.createElement(G.a,{align:"middle"},n.a.createElement("h1",{style:{marginBottom:0}},"\u8865\u4EA4\u8BBE\u7F6E"),n.a.createElement(D.a,{placement:"right",title:"\u4F5C\u4E1A\u622A\u6B62\u540E\u624D\u53EF\u5F00\u542F\u8865\u4EA4\uFF0C\u5F00\u542F\u8865\u4EA4\u540E\u4E0D\u53EF\u53D8\u66F4\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3002"},n.a.createElement(Mn.a,{style:{marginLeft:4,cursor:"pointer"}})))),n.a.createElement(le.a,{span:24,className:"mt10"},n.a.createElement(Ie.a,{checked:it.allow_late,disabled:_t||sr,onChange:function(){it.allow_late=!it.allow_late,pt==""&&gn([{late_minus_score:5}]),_n(Object.assign({},it))}},n.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4")),n.a.createElement(D.a,{overlayStyle:{width:380,maxWidth:380},title:n.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),n.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4\uFF0C\u5B66\u751F\u53EA\u5728\u8865\u4EA4\u65F6\u95F4\u5185\u624D\u901A\u5173\u5219\u6263\u9664\u5206\u503C\uFF0C\u672A\u901A\u5173\u4E0D\u6263\u5206\uFF1B"),n.a.createElement("span",null,"\u5B66\u751F\u5728\u6B63\u5E38\u4F5C\u4E1A\u89C4\u5B9A\u65F6\u95F4\u5185\u901A\u5173\uFF0C\u5728\u8865\u4EA4\u9636\u6BB5\u518D\u6B21\u901A\u5173\u4E0D\u6263\u5206\u3002"))},n.a.createElement(Mn.a,null)))),(it==null?void 0:it.allow_late)&&n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement("div",{className:"ml30 mt20",style:{marginLeft:50}},n.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),n.a.createElement(we.a.Group,{disabled:_t||(Be==null?void 0:Be.anonymous_comment)||(Be==null?void 0:Be.allow_late),value:it.unified_late,onChange:function(Xe){it.unified_late=Xe.target.value,pt==""&&!Xe.target.value&&gn([{late_minus_score:5}]),_n(Object(g.a)({},it))}},(it==null?void 0:it.unified_setting)&&n.a.createElement(we.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(Be==null||((Ue=Be.group_settings)===null||Ue===void 0)?void 0:Ue.length)&&n.a.createElement(we.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),it!=null&&it.unified_late?n.a.createElement(n.a.Fragment,null,n.a.createElement(G.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(le.a,null,"\u8865\u4EA4\u6263\u5206:"),n.a.createElement(le.a,{className:"ml5"},n.a.createElement(Ft.b,{disabled:_t||un,value:{type:it.penalty_type,inputValue:it.late_minus_score},onChange:function(Xe){_n(Object(g.a)(Object(g.a)({},it),{},{late_minus_score:Xe.inputValue,penalty_type:Xe.type}))}})),n.a.createElement(le.a,{flex:"1",className:"ml5"},n.a.createElement("span",{className:"c-grey-c ml10"},it.penalty_type===Ft.a.Number?"(\u8865\u4EA4\u65F6\u6309\u7167\u5B66\u751F\u603B\u6210\u7EE9\u6263\u5206)":"(\u5B66\u751F\u6210\u7EE9\u5C06\u6263\u9664\u8865\u4EA4\u5173\u5361\u5206\u503C\u7684\u767E\u5206\u6BD4)"))),n.a.createElement(G.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(le.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),n.a.createElement(le.a,{className:"ml5"},n.a.createElement(kn.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:F()(Object(y.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:_t||un,value:it.late_time?F()(it.late_time):"",disabledDate:function(Xe){return Object(zt.b)(Xe,Be==null?void 0:Be.course_end_date)},disabledTime:function(Xe){return Object(zt.c)(Xe)},onChange:function(Xe,Et){it.late_time=Et,_n(Object.assign({},it))}})),n.a.createElement(le.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):pt.map(function(mt,Xe){var Et;return n.a.createElement(le.a,{span:24,key:Xe},n.a.createElement(G.a,{className:"mt25"},n.a.createElement(le.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",Xe+1,"\uFF1A"),n.a.createElement(vn.a,{disabled:_t||!(ft!=null&&(Et=ft.homework_status)!==null&&Et!==void 0&&Et.includes("\u672A\u53D1\u5E03"))&&mt.id||(Be==null?void 0:Be.anonymous_comment),mode:"multiple",style:{width:306},value:typeof mt.group_name=="string"?[mt.group_name]:mt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Ht){pt[Xe].group_name=Ht,pt[Xe].group_id=mt.group_id,gn(pt.slice())}},Be.group_settings&&Be.group_settings.map(function(vt){if(it!=null&&it.unified_setting&&!pt.map(function(Ht){return Ht.group_name}).toString().split(",").includes(String(vt.group_name)))return n.a.createElement(yn,{value:vt.group_name,key:vt.id},vt.group_name);if(hn.map(function(Ht){return Ht.group_name}).toString().split(",").includes(String(vt.group_name))&&(!pt.map(function(Ht){return Ht.group_name}).toString().split(",").includes(String(vt.group_name))&&F()(vt.end_time)<=F()()))return n.a.createElement(yn,{value:vt.group_name,key:vt.id},vt.group_name)}))),n.a.createElement(le.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),n.a.createElement(Ft.b,{disabled:_t||nn(mt.id),value:{type:mt.penalty_type,inputValue:mt.late_minus_score},onChange:function(Ht){pt[Xe].late_minus_score=Ht.inputValue,pt[Xe].penalty_type=Ht.type,gn(Object(Ce.a)(pt))}})),n.a.createElement(le.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),n.a.createElement(kn.a,{disabled:_t||nn(mt.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:F()(Object(y.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(Ht){return Object(zt.b)(Ht,Be==null?void 0:Be.course_end_date)},disabledTime:function(Ht){return Object(zt.c)(Ht)},format:"YYYY-MM-DD HH:mm",value:mt!=null&&mt.late_time?F()(mt.late_time):void 0,onChange:function(Ht,Rn){pt[Xe].late_time=Rn,gn(Object(Ce.a)(pt))}})),!_t&&n.a.createElement(le.a,{className:"ml20"},Xe>0&&!mt.id&&n.a.createElement(Yn.a,{onClick:function(){pt=pt.filter(function(Ht,Rn){return Xe!==Rn}),gn(pt.slice()),setTimeout(function(){return gn(pt.slice())},10)}}),n.a.createElement(vr.a,{className:"c-green ml20",onClick:function(){gn(pt.concat({penalty_type:Ft.a.Percent,late_minus_score:20}))}}))))})),n.a.createElement("div",{style:{height:100}}),!_t&&n.a.createElement("div",{className:jt.a.btns},n.a.createElement(P.a,{type:"primary",loading:cn,onClick:function(){return In()}},"\u63D0\u4EA4"),n.a.createElement(P.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){st(!0),Gt()}},"\u53D6\u6D88")))},_r=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks,fn=Tn.loading;return{shixunHomeworks:qt,loading:fn.effects}})(bn);function Bn(Tn,qt){for(var fn=[],tn=Tn;tn<qt;tn++)fn.push(tn);return fn}var Qt=function(qt){var fn=new Date,tn=F()(qt).format("HH");if(F()(qt).isSame(F()(fn),"day")){var Xn=F()(fn).format("HH"),Qn=F()(fn).format("mm");return{disabledHours:function(){return Bn(0,24).splice(1,Xn*1-1)},disabledMinutes:function(){return console.log("\u7981\u6B62\u65F6\u95F4\uFF1A",tn,Xn),F()(qt).isSame(F()(fn),"hour")&&tn<=Xn?Bn(0,60).splice(0,Qn):Bn(60,60)}}}else if(F()(qt).isSame(F()(),"day")){var J=F()().format("HH"),ge=F()().format("mm");return{disabledHours:function(){return Bn(0,24).splice(0,J)},disabledMinutes:function(){return tn<=J?Bn(0,ge):Bn(60,60)}}}else return},Hn=kn.a.RangePicker,lr=vn.a.Option,Sn=function(qt){var fn,tn=qt.shixunHomeworks,Xn=qt.loading,Qn=qt.dispatch,J=Object(C.i)(),ge=Object(C.h)(),Oe=tn.workSetting,Re=tn.workList,qe=tn.changeData,Ue=Object(i.useState)(!0),Je=Object(s.a)(Ue,2),dt=Je[0],wt=Je[1],Tt=Object(i.useState)({}),Be=Object(s.a)(Tt,2),ft=Be[0],et=Be[1],rt=Object(i.useState)(!1),ht=Object(s.a)(rt,2),_t=ht[0],st=ht[1],Pt=Ot.a.useForm(),Wt=Object(s.a)(Pt,1),cn=Wt[0],On=Object(i.useState)([]),an=Object(s.a)(On,2),mn=an[0],hn=an[1],gt=Object(i.useState)([]),Kt=Object(s.a)(gt,2),St=Kt[0],pt=Kt[1],gn=Object(i.useState)(!1),on=Object(s.a)(gn,2),Dt=on[0],it=on[1],_n=Object(i.useState)([]),Gt=Object(s.a)(_n,2),In=Gt[0],kt=Gt[1],sn=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,open_code:!1,rank_forbidden:!1,open_code_type:void 0,comment_public:!0,total_score:"",eff_score:0,rank_forbidden_start:"",rank_forbidden_end:""}),En=Object(s.a)(sn,2),$t=En[0],sr=En[1];Object(i.useEffect)(function(){return un(),function(){hn([].concat())}},[]);var un=function(){Qn({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},J)})},nn=function(vt){return vt&&vt<F()().startOf("day")};Object(i.useEffect)(function(){var Et;if(!(Oe!=null&&Oe.course_id))return;Object.keys($t).map(function(vt){$t[vt]=Oe[vt]}),(!$t.allow_late||!$t.unified_late)&&($t.late_penalty=5),mn=JSON.parse(JSON.stringify(Oe.group_settings.map(function(vt){return Object(g.a)(Object(g.a)({},vt),{},{group_name:[vt.group_name]})}).filter(function(vt){return vt.publish_time!==null}))),St=JSON.parse(JSON.stringify(Oe.allow_late_settings.map(function(vt){return Object(g.a)(Object(g.a)({},vt),{},{group_name:[vt.group_name]})}).filter(function(vt){return vt.rank_forbidden_start!==null}))),sr(Object(g.a)({},$t)),hn(Object(Ce.a)(mn)),((Et=St)===null||Et===void 0?void 0:Et.length)<=0?pt([{}]):pt(Object(Ce.a)(St))},[Oe]),console.log($t,"data");var mt=function(){var vt,Ht=JSON.parse(JSON.stringify($t));if(Ht.categoryId=J.categoryId,$t.unified_setting||(mn=(vt=mn)===null||vt===void 0?void 0:vt.map(function(pn){var Gn;if(!pn.publish_time||!pn.end_time)throw p.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!pn.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return pn.group_name=typeof(pn==null?void 0:pn.group_name)=="string"?[pn==null?void 0:pn.group_name]:pn==null?void 0:pn.group_name,pn.group_id=(Gn=Oe.group_settings)===null||Gn===void 0?void 0:Gn.filter(function(jn){var mr;return pn==null||((mr=pn.group_name)===null||mr===void 0)?void 0:mr.includes(jn.group_name)}).map(function(jn){return jn.group_id||jn.id}).toString().split(","),pn})),Ht.group_settings=mn,$t.rank_forbidden)if($t.unified_setting){if(!$t.rank_forbidden_start)throw p.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!$t.rank_forbidden_end)throw p.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(F()($t.rank_forbidden_end)<F()($t.rank_forbidden_start))throw p.b.error("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u65E9\u4E8E\u5F00\u59CB\u65F6\u95F4"),new String("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u65E9\u4E8E\u5F00\u59CB\u65F6\u95F4")}else{var Rn;St=(Rn=St)===null||Rn===void 0?void 0:Rn.map(function(pn){var Gn,jn;if(!pn.rank_forbidden_start)throw p.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!pn.rank_forbidden_end)throw p.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!pn.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return pn.group_name=typeof(pn==null?void 0:pn.group_name)=="string"?[pn==null?void 0:pn.group_name]:pn==null?void 0:pn.group_name,pn.group_id=pn==null||((Gn=pn.group_name)===null||Gn===void 0||((jn=Gn.map(function(mr){var rr,ur,Hr=(rr=Oe.group_settings)===null||rr===void 0||((ur=rr.filter(function(Nr){return(Nr==null?void 0:Nr.group_name)===mr}))===null||ur===void 0)?void 0:ur[0];return Hr==null?void 0:Hr.group_id}))===null||jn===void 0))?void 0:jn.toString().split(","),pn}),Ht.group_settingss=St}Xe(Ht)},Xe=function(vt){if(console.log(vt.total_score,vt.eff_score),vt.total_score===null){p.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(vt!=null&&vt.work_efficiency&&vt.eff_score===null){p.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var Ht={shixun_evaluation:vt.shixun_evaluation},Rn=function(){var pn=Object(m.a)(l.a.mark(function Gn(){var jn;return l.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:return st(!0),rr.next=3,Object(O.a)("/api/homework_commons/".concat(J.categoryId,"/public_setting.json"),{method:"post",body:Object(g.a)({},vt)});case 3:jn=rr.sent,jn.status===0&&(p.b.success("\u66F4\u65B0\u6210\u529F"),wt(!0),un(),Qn({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},J)})),st(!1);case 6:case"end":return rr.stop()}},Gn)}));return function(){return pn.apply(this,arguments)}}();Rn()};return n.a.createElement("section",{className:jt.a.form},n.a.createElement(G.a,{align:"middle"},n.a.createElement(le.a,{flex:"1"},n.a.createElement("div",{className:jt.a.title},"\u516C\u5F00\u8BBE\u7F6E")),n.a.createElement(le.a,null,(Oe==null?void 0:Oe.can_edit)&&n.a.createElement(P.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return wt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(G.a,null,n.a.createElement(le.a,{span:24,className:"mt15 mt20"},n.a.createElement(Ie.a,{checked:$t.score_open,disabled:dt,onChange:function(vt){$t.score_open=vt.target.checked,sr(Object.assign({},$t))}},n.a.createElement("span",{className:"font14"},"\u516C\u5F00\u6210\u7EE9")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u5728\u4F5C\u4E1A\u622A\u6B62/\u8865\u4EA4\u7ED3\u675F\u65F6\u95F4\u4E4B\u540E\uFF0C\u5DF2\u63D0\u4EA4\u4F5C\u54C1\u7684\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5176\u5B83\u5B66\u751F\u7684\u6210\u7EE9\uFF0C\u5426\u5219\u53EA\u80FD\u67E5\u770B\u81EA\u5DF1\u7684\u6210\u7EE9)")),n.a.createElement(le.a,{span:24,className:"mt15"},n.a.createElement(Ie.a,{checked:$t.open_code,disabled:dt,onChange:function(vt){$t.open_code=vt.target.checked,sr(Object.assign({},$t))}},n.a.createElement("span",{className:"font14"},"\u516C\u5F00\u4EE3\u7801")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5176\u4ED6\u5B66\u751F\u7684\u4EE3\u7801\u8BE6\u60C5)")),!!$t.open_code&&n.a.createElement(le.a,{span:24,className:"mt10 ml25"},n.a.createElement(we.a.Group,{disabled:dt,value:$t.open_code_type,onChange:function(vt){$t.open_code_type=vt.target.value,sr(Object.assign({},$t))}},n.a.createElement(we.a,{value:0},"\u4EFB\u610F\u65F6\u95F4\u67E5\u770B"),n.a.createElement(we.a,{style:{marginLeft:60},value:1},"\u7EC3\u4E60\u65F6\u95F4\u7ED3\u675F\u540E"))),n.a.createElement(le.a,{span:24,className:"mt15 mt20"},n.a.createElement(Ie.a,{checked:$t.rank_forbidden,disabled:dt,onChange:function(vt){$t.rank_forbidden=vt.target.checked,sr(Object.assign({},$t))}},n.a.createElement("span",{className:"font14"},"\u5F00\u542F\u5C01\u699C")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\u5219\u5728\u8BBE\u7F6E\u7684\u8FD9\u6BB5\u65F6\u95F4\u5185\uFF0C\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u4FE1\u606F\uFF0C\u5176\u4ED6\u65F6\u95F4\u53EF\u4EE5\u67E5\u770B)")),!!$t.rank_forbidden&&$t.unified_setting&&n.a.createElement(le.a,{span:24,className:"mt10 "},n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(G.a,{align:"middle",className:"mt25 "},n.a.createElement(le.a,null,"\u5F00\u59CB\u65F6\u95F4"),n.a.createElement(le.a,{className:"ml10"},n.a.createElement(kn.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:nn,disabledTime:Qt,disabled:dt||F()()>F()(Oe.rank_forbidden_start),value:$t.rank_forbidden_start?F()($t.rank_forbidden_start):"",onChange:function(vt,Ht){$t.rank_forbidden_start=Ht,($t.end_time==""||!$t.end_time)&&$t.unified_setting&&($t.end_time=F()(vt).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),sr(Object.assign({},$t))}})),n.a.createElement(le.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"))),n.a.createElement(G.a,{align:"middle",className:"mt25"},n.a.createElement(le.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(le.a,{className:"ml10"},n.a.createElement(kn.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:F()(Object(y.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:dt,disabledDate:nn,value:$t.rank_forbidden_end?F()($t.rank_forbidden_end):"",onChange:function(vt,Ht){$t.rank_forbidden_end=Ht,sr(Object.assign({},$t))}})),n.a.createElement(le.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))))),console.log("----",mn),!$t.unified_setting&&((fn=mn)===null||fn===void 0?void 0:fn.length)>0&&!!$t.rank_forbidden&&n.a.createElement(G.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(le.a,{span:24},n.a.createElement(G.a,null,n.a.createElement(le.a,{span:10}),n.a.createElement(le.a,{span:10},n.a.createElement(G.a,{className:"c-grey-c ml30"},n.a.createElement(le.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"),n.a.createElement(le.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))),n.a.createElement(le.a,{span:4}))),St.map(function(Et,vt){var Ht,Rn,pn,Gn,jn,mr,rr;return n.a.createElement(le.a,{span:24,key:vt},n.a.createElement(G.a,{className:"mt25"},n.a.createElement(le.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u5C01\u699C\u89C4\u5219",vt+1,"\uFF1A"),n.a.createElement(vn.a,{disabled:dt||!(Re!=null&&(Ht=Re.homework_status)!==null&&Ht!==void 0&&Ht.includes("\u672A\u53D1\u5E03"))&&Et.id,mode:"multiple",style:{width:306},value:typeof Et.group_name=="string"?[Et.group_name]:Et.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Hr){St[vt].group_name=Hr,St[vt].group_id=Et.group_id,pt(St.slice())}},Oe.group_settings&&Oe.group_settings.map(function(ur){if($t!=null&&$t.unified_setting&&!St.map(function(Hr){return Hr.group_name}).toString().split(",").includes(String(ur.group_name)))return n.a.createElement(lr,{value:ur.group_name,key:ur.id},ur.group_name);if(mn.map(function(Hr){return Hr.group_name}).toString().split(",").includes(String(ur.group_name))&&!St.map(function(Hr){return Hr.group_name}).toString().split(",").includes(String(ur.group_name)))return n.a.createElement(lr,{value:ur.group_name,key:ur.id},ur.group_name)}))),n.a.createElement(le.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(Hn,{allowClear:!1,disabled:dt||(Oe!=null&&(Rn=Oe.group_settings)!==null&&Rn!==void 0&&(pn=Rn.filter(function(ur){return ur.id===Et.id}))!==null&&pn!==void 0&&(Gn=pn[0])!==null&&Gn!==void 0&&Gn.rank_forbidden_start?F()()<F()(Oe==null||((jn=Oe.group_settings)===null||jn===void 0||((mr=jn.filter(function(ur){return ur.id===Et.id}))===null||mr===void 0||((rr=mr[0])===null||rr===void 0)))?void 0:rr.rank_forbidden_start)?!1:[!0,!1]:!1),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4","\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4"],disabledDate:nn,disabledTime:Qt,showTime:{format:"HH:mm",defaultValue:[F()(Object(y.d)(),"HH:mm"),F()(Object(y.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Et.rank_forbidden_start&&[F()(Et.rank_forbidden_start),Et.rank_forbidden_end?F()(Et.rank_forbidden_end):void 0],onChange:function(Hr,Nr){St[vt].rank_forbidden_start=Nr[0],St[vt].rank_forbidden_end=Nr[1],pt(Object(Ce.a)(St))}}))),!dt&&n.a.createElement(le.a,{className:"ml20"},vt>0&&!Et.id&&n.a.createElement(Yn.a,{onClick:function(){St=St.filter(function(Hr,Nr){return vt!==Nr}),pt(St.slice()),setTimeout(function(){return pt(St.slice())},10)}}),n.a.createElement(vr.a,{className:"c-green ml20",onClick:function(){pt(St.concat({}))}}))))})),!dt&&n.a.createElement("div",{className:jt.a.btns},n.a.createElement(P.a,{type:"primary",loading:_t,onClick:function(){return mt()}},"\u63D0\u4EA4"),n.a.createElement(P.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){wt(!0),un()}},"\u53D6\u6D88"))),n.a.createElement(a.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:Dt,onCancel:function(){return it(!1)}},n.a.createElement("div",null,n.a.createElement("div",{style:{display:"flex"}},n.a.createElement("label",{style:{width:"50px"}},"\u59D3\u540D\uFF1A")," ",n.a.createElement(Q.a.Search,{onChange:function(vt){}})),n.a.createElement(V.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(vt,Ht){kt(vt)}},pagination:!1,dataSource:[{name:"1"}],columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"},{title:"\u53D1\u5E03\u65F6\u95F4",dataIndex:"publish_time",key:"publish_time"},{title:"\u622A\u6B62\u65F6\u95F4",dataIndex:"end_time",key:"end_time"}]}))))},zn=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks,fn=Tn.loading;return{shixunHomeworks:qt,loading:fn.effects}})(Sn),tr=function(qt){var fn,tn=qt.shixunHomeworks,Xn=qt.loading,Qn=qt.dispatch,J=Object(C.i)(),ge=tn.workSetting,Oe=tn.workList,Re=tn.changeData,qe=Object(i.useState)(!0),Ue=Object(s.a)(qe,2),Je=Ue[0],dt=Ue[1],wt=Object(i.useState)(!1),Tt=Object(s.a)(wt,2),Be=Tt[0],ft=Tt[1],et=Object(i.useState)(!1),rt=Object(s.a)(et,2),ht=rt[0],_t=rt[1],st=Ot.a.useForm(),Pt=Object(s.a)(st,1),Wt=Pt[0],cn=Object(i.useState)([]),On=Object(s.a)(cn,2),an=On[0],mn=On[1],hn=Object(i.useState)([]),gt=Object(s.a)(hn,2),Kt=gt[0],St=gt[1],pt=!(Oe!=null&&(fn=Oe.homework_status)!==null&&fn!==void 0&&fn.includes("\u672A\u53D1\u5E03")),gn=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,is_onpage_time:!0,training_time_rules:1,hack_settings:[],punish_time:void 0,hack_score_settings:void 0}),on=Object(s.a)(gn,2),Dt=on[0],it=on[1];Object(i.useEffect)(function(){return _n(),function(){mn([].concat())}},[]);var _n=function(){Qn({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},J)})};Object(i.useEffect)(function(){if(!(ge!=null&&ge.course_id))return;Object.keys(Dt).map(function(sn){Dt[sn]=ge[sn]}),(!Dt.allow_late||!Dt.unified_late)&&(Dt.late_penalty=5),an=JSON.parse(JSON.stringify(ge.group_settings.map(function(sn){return Object(g.a)(Object(g.a)({},sn),{},{group_name:[sn.group_name]})}).filter(function(sn){return sn.publish_time!==null}))),Kt=JSON.parse(JSON.stringify(ge.allow_late_settings.map(function(sn){return Object(g.a)(Object(g.a)({},sn),{},{group_name:[sn.group_name]})}).filter(function(sn){return sn.late_time!==null}))),kt(),it(Object(g.a)({},Dt)),mn(Object(Ce.a)(an)),St(Object(Ce.a)(Kt))},[ge]);var Gt=function(){var En=JSON.parse(JSON.stringify(Dt));In(En)},In=function(En){if(console.log(En.total_score,En.eff_score),En.total_score===null){p.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}var $t=function(){var sr=Object(m.a)(l.a.mark(function un(){var nn;return l.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return ft(!0),Xe.next=3,Object(O.a)("/api/homework_commons/".concat(J.categoryId,"/hack_score_setting.json"),{method:"post",body:Object(g.a)({},En)});case 3:nn=Xe.sent,nn.status===0&&(p.b.success("\u66F4\u65B0\u6210\u529F"),dt(!0),_n(),Qn({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},J)})),ft(!1);case 6:case"end":return Xe.stop()}},un)}));return function(){return sr.apply(this,arguments)}}();(Dt==null?void 0:Dt.hack_score_settings)!==(ge==null?void 0:ge.hack_score_settings)&&pt?a.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:$t}):$t()},kt=function(){var En,$t=Dt.total_score,sr=(En=Dt.hack_settings)===null||En===void 0?void 0:En.length,un=0,nn;switch(Dt.hack_score_settings){case 0:var mt=($t/sr).toFixed(2);Dt.hack_settings.map(function(jn,mr){un=mr,jn.hack_score=mt>0?mt:0}),nn=($t-mt*(sr-1)).toFixed(2),Dt.hack_settings[un].hack_score=nn>0?nn:0;break;case 1:var Xe=[0,1,3,6],Et=0,vt=Dt.hack_settings.filter(function(jn){return jn.difficult===1}).length*Xe[1],Ht=Dt.hack_settings.filter(function(jn){return jn.difficult===2}).length*Xe[2],Rn=Dt.hack_settings.filter(function(jn){return jn.difficult===3}).length*Xe[3],pn=$t/(vt+Ht+Rn);console.log(pn,2222),Dt.hack_settings.map(function(jn,mr){un=mr,jn.hack_score=(Xe[jn.difficult]*pn).toFixed(2),Et=Et+Number(jn.hack_score)});var Gn=Dt.hack_settings[un].hack_score;nn=($t-Et+Number(Gn)).toFixed(2),Dt.hack_settings[un].hack_score=nn>0?nn:0;break}};return n.a.createElement("section",{className:jt.a.form},n.a.createElement(G.a,{align:"middle"},n.a.createElement(le.a,{flex:"1"}),n.a.createElement(le.a,null,(ge==null?void 0:ge.can_edit)&&n.a.createElement(P.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return dt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(G.a,{align:"middle"},n.a.createElement(le.a,null,n.a.createElement("span",null,"\u603B\u5206\u503C"),n.a.createElement(Ve.a,{min:0,className:"ml10 mr10",style:{width:160},value:Dt.total_score,disabled:Je||pt,onChange:function(En){Dt.total_score=En,it(Object.assign({},Dt)),kt()}}),"\xA0\u5206"),n.a.createElement(le.a,{style:{marginLeft:100}},n.a.createElement("span",null,"\u6D4B\u8BC4\u5355\u6B21\u62A5\u9519\u589E\u52A0\u65F6\u957F"),n.a.createElement(Ve.a,{className:"ml10 mr10",style:{width:160},min:0,value:Dt.punish_time,precision:0,disabled:Je,onChange:function(En){Dt.punish_time=En,it(Object.assign({},Dt)),kt()}}),"\xA0\u5206\u949F")),n.a.createElement(G.a,{align:"middle",style:{marginTop:20}},n.a.createElement(le.a,null,n.a.createElement("span",null,"\u8BD5\u9898\u5206\u503C\u8BBE\u7F6E\u89C4\u5219")),n.a.createElement(le.a,{flex:"1"},n.a.createElement(Ot.a.Item,{className:"ml20"},n.a.createElement(we.a.Group,{disabled:Je||pt,value:Dt.hack_score_settings,onChange:function(En){Dt.hack_score_settings=En.target.value,it(Object.assign({},Dt)),kt()}},n.a.createElement(we.a,{value:0},"\u5747\u5206\u6BD4\u4F8B"),n.a.createElement(we.a,{className:"ml20 mr20",value:1},"\u96BE\u6613\u5EA6"),n.a.createElement(we.a,{value:2},"\u81EA\u5B9A\u4E49\u5206\u503C"))))),n.a.createElement("div",{className:jt.a.hackList},Dt.hack_settings&&Dt.hack_settings.map(function(sn,En){return n.a.createElement(G.a,{key:En,align:"middle",style:{marginTop:20}},n.a.createElement(le.a,{flex:"1",className:"pr10"},n.a.createElement("strong",null,sn.hack_name)),n.a.createElement(le.a,{flex:"150px"},n.a.createElement(Ve.a,{min:0,step:.1,value:sn.hack_score,disabled:Je||Dt.hack_score_settings!==2||pt,onChange:function(sr){Dt.hack_settings[En].hack_score=sr;var un=Dt.hack_settings.reduce(function(nn,mt){return nn+Number(mt.hack_score)},0);Dt.total_score=un.toFixed(2),it(Object(g.a)({},Dt))}}),n.a.createElement("span",{className:"ml10"},"\u5206")),n.a.createElement(le.a,{style:{lineHeight:"20px"}},sn.difficult===1&&n.a.createElement("span",{className:"tag-style-border-small bg-green c-white mr10"},"\u7B80\u5355"),sn.difficult===2&&n.a.createElement("span",{className:"tag-style-border-small bg-blue c-white mr10"},"\u9002\u4E2D"),sn.difficult===3&&n.a.createElement("span",{className:"tag-style-border-small bg-orange c-white mr10"},"\u56F0\u96BE")))})),n.a.createElement("div",{style:{height:100}}),!Je&&n.a.createElement("div",{className:jt.a.btns},n.a.createElement(P.a,{type:"primary",loading:Be,onClick:function(){return Gt()}},"\u63D0\u4EA4"),n.a.createElement(P.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){dt(!0),_n()}},"\u53D6\u6D88")))},Gr=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks,fn=Tn.loading;return{shixunHomeworks:qt,loading:fn.effects}})(tr),Ar=function(qt){var fn,tn,Xn=qt.shixunHomeworks,Qn=qt.loading,J=qt.dispatch,ge=Object(i.useState)(!0),Oe=Object(s.a)(ge,2),Re=Oe[0],qe=Oe[1],Ue=Object(i.useState)(!1),Je=Object(s.a)(Ue,2),dt=Je[0],wt=Je[1],Tt=Object(i.useState)([]),Be=Object(s.a)(Tt,2),ft=Be[0],et=Be[1],rt=Object(i.useState)([]),ht=Object(s.a)(rt,2),_t=ht[0],st=ht[1],Pt=Object(i.useState)([]),Wt=Object(s.a)(Pt,2),cn=Wt[0],On=Wt[1],an=Object(i.useState)([]),mn=Object(s.a)(an,2),hn=mn[0],gt=mn[1],Kt=Object(C.i)();function St(){return pt.apply(this,arguments)}function pt(){return pt=Object(m.a)(l.a.mark(function it(){var _n;return l.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(O.a)("/api/homework_commons/".concat(Kt.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:_n=In.sent,st(_n);case 4:case"end":return In.stop()}},it)})),pt.apply(this,arguments)}function gn(){return on.apply(this,arguments)}function on(){return on=Object(m.a)(l.a.mark(function it(){var _n;return l.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(O.a)("/api/courses/".concat(Kt==null?void 0:Kt.coursesId,"/teachers"),{method:"get",params:{homework_id:Kt.categoryId}});case 2:_n=In.sent,_n==null||_n.teacher_list.map(function(kt){kt.key=kt.user_id}),On(_n==null?void 0:_n.teacher_list),gt(_n==null?void 0:_n.teacher_list);case 6:case"end":return In.stop()}},it)})),on.apply(this,arguments)}Object(i.useEffect)(function(){St(),gn()},[Kt]);var Dt=function(){};return n.a.createElement("section",{className:jt.a.form},n.a.createElement(G.a,null,n.a.createElement(le.a,{flex:"1"},n.a.createElement("span",{style:{fontSize:"16px"}},"\u534F\u4F5C\u8BBE\u7F6E"),(_t==null?void 0:_t.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",color:"#0152d9",marginLeft:"10px"},onClick:function(){wt(!0)}},"+\u6DFB\u52A0\u534F\u4F5C\u8005"))),n.a.createElement(G.a,{style:{marginTop:"20px",marginBottom:"20px"}},(_t==null||((fn=_t.data)===null||fn===void 0)?void 0:fn.length)<=0&&n.a.createElement(Z.a,{customText:"\u8BE5\u4F5C\u4E1A\u6682\u65E0\u534F\u4F5C\u8005"}),_t==null||((tn=_t.data)===null||tn===void 0)?void 0:tn.map(function(it){return n.a.createElement("span",{style:{display:"inline-flex",height:"40px",borderRadius:"4px",border:"1px solid #44D7B6",padding:"7px 20px",color:"#44D7B6",marginRight:"40px"}},n.a.createElement("span",{style:{flex:"1"}},it==null?void 0:it.real_name),(_t==null?void 0:_t.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",marginLeft:"10px"},onClick:Object(m.a)(l.a.mark(function _n(){var Gt;return l.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(O.a)("/api/homework_commons/".concat(Kt.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:it.id}});case 2:Gt=kt.sent,Gt.status===0&&(p.b.info("\u5220\u9664\u6210\u529F"),St(),gn());case 4:case"end":return kt.stop()}},_n)}))},"X"))})),n.a.createElement(G.a,null,!Re&&n.a.createElement(le.a,{className:"mb50"},n.a.createElement(P.a,{type:"primary",size:"large",onClick:function(){return Dt()}},"\u63D0\u4EA4"),n.a.createElement(P.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){qe(!0)}},"\u53D6\u6D88"))),n.a.createElement(a.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:dt,onCancel:function(){return wt(!1)},onOk:Object(m.a)(l.a.mark(function it(){var _n;return l.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:if(!(ft.length===0)){In.next=3;break}return p.b.info("\u8BF7\u9009\u62E9\u534F\u4F5C\u8001\u5E08"),In.abrupt("return");case 3:return In.next=5,Object(O.a)("/api/homework_commons/".concat(Kt.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:ft}});case 5:_n=In.sent,_n.status===0&&(p.b.info("\u6DFB\u52A0\u6210\u529F"),et([]),St(),gn(),wt(!1));case 7:case"end":return In.stop()}},it)}))},n.a.createElement("div",null,n.a.createElement("div",{style:{display:"flex"}},n.a.createElement("label",{style:{width:"50px"}},"\u59D3\u540D\uFF1A")," ",n.a.createElement(Q.a.Search,{onChange:function(_n){On(hn.filter(function(Gt){return Gt.name.indexOf(_n.target.value)>-1}))}})),n.a.createElement(V.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(_n,Gt){et(_n)},selectedRowKeys:ft,getCheckboxProps:function(_n){return{disabled:_n.is_collaborator}}},pagination:!1,dataSource:cn,columns:[{title:"\u59D3\u540D",dataIndex:"name",key:"name"},{title:"\u89D2\u8272",dataIndex:"role",key:"role"}]}))))},Yt=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks,fn=Tn.loading;return{shixunHomeworks:qt,loading:fn.effects}})(Ar),Vn=kn.a.RangePicker,vi=vn.a.Option,Pi=function(qt){var fn=qt.shixunHomeworks,tn=qt.loading,Xn=qt.dispatch;return n.a.createElement("section",{className:"bg-white pl30 pr30 pt10 mb10"},n.a.createElement(z.a,null,n.a.createElement(z.a.TabPane,{tab:"\u53D1\u5E03\u8BBE\u7F6E",key:1},n.a.createElement(_r,null)),n.a.createElement(z.a.TabPane,{tab:"\u8BC4\u5206\u8BBE\u7F6E",key:2},n.a.createElement(Gr,null)),n.a.createElement(z.a.TabPane,{tab:"\u516C\u5F00\u8BBE\u7F6E",key:3},n.a.createElement(zn,null)),n.a.createElement(z.a.TabPane,{tab:"\u534F\u4F5C\u8BBE\u7F6E",key:4},n.a.createElement(Yt,null))))},ai=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks,fn=Tn.loading;return{shixunHomeworks:qt,loading:fn.effects}})(Pi),Yr=k("RotF"),Lr=k.n(Yr),Fn=function(qt){var fn,tn=qt.shixunHomeworks,Xn=qt.loading,Qn=qt.dispatch,J=Object(C.i)(),ge=Object(C.h)(),Oe=Object(i.useState)([]),Re=Object(s.a)(Oe,2),qe=Re[0],Ue=Re[1],Je=Object(i.useState)([]),dt=Object(s.a)(Je,2),wt=dt[0],Tt=dt[1],Be=Object(i.useState)(!0),ft=Object(s.a)(Be,2),et=ft[0],rt=ft[1],ht=Object(i.useState)(!1),_t=Object(s.a)(ht,2),st=_t[0],Pt=_t[1],Wt=Object(i.useState)(1),cn=Object(s.a)(Wt,2),On=cn[0],an=cn[1],mn=Object(i.useState)([]),hn=Object(s.a)(mn,2),gt=hn[0],Kt=hn[1],St=Object(i.useState)(!1),pt=Object(s.a)(St,2),gn=pt[0],on=pt[1],Dt=Object(i.useState)(!1),it=Object(s.a)(Dt,2),_n=it[0],Gt=it[1];Object(i.useEffect)(function(){tn.actionTabs.key==="\u4EE3\u7801\u67E5\u91CD"?(sn.resetFields(),Ue([]),on(!0),$t()):on(!1)},[tn.actionTabs.key]);var In=Ot.a.useForm(),kt=Object(s.a)(In,1),sn=kt[0],En=[],$t=function(){var nn=Object(m.a)(l.a.mark(function mt(){var Xe,Et,vt;return l.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:if(!(et&&!st)){Rn.next=11;break}return Pt(!0),an(On+1),Rn.next=5,Object(q.x)(Object(g.a)(Object(g.a)({},J),{},{page:On}));case 5:Et=Rn.sent,vt=Object(Ce.a)(Et.group_list),Et!=null&&Et.ungroup_list&&vt.push({id:Et==null?void 0:Et.ungroup_list.id,name:Et==null?void 0:Et.ungroup_list.name,works_count:Et==null?void 0:Et.ungroup_list.work_count,last_review_time:Et==null?void 0:Et.ungroup_list.last_review_time}),Ue([].concat(Object(Ce.a)(qe),Object(Ce.a)(vt))),Pt(!1),((Xe=Et.group_list)===null||Xe===void 0?void 0:Xe.length)<10&&rt(!1);case 11:case"end":return Rn.stop()}},mt)}));return function(){return nn.apply(this,arguments)}}(),sr=function(){Qn({type:"shixunHomeworks/setActionTabs",payload:{}}),Gt(!1),rt(!0),Pt(!1),an(1),Ue([]),sn.resetFields()},un=[{title:"",dataIndex:"id",width:280,render:function(mt,Xe){return n.a.createElement(Ie.a,{disabled:!(Xe.works_count>1),value:String(Xe.id)},Xe.name)}},{title:"\u6709\u6548\u4F5C\u54C1\u6570",dataIndex:"works_count"},{title:"\u4E0A\u6B21\u67E5\u91CD\u65F6\u95F4",dataIndex:"last_review_time",width:130}];return n.a.createElement(a.a,{centered:!0,title:"\u4EE3\u7801\u67E5\u91CD",keyboard:!1,maskClosable:!1,visible:gn,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",width:820,bodyStyle:{minHeight:200},onOk:Object(m.a)(l.a.mark(function nn(){var mt,Xe;return l.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:return mt=sn.getFieldValue(),vt.next=3,Object(O.a)("/api/homework_commons/".concat(J.categoryId,"/hack_homework_code_repeat.json"),{method:"post",body:{group_ids:Object(Ce.a)(mt.group_ids)}});case 3:if(Xe=vt.sent,!(Xe.status===0)){vt.next=11;break}return sr(),p.b.success("\u64CD\u4F5C\u6210\u529F"),vt.next=9,Qn({type:"shixunHomeworks/getWorkList",payload:tn.actionTabs.params});case 9:R.d.push("/classrooms/".concat(J.coursesId,"/program_homework/").concat(J.categoryId,"/detail?tabs=2")),Qn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u6267\u884C\u4EE3\u7801\u67E5\u91CD"}});case 11:case"end":return vt.stop()}},nn)})),onCancel:sr},tn.codeReviewCourse&&n.a.createElement(Ot.a,{form:sn,onChange:function(mt){Kt(Object(g.a)({},sn.getFieldValue()))},initialValues:(fn={},Object(ze.a)(fn,"group_ids",En),Object(ze.a)(fn,"end_time",F()(F()().add(7,"days").format("YYYY-MM-DD HH:mm"))),fn)},n.a.createElement("div",{className:"flexd-table-header mt20"},n.a.createElement(V.a,{pagination:!1,dataSource:[],columns:un})),n.a.createElement(Ot.a.Item,{name:"group_ids"},n.a.createElement(Ie.a.Group,{className:"w100"},n.a.createElement("div",{style:{width:"100%",maxHeight:260,overflow:"auto"}},n.a.createElement(Lr.a,{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(mt){$t()},hasMore:et,useWindow:!1},n.a.createElement(V.a,{loading:Xn.effects["shixunHomeworks/getCodeReviewCourse"],showHeader:!1,columns:un,dataSource:qe,pagination:!1})))))),n.a.createElement(G.a,null,n.a.createElement(le.a,{className:"ml10"},n.a.createElement(Ie.a,{checked:_n,onChange:function(mt){Gt(mt.target.checked);var Xe=[];mt.target.checked&&(Xe=qe.filter(function(Et){return Et.works_count>1}).map(function(Et){return Et.id+""})),sn.setFieldsValue(Object(ze.a)({},"group_ids",Xe))}},"\u5168\u9009"))))},pi=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks,fn=Tn.loading;return{shixunHomeworks:qt,loading:fn}})(Fn),Zt=k("nPLb"),qr=k("XpUO"),zr=k("bTeP"),xi=k.n(zr),mi=k("HBuW"),ni=k("NLgs"),Bi=k("m3rI"),Hi=k("+92d"),ri=k.n(Hi),wr=k("wwSX"),Si=k.n(wr),Oi=k("zlzj"),ci=k.n(Oi),_i=k("deN7"),oa=[ri.a,Si.a,ci.a],$i=function(qt){var fn,tn,Xn=qt.user,Qn=Object(i.useState)(Object(g.a)(Object(g.a)({},Object(C.i)()),{},{page:1,per_page:10,rank_type:2,course_group:Object(Y.t)()?[Xn.userInfo.course.course_group_id]:[]},Object(C.i)())),J=Object(s.a)(Qn,2),ge=J[0],Oe=J[1],Re=Object(i.useState)([]),qe=Object(s.a)(Re,2),Ue=qe[0],Je=qe[1],dt=Object(i.useState)([]),wt=Object(s.a)(dt,2),Tt=wt[0],Be=wt[1],ft=Object(i.useState)([]),et=Object(s.a)(ft,2),rt=et[0],ht=et[1],_t=Object(i.useState)(!1),st=Object(s.a)(_t,2),Pt=st[0],Wt=st[1],cn=Object(i.useState)([{title:"\u6392\u884C",dataIndex:"rank",width:100,fixed:"left",render:function(St,pt,gn){return St<4?n.a.createElement("img",{src:oa[St-1]}):St}},{title:"\u7528\u6237",dataIndex:"user_name",width:150,fixed:"left",key:"user_name",render:function(St,pt,gn){return n.a.createElement("div",null,n.a.createElement("img",{style:{width:30,height:30,borderRadius:"50%",marginRight:10},src:Bi.a.IMG_SERVER+"/images/"+(pt==null?void 0:pt.image_url)}),St)}},{title:"\u5206\u73ED",dataIndex:"course_group",key:"course_group",ellipsis:!0,width:150,fixed:"left"},{title:"\u5B66\u53F7",dataIndex:"student_id",key:"student_id",width:150,ellipsis:!0,fixed:"left",render:function(St){return St||"- -"}},{title:"\u901A\u8FC7",dataIndex:"passed_count",width:100,fixed:"left",key:"passed_count"},{title:"\u5F97\u5206",dataIndex:"score",width:100,fixed:"left",key:"score"}]),On=Object(s.a)(cn,2),an=On[0],mn=On[1];Object(i.useEffect)(function(){an.splice(7);for(var Kt=function(on){var Dt,it,_n,Gt,In={};In.title=Ue!=null&&Ue.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(on+1)+"\uFF08".concat(Ue==null||((Dt=Ue.question_data)===null||Dt===void 0||((it=Dt[on])===null||it===void 0))?void 0:it.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(m.a)(l.a.mark(function kt(){var sn,En,$t;return l.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Object(O.a)("/api/problems/".concat(Ue==null||((sn=Ue.question_data)===null||sn===void 0||((En=sn[on])===null||En===void 0))?void 0:En.identifier,"/start.json"),{method:"get"});case 2:$t=un.sent,$t&&(window.open("/myproblems/".concat($t==null?void 0:$t.identifier,"?type=1")),localStorage.setItem("program_homework",[ge.coursesId,ge.categoryId]));case 4:case"end":return un.stop()}},kt)}))},"\u9898\u76EE"+(on+1)+"\uFF08".concat(Ue==null||((_n=Ue.question_data)===null||_n===void 0||((Gt=_n[on])===null||Gt===void 0))?void 0:Gt.question_score,"\uFF09")),In.dataIndex="question_data",In.width=250,In.render=function(kt,sn){var En,$t,sr,un,nn;return n.a.createElement("div",null,(kt==null||((En=kt[on])===null||En===void 0)?void 0:En.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(m.a)(l.a.mark(function mt(){var Xe,Et,vt,Ht,Rn,pn,Gn,jn;return l.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:if(kt!=null&&(Xe=kt[on])!==null&&Xe!==void 0&&Xe.open_code){rr.next=3;break}return p.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),rr.abrupt("return");case 3:return rr.next=5,Object(O.a)("/api/courses/view_code.json",{method:"get",params:Object(g.a)(Object(g.a)({},ge),{},{id:ge.coursesId,homework_common_id:ge.categoryId,hack_user_code_id:kt==null||((Et=kt[on])===null||Et===void 0)?void 0:Et.hack_user_code_id})});case 5:jn=rr.sent,a.a.warning({icon:null,width:800,title:n.a.createElement("div",null,n.a.createElement("span",null,"\u4EE3\u7801"),n.a.createElement("span",null,"\u4F7F\u7528\u8BED\u8A00\uFF1A",kt==null||((vt=kt[on])===null||vt===void 0)?void 0:vt.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",kt==null||((Ht=kt[on])===null||Ht===void 0)?void 0:Ht.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",kt==null||((Rn=kt[on])===null||Rn===void 0)?void 0:Rn.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",kt==null||((pn=kt[on])===null||pn===void 0)?void 0:pn.score)),content:n.a.createElement(_i.a,{languages:[{language:kt==null||((Gn=kt[on])===null||Gn===void 0)?void 0:Gn.language,code:jn==null?void 0:jn.code}],v:kt,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:kt.language,game_id:kt.id,diff_code_count:kt.diff_code_count})});case 7:case"end":return rr.stop()}},mt)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(kt==null||(($t=kt[on])===null||$t===void 0)?void 0:$t.answer_question_time)||"- -"),kt!=null&&(sr=kt[on])!==null&&sr!==void 0&&sr.submit_count?n.a.createElement(D.a,{title:"".concat((kt==null||((un=kt[on])===null||un===void 0)?void 0:un.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(kt==null||((nn=kt[on])===null||nn===void 0)?void 0:nn.submit_count)||0):null))},an.push(In)},St=0;St<(Ue==null||((pt=Ue.question_data)===null||pt===void 0)?void 0:pt.length);St++){var pt;Kt(St)}mn(Object(Ce.a)(an))},[Ue==null?void 0:Ue.question_data]),Object(i.useEffect)(function(){var Kt;Xn!=null&&(Kt=Xn.userInfo)!==null&&Kt!==void 0&&Kt.course&&(Object(Y.t)()&&(ge.course_group=Object(Y.t)()?[Xn.userInfo.course.course_group_id]:[],Oe(Object(g.a)({},ge))),hn(1))},[Xn==null?void 0:Xn.userInfo]);function hn(Kt){return gt.apply(this,arguments)}function gt(){return gt=Object(m.a)(l.a.mark(function Kt(St){var pt,gn,on,Dt,it,_n,Gt;return l.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return Wt(!0),kt.next=3,Object(O.a)("/api/courses/rank_list.json",{method:"get",params:Object(g.a)(Object(g.a)({},ge),{},{id:ge.coursesId,rank_type:2,homework_common_id:ge.categoryId})});case 3:if(pt=kt.sent,Je(pt),Wt(!1),Object(Y.t)()?(St===1&&Be([pt==null||((gn=pt.course_group)===null||gn===void 0||((on=gn[0])===null||on===void 0))?void 0:on.id]),pt!=null&&pt.my_rank?ht([pt==null?void 0:pt.my_rank].concat(Object(Ce.a)(pt==null?void 0:pt.rank_list))):ht(Object(Ce.a)(pt==null?void 0:pt.rank_list))):ht(Object(Ce.a)(pt==null?void 0:pt.rank_list)),St===1){for(Dt={title:n.a.createElement(D.a,{title:`\u603B\u8017\u65F6\u65F6\u4E3A\u505A\u9898\u901A\u8FC7\u65F6\u957F\u548C\u7F5A\u65F6\u65F6\u957F\u7684\u603B\u548C\uFF0C
|
|
\u7F5A\u65F6\u65F6\u957F=\u8BC4\u6D4B\u51FA\u9519\u6B21\u6570X\u8BBE\u7F6E\u7684\u7F5A\u65F6\uFF08\u5F53\u524D\u4E3A`.concat(pt==null?void 0:pt.punish_time,"\u5206\uFF09")},n.a.createElement("span",{style:{marginRight:3}},"\u603B\u8017\u65F6")," ",n.a.createElement("span",{style:{fontSize:"14px"},className:"iconfont icon-tishixiaowenhao c-blue"})),dataIndex:"finish_time",width:150,ellipsis:!0,fixed:"left",key:"finish_time"},an.push(Dt),it=function(En){var $t,sr,un,nn,mt={};mt.title=pt!=null&&pt.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(En+1)+"\uFF08".concat(pt==null||(($t=pt.question_data)===null||$t===void 0||((sr=$t[En])===null||sr===void 0))?void 0:sr.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(m.a)(l.a.mark(function Xe(){var Et,vt,Ht;return l.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return pn.next=2,Object(O.a)("/api/problems/".concat(pt==null||((Et=pt.question_data)===null||Et===void 0||((vt=Et[En])===null||vt===void 0))?void 0:vt.identifier,"/start.json"),{method:"get"});case 2:Ht=pn.sent,Ht&&(window.open("/myproblems/".concat(Ht==null?void 0:Ht.identifier,"?type=1")),localStorage.setItem("program_homework",[ge.coursesId,ge.categoryId]));case 4:case"end":return pn.stop()}},Xe)}))},"\u9898\u76EE"+(En+1)+"\uFF08".concat(pt==null||((un=pt.question_data)===null||un===void 0||((nn=un[En])===null||nn===void 0))?void 0:nn.question_score,"\uFF09")),mt.dataIndex="question_data",mt.width=250,mt.render=function(Xe,Et){var vt,Ht,Rn,pn,Gn;return n.a.createElement("div",null,(Xe==null||((vt=Xe[En])===null||vt===void 0)?void 0:vt.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(m.a)(l.a.mark(function jn(){var mr,rr,ur,Hr,Nr,Fr,si,li;return l.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:if(Xe!=null&&(mr=Xe[En])!==null&&mr!==void 0&&mr.open_code){Ne.next=3;break}return p.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),Ne.abrupt("return");case 3:return Ne.next=5,Object(O.a)("/api/courses/view_code.json",{method:"get",params:Object(g.a)(Object(g.a)({},ge),{},{id:ge.coursesId,homework_common_id:ge.categoryId,hack_user_code_id:Xe==null||((rr=Xe[En])===null||rr===void 0)?void 0:rr.hack_user_code_id})});case 5:li=Ne.sent,a.a.warning({icon:null,width:800,title:n.a.createElement("div",null,n.a.createElement("span",null,"\u4EE3\u7801"),n.a.createElement("span",null,"\u4F7F\u7528\u8BED\u8A00\uFF1A",Xe==null||((ur=Xe[En])===null||ur===void 0)?void 0:ur.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",Xe==null||((Hr=Xe[En])===null||Hr===void 0)?void 0:Hr.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",Xe==null||((Nr=Xe[En])===null||Nr===void 0)?void 0:Nr.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",Xe==null||((Fr=Xe[En])===null||Fr===void 0)?void 0:Fr.score)),content:n.a.createElement(_i.a,{languages:[{language:Xe==null||((si=Xe[En])===null||si===void 0)?void 0:si.language,code:li==null?void 0:li.code}],v:Xe,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:Xe.language,game_id:Xe.id,diff_code_count:Xe.diff_code_count})});case 7:case"end":return Ne.stop()}},jn)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(Xe==null||((Ht=Xe[En])===null||Ht===void 0)?void 0:Ht.answer_question_time)||"- -"),Xe!=null&&(Rn=Xe[En])!==null&&Rn!==void 0&&Rn.submit_count?n.a.createElement(D.a,{title:"".concat((Xe==null||((pn=Xe[En])===null||pn===void 0)?void 0:pn.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(Xe==null||((Gn=Xe[En])===null||Gn===void 0)?void 0:Gn.submit_count)||0):null))},an.push(mt)},_n=0;_n<(pt==null||((Gt=pt.question_data)===null||Gt===void 0)?void 0:Gt.length);_n++)it(_n);mn(Object(Ce.a)(an))}case 8:case"end":return kt.stop()}},Kt)})),gt.apply(this,arguments)}return console.log("----",an),n.a.createElement("div",{style:{width:1200,margin:"0px auto"}},(Ue==null?void 0:Ue.message)==="\u5C01\u699C\u4E2D"?n.a.createElement(Z.a,{customText:"\u7B54\u9898\u65F6\u95F4\u8FDB\u5165\u5012\u8BA1\u65F6\uFF0C\u6682\u65F6\u5C01\u699C\uFF0C\u8BF7\u52A0\u901F\u7ADE\u6280\u901A\u5173\u7B54\u9898"}):n.a.createElement("div",{style:{background:"#fff",padding:20}},n.a.createElement("div",{style:{display:"inline-flex"}},n.a.createElement("label",null,"\u5206\u73ED\u60C5\u51B5\uFF1A"),Object(Y.c)()&&n.a.createElement("div",{style:{flex:1}},n.a.createElement(Ie.a.Group,{className:xi.a.checkboxgroup,value:Tt,onChange:function(St){if(ge.type===1)Be([]),ge.course_group=[],ge.page=1,Oe(Object(g.a)({},ge)),hn();else if(ge.type===2){var pt;Be(["\u5168\u90E8"].concat()),ge.course_group=Ue==null||((pt=Ue.course_group)===null||pt===void 0)?void 0:pt.map(function(gn){return gn.id}),ge.page=1,Oe(Object(g.a)({},ge)),hn()}else Be(Object(Ce.a)(St.filter(function(gn){return gn!="\u5168\u90E8"}))),ge.course_group=St.filter(function(gn){return gn!="\u5168\u90E8"}),ge.page=1,Oe(Object(g.a)({},ge)),hn()}},n.a.createElement(Ie.a,{value:"\u5168\u90E8",onChange:function(St){St.target.checked?ge.type=2:ge.type=1}},"\u5168\u90E8\u5206\u73ED"),Ue==null||((fn=Ue.course_group)===null||fn===void 0)?void 0:fn.map(function(Kt,St){return n.a.createElement(Ie.a,{onChange:function(gn){ge.type=3},value:Kt.id},Kt==null?void 0:Kt.name)}))),Object(Y.t)()&&n.a.createElement(we.a.Group,{onChange:function(St){St.target.value==="\u5168\u90E8"?(ge.course_group=[],ge.page=1,Oe(Object(g.a)({},ge)),hn()):(ge.course_group=[St.target.value],ge.page=1,Oe(Object(g.a)({},ge)),hn())},defaultValue:Xn.userInfo.course.course_group_id},n.a.createElement(we.a,{value:"\u5168\u90E8"},"\u5168\u90E8\u5206\u73ED"),Ue==null||((tn=Ue.course_group)===null||tn===void 0)?void 0:tn.map(function(Kt,St){return n.a.createElement(we.a,{value:Kt.id},Kt.name)}))),Object(Y.c)()&&n.a.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginTop:10}},n.a.createElement("span",{style:{fontSize:14,color:"#B1BACD"}},"\u6392\u884C\u89C4\u5219\uFF1A\u65F6\u95F4\u7ED3\u675F\u540E\u6B63\u5F0F\u5C01\u699C\uFF0C\u65F6\u95F4\u6BB5\u4E4B\u5916\u7684\u63D0\u4EA4\u4E0D\u8BA1\u5165\u6392\u884C\u3002"," ",n.a.createElement("a",{onClick:function(){a.a.warning({title:"\u8BA1\u5206\u89C4\u5219",width:500,content:n.a.createElement("div",null,n.a.createElement("p",null,"\u6392\u540D\u89C4\u5219\uFF1A\u7ECF\u5178ACM\u89C4\u5219"),n.a.createElement("p",null,"AC\uFF08\u901A\u8FC7\u9898\u76EE\uFF09\u8D8A\u591A\uFF0C\u6392\u540D\u8D8A\u9760\u524D\u3002"),n.a.createElement("p",null,"AC\u76F8\u540C\uFF0C\u603B\u7528\u65F6\u8D8A\u5C11\uFF0C\u6392\u540D\u8D8A\u9760\u524D\u3002"),n.a.createElement("p",null,"\u603B\u7528\u65F6=\u2211\uFF08\u6BCF\u4E00\u4E2A\u9898\u76EE\u7684\u7528\u65F6\uFF09"),n.a.createElement("p",null,"\u6BCF\u4E00\u4E2A\u9898\u76EE\u7684\u7528\u65F6=\u6BD4\u8D5B\u5F00\u59CB\u5230\u63D0\u4EA4\u88AB\u901A\u8FC7\u7684\u65F6\u95F4+\u7F5A\u65F6"),n.a.createElement("p",null,"\u7F5A\u65F6=\uFF08\u901A\u8FC7\u524D\uFF09\u9519\u8BEF\u4EE3\u7801\u63D0\u4EA4\u6B21\u6570*\u6BCF\u6B21\u7F5A\u65F6"),n.a.createElement("p",null,"\u4E0D\u7B97\u7F5A\u65F6\u7684\u60C5\u51B5\uFF1A\u6CA1\u6709\u901A\u8FC7\u7684\u9898\u76EE\u3001\uFF08\u7CFB\u7EDF\uFF09\u5185\u90E8\u9519\u8BEF\u3001\u7F16\u8BD1\u9519\u8BEF"))})}},"\u70B9\u51FB\u67E5\u770B\u8BA1\u5206\u89C4\u5219")),n.a.createElement(P.a,{onClick:function(){Object(Ee.v)(Object(g.a)(Object(g.a)({},ge),{},{id:ge.coursesId,rank_type:2,homework_common_id:ge.categoryId}))}},"\u5BFC\u51FA")),n.a.createElement(f.a,{spinning:Pt},n.a.createElement(V.a,{style:{marginTop:10},pagination:!1,scroll:{x:1200},rowClassName:function(St,pt){return pt===0&&Object(Y.t)()&&xi.a.tables},dataSource:rt,columns:an})),n.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},n.a.createElement(v.a,{current:ge.page,pageSize:ge.per_page,total:Ue==null?void 0:Ue.count,hideOnSinglePage:!0,onChange:function(St,pt){ge.page=St,ge.per_page=pt,Oe(Object(g.a)({},ge)),hn()}}))))},yr=Object(R.a)(function(Tn){var qt=Tn.user;return{user:qt}})($i),br=[{live:"A",gz:"0\u4E2A\u9519\u8BEF",ld:"0\u4E2A\u6F0F\u6D1E",gf:"0 - 5%"},{live:"B",gz:"\u81F3\u5C111\u4E2A\u6B21\u8981\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u6B21\u8981\u6F0F\u6D1E",gf:"6% - 10%"},{live:"C",gz:"\u81F3\u5C111\u4E2A\u4E3B\u8981\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u4E3B\u8981\u6F0F\u6D1E",gf:"11% - 20%"},{live:"D",gz:"\u81F3\u5C111\u4E2A\u4E25\u91CD\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u4E25\u91CD\u6F0F\u6D1E",gf:"21% - 50%"},{live:"E",gz:"\u81F3\u5C111\u4E2A\u5D29\u6E83\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u5D29\u6E83\u6F0F\u6D1E",gf:"\u8D85\u8FC750%"}],oi=function(qt){var fn,tn=qt.shixunHomeworks,Xn=qt.globalSetting,Qn=qt.loading,J=qt.dispatch,ge=Object(C.i)(),Oe=Object(C.h)(),Re=Object(C.g)(),qe=Object(i.useState)([]),Ue=Object(s.a)(qe,2),Je=Ue[0],dt=Ue[1],wt=Object(i.useState)(Oe.query.tabs||"0"),Tt=Object(s.a)(wt,2),Be=Tt[0],ft=Tt[1],et=Object(i.useState)({}),rt=Object(s.a)(et,2),ht=rt[0],_t=rt[1],st=tn.workList,Pt=Object(i.useState)(!1),Wt=Object(s.a)(Pt,2),cn=Wt[0],On=Wt[1],an;ge.category=Oe.query.category_id,ge.order="work_score",ge.b_order="desc";var mn=function(Dt){ft(Dt),Dt==="0"&&J({type:"shixunHomeworks/getWorkList",payload:ge})},hn=function(){a.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u4F60\u5728\u8BE5\u5B9E\u8BAD\u7684\u5B66\u4E60\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A\uFF0C\u65E0\u6CD5\u6062\u590D",n.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u91CD\u505A\uFF1F"),onOk:function(){var Dt=Object(m.a)(l.a.mark(function _n(){var Gt,In,kt;return l.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return In=(Gt=tn.workList)===null||Gt===void 0?void 0:Gt.myshixun_identifier,En.next=3,Object(q.X)({id:In});case 3:kt=En.sent,kt&&(p.b.info(`\u5DF2\u6E05\u7A7A\u672C\u5B9E\u8BAD\u7684\u5B66\u4E60\u8BB0\u5F55
|
|
|
|
\u8BF7\u70B9\u51FB\u201C\u5F00\u542F\u6311\u6218\u201D\u91CD\u505A\u8BFE\u7A0B\u5B9E\u9A8C`),J({type:"shixunHomeworks/getWorkList",payload:ht}));case 5:case"end":return En.stop()}},_n)}));function it(){return Dt.apply(this,arguments)}return it}()})},gt=function on(Dt){var it;Dt=(it=Dt)!==null&&it!==void 0&&it.includes(".json")?Dt:"".concat(Dt,".json"),a.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var _n=Object(m.a)(l.a.mark(function In(){var kt,sn;return l.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object(mi.Cb)({url:Dt});case 2:if(kt=$t.sent,kt){$t.next=5;break}return $t.abrupt("return");case 5:return p.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),$t.next=8,Object(mi.E)({id:kt.shixun_identifier});case 8:if(sn=$t.sent,!(sn!=null&&sn.game_identifier)){$t.next=12;break}return Object(y.S)("/tasks/".concat(sn.game_identifier,"?coursesId=").concat(ge.coursesId)),$t.abrupt("return");case 12:(sn==null?void 0:sn.status)===2?on(sn==null?void 0:sn.message):(sn==null?void 0:sn.status)===3&&Kt(sn==null?void 0:sn.message);case 13:case"end":return $t.stop()}},In)}));function Gt(){return _n.apply(this,arguments)}return Gt}()})},Kt=function(Dt){a.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",Dt,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},St=function(){var on=Object(m.a)(l.a.mark(function Dt(it){var _n,Gt;return l.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return it=(_n=it)!==null&&_n!==void 0&&_n.includes(".json")?it:"".concat(it,".json"),kt.next=3,Object(mi.Cb)({url:it});case 3:if(Gt=kt.sent,console.log(Gt,"execRes"),!(Gt!=null&&Gt.game_identifier)){kt.next=8;break}return Object(y.S)("/tasks/".concat(Gt.game_identifier,"?coursesId=").concat(ge.coursesId)),kt.abrupt("return");case 8:(Gt==null?void 0:Gt.status)===-3?Object(y.q)():(Gt==null?void 0:Gt.status)===2?gt(Gt==null?void 0:Gt.message):(Gt==null?void 0:Gt.status)===3&&Kt(Gt==null?void 0:Gt.message);case 9:case"end":return kt.stop()}},Dt)}));return function(it){return on.apply(this,arguments)}}(),pt=[{name:"\u4F5C\u4E1A\u5217\u8868",id:"0",compontent:n.a.createElement(at,{setExportParams:_t}),forceRender:!0},{name:"\u4F5C\u4E1A\u8BE6\u60C5",id:"1",compontent:n.a.createElement(Ze,null)},{name:"\u6392\u884C\u699C",id:"5",compontent:n.a.createElement(yr,null)},{name:"\u4EE3\u7801\u67E5\u91CD",id:"2",compontent:n.a.createElement(Un,null)},{name:Object(Y.c)()?"\u9AD8\u7EA7\u8BBE\u7F6E":"\u5F97\u5206\u89C4\u5219",id:"3",compontent:n.a.createElement(ai,null)},{name:n.a.createElement("a",{style:{color:"#b9b8b8"},href:"/classrooms/".concat(ge.coursesId,"/program_homework/").concat(ge.categoryId,"/answer")},"\u89E3\u7B54&\u8BA8\u8BBA"),id:"6",compontent:!1}].filter(function(on){var Dt;if(Object(Y.t)())return on.name!=="\u4EE3\u7801\u67E5\u91CD";if(Object(Y.t)()||(st==null||((Dt=st.homework_status)===null||Dt===void 0)?void 0:Dt[0])!=="\u5DF2\u622A\u6B62")return on.name!=="\u8D28\u91CF\u68C0\u6D4B";var it;return!st.code_review&&(st==null||((it=st.homework_status)===null||it===void 0)?void 0:it[0])!=="\u672A\u53D1\u5E03"?!0:on.name!=="\u4EE3\u7801\u67E5\u91CD"}).filter(function(on){return st.open_code_quality_analysis?!0:on.name!=="\u8D28\u91CF\u68C0\u6D4B"}),gn=function(){var Dt,it,_n,Gt,In,kt,sn,En;return n.a.createElement("aside",{className:xi.a.workListTabButton},Object(Y.t)()&&((Dt=tn.workList)===null||Dt===void 0?void 0:Dt.redo_work)&&n.a.createElement(P.a,{onClick:hn,type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-dahuizhongzuo3x"})},"\u91CD\u505A"),((it=tn.workList)===null||it===void 0?void 0:it.shixun_status)>1&&((_n=tn.workList)===null||_n===void 0?void 0:_n.time_status)<5&&Object(Y.t)()&&n.a.createElement(P.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-kaiqizhong"}),onClick:function(){var sr,un,nn,mt,Xe,Et,vt;if(!Object(ni.e)(J,!0))return;(sr=tn.workList)!==null&&sr!==void 0&&(un=sr.task_operation)!==null&&un!==void 0&&(nn=un[1])!==null&&nn!==void 0&&nn.includes("/")?St((mt=tn.workList)===null||mt===void 0||((Xe=mt.task_operation)===null||Xe===void 0)?void 0:Xe[1]):Object(y.S)("/tasks/".concat((Et=tn.workList)===null||Et===void 0||((vt=Et.task_operation)===null||vt===void 0)?void 0:vt[1]))}},(Gt=tn.workList)===null||Gt===void 0||((In=Gt.task_operation)===null||In===void 0)?void 0:In[0]),((kt=tn.workList)===null||kt===void 0?void 0:kt.commit_des)&&n.a.createElement(P.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-tijiaozongjie"}),onClick:function(){var sr;Object(y.S)("/classrooms/".concat(ge.coursesId,"/shixun_homework/").concat(ge.categoryId,"/").concat((sr=tn.workList)===null||sr===void 0?void 0:sr.id,"/commitsummary"))}},(sn=tn.workList)===null||sn===void 0?void 0:sn.commit_des),Object(Y.c)()&&(st==null||((En=st.homework_status)===null||En===void 0)?void 0:En[0])==="\u672A\u53D1\u5E03"&&n.a.createElement(P.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-bianji2"}),onClick:function(){Re.push("/classrooms/".concat(ge.coursesId,"/program_homework/").concat(ge.categoryId,"/edit"))}},"\u7F16\u8F91\u4F5C\u4E1A"),Object(Y.c)()&&st.publish_immediately&&n.a.createElement(P.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-yishezhifabushijian1"}),onClick:function(){J({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u53D1\u5E03",selectArrs:[ge.categoryId],selectArrsAll:[st],params:ge,detail:!0,type:2}})}},"\u7ACB\u5373\u53D1\u5E03"),Object(Y.c)()&&st.end_immediately&&n.a.createElement(P.a,{style:{background:"#0152d9",color:"#fff"},type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-jiezhishiyan"}),onClick:function(){J({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u622A\u6B62",params:ge,type:2,detail:!0,selectArrs:[ge.categoryId]}})}},"\u7ACB\u5373\u622A\u6B62"))};return n.a.createElement("section",null,n.a.createElement("div",{className:"edu-container"},st.homework_name&&n.a.createElement("section",{className:"animated fadeIn"},n.a.createElement("aside",{className:"mt10"},st.category&&n.a.createElement(M.a,{separator:">"},n.a.createElement(M.a.Item,null,n.a.createElement(T.a,{to:"/classrooms/".concat(st.course_id,"/program_homework")},st.course_name)),n.a.createElement(M.a.Item,null,n.a.createElement(T.a,{to:"/classrooms/".concat(st.course_id,"/program_homework/").concat(st.category.main?"":st.category.category_id)},st.category.category_name)),n.a.createElement(M.a.Item,null,"\u4F5C\u4E1A\u8BE6\u60C5"))),n.a.createElement("aside",{className:[xi.a.title,"mt20"].join(" ")},n.a.createElement(T.a,{to:"/classrooms/".concat(st.course_id,"/program_homework/").concat(st.category.main?"":st.category.category_id)},n.a.createElement(S.a,{className:"font16 c-black"})),n.a.createElement(D.a,{title:st.homework_name,placement:"bottom"},n.a.createElement("strong",{className:"font20 ml5"},st.homework_name)),n.a.createElement(y.m,{temporary:!0,status:st.homework_status}),Object(Y.t)()&&n.a.createElement("span",{style:{fontWeight:800,color:"#0152d9",textAlign:"end",flex:1,cursor:"pointer"}},n.a.createElement(P.a,{onClick:Object(m.a)(l.a.mark(function on(){var Dt,it;return l.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Gt.next=2,Object(O.a)("/api/problems/".concat((Dt=tn.workList)===null||Dt===void 0?void 0:Dt.start_identifier,"/start.json"),{method:"get"});case 2:it=Gt.sent,it&&(window.open("/myproblems/".concat(it==null?void 0:it.identifier,"?type=1")),localStorage.setItem("program_homework",[ge.coursesId,ge.categoryId]));case 4:case"end":return Gt.stop()}},on)})),type:"primary"},(fn=st.homework_status)!==null&&fn!==void 0&&fn.includes("\u5DF2\u622A\u6B62")?"\u67E5\u770B\u4F5C\u4E1A":"\u8FDB\u5165\u7EC3\u4E60"," ")))),n.a.createElement("aside",{className:"mt30 relative ".concat(xi.a.workListTabWrap)},n.a.createElement(z.a,{type:"card",defaultActiveKey:Be,activeKey:Be,tabBarExtraContent:gn(),onChange:mn},pt.map(function(on,Dt){return n.a.createElement(z.a.TabPane,{tab:on.name,key:on.id,forceRender:on.forceRender},on.compontent)})))),n.a.createElement(pi,null),n.a.createElement(Zt.a,{courseEndTime:st==null?void 0:st.course_end_date}),n.a.createElement(qr.a,{courseEndTime:st==null?void 0:st.course_end_date}),n.a.createElement(a.a,{visible:cn,title:"\u89C4\u5219\u8BF4\u660E",width:800,footer:null,onCancel:function(){On(!1)}},n.a.createElement("p",null,"\u4E00\u3001\u7B49\u7EA7\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"1. \u7F3A\u9677\u7B49\u7EA7"),n.a.createElement("p",{style:{marginLeft:"10px"}},n.a.createElement(V.a,{dataSource:br,columns:[{title:"\u7B49\u7EA7",dataIndex:"live"},{title:"\u7F3A\u9677\u8BC4\u4F30\u89C4\u5219",dataIndex:"gz"},{title:"\u6F0F\u6D1E\u8BC4\u4F30\u89C4\u5219",dataIndex:"ld"},{title:"\u4EE3\u7801\u89C4\u8303\u8BC4\u4F30\u89C4\u5219",dataIndex:"gf"}],pagination:!1})),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6CE8\uFF1A\u4EE3\u7801\u89C4\u8303\u8BC4\u4F30\u89C4\u5219\u4E2D\u6570\u503C\u6765\u6E90\u4E3A\u8BA1\u7B97\u6280\u672F\u503A\u52A1\u65F6\u95F4\u5360\u5F00\u53D1\u6240\u6709\u4EE3\u7801\u6240\u9700\u8981\u7684\u65F6\u95F4\u7684\u6BD4\u4F8B\uFF08Technical Debt Ratio\uFF09"),n.a.createElement("p",{style:{marginLeft:"20px"}},"Technical Debt Ratio = \u6280\u672F\u503A\u52A1\u65F6\u95F4 / \u5F00\u53D1\u65F6\u95F4"),n.a.createElement("p",{style:{marginLeft:"20px"}},"\u6280\u672F\u503A\u52A1\u65F6\u95F4\u4E3A\u4FEE\u590D\u6240\u6709\u95EE\u9898\u6240\u9700\u8981\u7684\u65F6\u95F4\u3002"),n.a.createElement("p",null,"\u4E8C\u3001\u590D\u6742\u5EA6\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6839\u636E\u4EE3\u7801\u8DEF\u5F84\u6570\u8BA1\u7B97\u7684\u6570\u503C\uFF0C\u6BCF\u5F53\u4E00\u4E2A\u51FD\u6570\u7684\u63A7\u5236\u6D41\u5206\u53C9\u65F6\uFF0C\u590D\u6742\u5EA6\u8BA1\u6570\u5668\u5C31\u4F1A\u81EA\u589E\u4E00\u3002"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6BCF\u4E2A\u7A0B\u5E8F\u8BED\u8A00\u7684\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u590D\u6742\u5EA6\u6570\u636E\u4E0D\u540C\uFF0C\u4F46\u6BCF\u4E2A\u51FD\u6570\u7684\u6700\u5C0F\u590D\u6742\u5EA6\u4E3A1\u3002\uFF08\u7279\u5B9A\u8BED\u8A00\u7684\u8BE6\u7EC6\u6570\u636E\u7565\uFF09"),n.a.createElement("p",null,"\u4E09\u3001\u4EE3\u7801\u8D28\u91CF\u5206\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u4EE3\u7801\u8D28\u91CF\u5206 = 0.5*\u7F3A\u9677\u5206\u6570 + 0.3*\u6F0F\u6D1E\u5206\u6570 + 0.2*\u4EE3\u7801\u89C4\u8303\u6027\u5206\u6570"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u5176\u4E2D\uFF1A"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u7F3A\u9677/\u6F0F\u6D1E/\u4EE3\u7801\u89C4\u8303\u6027\u5206\u6570\u8BA1\u7B97\u89C4\u5219\u4E3A\uFF1A100 - 100 *((100*\u5D29\u6E83\u6570 + 5*\u4E25\u91CD\u6570 + 3*\u4E3B\u8981\u6570 + 1*\u6B21\u6570\uFF09/ \u4EE3\u7801\u884C\u6570\uFF09"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6CE8\uFF1A\u5206\u6570\u4E3A\u7A7A\u7684\u4EE3\u8868\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u683C\u5F0F\u3002")))},kr=ve.default=Object(R.a)(function(Tn){var qt=Tn.shixunHomeworks,fn=Tn.loading,tn=Tn.globalSetting;return{shixunHomeworks:qt,globalSetting:tn,loading:fn.effects}})(oi)},OZM5:function(Lt,ve,k){"use strict";k.d(ve,"b",function(){return P}),k.d(ve,"a",function(){return x}),k.d(ve,"k",function(){return p}),k.d(ve,"h",function(){return m}),k.d(ve,"i",function(){return c}),k.d(ve,"g",function(){return a}),k.d(ve,"c",function(){return s}),k.d(ve,"d",function(){return d}),k.d(ve,"j",function(){return n}),k.d(ve,"e",function(){return O}),k.d(ve,"f",function(){return C});var ne=k("KQm4"),V=k("U8pU"),I=k("Ff2n"),z=k("q1tI"),L=k.n(z),D=k("Kwbf"),K=k("WaYH"),M=.25,r=2;function P(T,R){var S=T.slice(),y=S.indexOf(R);return y>=0&&S.splice(y,1),S}function x(T,R){var S=T.slice();return S.indexOf(R)===-1&&S.push(R),S}function p(T){return T.split("-")}function m(T,R){return"".concat(T,"-").concat(R)}function c(T){return T&&T.type&&T.type.isTreeNode}function a(T,R){var S=[T],y=R[T];function E(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];f.forEach(function(h){var v=h.key,g=h.children;S.push(v),E(g)})}return E(y.children),S}function s(T,R){var S=T.clientY,y=R.selectHandle.getBoundingClientRect(),E=y.top,f=y.bottom,h=y.height,v=Math.max(h*M,r);return S<=E+v?-1:S>=f-v?1:0}function d(T,R){if(!T)return;var S=R.multiple;return S?T.slice():T.length?[T[0]]:T}var l=function(R){return R};function i(T,R){if(!T)return[];var S=R||{},y=S.processProps,E=y===void 0?l:y,f=Array.isArray(T)?T:[T];return f.map(function(h){var v=h.children,g=Object(I.a)(h,["children"]),b=i(v,R);return L.a.createElement(K.a,Object.assign({},E(g)),b)})}function n(T){if(!T)return null;var R;if(Array.isArray(T))R={checkedKeys:T,halfCheckedKeys:void 0};else if(Object(V.a)(T)==="object")R={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return Object(D.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function O(T,R){var S=new Set;function y(E){if(S.has(E))return;var f=R[E];if(!f)return;S.add(E);var h=f.parent,v=f.node;if(v.disabled)return;h&&y(h.key)}return(T||[]).forEach(function(E){y(E)}),Object(ne.a)(S)}function C(T){var R={};return Object.keys(T).forEach(function(S){(S.startsWith("data-")||S.startsWith("aria-"))&&(R[S]=T[S])}),R}},Ot1p:function(Lt,ve,k){"use strict";var ne=k("2qtc"),V=k("kLXV"),I=k("rAM+"),z=k("miYZ"),L=k("tsqr"),D=k("9og8"),K=k("tJVT"),M=k("jrin"),r=k("WmNS"),P=k.n(r),x=k("q1tI"),p=k.n(x),m=k("VrN/"),c=k.n(m),a=k("bdgK"),s=k("p77/"),d=k("Bd2K"),l=k("ELLl"),i=k("19Vz"),n=k("lZu9"),O=k("+NIl"),C=k("kSUc"),T=k("9Bee"),R=function(Ee){var Le=Ee.value,at=Le===void 0?"":Le,Ct=Ee.className,Jt=Ee.showTextOnly,lt=Ee.showLines,Un=Ee.style,Cn=Un===void 0?{}:Un,vn=Object(x.useMemo)(function(){return""},[at]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:vn}}))},S=k("0Owb"),y=k("dejd"),E=k("C+DQ"),f=k("1vsH"),h=k("m3rI"),v=[{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 g(Ee){var Le=Ee.onActionCallback,at=Ee.title,Ct=Ee.icon,Jt=Ee.actionName,lt=Ee.className,Un=lt===void 0?"":lt,Cn=Ee.children;function vn(){Le(Jt)}return p.a.createElement("a",{title:at,className:Un,onClick:vn},p.a.createElement("i",{className:"md-iconfont ".concat(Ct)}),Cn)}var b=function(Ee){var Le=Ee.watch,at=Ee.showNullButton,Ct=Ee.onActionCallback,Jt=Ee.fullScreen,lt=Ee.insertTemp,Un=Ee.hidetoolBar,Cn=Ee.uuid,vn=Ee.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(Cn,"&api=").concat(encodeURIComponent(h.a.PROXY_SERVER)));var er=[].concat(v,[{title:"".concat(Le?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Le?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!Un&&er.map(function(kn,Yn){return p.a.createElement("li",{key:Yn},kn.actionName?p.a.createElement(g,Object(S.a)({},kn,{onActionCallback:Ct})):p.a.createElement("span",{className:"v-line"}))}),at?p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ct},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,lt&&p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(lt),onActionCallback:Ct},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(g,{icon:"".concat(Jt?"icon-shrink":"icon-enlarge"),title:Jt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ct})))},N=k("M8RZ"),H=k("+L6B"),A=k("2/Rp"),F=k("y8nQ"),U=k("Vl3Y"),w=k("5NDa"),Y=k("5rEg"),Z={labelCol:{span:4},wrapperCol:{span:20}},ce=function(Ee){var Le=Ee.callback,at=Ee.onCancel;function Ct(Jt){Le(Jt)}return p.a.createElement(U.a,Object(S.a)({},Z,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ct}),p.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(Y.a,null)),p.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(Y.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))},be=k("7ahc"),Ze=k("HmJG"),Ce=k("BjJ7"),We=U.a.useForm,Ve={width:280,marginRight:10},Ye={labelCol:{span:5},wrapperCol:{span:19}},we=function(Ee){var Le=Ee.callback,at=Ee.onCancel,Ct=We(),Jt=Object(K.a)(Ct,1),lt=Jt[0];function Un(er){Le(er)}function Cn(er,kn){if(er.status===-1){L.b.error(er.message);return}lt.setFieldsValue({src:"/api/attachments/".concat(er.id),type:kn.type})}function vn(er){var kn=er.target.files[0];j(kn,Cn)}return p.a.createElement(U.a,Object(S.a)({form:lt},Ye,{className:"upload-image-panel",onFinish:Un}),p.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(Y.a,{style:Ve})),p.a.createElement(X,{onFileChange:vn}))),p.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(Y.a,{style:{width:264}})),p.a.createElement(U.a.Item,{style:{textAlign:"right"}},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))};function X(Ee){var Le=Ee.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Le}))}function j(Ee,Le){if(!Ee)throw new String("\u6CA1\u6709\u6587\u4EF6");var at=new FormData;at.append("editormd-image-file",Ee),at.append("file_param_name","editormd-image-file"),at.append("byxhr","true");var Ct=new window.XMLHttpRequest;Ct.withCredentials=!0,Ct.addEventListener("load",function(Jt){Le(JSON.parse(Jt.target.responseText),Ee)},!1),Ct.addEventListener("error",function(Jt){console.error(Jt)},!1),Ct.open("POST","".concat(Ce.a,"/api/attachments.json")),Ct.send(at)}var W=k("giR+"),Q=k("fyUT"),re=k("7Kak"),G=k("9yH6"),xe=G.a.Group,Ie={margin:"0 8px"},tt=function(Ee){var Le=Ee.callback,at=Ee.onCancel;function Ct(Jt){Le(Jt)}return p.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ct},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Ie},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Ie},"\u884C\u6570"),p.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(Q.a,null)),p.a.createElement("span",{style:Ie},"\u5217\u6570"),p.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(Q.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:Ie},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(U.a.Item,{name:"align"},p.a.createElement(xe,null,p.a.createElement(G.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(G.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(G.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(G.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))},le=k("ErOA"),Se=k("7Cbv"),je="link",ze="upload-image",yt="code-block",Ot="add-table",Ut="------------",Qe={default:Ut,left:":".concat(Ut),center:":".concat(Ut,":"),right:"".concat(Ut,":")},Bt=k("9VGf"),ln,Ke;function He(){}var ct=0,bt=1e4,de="\u2581",q=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function te(Ee){return/^\d+$/.test(Ee)?"".concat(Ee,"px"):Ee}var se=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=se?"Cmd":"Ctrl",ae=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ie=(ln={},Object(M.a)(ln,pe+"-B","bold"),Object(M.a)(ln,pe+"-I","italic"),ln),me=(Ke={},Object(M.a)(Ke,je,"\u6DFB\u52A0\u94FE\u63A5"),Object(M.a)(Ke,yt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(M.a)(Ke,ze,"\u6DFB\u52A0\u6587\u4EF6"),Object(M.a)(Ke,Ot,"\u6DFB\u52A0\u8868\u683C"),Ke),_e=ve.a=function(Ee){var Le=Ee.defaultValue,at=Le===void 0?"":Le,Ct=Ee.onChange,Jt=Ee.width,lt=Jt===void 0?"100%":Jt,Un=Ee.height,Cn=Un===void 0?400:Un,vn=Ee.miniToolbar,er=vn===void 0?!1:vn,kn=Ee.isFocus,Yn=kn===void 0?!1:kn,vr=Ee.watch,Mn=Ee.insertTemp,Zn=Ee.mode,dr=Zn===void 0?"markdown":Zn,jt=Ee.id,Ft=jt===void 0?"markdown-editor-id":jt,zt=Ee.showResizeBar,dn=zt===void 0?!1:zt,yn=Ee.noStorage,bn=yn===void 0?!1:yn,_r=Ee.showNullButton,Bn=_r===void 0?!1:_r,Qt=Ee.hidetoolBar,Hn=Qt===void 0?!1:Qt,lr=Ee.fullScreen,Sn=lr===void 0?!1:lr,zn=Ee.onBlur,tr=Ee.onCMBeforeChange,Gr=Ee.onFullScreen,Ar=Ee.className,Yt=Ar===void 0?"":Ar,Vn=Ee.disablePaste,vi=Vn===void 0?!1:Vn,Pi=Ee.placeholder,ai=Pi===void 0?"":Pi,Yr=Ee.values,Lr=Yr===void 0?"":Yr,Fn=Object(x.useState)(null),pi=Object(K.a)(Fn,2),Zt=pi[0],qr=pi[1],zr=Object(x.useState)(at),xi=Object(K.a)(zr,2),mi=xi[0],ni=xi[1],Bi=Object(x.useState)(vr),Hi=Object(K.a)(Bi,2),ri=Hi[0],wr=Hi[1],Si=Object(x.useState)(Sn),Oi=Object(K.a)(Si,2),ci=Oi[0],_i=Oi[1],oa=Object(x.useState)(""),$i=Object(K.a)(oa,2),yr=$i[0],br=$i[1],oi=Object(x.useState)(0),kr=Object(K.a)(oi,2),Tn=kr[0],qt=kr[1],fn=Object(x.useState)(Cn),tn=Object(K.a)(fn,2),Xn=tn[0],Qn=tn[1],J=Object(x.useState)(!1),ge=Object(K.a)(J,2),Oe=ge[0],Re=ge[1],qe=Object(x.useRef)(Object(Se.a)()),Ue=Object(x.useRef)(!1),Je=Object(x.useRef)(),dt=Object(x.useRef)(),wt=Object(x.useRef)(),Tt=Object(x.useRef)(),Be=Object(x.useRef)(),ft=function(){var gt=Object(D.a)(P.a.mark(function Kt(){var St,pt;return P.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,Object(le.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:qe.current}});case 2:pt=on.sent,pt!=null&&(St=pt.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",Zt,dt),pt.attachments.map(function(Dt){Dt.content_type.indexOf("image")>-1?Zt.replaceSelection(".concat(Dt.content_type,")")):Dt.content_type.indexOf("video")>-1?Zt.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Dt.content_type.indexOf("pdf")>-1?Zt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(Dt.content_type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):Zt.replaceSelection("[".concat(Dt.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(Dt.content_type,")"))}));case 4:case"end":return on.stop()}},Kt)}));return function(){return gt.apply(this,arguments)}}();Object(x.useEffect)(function(){ni(Lr),Zt==null||Zt.setValue(Lr)},[Lr]),Object(x.useEffect)(function(){Gr==null||Gr(ci)},[ci]),Object(x.useEffect)(function(){if(dt.current){var gt=c.a.fromTextArea(dt.current,{mode:dr,lineNumbers:!er,lineWrapping:!0,value:at,autoCloseTags:!0,autoCloseBrackets:!0});Yn&>.focus();function Kt(St,pt){if(vi){pt.preventDefault();return}var gn=pt.clipboardData;if(gn){var on=gn.types.toString(),Dt=gn.items;if(on==="Files"||gn.types.indexOf("Files")>-1){if(pt.preventDefault(),dr=="stex")return;try{var it,_n=Dt[1];((it=Dt[0])===null||it===void 0?void 0:it.kind)==="file"&&(_n=Dt[0]);var Gt=_n.getAsFile(),In=Gt.name.split(".").pop();j(Gt,function(kt){if(kt.id){var sn,En,$t;(Gt==null||((sn=Gt.type)===null||sn===void 0)?void 0:sn.indexOf("image"))>-1?gt.replaceSelection(".concat(kt.content_type,")")):(Gt==null||((En=Gt.type)===null||En===void 0)?void 0:En.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(kt.id,'"></video>')):(Gt==null||(($t=Gt.type)===null||$t===void 0)?void 0:$t.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(kt.id,"?type=").concat(Gt.type,'&disposition=inline" target="_blank">').concat(Gt.name,"</a>")):ae.includes(In)?gt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(kt.id,'?type=office&disposition=inline" target="_blank">').concat(Gt.name,"</a>")):gt.replaceSelection("[".concat(Gt.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(kt.id,"?type=").concat(kt.content_type,")"))}else(kt==null?void 0:kt.status)===401&&(document.location.href="/user/login")})}catch(kt){L.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return gt.on("paste",Kt),gt.on("dragleave",function(St,pt){wt.current.classList.remove("mouse-hover-md")}),gt.on("dragover",function(St,pt){wt.current.classList.add("mouse-hover-md")}),gt.on("drop",function(St,pt){wt.current.classList.add("mouse-hover-md");var gn;if(gn=pt.dataTransfer.files,gn.length>0){pt.preventDefault(),pt.stopPropagation();for(var on=function(_n){var Gt=gn[_n],In=Gt.name.split(".").pop();j(Gt,function(kt){if(kt.id){var sn,En,$t;(Gt==null||((sn=Gt.type)===null||sn===void 0)?void 0:sn.indexOf("image"))>-1?gt.replaceSelection(".concat(kt.content_type,")")):(Gt==null||((En=Gt.type)===null||En===void 0)?void 0:En.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(kt.id,'"></video>')):(Gt==null||(($t=Gt.type)===null||$t===void 0)?void 0:$t.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(kt.id,"?type=").concat(Gt.type,'&disposition=inline" target="_blank">').concat(Gt.name,"</a>")):ae.includes(In)?gt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(kt.id,'?type=office&disposition=inline" target="_blank">').concat(Gt.name,"</a>")):gt.replaceSelection("[".concat(Gt.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(kt.id,"?type=").concat(kt.content_type,")"))}else(kt==null?void 0:kt.status)===401&&(document.location.href="/user/login")})},Dt=0;Dt<gn.length;Dt++)on(Dt)}}),qr(gt),function(){gt.off("paste",Kt)}}},[]);var et=Object(x.useCallback)(function(){if(wt.current)try{}catch(gt){console.log(gt,"---- to set md editor body height")}},[Xn,wt,ci]);Object(x.useEffect)(function(){function gt(){var St=new a.default(function(pt){var gn=Object(I.a)(pt),on;try{for(gn.s();!(on=gn.n()).done;){var Dt=on.value;(Dt.target.offsetHeight>0||Dt.target.offsetWidth>0)&&(et(),Zt.setSize("100%","100%"),Zt.refresh())}}catch(it){gn.e(it)}finally{gn.f()}});return St.observe(dt.current.parentElement),St}if(Zt){var Kt=gt();return function(){Kt.unobserve(dt.current.parentElement)}}},[Zt,et]),Object(x.useEffect)(function(){if(Zt){for(var gt=[],Kt=function(){var Dt=pt[St];gn=Object(K.a)(Dt,2);var it=gn[0],_n=gn[1],Gt=Object(M.a)({},it,function(){rt(_n)});gt.push(Gt),Zt.addKeyMap(Gt)},St=0,pt=Object.entries(ie);St<pt.length;St++){var gn;Kt()}return Je.current=setInterval(function(){Ue.current&&ft()},4e3),function(){clearInterval(Je.current);var on=Object(I.a)(gt),Dt;try{for(on.s();!(Dt=on.n()).done;){var it=Dt.value;Zt.removeKeyMap(it)}}catch(_n){on.e(_n)}finally{on.f()}}}},[Zt]),Object(x.useEffect)(function(){Sn!==ci&&_i(Sn)},[Sn]),Object(Bt.a)(function(){if(!bn&&Tn>0){var gt=new Date().getTime(),Kt=window.sessionStorage.getItem(Ft);gt>=Tn+bt&&(!Kt||Kt!==mi)&&(window.sessionStorage.setItem(Ft,mi),Re(!0))}},bt),Object(x.useEffect)(function(){wr(vr)},[Zt,vr]),Object(x.useEffect)(function(){Zt&&(Yn&&Zt.focus())},[Zt,Yn]),Object(x.useEffect)(function(){if(ri&&Zt){var gt=Zt.getScrollerElement();function Kt(St){var pt=St.target;if(Be.current){var gn=pt.scrollTop/pt.scrollHeight;Be.current.scrollTop=Be.current.scrollHeight*gn}}return gt.addEventListener("scroll",Kt),function(){gt.removeEventListener("scroll",Kt)}}},[Zt,ri]),Object(x.useEffect)(function(){if(Zt&&tr){function gt(Kt,St){tr(Kt,St)}return Zt.on("beforeChange",gt),function(){Zt.off("beforeChange",gt)}}},[Zt,tr]),Object(x.useEffect)(function(){if(Zt&&zn){function gt(){zn(Zt.getValue())}return Zt.on("blur",gt),function(){Zt.off("blur",gt)}}},[Zt,zn]),Object(x.useEffect)(function(){if(Zt){function gt(Kt){var St=Kt.getValue();ni(St),qt(new Date().getTime()),Kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ct&&Ct(St)}return Zt.on("change",gt),function(){Zt.off("change",gt)}}},[Zt,Ct]),Object(x.useEffect)(function(){Zt&&(at==null?(Zt.setValue(""),ni("")):at!==Zt.getValue()&&(Zt.setValue(at),ni(at),Zt.setCursor(Zt.lineCount(),0)))},[Zt,at]);var rt=Object(x.useCallback)(function(gt){var Kt=Zt.getCursor(),St=Zt.getSelection(),pt=St.split(`
|
|
`);switch(gt){case"bold":return Zt.replaceSelection("**"+St+"**"),St===""&&Zt.setCursor(Kt.line,Kt.ch+2),Zt.focus();case"italic":return Zt.replaceSelection("*"+St+"*"),St===""&&Zt.setCursor(Kt.line,Kt.ch+1),Zt.focus();case"code":return Zt.replaceSelection("`"+St+"`"),St===""&&Zt.setCursor(Kt.line,Kt.ch+1),Zt.focus();case"inline-latex":return Zt.replaceSelection("`$$"+St+"$$`"),St===""&&Zt.setCursor(Kt.line,Kt.ch+3),Zt.focus();case"latex":return Zt.replaceSelection("```latex\n"+St+"\n```"),Zt.setCursor(Kt.line+1,St.length+1),Zt.focus();case"line-break":return Zt.replaceSelection(`<br/>
|
|
`),Zt.focus();case"list-ul":return St===""?Zt.replaceSelection("- "+St):Zt.replaceSelection(pt.map(function(gn){return gn===""?"":"- ".concat(gn)}).join(`
|
|
`)),Zt.focus();case"list-ol":return St===""?Zt.replaceSelection("1. "+St):Zt.replaceSelection(pt.map(function(gn,on){return gn===""?"":"".concat(on+1,". ").concat(gn)}).join(`
|
|
`)),Zt.focus();case"add-null-ch":return St===""&&Zt.setCursor(Kt.line,Kt.ch+1),Zt.replaceSelection(de),Zt.focus();case"inster-template-1":return St===""&&Zt.setCursor(Kt.line,Kt.ch),Zt.replaceSelection(q),Zt.focus();case"eraser":return Zt.setValue(""),Zt.focus();case"trigger-watch":return wr(!ri),Zt.focus();case"trigger-full-screen":return _i(!ci),Zt.focus();case je:br(je);return;case yt:br(yt);return;case ze:br(ze);return;case Ot:br(Ot);return;default:throw new Error}},[Zt,ri,ci]),ht=Object(x.useCallback)(function(gt){br("");switch(yr){case je:var Kt=gt.title,St=gt.link;return Zt.replaceSelection("[".concat(Kt,"](").concat(St,")")),Zt.focus();case yt:var pt=gt.language,gn=gt.content;return Zt.replaceSelection(["```"+pt,gn,"```"].join(`
|
|
`)),Zt.focus();case ze:var on=gt.src,Dt=gt.alt;return Dt?Zt.replaceSelection(".concat(on,' "').concat(Dt,'" )')):Zt.replaceSelection("")),Zt.focus();case Ot:for(var it=gt.row,_n=gt.col,Gt=gt.align,In=`
|
|
`,kt=0;kt<it;kt++){for(var sn=[],En=[],$t=0;$t<_n;$t++)kt===1&&En.push(Qe[Gt]),sn.push(" ");kt===1&&(In+="| ".concat(En.join(" | "),` |
|
|
`)),In+="| ".concat(sn.join(_n===1?"":" | "),` |
|
|
`)}return Zt.replaceSelection(In+`
|
|
`),Zt.focus();default:throw new Error}},[Zt,yr]),_t=Object(x.useMemo)(function(){switch(yr){case je:return p.a.createElement(ce,{callback:ht,onCancel:st});case yt:return p.a.createElement(be.b,{callback:ht,onCancel:st});case ze:return p.a.createElement(we,{callback:ht,onCancel:st});case Ot:return p.a.createElement(tt,{callback:ht,onCancel:st});default:return null}},[yr]);function st(){br("")}Object(x.useEffect)(function(){if(Tt.current){var gt=Tt.current,Kt=!1,St=0;function pt(Dt){Kt=!0,St=Dt.pageY}function gn(){Kt=!1}function on(Dt){if(Kt){var it=Dt.pageY-St;it<0&&(it=0),it>300&&(it=300);var _n=Cn+it+"px";Qn(_n)}}return gt.addEventListener("mousedown",pt),document.addEventListener("mousemove",on),document.addEventListener("mouseup",gn),function(){gt.removeEventListener("mousedown",pt),document.removeEventListener("mousemove",on),document.removeEventListener("mouseup",gn)}}},[Zt,Tt]),Object(x.useEffect)(function(){Qn(Cn)},[Cn]);var Pt=te(lt),Wt=te(Xn),cn={width:Pt,height:Wt},On=Object(x.useMemo)(function(){if(Tn){var gt=new Date(Tn),Kt=gt.getHours(),St=gt.getMinutes(),pt=gt.getSeconds();return Kt=Kt<10?"0"+Kt:Kt,St=St<10?"0"+St:St,pt=pt<10?"0"+pt:pt,"".concat(Kt,":").concat(St,":").concat(pt)}return 0},[Tn]);function an(){window.sessionStorage.removeItem(Ft),Re(!1),qt(0)}function mn(){Re(!1),qt(0),Zt.setValue(window.sessionStorage.getItem(Ft))}function hn(gt,Kt){var St=Zt.getValue();St=St.replace(gt,Kt),ni(St),Zt==null||Zt.setValue(St)}return p.a.createElement(x.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:wt},p.a.createElement("div",{className:"markdown-editor-container ".concat(Yt," ").concat(ri?"on-preview":""," ").concat(er?"mini":""," ").concat(ci?"full-screen":""),style:cn},p.a.createElement(b,{insertTemp:Mn,watch:ri,fullScreen:ci,showNullButton:Bn,onActionCallback:rt,hidetoolBar:Hn,uuid:qe.current,setOpenPhones:function(){Ue.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:dt,placeholder:ai})),ri?p.a.createElement("div",{ref:Be,className:"preview-container"},dr==="stex"&&p.a.createElement(R,{value:mi}),dr!=="stex"&&p.a.createElement(T.a,{edit:!0,value:mi,replaces:hn})):null))),dn?p.a.createElement("a",{ref:Tt,className:"editor-resize"}):null,p.a.createElement(N.a,null,me[yr]?p.a.createElement(V.a,{centered:!0,title:me[yr],visible:!0,onCancel:st,footer:null,className:"markdown-popup-form"},_t):null))}},RotF:function(Lt,ve,k){Lt.exports=k("LSTS")},"SA+Z":function(Lt,ve,k){var ne=k("wTVA"),V=k("EbDI"),I=k("ZhPi"),z=k("wkBT");function L(D){return ne(D)||V(D)||I(D)||z()}Lt.exports=L,Lt.exports.__esModule=!0,Lt.exports.default=Lt.exports},SJMd:function(Lt,ve){/**
|
|
* @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 k,ne,V,I=!1,z,L;window.PR_SHOULD_USE_CONTINUATION=!0;var D,K;(function(){var M=window,r=["break,continue,do,else,for,if,return,while"],P=[r,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],x=[P,"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"],m=[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",s=[x,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],d="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",l=[r,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],i=[r,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],n=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[p,c,m,s,d,l,i,n],C=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",R="kwd",S="com",y="typ",E="lit",f="pun",h="pln",v="tag",g="dec",b="src",N="atn",H="atv",A="nocode",F="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(xe){for(var Ie=0,tt=!1,le=!1,Se=0,je=xe.length;Se<je;++Se){var ze=xe[Se];if(ze.ignoreCase)le=!0;else if(/[a-z]/i.test(ze.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){tt=!0,le=!1;break}}var yt={b:8,t:9,n:10,v:11,f:12,r:13};function Ot(Ke){var He=Ke.charCodeAt(0);if(He!==92)return He;var ct=Ke.charAt(1);return He=yt[ct],He||("0"<=ct&&ct<="7"?parseInt(Ke.substring(1),8):ct==="u"||ct==="x"?parseInt(Ke.substring(2),16):Ke.charCodeAt(1))}function Ut(Ke){if(Ke<32)return(Ke<16?"\\x0":"\\x")+Ke.toString(16);var He=String.fromCharCode(Ke);return He==="\\"||He==="-"||He==="]"||He==="^"?"\\"+He:He}function Qe(Ke){var He=Ke.substring(1,Ke.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),ct=[],bt=He[0]==="^",de=["["];bt&&de.push("^");for(var q=bt?1:0,te=He.length;q<te;++q){var se=He[q];if(/\\[bdsw]/i.test(se))de.push(se);else{var pe=Ot(se),ae;q+2<te&&He[q+1]==="-"?(ae=Ot(He[q+2]),q+=2):ae=pe,ct.push([pe,ae]),ae<65||pe>122||(ae<65||pe>90||ct.push([Math.max(65,pe)|32,Math.min(ae,90)|32]),ae<97||pe>122||ct.push([Math.max(97,pe)&~32,Math.min(ae,122)&~32]))}}ct.sort(function(Ee,Le){return Ee[0]-Le[0]||Le[1]-Ee[1]});for(var ie=[],me=[],q=0;q<ct.length;++q){var _e=ct[q];_e[0]<=me[1]+1?me[1]=Math.max(me[1],_e[1]):ie.push(me=_e)}for(var q=0;q<ie.length;++q){var _e=ie[q];de.push(Ut(_e[0])),_e[1]>_e[0]&&(_e[1]+1>_e[0]&&de.push("-"),de.push(Ut(_e[1])))}return de.push("]"),de.join("")}function Bt(Ke){for(var He=Ke.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ct=He.length,bt=[],de=0,q=0;de<ct;++de){var te=He[de];if(te==="(")++q;else if(te.charAt(0)==="\\"){var se=+te.substring(1);se&&(se<=q?bt[se]=-1:He[de]=Ut(se))}}for(var de=1;de<bt.length;++de)bt[de]===-1&&(bt[de]=++Ie);for(var de=0,q=0;de<ct;++de){var te=He[de];if(te==="(")++q,bt[q]||(He[de]="(?:");else if(te.charAt(0)==="\\"){var se=+te.substring(1);se&&se<=q&&(He[de]="\\"+bt[se])}}for(var de=0;de<ct;++de)He[de]==="^"&&He[de+1]!=="^"&&(He[de]="");if(Ke.ignoreCase&&tt)for(var de=0;de<ct;++de){var te=He[de],pe=te.charAt(0);te.length>=2&&pe==="["?He[de]=Qe(te):pe!=="\\"&&(He[de]=te.replace(/[a-zA-Z]/g,function(me){var _e=me.charCodeAt(0);return"["+String.fromCharCode(_e&~32,_e|32)+"]"}))}return He.join("")}for(var ln=[],Se=0,je=xe.length;Se<je;++Se){var ze=xe[Se];if(ze.global||ze.multiline)throw new Error(""+ze);ln.push("(?:"+Bt(ze)+")")}return new RegExp(ln.join("|"),le?"gi":"g")}function w(xe,Ie){var tt=/(?:^|\s)nocode(?:\s|$)/,le=[],Se=0,je=[],ze=0;function yt(Ot){var Ut=Ot.nodeType;if(Ut==1){if(tt.test(Ot.className))return;for(var Qe=Ot.firstChild;Qe;Qe=Qe.nextSibling)yt(Qe);var Bt=Ot.nodeName.toLowerCase();(Bt==="br"||Bt==="li")&&(le[ze]=`
|
|
`,je[ze<<1]=Se++,je[ze++<<1|1]=Ot)}else if(Ut==3||Ut==4){var ln=Ot.nodeValue;ln.length&&(Ie?ln=ln.replace(/\r\n?/g,`
|
|
`):ln=ln.replace(/[ \t\r\n]+/g," "),le[ze]=ln,je[ze<<1]=Se,Se+=ln.length,je[ze++<<1|1]=Ot)}}return yt(xe),{sourceCode:le.join("").replace(/\n$/,""),spans:je}}function Y(xe,Ie,tt,le,Se){if(!tt)return;var je={sourceNode:xe,pre:1,langExtension:null,numberLines:null,sourceCode:tt,spans:null,basePos:Ie,decorations:null};le(je),Se.push.apply(Se,je.decorations)}var Z=/\S/;function ce(xe){for(var Ie=void 0,tt=xe.firstChild;tt;tt=tt.nextSibling){var le=tt.nodeType;Ie=le===1?Ie?xe:tt:le===3&&Z.test(tt.nodeValue)?xe:Ie}return Ie===xe?void 0:Ie}function be(xe,Ie){var tt={},le;(function(){for(var ze=xe.concat(Ie),yt=[],Ot={},Ut=0,Qe=ze.length;Ut<Qe;++Ut){var Bt=ze[Ut],ln=Bt[3];if(ln)for(var Ke=ln.length;--Ke>=0;)tt[ln.charAt(Ke)]=Bt;var He=Bt[1],ct=""+He;Ot.hasOwnProperty(ct)||(yt.push(He),Ot[ct]=null)}yt.push(/[\0-\uffff]/),le=U(yt)})();var Se=Ie.length,je=function(ze){for(var yt=ze.sourceCode,Ot=ze.basePos,Ut=ze.sourceNode,Qe=[Ot,h],Bt=0,ln=yt.match(le)||[],Ke={},He=0,ct=ln.length;He<ct;++He){var bt=ln[He],de=Ke[bt],q=void 0,te;if(typeof de=="string")te=!1;else{var se=tt[bt.charAt(0)];if(se)q=bt.match(se[1]),de=se[0];else{for(var pe=0;pe<Se;++pe)if(se=Ie[pe],q=bt.match(se[1]),q){de=se[0];break}q||(de=h)}te=de.length>=5&&de.substring(0,5)==="lang-",te&&!(q&&typeof q[1]=="string")&&(te=!1,de=b),te||(Ke[bt]=de)}var ae=Bt;if(Bt+=bt.length,!te)Qe.push(Ot+ae,de);else{var ie=q[1],me=bt.indexOf(ie),_e=me+ie.length;q[2]&&(_e=bt.length-q[2].length,me=_e-ie.length);var Ee=de.substring(5);Y(Ut,Ot+ae,bt.substring(0,me),je,Qe),Y(Ut,Ot+ae+me,ie,X(Ee,ie),Qe),Y(Ut,Ot+ae+_e,bt.substring(_e),je,Qe)}}ze.decorations=Qe};return je}function Ze(xe){var Ie=[],tt=[];xe.tripleQuotedStrings?Ie.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):xe.multiLineStrings?Ie.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ie.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),xe.verbatimStrings&&tt.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var le=xe.hashComments;le&&(xe.cStyleComments?(le>1?Ie.push([S,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ie.push([S,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),tt.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ie.push([S,/^#[^\r\n]*/,null,"#"])),xe.cStyleComments&&(tt.push([S,/^\/\/[^\r\n]*/,null]),tt.push([S,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Se=xe.regexLiterals;if(Se){var je=Se>1?"":`
|
|
\r`,ze=je?".":"[\\S\\s]",yt="/(?=[^/*"+je+"])(?:[^/\\x5B\\x5C"+je+"]|\\x5C"+ze+"|\\x5B(?:[^\\x5C\\x5D"+je+"]|\\x5C"+ze+")*(?:\\x5D|$))+/";tt.push(["lang-regex",RegExp("^"+F+"("+yt+")")])}var Ot=xe.types;Ot&&tt.push([y,Ot]);var Ut=(""+xe.keywords).replace(/^ | $/g,"");Ut.length&&tt.push([R,new RegExp("^(?:"+Ut.replace(/[\s,]+/g,"|")+")\\b"),null]),Ie.push([h,/^\s+/,null,` \r
|
|
\xA0`]);var Qe="^.[^\\s\\w.$@'\"`/\\\\]*";return xe.regexLiterals&&(Qe+="(?!s*/)"),tt.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[h,/^[a-z_$][a-z_$@0-9]*/i,null],[E,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[h,/^\\[\s\S]?/,null],[f,new RegExp(Qe),null]),be(Ie,tt)}var Ce=Ze({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function We(xe,Ie,tt){for(var le=/(?:^|\s)nocode(?:\s|$)/,Se=/\r\n?|\n/,je=xe.ownerDocument,ze=je.createElement("li");xe.firstChild;)ze.appendChild(xe.firstChild);var yt=[ze];function Ot(He){var ct=He.nodeType;if(ct==1&&!le.test(He.className))if(He.nodeName==="br")Ut(He),He.parentNode&&He.parentNode.removeChild(He);else for(var bt=He.firstChild;bt;bt=bt.nextSibling)Ot(bt);else if((ct==3||ct==4)&&tt){var de=He.nodeValue,q=de.match(Se);if(q){var te=de.substring(0,q.index);He.nodeValue=te;var se=de.substring(q.index+q[0].length);if(se){var pe=He.parentNode;pe.insertBefore(je.createTextNode(se),He.nextSibling)}Ut(He),te||He.parentNode.removeChild(He)}}}function Ut(He){for(;!He.nextSibling;)if(He=He.parentNode,!He)return;function ct(q,te){var se=te?q.cloneNode(!1):q,pe=q.parentNode;if(pe){var ae=ct(pe,1),ie=q.nextSibling;ae.appendChild(se);for(var me=ie;me;me=ie)ie=me.nextSibling,ae.appendChild(me)}return se}for(var bt=ct(He.nextSibling,0),de;(de=bt.parentNode)&&de.nodeType===1;)bt=de;yt.push(bt)}for(var Qe=0;Qe<yt.length;++Qe)Ot(yt[Qe]);Ie===(Ie|0)&&yt[0].setAttribute("value",Ie);var Bt=je.createElement("ol");Bt.className="linenums";for(var ln=Math.max(0,Ie-1|0)||0,Qe=0,Ke=yt.length;Qe<Ke;++Qe)ze=yt[Qe],ze.className="L"+(Qe+ln)%10,ze.firstChild||ze.appendChild(je.createTextNode("\xA0")),Bt.appendChild(ze);xe.appendChild(Bt)}function Ve(xe){var Ie=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ie=Ie&&+Ie[1]<=8;var tt=/\n/g,le=xe.sourceCode,Se=le.length,je=0,ze=xe.spans,yt=ze.length,Ot=0,Ut=xe.decorations,Qe=Ut.length,Bt=0;Ut[Qe]=Se;var ln,Ke;for(Ke=ln=0;Ke<Qe;)Ut[Ke]!==Ut[Ke+2]?(Ut[ln++]=Ut[Ke++],Ut[ln++]=Ut[Ke++]):Ke+=2;for(Qe=ln,Ke=ln=0;Ke<Qe;){for(var He=Ut[Ke],ct=Ut[Ke+1],bt=Ke+2;bt+2<=Qe&&Ut[bt+1]===ct;)bt+=2;Ut[ln++]=He,Ut[ln++]=ct,Ke=bt}Qe=Ut.length=ln;var de=xe.sourceNode,q="";de&&(q=de.style.display,de.style.display="none");try{for(var te=null;Ot<yt;){var se=ze[Ot],pe=ze[Ot+2]||Se,ae=Ut[Bt+2]||Se,bt=Math.min(pe,ae),ie=ze[Ot+1],me;if(ie.nodeType!==1&&(me=le.substring(je,bt))){Ie&&(me=me.replace(tt,"\r")),ie.nodeValue=me;var _e=ie.ownerDocument,Ee=_e.createElement("span");Ee.className=Ut[Bt+1];var Le=ie.parentNode;Le.replaceChild(Ee,ie),Ee.appendChild(ie),je<pe&&(ze[Ot+1]=ie=_e.createTextNode(le.substring(bt,pe)),Le.insertBefore(ie,Ee.nextSibling))}je=bt,je>=pe&&(Ot+=2),je>=ae&&(Bt+=2)}}finally{de&&(de.style.display=q)}}var Ye={};function we(xe,Ie){for(var tt=Ie.length;--tt>=0;){var le=Ie[tt];Ye.hasOwnProperty(le)?M.console&&console.warn("cannot override language handler %s",le):Ye[le]=xe}}function X(xe,Ie){return xe&&Ye.hasOwnProperty(xe)||(xe=/^\s*</.test(Ie)?"default-markup":"default-code"),Ye[xe]}we(Ce,["default-code"]),we(be([],[[h,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[S,/^<\!--[\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"]),we(be([[h,/^[\s]+/,null,` \r
|
|
`],[H,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[v,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!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"]),we(be([],[[H,/^[\s\S]+/]]),["uq.val"]),we(Ze({keywords:p,hashComments:!0,cStyleComments:!0,types:C}),["c","cc","cpp","cxx","cyc","m"]),we(Ze({keywords:"null,true,false"}),["json"]),we(Ze({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:C}),["cs"]),we(Ze({keywords:m,cStyleComments:!0}),["java"]),we(Ze({keywords:n,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),we(Ze({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),we(Ze({keywords:d,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),we(Ze({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),we(Ze({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),we(Ze({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),we(be([],[[T,/^[\s\S]+/]]),["regex"]);function j(xe){var Ie=xe.langExtension;try{var tt=w(xe.sourceNode,xe.pre),le=tt.sourceCode;xe.sourceCode=le,xe.spans=tt.spans,xe.basePos=0,X(Ie,le)(xe),Ve(xe)}catch(Se){M.console&&console.log(Se&&Se.stack||Se)}}function W(xe,Ie,tt){var le=tt||!1,Se=Ie||null,je=document.createElement("div");je.innerHTML="<pre>"+xe+"</pre>",je=je.firstChild,le&&We(je,le,!0);var ze={langExtension:Se,numberLines:le,sourceNode:je,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return j(ze),je.innerHTML}function Q(xe,Ie){var tt=Ie||document.body,le=tt.ownerDocument||document;function Se(se){return tt.getElementsByTagName(se)}for(var je=[Se("pre"),Se("code"),Se("xmp")],ze=[],yt=0;yt<je.length;++yt)for(var Ot=0,Ut=je[yt].length;Ot<Ut;++Ot)ze.push(je[yt][Ot]);je=null;var Qe=Date;Qe.now||(Qe={now:function(){return+new Date}});var Bt=0,ln=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ke=/\bprettyprint\b/,He=/\bprettyprinted\b/,ct=/pre|xmp/i,bt=/^code$/i,de=/^(?:pre|code|xmp)$/i,q={};function te(){for(var se=M.PR_SHOULD_USE_CONTINUATION?Qe.now()+250:Infinity;Bt<ze.length&&Qe.now()<se;Bt++){for(var pe=ze[Bt],ae=q,ie=pe;ie=ie.previousSibling;){var me=ie.nodeType,_e=(me===7||me===8)&&ie.nodeValue;if(_e?!/^\??prettify\b/.test(_e):me!==3||/\S/.test(ie.nodeValue))break;if(_e){ae={},_e.replace(/\b(\w+)=([\w:.%+-]+)/g,function(vr,Mn,Zn){ae[Mn]=Zn});break}}var Ee=pe.className;if((ae!==q||Ke.test(Ee))&&!He.test(Ee)){for(var Le=!1,at=pe.parentNode;at;at=at.parentNode){var Ct=at.tagName;if(de.test(Ct)&&at.className&&Ke.test(at.className)){Le=!0;break}}if(!Le){pe.className+=" prettyprinted";var Jt=ae.lang;if(!Jt){Jt=Ee.match(ln);var lt;!Jt&&(lt=ce(pe))&&bt.test(lt.tagName)&&(Jt=lt.className.match(ln)),Jt&&(Jt=Jt[1])}var Un;if(ct.test(pe.tagName))Un=1;else{var Cn=pe.currentStyle,vn=le.defaultView,er=Cn?Cn.whiteSpace:vn&&vn.getComputedStyle?vn.getComputedStyle(pe,null).getPropertyValue("white-space"):0;Un=er&&er.substring(0,3)==="pre"}var kn=ae.linenums;(kn=kn==="true"||+kn)||(kn=Ee.match(/\blinenums\b(?::(\d+))?/),kn=kn?kn[1]&&kn[1].length?+kn[1]:!0:!1),kn&&We(pe,kn,Un);var Yn={langExtension:Jt,sourceNode:pe,numberLines:kn,pre:Un,sourceCode:null,basePos:null,spans:null,decorations:null};j(Yn)}}}Bt<ze.length?M.setTimeout(te,250):typeof xe=="function"&&xe()}te()}var re=M.PR={createSimpleLexer:be,registerLangHandler:we,sourceDecorator:Ze,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:H,PR_COMMENT:S,PR_DECLARATION:g,PR_KEYWORD:R,PR_LITERAL:E,PR_NOCODE:A,PR_PLAIN:h,PR_PUNCTUATION:f,PR_SOURCE:b,PR_STRING:T,PR_TAG:v,PR_TYPE:y,prettyPrintOne:I?M.prettyPrintOne=W:D=W,prettyPrint:K=I?M.prettyPrint=Q:K=Q},G=M.define;typeof G=="function"&&G.amd&&G("google-code-prettify",[],function(){return re})})()},STEk:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return we});/*! *****************************************************************************
|
|
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 ne=function(X,j){return(ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(W,Q){W.__proto__=Q}||function(W,Q){for(var re in Q)Object.prototype.hasOwnProperty.call(Q,re)&&(W[re]=Q[re])})(X,j)};function V(X,j){function W(){this.constructor=X}ne(X,j),X.prototype=j===null?Object.create(j):(W.prototype=j.prototype,new W)}function I(X,j,W,Q){return new(W||(W=Promise))(function(re,G){function xe(le){try{tt(Q.next(le))}catch(Se){G(Se)}}function Ie(le){try{tt(Q.throw(le))}catch(Se){G(Se)}}function tt(le){var Se;le.done?re(le.value):(Se=le.value,Se instanceof W?Se:new W(function(je){je(Se)})).then(xe,Ie)}tt((Q=Q.apply(X,j||[])).next())})}function z(X,j){var W,Q,re,G,xe={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return G={next:Ie(0),throw:Ie(1),return:Ie(2)},typeof Symbol=="function"&&(G[Symbol.iterator]=function(){return this}),G;function Ie(tt){return function(le){return function(Se){if(W)throw new TypeError("Generator is already executing.");for(;xe;)try{if(W=1,Q&&(re=2&Se[0]?Q.return:Se[0]?Q.throw||((re=Q.return)&&re.call(Q),0):Q.next)&&!(re=re.call(Q,Se[1])).done)return re;switch(Q=0,re&&(Se=[2&Se[0],re.value]),Se[0]){case 0:case 1:re=Se;break;case 4:return xe.label++,{value:Se[1],done:!1};case 5:xe.label++,Q=Se[1],Se=[0];continue;case 7:Se=xe.ops.pop(),xe.trys.pop();continue;default:if(!(re=xe.trys,(re=re.length>0&&re[re.length-1])||Se[0]!==6&&Se[0]!==2)){xe=0;continue}if(Se[0]===3&&(!re||Se[1]>re[0]&&Se[1]<re[3])){xe.label=Se[1];break}if(Se[0]===6&&xe.label<re[1]){xe.label=re[1],re=Se;break}if(re&&xe.label<re[2]){xe.label=re[2],xe.ops.push(Se);break}re[2]&&xe.ops.pop(),xe.trys.pop();continue}Se=j.call(X,xe)}catch(je){Se=[6,je],Q=0}finally{W=re=0}if(5&Se[0])throw Se[1];return{value:Se[0]?Se[1]:void 0,done:!0}}([tt,le])}}}function L(){for(var X=0,j=0,W=arguments.length;j<W;j++)X+=arguments[j].length;var Q=Array(X),re=0;for(j=0;j<W;j++)for(var G=arguments[j],xe=0,Ie=G.length;xe<Ie;xe++,re++)Q[re]=G[xe];return Q}var D=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(j,W){for(var Q=0,re=W;Q<re.length;Q++){var G=re[Q],xe=G[0],Ie=G[1];j.setAttribute(xe,Ie)}},X.createRect=function(j,W,Q){var re=document.createElementNS("http://www.w3.org/2000/svg","rect");return re.setAttribute("width",j.toString()),re.setAttribute("height",W.toString()),Q&&X.setAttributes(re,Q),re},X.createLine=function(j,W,Q,re,G){var xe=document.createElementNS("http://www.w3.org/2000/svg","line");return xe.setAttribute("x1",j.toString()),xe.setAttribute("y1",W.toString()),xe.setAttribute("x2",Q.toString()),xe.setAttribute("y2",re.toString()),G&&X.setAttributes(xe,G),xe},X.createPolygon=function(j,W){var Q=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Q.setAttribute("points",j),W&&X.setAttributes(Q,W),Q},X.createCircle=function(j,W){var Q=document.createElementNS("http://www.w3.org/2000/svg","circle");return Q.setAttribute("cx",(j/2).toString()),Q.setAttribute("cy",(j/2).toString()),Q.setAttribute("r",j.toString()),W&&X.setAttributes(Q,W),Q},X.createEllipse=function(j,W,Q){var re=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return re.setAttribute("cx",(j/2).toString()),re.setAttribute("cy",(W/2).toString()),re.setAttribute("rx",(j/2).toString()),re.setAttribute("ry",(W/2).toString()),Q&&X.setAttributes(re,Q),re},X.createGroup=function(j){var W=document.createElementNS("http://www.w3.org/2000/svg","g");return j&&X.setAttributes(W,j),W},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(j,W,Q,re,G,xe,Ie){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(tt,[["id",j],["orient",W],["markerWidth",Q.toString()],["markerHeight",re.toString()],["refX",G.toString()],["refY",xe.toString()]]),tt.appendChild(Ie),tt},X.createText=function(j){var W=document.createElementNS("http://www.w3.org/2000/svg","text");return W.setAttribute("x","0"),W.setAttribute("y","0"),j&&X.setAttributes(W,j),W},X.createTSpan=function(j,W){var Q=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Q.textContent=j,W&&X.setAttributes(Q,W),Q},X.createImage=function(j){var W=document.createElementNS("http://www.w3.org/2000/svg","image");return j&&X.setAttributes(W,j),W},X.createPoint=function(j,W){var Q=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Q.x=j,Q.y=W,Q},X.createPath=function(j,W){var Q=document.createElementNS("http://www.w3.org/2000/svg","path");return Q.setAttribute("d",j),W&&X.setAttributes(Q,W),Q},X}(),K=function(){function X(){}return X.addKey=function(j){X.key=j},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),M=function(){function X(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return X.prototype.rasterize=function(j,W,Q){var re=this;return new Promise(function(G){var xe=Q!==void 0?Q:document.createElement("canvas");j===null&&(re.markersOnly=!0,re.naturalSize=!1);var Ie=document.createElementNS("http://www.w3.org/2000/svg","svg");Ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ie.setAttribute("width",W.width.baseVal.valueAsString),Ie.setAttribute("height",W.height.baseVal.valueAsString),Ie.setAttribute("viewBox","0 0 "+W.viewBox.baseVal.width.toString()+" "+W.viewBox.baseVal.height.toString()),Ie.innerHTML=W.innerHTML,re.naturalSize===!0?(Ie.width.baseVal.value=j.naturalWidth,Ie.height.baseVal.value=j.naturalHeight):re.width!==void 0&&re.height!==void 0&&(Ie.width.baseVal.value=re.width,Ie.height.baseVal.value=re.height),xe.width=Ie.width.baseVal.value,xe.height=Ie.height.baseVal.value;var tt=Ie.outerHTML,le=xe.getContext("2d");re.markersOnly!==!0&&le.drawImage(j,0,0,xe.width,xe.height);var Se=window.URL,je=new Image(xe.width,xe.height);je.setAttribute("crossOrigin","anonymous");var ze=new Blob([tt],{type:"image/svg+xml"}),yt=Se.createObjectURL(ze);je.onload=function(){le.drawImage(je,0,0),Se.revokeObjectURL(yt);var Ot=xe.toDataURL(re.imageType,re.imageQuality);G(Ot)},je.src=yt})},X}(),r=function(){},P=function(){function X(j){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+j+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.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(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(j){return this.styleSheet===void 0&&this.addStyleSheet(),j.name=""+this.classNamePrefix+j.localName,this.classes.push(j),this.styleSheet.sheet.insertRule("."+j.name+" {"+j.style+"}",this.styleSheet.sheet.cssRules.length),j},X.prototype.addRule=function(j){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(j),this.styleSheet.sheet.insertRule(j.selector+" {"+j.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var j;this.styleSheet=document.createElement("style"),((j=this.styleSheetRoot)!==null&&j!==void 0?j:document.head).appendChild(this.styleSheet),this.addRule(new x("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new x("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new x("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new p("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new p("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},X.prototype.removeStyleSheet=function(){var j;this.styleSheet&&(((j=this.styleSheetRoot)!==null&&j!==void 0?j:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),x=function(X,j){this.selector=X,this.style=j},p=function(X,j){this.localName=X,this.style=j},m=function(){function X(j,W,Q,re,G){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=j,this.displayMode=W,this.markerItems=Q,this.uiStyleSettings=re,this.styles=G,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return X.prototype.show=function(j){var W=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=j,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Q=document.createElement("div");Q.className=this.toolbarBlockStyleClass.name,Q.style.whiteSpace="nowrap",this.uiContainer.appendChild(Q),this.addActionButton(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Q,'<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(G){var xe=document.createElement("div");xe.className=""+W.toolbarButtonStyleClass.name,xe.setAttribute("data-type-name",G.typeName),xe.innerHTML=G.icon,xe.addEventListener("click",function(){W.markerToolbarButtonClicked(xe,G)}),W.buttons.push(xe),W.markerButtons.push(xe)}),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 re=document.createElement("div");re.className=this.toolbarBlockStyleClass.name,re.style.whiteSpace="nowrap",re.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(re),this.addActionButton(re,'<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(re,'<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()},X.prototype.addButtonClickListener=function(j){this.buttonClickListeners.push(j)},X.prototype.removeButtonClickListener=function(j){this.buttonClickListeners.indexOf(j)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(j),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var j=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var W=0;W<this.markerButtons.length;W++)W<j||W===j&&this.markerButtons.length-1===j?this.markerButtonBlock.appendChild(this.markerButtons[W]):(W===j&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[W]))}},X.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")},X.prototype.resetButtonStyles=function(){var j=this;this.buttons.forEach(function(W){W.className=W.className.replace(j.uiStyleSettings.toolbarButtonStyleColorsClassName?j.uiStyleSettings.toolbarButtonStyleColorsClassName:j.toolbarButtonStyleColorsClass.name,"").trim(),W.className=W.className.replace(j.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?j.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:j.toolbarActiveButtonStyleColorsClass.name,"").trim(),W.className+=" "+(j.uiStyleSettings.toolbarButtonStyleColorsClassName?j.uiStyleSettings.toolbarButtonStyleColorsClassName:j.toolbarButtonStyleColorsClass.name)})},X.prototype.addActionButton=function(j,W,Q){var re=this,G=document.createElement("div");switch(G.className=""+this.toolbarButtonStyleClass.name,G.innerHTML=W,G.setAttribute("data-action",Q),G.addEventListener("click",function(){re.actionToolbarButtonClicked(G,Q)}),Q){case"select":G.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":G.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":G.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":G.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":G.style.fill=this.uiStyleSettings.closeButtonColor}j.appendChild(G),this.buttons.push(G)},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new p("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 p("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new p("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new p("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 p("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var j=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new p("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*j)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*j)+`px;
|
|
padding: `+j+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new p("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new x("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new x("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},X.prototype.markerToolbarButtonClicked=function(j,W){this.setActiveButton(j),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Q){return Q("marker",W)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(j,W){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Q){return Q("action",W)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(j){this.resetButtonStyles(),j.className=j.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),j.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(j){var W=this.markerButtons.find(function(Q){return Q.getAttribute("data-type-name")===j});W&&this.setActiveButton(W)},X.prototype.setCurrentMarker=function(j){var W=this;this.currentMarker=j,this.buttons.filter(function(Q){return/delete|notes/.test(Q.getAttribute("data-action"))}).forEach(function(Q){W.currentMarker===void 0?(Q.style.fillOpacity="0.4",Q.style.pointerEvents="none"):(Q.style.fillOpacity="1",Q.style.pointerEvents="all")})},X}(),c=function(){function X(j,W,Q,re){this.panels=[],this.panelButtons=[],this.markerjsContainer=j,this.displayMode=W,this.uiStyleSettings=Q,this.styles=re,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var j;this.toolboxStyleClass=this.styles.addClass(new p("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 p("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var W=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new p("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new p("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new p("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 p("toolbox-panel-row_colors",`
|
|
background-color: `+((j=this.uiStyleSettings.toolboxBackgroundColor)!==null&&j!==void 0?j:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new p("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*W)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*W)+`px;
|
|
padding: `+W+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new p("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new x("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new x("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},X.prototype.show=function(j){var W;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=j,this.uiContainer.className=this.toolboxStyleClass.name+" "+((W=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(j){var W,Q,re=this;this.panels=j,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Q=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Q!==void 0?Q:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(G){var xe;G.uiStyleSettings=re.uiStyleSettings;var Ie=document.createElement("div");Ie.className=re.toolboxButtonStyleClass.name+" "+((xe=re.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&xe!==void 0?xe:re.toolboxButtonStyleColorsClass.name),Ie.innerHTML=G.icon,Ie.title=G.title,Ie.addEventListener("click",function(){re.panelButtonClick(G)}),re.panelButtons.push(Ie),re.buttonRow.appendChild(Ie)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(j){var W=this,Q=-1;if(j!==this.activePanel){Q=this.panels.indexOf(j),this.panelRow.innerHTML="";var re=j.getUi();re.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(re),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=j}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){W.displayMode==="inline"?W.panelRow.style.display="none":W.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(G,xe){var Ie,tt;G.className=W.toolboxButtonStyleClass.name+" "+(xe===Q?""+((Ie=W.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ie!==void 0?Ie:W.toolboxActiveButtonStyleColorsClass.name):""+((tt=W.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&tt!==void 0?tt:W.toolboxButtonStyleColorsClass.name))})},X}(),a=function(X,j){this.title=X,this.icon=j},s=function(X){function j(W,Q,re,G){var xe=X.call(this,W,G||'<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 xe.colors=[],xe.addTransparent=!1,xe.colorBoxes=[],xe.colors=Q,xe.currentColor=re,xe.setCurrentColor=xe.setCurrentColor.bind(xe),xe.getColorBox=xe.getColorBox.bind(xe),xe}return V(j,X),j.prototype.getUi=function(){var W=this,Q=document.createElement("div");return Q.style.overflow="hidden",Q.style.whiteSpace="nowrap",this.colors.forEach(function(re){var G=W.getColorBox(re);Q.appendChild(G),W.colorBoxes.push(G)}),Q},j.prototype.getColorBox=function(W){var Q=this,re=this.uiStyleSettings.toolbarHeight/4,G=this.uiStyleSettings.toolbarHeight-re,xe=document.createElement("div");xe.style.display="inline-block",xe.style.boxSizing="content-box",xe.style.width=G-2+"px",xe.style.height=G-2+"px",xe.style.padding="1px",xe.style.marginRight="2px",xe.style.marginBottom="2px",xe.style.borderWidth="2px",xe.style.borderStyle="solid",xe.style.borderRadius=(G+2)/2+"px",xe.style.borderColor=W===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",xe.addEventListener("click",function(){Q.setCurrentColor(W,xe)});var Ie=document.createElement("div");return Ie.style.display="inline-block",Ie.style.width=G-2+"px",Ie.style.height=G-2+"px",Ie.style.backgroundColor=W,Ie.style.borderRadius=G/2+"px",W==="transparent"&&(Ie.style.fill=this.uiStyleSettings.toolboxAccentColor,Ie.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>`),xe.appendChild(Ie),xe},j.prototype.setCurrentColor=function(W,Q){var re=this;this.currentColor=W,this.colorBoxes.forEach(function(G){G.style.borderColor=G===Q?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(W)},j}(a),d=function(){function X(j,W,Q){this._state="new",this._isSelected=!1,this._container=j,this._overlayContainer=W,this.globalSettings=Q,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(j){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(j,W){},X.prototype.dblClick=function(j,W){},X.prototype.manipulate=function(j){},X.prototype.pointerUp=function(j){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(j){this.container.childNodes.length>0?this.container.insertBefore(j,this.container.childNodes[0]):this.container.appendChild(j)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(j){this._state=j.state,this.notes=j.notes},X.prototype.scale=function(j,W){},X.prototype.colorChanged=function(j){this.onColorChanged&&this.onColorChanged(j),this.stateChanged()},X.prototype.fillColorChanged=function(j){this.onFillColorChanged&&this.onFillColorChanged(j),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var j=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),j.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(j)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),l=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(j){return this.topLeft.ownsTarget(j)?this.topLeft:this.topCenter.ownsTarget(j)?this.topCenter:this.topRight.ownsTarget(j)?this.topRight:this.centerLeft.ownsTarget(j)?this.centerLeft:this.centerRight.ownsTarget(j)?this.centerRight:this.bottomLeft.ownsTarget(j)?this.bottomLeft:this.bottomCenter.ownsTarget(j)?this.bottomCenter:this.bottomRight.ownsTarget(j)?this.bottomRight:void 0},X}(),i=function(){function X(){this.GRIP_SIZE=10,this.visual=D.createGroup(),this.visual.appendChild(D.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(D.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(j){return j===this.visual||j===this.visual.childNodes[0]||j===this.visual.childNodes[1]},X}(),n=function(){function X(){}return X.toITransformMatrix=function(j){return{a:j.a,b:j.b,c:j.c,d:j.d,e:j.e,f:j.f}},X.toSVGMatrix=function(j,W){return j.a=W.a,j.b=W.b,j.c=W.c,j.d=W.d,j.e=W.e,j.f=W.f,j},X}(),O=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.left=0,G.top=0,G.width=0,G.height=0,G.defaultSize={x:50,y:20},G.offsetX=0,G.offsetY=0,G.rotationAngle=0,G.CB_DISTANCE=10,G._suppressMarkerCreateEvent=!1,G.container.transform.baseVal.appendItem(D.createTransform()),G.setupControlBox(),G}return V(j,X),Object.defineProperty(j.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"visual",{get:function(){return this._visual},set:function(W){this._visual=W;var Q=D.createTransform();this._visual.transform.baseVal.appendItem(Q)},enumerable:!1,configurable:!0}),j.prototype.ownsTarget=function(W){return!!X.prototype.ownsTarget.call(this,W)||!!(this.controlGrips.findGripByVisual(W)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W))},j.prototype.pointerDown=function(W,Q){X.prototype.pointerDown.call(this,W,Q),this.state==="new"&&(this.left=W.x,this.top=W.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var re=this.unrotatePoint(W);if(this.manipulationStartX=re.x,this.manipulationStartY=re.y,this.offsetX=re.x-this.left,this.offsetY=re.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Q),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Q)){this.activeGrip=this.rotatorGrip;var G=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=G.x-this.width/2,this.top=G.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var xe=this.container.transform.baseVal.getItem(0);xe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(xe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},j.prototype.pointerUp=function(W){var Q=this.state;X.prototype.pointerUp.call(this,W),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(W),this._state="select",Q==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},j.prototype.moveVisual=function(W){this.visual.style.transform="translate("+W.x+"px, "+W.y+"px)"},j.prototype.manipulate=function(W){var Q=this.unrotatePoint(W);this.state==="creating"?this.resize(W):this.state==="move"?(this.left=this.manipulationStartLeft+(Q.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Q.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Q):this.state==="rotate"&&this.rotate(W)},j.prototype.resize=function(W){var Q=this.manipulationStartLeft,re=this.manipulationStartWidth,G=this.manipulationStartTop,xe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Q=this.manipulationStartLeft+W.x-this.manipulationStartX,re=this.manipulationStartWidth+this.manipulationStartLeft-Q;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:re=this.manipulationStartWidth+W.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:G=this.manipulationStartTop+W.y-this.manipulationStartY,xe=this.manipulationStartHeight+this.manipulationStartTop-G;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:xe=this.manipulationStartHeight+W.y-this.manipulationStartY}re>=0?(this.left=Q,this.width=re):(this.left=Q+re,this.width=-re),xe>=0?(this.top=G,this.height=xe):(this.top=G+xe,this.height=-xe),this.setSize()},j.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},j.prototype.rotate=function(W){if(Math.abs(W.x-this.centerX)>.1){var Q=Math.sign(W.x-this.centerX);this.rotationAngle=180*Math.atan((W.y-this.centerY)/(W.x-this.centerX))/Math.PI+90*Q,this.applyRotation()}},j.prototype.applyRotation=function(){var W=this.container.transform.baseVal.getItem(0);W.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(W,0)},j.prototype.rotatePoint=function(W){if(this.rotationAngle===0)return W;var Q=this.container.getCTM(),re=D.createPoint(W.x,W.y);return{x:(re=re.matrixTransform(Q)).x,y:re.y}},j.prototype.unrotatePoint=function(W){if(this.rotationAngle===0)return W;var Q=this.container.getCTM();Q=Q.inverse();var re=D.createPoint(W.x,W.y);return{x:(re=re.matrixTransform(Q)).x,y:re.y}},j.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},j.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},j.prototype.setupControlBox=function(){this.controlBox=D.createGroup();var W=D.createTransform();W.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(W),this.container.appendChild(this.controlBox),this.controlRect=D.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=D.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 l,this.addControlGrips(),this.controlBox.style.display="none"},j.prototype.adjustControlBox=function(){var W=this.controlBox.transform.baseVal.getItem(0);W.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(W,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()},j.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()},j.prototype.createGrip=function(){var W=new i;return W.visual.transform.baseVal.appendItem(D.createTransform()),this.controlBox.appendChild(W.visual),W},j.prototype.positionGrips=function(){var W=this.controlGrips.topLeft.GRIP_SIZE,Q=-W/2,re=Q,G=(this.width+this.CB_DISTANCE)/2-W/2,xe=(this.height+this.CB_DISTANCE)/2-W/2,Ie=this.height+this.CB_DISTANCE-W/2,tt=this.width+this.CB_DISTANCE-W/2;this.positionGrip(this.controlGrips.topLeft.visual,Q,re),this.positionGrip(this.controlGrips.topCenter.visual,G,re),this.positionGrip(this.controlGrips.topRight.visual,tt,re),this.positionGrip(this.controlGrips.centerLeft.visual,Q,xe),this.positionGrip(this.controlGrips.centerRight.visual,tt,xe),this.positionGrip(this.controlGrips.bottomLeft.visual,Q,Ie),this.positionGrip(this.controlGrips.bottomCenter.visual,G,Ie),this.positionGrip(this.controlGrips.bottomRight.visual,tt,Ie),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,G,re-3*this.CB_DISTANCE)},j.prototype.positionGrip=function(W,Q,re){var G=W.transform.baseVal.getItem(0);G.setTranslate(Q,re),W.transform.baseVal.replaceItem(G,0)},j.prototype.hideControlBox=function(){this.controlBox.style.display="none"},j.prototype.showControlBox=function(){this.controlBox.style.display=""},j.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:n.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:n.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},j.prototype.restoreState=function(W){X.prototype.restoreState.call(this,W);var Q=W;this.left=Q.left,this.top=Q.top,this.width=Q.width,this.height=Q.height,this.rotationAngle=Q.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(n.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Q.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(n.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Q.containerTransformMatrix))},j.prototype.scale=function(W,Q){X.prototype.scale.call(this,W,Q);var re=this.rotatePoint({x:this.left,y:this.top}),G=this.unrotatePoint({x:re.x*W,y:re.y*Q});this.left=G.x,this.top=G.y,this.width=this.width*W,this.height=this.height*Q,this.adjustControlBox()},j}(d),C=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.fillColor="transparent",G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.opacity=1,G.setStrokeColor=G.setStrokeColor.bind(G),G.setFillColor=G.setFillColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.createVisual=G.createVisual.bind(G),G}return V(j,X),j.prototype.ownsTarget=function(W){return!(!X.prototype.ownsTarget.call(this,W)&&W!==this.visual)},j.prototype.createVisual=function(){this.visual=D.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)},j.prototype.pointerDown=function(W,Q){X.prototype.pointerDown.call(this,W,Q),this.state==="new"&&(this.createVisual(),this.moveVisual(W),this._state="creating")},j.prototype.manipulate=function(W){X.prototype.manipulate.call(this,W)},j.prototype.resize=function(W){X.prototype.resize.call(this,W),this.setSize()},j.prototype.setSize=function(){X.prototype.setSize.call(this),D.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},j.prototype.pointerUp=function(W){X.prototype.pointerUp.call(this,W),this.setSize()},j.prototype.setStrokeColor=function(W){this.strokeColor=W,this.visual&&D.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(W),this.stateChanged()},j.prototype.setFillColor=function(W){this.fillColor=W,this.visual&&D.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},j.prototype.setStrokeWidth=function(W){this.strokeWidth=W,this.visual&&D.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},j.prototype.setStrokeDasharray=function(W){this.strokeDasharray=W,this.visual&&D.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},j.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},j.prototype.restoreState=function(W){var Q=W;this.fillColor=Q.fillColor,this.strokeColor=Q.strokeColor,this.strokeWidth=Q.strokeWidth,this.strokeDasharray=Q.strokeDasharray,this.opacity=Q.opacity,this.createVisual(),X.prototype.restoreState.call(this,W),this.setSize()},j.prototype.scale=function(W,Q){X.prototype.scale.call(this,W,Q),this.setSize()},j.title="Rectangle marker",j}(O),T=function(X){function j(W,Q,re,G){var xe=X.call(this,W,G||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return xe.widths=[],xe.widthBoxes=[],xe.widths=Q,xe.currentWidth=re,xe.setCurrentWidth=xe.setCurrentWidth.bind(xe),xe}return V(j,X),j.prototype.getUi=function(){var W=this,Q=document.createElement("div");return Q.style.display="flex",Q.style.overflow="hidden",Q.style.flexGrow="2",this.widths.forEach(function(re){var G=document.createElement("div");G.style.display="flex",G.style.flexGrow="2",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.borderColor=re===W.currentWidth?W.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){W.setCurrentWidth(re,G)}),Q.appendChild(G);var xe=document.createElement("div");xe.innerText=re.toString(),xe.style.marginRight="5px",G.appendChild(xe);var Ie=document.createElement("div");Ie.style.minHeight="20px",Ie.style.flexGrow="2",Ie.style.display="flex",Ie.style.alignItems="center";var tt=document.createElement("hr");tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop=re+"px solid "+W.uiStyleSettings.toolboxColor,tt.style.flexGrow="2",Ie.appendChild(tt),G.appendChild(Ie),W.widthBoxes.push(G)}),Q},j.prototype.setCurrentWidth=function(W,Q){var re=this;this.currentWidth=W,this.widthBoxes.forEach(function(G){G.style.borderColor=G===Q?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},j}(a),R=function(X){function j(W,Q,re,G){var xe=X.call(this,W,G||'<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 xe.styles=[],xe.styleBoxes=[],xe.styles=Q,xe.currentStyle=re,xe.setCurrentStyle=xe.setCurrentStyle.bind(xe),xe}return V(j,X),j.prototype.getUi=function(){var W=this,Q=document.createElement("div");return Q.style.display="flex",Q.style.overflow="hidden",Q.style.flexGrow="2",this.styles.forEach(function(re){var G=document.createElement("div");G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.overflow="hidden",G.style.maxWidth=100/W.styles.length-5+"%",G.style.borderColor=re===W.currentStyle?W.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){W.setCurrentStyle(re,G)}),Q.appendChild(G);var xe=document.createElement("div");xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.overflow="hidden";var Ie=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+W.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(re!==""?'stroke-dasharray="'+re+'"':"")+` />
|
|
</svg>`;xe.innerHTML=Ie,G.appendChild(xe),W.styleBoxes.push(G)}),Q},j.prototype.setCurrentStyle=function(W,Q){var re=this;this.currentStyle=W,this.styleBoxes.forEach(function(G){G.style.borderColor=G===Q?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},j}(a),S=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.strokeColor=re.defaultColor,G.strokeWidth=re.defaultStrokeWidth,G.strokeDasharray=re.defaultStrokeDasharray,G.strokePanel=new s("Line color",re.defaultColorSet,re.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new T("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new R("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return V(j,X),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var W=X.prototype.getState.call(this);return W.typeName=j.typeName,W},j.typeName="FrameMarker",j.title="Frame marker",j.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',j}(C),y=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},E=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.x1=0,G.y1=0,G.x2=0,G.y2=0,G.defaultLength=50,G.manipulationStartX=0,G.manipulationStartY=0,G.manipulationStartX1=0,G.manipulationStartY1=0,G.manipulationStartX2=0,G.manipulationStartY2=0,G.setupControlBox(),G}return V(j,X),j.prototype.ownsTarget=function(W){return!!X.prototype.ownsTarget.call(this,W)||!(!this.grip1.ownsTarget(W)&&!this.grip2.ownsTarget(W))},j.prototype.pointerDown=function(W,Q){X.prototype.pointerDown.call(this,W,Q),this.manipulationStartX=W.x,this.manipulationStartY=W.y,this.state==="new"&&(this.x1=W.x,this.y1=W.y,this.x2=W.x,this.y2=W.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(Q)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Q)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},j.prototype.pointerUp=function(W){var Q=this.state;X.prototype.pointerUp.call(this,W),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(W),this._state="select",Q==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},j.prototype.adjustVisual=function(){},j.prototype.manipulate=function(W){this.state==="creating"?this.resize(W):this.state==="move"?(this.x1=this.manipulationStartX1+W.x-this.manipulationStartX,this.y1=this.manipulationStartY1+W.y-this.manipulationStartY,this.x2=this.manipulationStartX2+W.x-this.manipulationStartX,this.y2=this.manipulationStartY2+W.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(W)},j.prototype.resize=function(W){switch(this.activeGrip){case this.grip1:this.x1=W.x,this.y1=W.y;break;case this.grip2:case void 0:this.x2=W.x,this.y2=W.y}this.adjustVisual(),this.adjustControlBox()},j.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},j.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},j.prototype.setupControlBox=function(){this.controlBox=D.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},j.prototype.adjustControlBox=function(){this.positionGrips()},j.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},j.prototype.createGrip=function(){var W=new i;return W.visual.transform.baseVal.appendItem(D.createTransform()),this.controlBox.appendChild(W.visual),W},j.prototype.positionGrips=function(){var W=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-W/2,this.y1-W/2),this.positionGrip(this.grip2.visual,this.x2-W/2,this.y2-W/2)},j.prototype.positionGrip=function(W,Q,re){var G=W.transform.baseVal.getItem(0);G.setTranslate(Q,re),W.transform.baseVal.replaceItem(G,0)},j.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},j.prototype.restoreState=function(W){X.prototype.restoreState.call(this,W);var Q=W;this.x1=Q.x1,this.y1=Q.y1,this.x2=Q.x2,this.y2=Q.y2},j.prototype.scale=function(W,Q){X.prototype.scale.call(this,W,Q),this.x1=this.x1*W,this.y1=this.y1*Q,this.x2=this.x2*W,this.y2=this.y2*Q,this.adjustVisual(),this.adjustControlBox()},j}(d),f=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.setStrokeColor=G.setStrokeColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.strokeColor=re.defaultColor,G.strokeWidth=re.defaultStrokeWidth,G.strokeDasharray=re.defaultStrokeDasharray,G.strokePanel=new s("Line color",re.defaultColorSet,re.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new T("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new R("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return V(j,X),j.prototype.ownsTarget=function(W){return!(!X.prototype.ownsTarget.call(this,W)&&W!==this.visual&&W!==this.selectorLine&&W!==this.visibleLine)},j.prototype.createVisual=function(){this.visual=D.createGroup(),this.selectorLine=D.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=D.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)},j.prototype.pointerDown=function(W,Q){X.prototype.pointerDown.call(this,W,Q),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},j.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()),D.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),D.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),D.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},j.prototype.setStrokeColor=function(W){this.strokeColor=W,this.adjustVisual(),this.colorChanged(W)},j.prototype.setStrokeWidth=function(W){this.strokeWidth=W,this.adjustVisual()},j.prototype.setStrokeDasharray=function(W){this.strokeDasharray=W,this.adjustVisual(),this.stateChanged()},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var W=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return W.typeName=j.typeName,W},j.prototype.restoreState=function(W){X.prototype.restoreState.call(this,W);var Q=W;this.strokeColor=Q.strokeColor,this.strokeWidth=Q.strokeWidth,this.strokeDasharray=Q.strokeDasharray,this.createVisual(),this.adjustVisual()},j.typeName="LineMarker",j.title="Line marker",j.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',j}(E),h=function(X){function j(W,Q,re,G){var xe=X.call(this,W,G||'<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 xe.fonts=[],xe.fontBoxes=[],xe.fonts=Q,xe.currentFont=re,xe.setCurrentFont=xe.setCurrentFont.bind(xe),xe}return V(j,X),j.prototype.getUi=function(){var W=this,Q=document.createElement("div");return Q.style.overflow="hidden",Q.style.flexGrow="2",this.fonts.forEach(function(re){var G=document.createElement("div");G.style.display="inline-block",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.overflow="hidden",G.style.maxWidth=100/W.fonts.length-5+"%",G.style.borderColor=re===W.currentFont?W.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){W.setCurrentFont(re,G)}),Q.appendChild(G);var xe=document.createElement("div");xe.style.display="flex",xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.fontFamily=re,xe.style.overflow="hidden";var Ie=document.createElement("div");Ie.style.whiteSpace="nowrap",Ie.style.overflow="hidden",Ie.style.textOverflow="ellipsis",Ie.innerHTML="The quick brown fox jumps over the lazy dog",xe.appendChild(Ie),G.appendChild(xe),W.fontBoxes.push(G)}),Q},j.prototype.setCurrentFont=function(W,Q){var re=this;this.currentFont=W,this.fontBoxes.forEach(function(G){G.style.borderColor=G===Q?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},j}(a),v=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.color="transparent",G.padding=5,G.DEFAULT_TEXT="your text here",G.text=G.DEFAULT_TEXT,G.isMoved=!1,G.color=re.defaultColor,G.fontFamily=re.defaultFontFamily,G.defaultSize={x:100,y:30},G.setColor=G.setColor.bind(G),G.setFont=G.setFont.bind(G),G.renderText=G.renderText.bind(G),G.sizeText=G.sizeText.bind(G),G.textEditDivClicked=G.textEditDivClicked.bind(G),G.showTextEditor=G.showTextEditor.bind(G),G.setSize=G.setSize.bind(G),G.positionTextEditor=G.positionTextEditor.bind(G),G.colorPanel=new s("Color",re.defaultColorSet,re.defaultColor),G.colorPanel.onColorChanged=G.setColor,G.fontFamilyPanel=new h("Font",re.defaultFontFamilies,re.defaultFontFamily),G.fontFamilyPanel.onFontChanged=G.setFont,G}return V(j,X),j.prototype.ownsTarget=function(W){if(X.prototype.ownsTarget.call(this,W)||W===this.visual||W===this.textElement||W===this.bgRectangle)return!0;var Q=!1;return this.textElement.childNodes.forEach(function(re){re===W&&(Q=!0)}),Q},j.prototype.createVisual=function(){this.visual=D.createGroup(),this.bgRectangle=D.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=D.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(D.createTransform()),this.textElement.transform.baseVal.appendItem(D.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},j.prototype.pointerDown=function(W,Q){X.prototype.pointerDown.call(this,W,Q),this.isMoved=!1,this.pointerDownPoint=W,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(W),this._state="creating")},j.prototype.renderText=function(){var W=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(Q){W.textElement.appendChild(D.createTSpan(Q.trim()===""?" ":Q.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},j.prototype.getTextScale=function(){var W=this.textElement.getBBox(),Q=1;if(W.width>0&&W.height>0){var re=(1*this.width-this.width*this.padding*2/100)/W.width,G=(1*this.height-this.height*this.padding*2/100)/W.height;Q=Math.min(re,G)}return Q},j.prototype.getTextPosition=function(W){var Q=this.textElement.getBBox(),re=0,G=0;return Q.width>0&&Q.height>0&&(re=(this.width-Q.width*W)/2,G=this.height/2-Q.height*W/2),{x:re,y:G}},j.prototype.sizeText=function(){var W=this.textElement.getBBox(),Q=this.getTextScale(),re=this.getTextPosition(Q);re.y-=W.y*Q,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+re.x+"px, "+re.y+"px) scale("+Q+", "+Q+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(re.x,re.y),this.textElement.transform.baseVal.getItem(1).setScale(Q,Q))},j.prototype.manipulate=function(W){X.prototype.manipulate.call(this,W),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(W.x-this.pointerDownPoint.x)>5||Math.abs(W.y-this.pointerDownPoint.y)>5)},j.prototype.resize=function(W){X.prototype.resize.call(this,W),this.isMoved=!0,this.setSize(),this.sizeText()},j.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(D.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),D.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},j.prototype.pointerUp=function(W){var Q=this.state;Q==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,W),this.setSize(),(Q==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},j.prototype.showTextEditor=function(){var W=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(Q){Q.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Q=Number.parseFloat(W.textEditor.style.fontSize);W.textEditor.clientWidth>=Number.parseInt(W.textEditor.style.maxWidth)&&Q>.9;)Q-=.1,W.textEditor.style.fontSize=Math.max(Q,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Q){Q.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Q){if(Q.clipboardData){var re=Q.clipboardData.getData("text"),G=window.getSelection();if(!G.rangeCount)return!1;G.deleteFromDocument(),G.getRangeAt(0).insertNode(document.createTextNode(re)),Q.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){W.textEditDivClicked(W.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},j.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var W=this.getTextScale(),Q=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),re=this.textElement.getBBox(),G={x:re.width*W,y:re.height*W};Q.x-=G.x/2,Q.y-=G.y/2,this.textEditor.style.top=Q.y+"px",this.textEditor.style.left=Q.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Q.x+"px",this.textEditor.style.fontSize=Math.max(16*W,12)+"px",this.textElement.style.display="none"}},j.prototype.textEditDivClicked=function(W){this.text=W.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},j.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},j.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},j.prototype.dblClick=function(W,Q){X.prototype.dblClick.call(this,W,Q),this.showTextEditor()},j.prototype.setColor=function(W){this.textElement&&D.setAttributes(this.textElement,[["fill",W]]),this.color=W,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(W)},j.prototype.setFont=function(W){this.textElement&&D.setAttributes(this.textElement,[["font-family",W]]),this.fontFamily=W,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},j.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},j.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var W=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return W.typeName=j.typeName,W},j.prototype.restoreState=function(W){var Q=W;this.color=Q.color,this.fontFamily=Q.fontFamily,this.padding=Q.padding,this.text=Q.text,this.createVisual(),X.prototype.restoreState.call(this,W),this.setSize()},j.prototype.scale=function(W,Q){X.prototype.scale.call(this,W,Q),this.setSize(),this.sizeText(),this.positionTextEditor()},j.typeName="TextMarker",j.title="Text marker",j.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>',j}(O),g=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.color="transparent",G.lineWidth=3,G.drawing=!1,G.pixelRatio=1,G.color=re.defaultColor,G.lineWidth=re.defaultStrokeWidth,G.pixelRatio=re.freehandPixelRatio,G.setColor=G.setColor.bind(G),G.addCanvas=G.addCanvas.bind(G),G.finishCreation=G.finishCreation.bind(G),G.setLineWidth=G.setLineWidth.bind(G),G.colorPanel=new s("Color",re.defaultColorSet,re.defaultColor),G.colorPanel.onColorChanged=G.setColor,G.lineWidthPanel=new T("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),G.lineWidthPanel.onWidthChanged=G.setLineWidth,G}return V(j,X),j.prototype.ownsTarget=function(W){return!(!X.prototype.ownsTarget.call(this,W)&&W!==this.visual&&W!==this.drawingImage)},j.prototype.createVisual=function(){this.visual=D.createGroup(),this.drawingImage=D.createImage(),this.visual.appendChild(this.drawingImage);var W=D.createTransform();this.visual.transform.baseVal.appendItem(W),this.addMarkerVisualToContainer(this.visual)},j.prototype.pointerDown=function(W,Q){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(W.x,W.y),this.drawing=!0):X.prototype.pointerDown.call(this,W,Q)},j.prototype.manipulate=function(W){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(W.x,W.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,W)},j.prototype.resize=function(W){X.prototype.resize.call(this,W),D.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),D.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},j.prototype.pointerUp=function(W){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,W)},j.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)},j.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},j.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},j.prototype.finishCreation=function(){for(var W=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Q=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],re=Q[0],G=Q[1],xe=Q[2],Ie=Q[3],tt=!1,le=0;le<this.canvasElement.height;le++)for(var Se=0;Se<this.canvasElement.width;Se++)W.data[le*this.canvasElement.width*4+4*Se+3]>0&&(tt=!0,le<G&&(G=le),Se<re&&(re=Se),le>Ie&&(Ie=le),Se>xe&&(xe=Se));if(tt){this.left=re/this.pixelRatio,this.top=G/this.pixelRatio,this.width=(xe-re)/this.pixelRatio,this.height=(Ie-G)/this.pixelRatio;var je=document.createElement("canvas");je.width=xe-re,je.height=Ie-G,je.getContext("2d").putImageData(this.canvasContext.getImageData(re,G,xe-re,Ie-G),0,0),this.drawingImgUrl=je.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},j.prototype.setDrawingImage=function(){D.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),D.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},j.prototype.setColor=function(W){this.color=W,this.colorChanged(W)},j.prototype.setLineWidth=function(W){this.lineWidth=W},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var W=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return W.typeName=j.typeName,W},j.prototype.restoreState=function(W){this.createVisual(),X.prototype.restoreState.call(this,W),this.drawingImgUrl=W.drawingImgUrl,this.setDrawingImage()},j.prototype.scale=function(W,Q){X.prototype.scale.call(this,W,Q),this.setDrawingImage()},j.typeName="FreehandMarker",j.title="Freehand marker",j.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>',j}(O),b=function(X){function j(W,Q,re){var G=X.call(this,W,re||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return G.typeBoxes=[],G.currentType=Q,G.setCurrentType=G.setCurrentType.bind(G),G}return V(j,X),j.prototype.getUi=function(){var W=this,Q=document.createElement("div");Q.style.display="flex",Q.style.overflow="hidden",Q.style.flexGrow="2";for(var re=function(Ie){var tt="both";switch(Ie){case 0:tt="both";break;case 1:tt="start";break;case 2:tt="end";break;case 3:tt="none"}var le=document.createElement("div");if(le.style.display="flex",le.style.flexGrow="2",le.style.alignItems="center",le.style.justifyContent="space-between",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.borderColor=tt===G.currentType?G.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){W.setCurrentType(tt,le)}),Q.appendChild(le),tt==="both"||tt==="start"){var Se=document.createElement("div");Se.style.display="flex",Se.style.alignItems="center",Se.style.minHeight="20px",Se.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="`+(G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Se.style.marginLeft="5px",le.appendChild(Se)}var je=document.createElement("div");je.style.display="flex",je.style.alignItems="center",je.style.minHeight="20px",je.style.flexGrow="2";var ze=document.createElement("hr");if(ze.style.minWidth="20px",ze.style.border="0px",ze.style.borderTop="3px solid "+(G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxColor:"#eeeeee"),ze.style.flexGrow="2",je.appendChild(ze),le.appendChild(je),tt==="both"||tt==="end"){var yt=document.createElement("div");yt.style.display="flex",yt.style.alignItems="center",yt.style.minHeight="20px",yt.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="`+(G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,yt.style.marginRight="5px",le.appendChild(yt)}G.typeBoxes.push(le)},G=this,xe=0;xe<4;xe++)re(xe);return Q},j.prototype.setCurrentType=function(W,Q){var re=this;this.currentType=W,this.typeBoxes.forEach(function(G){G.style.borderColor=G===Q?re.uiStyleSettings!==void 0?re.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},j}(a),N=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.arrowType="end",G.arrowBaseHeight=10,G.arrowBaseWidth=10,G.getArrowPoints=G.getArrowPoints.bind(G),G.setArrowType=G.setArrowType.bind(G),G.arrowTypePanel=new b("Arrow type","end"),G.arrowTypePanel.onArrowTypeChanged=G.setArrowType,G}return V(j,X),j.prototype.ownsTarget=function(W){return!(!X.prototype.ownsTarget.call(this,W)&&W!==this.arrow1&&W!==this.arrow2)},j.prototype.getArrowPoints=function(W,Q){var re=this.arrowBaseWidth+2*this.strokeWidth,G=this.arrowBaseHeight+2*this.strokeWidth;return W-re/2+","+(Q+G/2)+" "+W+","+(Q-G/2)+" "+(W+re/2)+","+(Q+G/2)},j.prototype.createTips=function(){this.arrow1=D.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(D.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=D.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(D.createTransform()),this.visual.appendChild(this.arrow2)},j.prototype.pointerDown=function(W,Q){X.prototype.pointerDown.call(this,W,Q),this.state==="creating"&&this.createTips()},j.prototype.adjustVisual=function(){if(X.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",D.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),D.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var W=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Q=this.arrow1.transform.baseVal.getItem(0);Q.setRotate(W,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Q,0);var re=this.arrow2.transform.baseVal.getItem(0);re.setRotate(W+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(re,0)}},j.prototype.setArrowType=function(W){this.arrowType=W,this.adjustVisual(),this.stateChanged()},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var W=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return W.typeName=j.typeName,W},j.prototype.restoreState=function(W){X.prototype.restoreState.call(this,W);var Q=W;this.arrowType=Q.arrowType,this.createTips(),this.adjustVisual()},j.typeName="ArrowMarker",j.title="Arrow marker",j.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',j}(f),H=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.fillColor=re.defaultFillColor,G.strokeWidth=0,G.fillPanel=new s("Color",re.defaultColorSet,re.defaultFillColor),G.fillPanel.onColorChanged=G.setFillColor,G}return V(j,X),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var W=X.prototype.getState.call(this);return W.typeName=j.typeName,W},j.typeName="CoverMarker",j.title="Cover marker",j.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',j}(C),A=function(X){function j(W,Q,re,G){var xe=X.call(this,W,G||'<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 xe.opacities=[],xe.opacityBoxes=[],xe.opacities=Q,xe.currentOpacity=re,xe.setCurrentOpacity=xe.setCurrentOpacity.bind(xe),xe}return V(j,X),j.prototype.getUi=function(){var W=this,Q=document.createElement("div");return Q.style.display="flex",Q.style.overflow="hidden",Q.style.flexGrow="2",Q.style.justifyContent="space-between",this.opacities.forEach(function(re){var G=document.createElement("div");G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="center",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.borderColor=re===W.currentOpacity?W.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){W.setCurrentOpacity(re,G)}),Q.appendChild(G);var xe=document.createElement("div");xe.innerText=100*re+"%",G.appendChild(xe),W.opacityBoxes.push(G)}),Q},j.prototype.setCurrentOpacity=function(W,Q){var re=this;this.currentOpacity=W,this.opacityBoxes.forEach(function(G){G.style.borderColor=G===Q?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},j}(a),F=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.setOpacity=G.setOpacity.bind(G),G.fillColor=re.defaultHighlightColor,G.strokeWidth=0,G.opacity=re.defaultHighlightOpacity,G.fillPanel=new s("Color",re.defaultColorSet,G.fillColor),G.fillPanel.onColorChanged=G.setFillColor,G.opacityPanel=new A("Opacity",re.defaultOpacitySteps,G.opacity),G.opacityPanel.onOpacityChanged=G.setOpacity,G}return V(j,X),j.prototype.setOpacity=function(W){this.opacity=W,this.visual&&D.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var W=X.prototype.getState.call(this);return W.typeName=j.typeName,W},j.typeName="HighlightMarker",j.title="Highlight marker",j.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>',j}(H),U='<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>',w=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.bgColor="transparent",G.tipPosition={x:0,y:0},G.tipBase1Position={x:0,y:0},G.tipBase2Position={x:0,y:0},G.tipMoving=!1,G.color=re.defaultStrokeColor,G.bgColor=re.defaultFillColor,G.fontFamily=re.defaultFontFamily,G.defaultSize={x:100,y:30},G.setBgColor=G.setBgColor.bind(G),G.getTipPoints=G.getTipPoints.bind(G),G.positionTip=G.positionTip.bind(G),G.setTipPoints=G.setTipPoints.bind(G),G.colorPanel=new s("Text color",re.defaultColorSet,G.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>'),G.colorPanel.onColorChanged=G.setColor,G.bgColorPanel=new s("Fill color",re.defaultColorSet,G.bgColor,U),G.bgColorPanel.onColorChanged=G.setBgColor,G.fontFamilyPanel=new h("Font",re.defaultFontFamilies,re.defaultFontFamily),G.fontFamilyPanel.onFontChanged=G.setFont,G.tipGrip=new i,G.tipGrip.visual.transform.baseVal.appendItem(D.createTransform()),G.controlBox.appendChild(G.tipGrip.visual),G}return V(j,X),j.prototype.ownsTarget=function(W){return X.prototype.ownsTarget.call(this,W)||this.tipGrip.ownsTarget(W)||this.tip===W},j.prototype.createTip=function(){D.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=D.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},j.prototype.pointerDown=function(W,Q){this.state==="new"&&X.prototype.pointerDown.call(this,W,Q),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Q)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,W,Q)},j.prototype.pointerUp=function(W){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,W);else{var Q=this.state==="creating";X.prototype.pointerUp.call(this,W),this.setTipPoints(Q),this.positionTip()}},j.prototype.manipulate=function(W){if(this.tipMoving){var Q=this.unrotatePoint(W);this.tipPosition={x:Q.x-this.manipulationStartLeft,y:Q.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,W)},j.prototype.setBgColor=function(W){this.bgRectangle&&this.tip&&(D.setAttributes(this.bgRectangle,[["fill",W]]),D.setAttributes(this.tip,[["fill",W]])),this.bgColor=W,this.fillColorChanged(W)},j.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},j.prototype.setTipPoints=function(W){W===void 0&&(W=!1);var Q=Math.min(this.height/2,15),re=this.height/5;W&&(this.tipPosition={x:Q+re/2,y:this.height+20});var G=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?G<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(re=this.width/5,Q=Math.min(this.width/2,15),this.tipBase1Position={x:Q,y:0},this.tipBase2Position={x:Q+re,y:0}):(this.tipBase1Position={x:0,y:Q},this.tipBase2Position={x:0,y:Q+re}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?G<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(re=this.width/5,Q=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Q-re,y:0},this.tipBase2Position={x:this.width-Q,y:0}):(this.tipBase1Position={x:this.width,y:Q},this.tipBase2Position={x:this.width,y:Q+re}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?G<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(re=this.width/5,Q=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Q-re,y:this.height},this.tipBase2Position={x:this.width-Q,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Q-re},this.tipBase2Position={x:this.width,y:this.height-Q}):G<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(re=this.width/5,Q=Math.min(this.width/2,15),this.tipBase1Position={x:Q,y:this.height},this.tipBase2Position={x:Q+re,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Q},this.tipBase2Position={x:0,y:this.height-Q-re})},j.prototype.resize=function(W){X.prototype.resize.call(this,W),this.positionTip()},j.prototype.positionTip=function(){D.setAttributes(this.tip,[["points",this.getTipPoints()]]);var W=this.tipGrip.visual.transform.baseVal.getItem(0);W.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(W,0)},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),j.prototype.select=function(){this.positionTip(),X.prototype.select.call(this)},j.prototype.getState=function(){var W=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},X.prototype.getState.call(this));return W.typeName=j.typeName,W},j.prototype.restoreState=function(W){var Q=W;this.bgColor=Q.bgColor,this.tipPosition=Q.tipPosition,X.prototype.restoreState.call(this,W),this.createTip(),this.setTipPoints()},j.prototype.scale=function(W,Q){X.prototype.scale.call(this,W,Q),this.tipPosition={x:this.tipPosition.x*W,y:this.tipPosition.y*Q},this.positionTip()},j.typeName="CalloutMarker",j.title="Callout marker",j.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>',j}(v),Y=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.fillColor="transparent",G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.opacity=1,G.strokeColor=re.defaultColor,G.strokeWidth=re.defaultStrokeWidth,G.strokeDasharray=re.defaultStrokeDasharray,G.fillColor=re.defaultFillColor,G.setStrokeColor=G.setStrokeColor.bind(G),G.setFillColor=G.setFillColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.setOpacity=G.setOpacity.bind(G),G.createVisual=G.createVisual.bind(G),G.strokePanel=new s("Line color",L(re.defaultColorSet,["transparent"]),re.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.fillPanel=new s("Fill color",L(re.defaultColorSet,["transparent"]),G.fillColor,U),G.fillPanel.onColorChanged=G.setFillColor,G.strokeWidthPanel=new T("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new R("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G.opacityPanel=new A("Opacity",re.defaultOpacitySteps,G.opacity),G.opacityPanel.onOpacityChanged=G.setOpacity,G}return V(j,X),j.prototype.ownsTarget=function(W){return!(!X.prototype.ownsTarget.call(this,W)&&W!==this.visual)},j.prototype.createVisual=function(){this.visual=D.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)},j.prototype.pointerDown=function(W,Q){X.prototype.pointerDown.call(this,W,Q),this.state==="new"&&(this.createVisual(),this.moveVisual(W),this._state="creating")},j.prototype.manipulate=function(W){X.prototype.manipulate.call(this,W)},j.prototype.resize=function(W){X.prototype.resize.call(this,W),this.setSize()},j.prototype.setSize=function(){X.prototype.setSize.call(this),D.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},j.prototype.pointerUp=function(W){X.prototype.pointerUp.call(this,W),this.setSize()},j.prototype.setStrokeColor=function(W){this.strokeColor=W,this.visual&&D.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(W),this.stateChanged()},j.prototype.setFillColor=function(W){this.fillColor=W,this.visual&&D.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(W),this.stateChanged()},j.prototype.setStrokeWidth=function(W){this.strokeWidth=W,this.visual&&D.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},j.prototype.setStrokeDasharray=function(W){this.strokeDasharray=W,this.visual&&D.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},j.prototype.setOpacity=function(W){this.opacity=W,this.visual&&D.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var W=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return W.typeName=j.typeName,W},j.prototype.restoreState=function(W){var Q=W;this.fillColor=Q.fillColor,this.strokeColor=Q.strokeColor,this.strokeWidth=Q.strokeWidth,this.strokeDasharray=Q.strokeDasharray,this.opacity=Q.opacity,this.createVisual(),X.prototype.restoreState.call(this,W),this.setSize()},j.prototype.scale=function(W,Q){X.prototype.scale.call(this,W,Q),this.setSize()},j.typeName="EllipseMarker",j.title="Ellipse marker",j.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>',j}(O),Z=function(X){function j(W,Q,re){return X.call(this,W,Q,re)||this}return V(j,X),Object.defineProperty(j.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),j.prototype.ownsTarget=function(W){return!(!X.prototype.ownsTarget.call(this,W)&&W!==this.tip1&&W!==this.tip2)},j.prototype.createTips=function(){this.tip1=D.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(D.createTransform()),this.visual.appendChild(this.tip1),this.tip2=D.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(D.createTransform()),this.visual.appendChild(this.tip2)},j.prototype.pointerDown=function(W,Q){X.prototype.pointerDown.call(this,W,Q),this.state==="creating"&&this.createTips()},j.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(D.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()]]),D.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 W=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Q=this.tip1.transform.baseVal.getItem(0);Q.setRotate(W,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Q,0);var re=this.tip2.transform.baseVal.getItem(0);re.setRotate(W+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(re,0)}},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var W=X.prototype.getState.call(this);return W.typeName=j.typeName,W},j.prototype.restoreState=function(W){X.prototype.restoreState.call(this,W),this.createTips(),this.adjustVisual()},j.typeName="MeasurementMarker",j.title="Measurement marker",j.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>',j}(f),ce=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.strokePanel.colors=re.defaultColorSet,G.fillColor="transparent",G}return V(j,X),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var W=X.prototype.getState.call(this);return W.typeName=j.typeName,W},j.typeName="EllipseFrameMarker",j.title="Ellipse frame marker",j.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>',j}(Y),be=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(j){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(j)||(this.undoStack.push(j),JSON.stringify(this.lastRedoStep)!==JSON.stringify(j)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(j){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=j)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var j=this.undoStack.pop();return j!==void 0&&this.redoStack.push(j),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),Ze=function(X){function j(W,Q,re){var G=X.call(this,W,Q,re)||this;return G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.curveX=0,G.curveY=0,G.manipulationStartCurveX=0,G.manipulationStartCurveY=0,G.setStrokeColor=G.setStrokeColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.positionGrips=G.positionGrips.bind(G),G.addControlGrips=G.addControlGrips.bind(G),G.adjustVisual=G.adjustVisual.bind(G),G.setupControlBox=G.setupControlBox.bind(G),G.resize=G.resize.bind(G),G.strokeColor=re.defaultColor,G.strokeWidth=re.defaultStrokeWidth,G.strokeDasharray=re.defaultStrokeDasharray,G.strokePanel=new s("Line color",re.defaultColorSet,re.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new T("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new R("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return V(j,X),j.prototype.ownsTarget=function(W){return!(!X.prototype.ownsTarget.call(this,W)&&W!==this.visual&&W!==this.selectorCurve&&W!==this.visibleCurve&&!this.curveGrip.ownsTarget(W))},j.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},j.prototype.createVisual=function(){this.visual=D.createGroup(),this.selectorCurve=D.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=D.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)},j.prototype.pointerDown=function(W,Q){X.prototype.pointerDown.call(this,W,Q),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=W.x,this.curveY=W.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Q)&&(this.activeGrip=this.curveGrip,this._state="resize")},j.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),D.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),D.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),D.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},j.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=D.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=D.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)},j.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},j.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var W=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-W/2,this.curveY-W/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()))},j.prototype.manipulate=function(W){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+W.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+W.y-this.manipulationStartY),X.prototype.manipulate.call(this,W)},j.prototype.resize=function(W){this.activeGrip===this.curveGrip&&(this.curveX=W.x,this.curveY=W.y),X.prototype.resize.call(this,W),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},j.prototype.setStrokeColor=function(W){this.strokeColor=W,this.adjustVisual(),this.colorChanged(W)},j.prototype.setStrokeWidth=function(W){this.strokeWidth=W,this.adjustVisual()},j.prototype.setStrokeDasharray=function(W){this.strokeDasharray=W,this.adjustVisual()},j.prototype.scale=function(W,Q){this.curveX=this.curveX*W,this.curveY=this.curveY*Q,X.prototype.scale.call(this,W,Q)},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var W=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return W.typeName=j.typeName,W},j.prototype.restoreState=function(W){X.prototype.restoreState.call(this,W);var Q=W;this.strokeColor=Q.strokeColor,this.strokeWidth=Q.strokeWidth,this.strokeDasharray=Q.strokeDasharray,this.curveX=Q.curveX,this.curveY=Q.curveY,this.createVisual(),this.adjustVisual()},j.typeName="CurveMarker",j.title="Curve marker",j.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>',j}(E),Ce=function(){function X(j,W){W===void 0&&(W=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=j,this.cancelable=W}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),We=function(X){function j(W,Q,re){var G=X.call(this,W,!1)||this;return G.dataUrl=Q,G.state=re,G}return V(j,X),j}(Ce),Ve=function(X){function j(W,Q,re){re===void 0&&(re=!1);var G=X.call(this,W,re)||this;return G.marker=Q,G}return V(j,X),j}(Ce),Ye=function(){function X(){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 X.prototype.addEventListener=function(j,W){this[j].push(W)},X.prototype.removeEventListener=function(j,W){var Q=this[j].indexOf(W);Q>-1&&this[j].splice(Q,1)},X}(),we=function(){function X(j){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new y,this._isOpen=!1,this.undoRedoManager=new be,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 Ye,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new P(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=j,this.targetRoot=document.body,this.width=j.clientWidth,this.height=j.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(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[S,g,N,v,ce,Y,F,w,Z,H,f,Ze]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[S,g,N,v,Y,F,w]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[S,g,N,v,F]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(j){var W=this;this._availableMarkerTypes.splice(0),j.forEach(function(Q){if(typeof Q=="string"){var re=W.ALL_MARKER_TYPES.find(function(G){return G.typeName===Q});re!==void 0&&W._availableMarkerTypes.push(re)}else W._availableMarkerTypes.push(Q)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(j){this._zoomLevel=j,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(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),K.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var j=this;this.styles.styleSheetRoot===void 0&&r.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=r.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(W){return W(new Ce(j))})},X.prototype.render=function(){return I(this,void 0,void 0,function(){var j;return z(this,function(W){switch(W.label){case 0:return this.setCurrentMarker(),(j=new M).naturalSize=this.renderAtNaturalSize,j.imageType=this.renderImageType,j.imageQuality=this.renderImageQuality,j.markersOnly=this.renderMarkersOnly,j.width=this.renderWidth,j.height=this.renderHeight,[4,j.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return W.sent(),[4,j.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,W.sent()]}})})},X.prototype.close=function(j){var W=this;if(j===void 0&&(j=!1),this.isOpen){var Q=!1;j||this.eventListeners.beforeclose.forEach(function(re){var G=new Ce(W,!0);re(G),G.defaultPrevented&&(Q=!0)}),Q||(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(re){return re(new Ce(W))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var j,W=[],Q=0;Q<arguments.length;Q++)W[Q]=arguments[Q];(j=this._availableMarkerTypes).push.apply(j,W)},X.prototype.addRenderEventListener=function(j){this.addEventListener("render",function(W){j(W.dataUrl,W.state)})},X.prototype.removeRenderEventListener=function(j){},X.prototype.addCloseEventListener=function(j){this.addEventListener("close",function(){j()})},X.prototype.removeCloseEventListener=function(j){},X.prototype.setupResizeObserver=function(){var j=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){j.resize(j.target.clientWidth,j.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return j.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupTargetResize=function(){var j=1*this.target.clientWidth/this.target.clientHeight,W=this.editorCanvas.clientWidth/j>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*j:this.editorCanvas.clientWidth,Q=W<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/j;this.resize(W,Q)},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.resize=function(j,W){this._isResizing=!0;var Q=j/this.imageWidth,re=W/this.imageHeight;this.imageWidth=Math.round(j),this.imageHeight=Math.round(W),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(Q,re),this._isResizing=!1},X.prototype.scaleMarkers=function(j,W){var Q,re=this;this._currentMarker&&this._currentMarker instanceof v?this._currentMarker.scale(j,W):(Q=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(G){G!==re._currentMarker&&G.scale(j,W)}),Q!==void 0&&this.setCurrentMarker(Q)},X.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"},X.prototype.setTopLeft=function(){var j=this.editingTarget.getBoundingClientRect(),W=this.editorCanvas.getBoundingClientRect();this.left=j.left-W.left,this.top=j.top-W.top},X.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)},X.prototype.addDefs=function(){for(var j,W=[],Q=0;Q<arguments.length;Q++)W[Q]=arguments[Q];this.defs=D.createDefs(),this.addDefsToImage(),(j=this.defs).append.apply(j,W)},X.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},X.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)},X.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},X.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},X.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)},X.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},X.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)},X.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 j=document.createElement("a");j.href="https://markerjs.com/",j.target="_blank",j.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>',j.title="Powered by marker.js",j.style.display="grid",j.style.alignItems="center",j.style.justifyItems="center",j.style.padding="3px",j.style.width="20px",j.style.height="20px",this.logoUI.appendChild(j),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.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")},X.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"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.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 j=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=j+"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 m(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 c(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},X.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.removeMarker=function(j){this.markerImage.removeChild(j.container),this.markers.indexOf(j)>-1&&this.markers.splice(this.markers.indexOf(j),1),j.dispose()},X.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())},X.prototype.toolbarButtonClicked=function(j,W){if(j==="marker"&&W!==void 0)this.createNewMarker(W);else if(j==="action")switch(W){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()}},X.prototype.deleteSelectedMarker=function(){var j=this;if(this._currentMarker!==void 0){var W=!1;if(this.eventListeners.markerbeforedelete.forEach(function(re){var G=new Ve(j,j._currentMarker,!0);re(G),G.defaultPrevented&&(W=!0)}),!W){var Q=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(re){return re(new Ve(j,Q))})}}},X.prototype.clear=function(){var j=this,W=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(xe){var Ie=new Ve(j,void 0,!0);xe(Ie),Ie.defaultPrevented&&(W=!0)}),!W)){this.setCurrentMarker();for(var Q=function(xe){var Ie=re.markers[xe];re.setCurrentMarker(re.markers[xe]),re._currentMarker.dispose(),re.markerImage.removeChild(re._currentMarker.container),re.markers.splice(re.markers.indexOf(re._currentMarker),1),re.eventListeners.markerdelete.forEach(function(tt){return tt(new Ve(j,Ie))})},re=this,G=this.markers.length-1;G>=0;G--)Q(G);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var j;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=(j=this._currentMarker.notes)!==null&&j!==void 0?j:"",this.overlayContainer.appendChild(this.notesArea))},X.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)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var j=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var W=this.getState(),Q=this.undoRedoManager.getLastUndoStep();if(!Q||Q.width===W.width&&Q.height===W.height){var re=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(W),re<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(G){return G(new Ce(j))})}else this.undoRedoManager.replaceLastUndoStep(W),this.eventListeners.statechange.forEach(function(G){return G(new Ce(j))})}},X.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},X.prototype.undoStep=function(){var j=this,W=this.undoRedoManager.undo();W!==void 0&&(this.restoreState(W),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Q){return Q(new Ce(j))}))},X.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},X.prototype.redoStep=function(){var j=this,W=this.undoRedoManager.redo();W!==void 0&&(this.restoreState(W),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Q){return Q(new Ce(j))}))},X.prototype.stepZoom=function(){var j=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=j<this.zoomSteps.length-1?this.zoomSteps[j+1]:this.zoomSteps[0]},X.prototype.panTo=function(j){this.contentDiv.scrollBy({left:this.prevPanPoint.x-j.x,top:this.prevPanPoint.y-j.y}),this.prevPanPoint=j},X.prototype.startRenderAndClose=function(){return I(this,void 0,void 0,function(){var j,W,Q=this;return z(this,function(re){switch(re.label){case 0:return[4,this.render()];case 1:return j=re.sent(),W=this.getState(),this.eventListeners.render.forEach(function(G){return G(new We(Q,j,W))}),this.close(!0),[2]}})})},X.prototype.getState=function(j){j===!0&&this.setCurrentMarker();var W={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Q){return W.markers.push(Q.getState())}),W},X.prototype.restoreState=function(j){var W=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);j.markers.forEach(function(Q){var re=W._availableMarkerTypes.find(function(xe){return xe.typeName===Q.typeName});if(re!==void 0){var G=W.addNewMarker(re);G.restoreState(Q),W.markers.push(G)}}),j.width&&j.height&&(j.width!==this.imageWidth||j.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/j.width,this.imageHeight/j.height),this.eventListeners.restorestate.forEach(function(Q){return Q(new Ce(W))})},X.prototype.addNewMarker=function(j){var W=D.createGroup();return this.markerImage.appendChild(W),new j(W,this.overlayContainer,this.settings)},X.prototype.createNewMarker=function(j){var W,Q=this;(W=typeof j=="string"?this._availableMarkerTypes.find(function(re){return re.typeName===j}):j)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(W),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(W.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(re){return re(new Ve(Q,Q._currentMarker))}))},X.prototype.markerCreated=function(j){var W=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(j),this.setCurrentMarker(j),j instanceof g&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(g):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Q){return Q(new Ve(W,W._currentMarker))})},X.prototype.colorChanged=function(j){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=j,this.settings.defaultStrokeColor=j)},X.prototype.fillColorChanged=function(j){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=j)},X.prototype.markerStateChanged=function(j){var W=this;this.eventListeners.markerchange.forEach(function(Q){return Q(new Ve(W,j))})},X.prototype.setCurrentMarker=function(j){var W=this;this._currentMarker!==j&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Q){return Q(new Ve(W,W._currentMarker))})),this._currentMarker=j,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(Q){return Q(new Ve(W,W._currentMarker))}))},X.prototype.onPointerDown=function(j){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||j.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var W=this.markers.find(function(Q){return Q.ownsTarget(j.target)});W!==void 0?(this.setCurrentMarker(W),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(j.clientX,j.clientY),j.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:j.clientX,y:j.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(j.clientX,j.clientY))},X.prototype.onDblClick=function(j){if(this._isFocused||this.focus(),this.mode==="select"){var W=this.markers.find(function(Q){return Q.ownsTarget(j.target)});W!==void 0&&W!==this._currentMarker&&this.setCurrentMarker(W),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(j.clientX,j.clientY),j.target):this.setCurrentMarker()}},X.prototype.onPointerMove=function(j){this.touchPoints!==1&&j.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||j.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(j.clientX,j.clientY)):this.zoomLevel>1&&this.panTo({x:j.clientX,y:j.clientY}))},X.prototype.onPointerUp=function(j){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(j.clientX,j.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(j){this._currentMarker===void 0||this.notesArea!==void 0||j.key!=="Delete"&&j.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(j,W){var Q=this.markerImage.getBoundingClientRect();return{x:(j-Q.left)/this.zoomLevel,y:(W-Q.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var j=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=j+"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()},X.prototype.addLicenseKey=function(j){K.addKey(j)},X.prototype.addEventListener=function(j,W){this.eventListeners.addEventListener(j,W)},X.prototype.removeEventListener=function(j,W){this.eventListeners.removeEventListener(j,W)},X.prototype.renderState=function(j){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(j),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var j=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(W){return W(new Ce(j))}))},X.prototype.blur=function(){var j=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(W){return W(new Ce(j))}))},X.instanceCounter=0,X}()},T7RX:function(Lt,ve,k){"use strict";var ne=k("2qtc"),V=k("kLXV"),I=k("k1fw"),z=k("miYZ"),L=k("tsqr"),D=k("9og8"),K=k("PpiC"),M=k("WmNS"),r=k.n(M),P=k("q1tI"),x=k.n(P),p=k("ErOA"),m=k("Ty5D"),c=k("9kvl"),a=function(d){var l=d.shixunHomeworks,i=d.dispatch,n=Object(K.a)(d,["shixunHomeworks","dispatch"]),O=Object(m.i)();return x.a.createElement(V.a,{centered:!0,title:"\u63D0\u793A",visible:l.actionTabs.key==="\u6253\u56DE\u91CD\u505A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(D.a)(r.a.mark(function C(){var T;return r.a.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return S.next=2,Object(p.a)("/api/myshixuns/".concat(l.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"GET",params:{course_id:O.coursesId}});case 2:T=S.sent,T.shixun_identifier&&(L.b.success("\u64CD\u4F5C\u6210\u529F"),i({type:"shixunHomeworks/setActionTabs",payload:{}}),i({type:"shixunHomeworks/getWorkList",payload:Object(I.a)({},l.actionTabs.params)}));case 4:case"end":return S.stop()}},C)})),onCancel:function(){i({type:"shixunHomeworks/setActionTabs",payload:{}})}},x.a.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),x.a.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"))};ve.a=Object(c.a)(function(s){var d=s.shixunHomeworks;return{shixunHomeworks:d}})(a)},T8No:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return K}),k.d(ve,"e",function(){return M}),k.d(ve,"c",function(){return f}),k.d(ve,"b",function(){return h}),k.d(ve,"d",function(){return v}),k.d(ve,"f",function(){return N});var ne=k("MNsG"),V=k("N0LK"),I=k("Cg/j");let z=ne.k||"";const L=new Map;L.set("false",!1),L.set("true",!0),L.set("isMac",ne.f),L.set("isLinux",ne.d),L.set("isWindows",ne.i),L.set("isWeb",ne.h),L.set("isMacNative",ne.f&&!ne.h),L.set("isEdge",z.indexOf("Edg/")>=0),L.set("isFirefox",z.indexOf("Firefox")>=0),L.set("isChrome",z.indexOf("Chrome")>=0),L.set("isSafari",z.indexOf("Safari")>=0);const D=Object.prototype.hasOwnProperty;class K{static has(A){return p.create(A)}static equals(A,F){return m.create(A,F)}static regex(A,F){return T.create(A,F)}static not(A){return d.create(A)}static and(...A){return y.create(A,null)}static or(...A){return E.create(A,null,!0)}static deserialize(A,F=!1){return A?this._deserializeOrExpression(A,F):void 0}static _deserializeOrExpression(A,F){let U=A.split("||");return E.create(U.map(w=>this._deserializeAndExpression(w,F)),null,!0)}static _deserializeAndExpression(A,F){let U=A.split("&&");return y.create(U.map(w=>this._deserializeOne(w,F)),null)}static _deserializeOne(A,F){if(A=A.trim(),A.indexOf("!=")>=0){let U=A.split("!=");return s.create(U[0].trim(),this._deserializeValue(U[1],F))}if(A.indexOf("==")>=0){let U=A.split("==");return m.create(U[0].trim(),this._deserializeValue(U[1],F))}if(A.indexOf("=~")>=0){let U=A.split("=~");return T.create(U[0].trim(),this._deserializeRegexValue(U[1],F))}if(A.indexOf(" in ")>=0){let U=A.split(" in ");return c.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const U=A.split(">=");return n.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const U=A.split(">");return i.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const U=A.split("<=");return C.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const U=A.split("<");return O.create(U[0].trim(),U[1].trim())}return/^\!\s*/.test(A)?d.create(A.substr(1).trim()):p.create(A)}static _deserializeValue(A,F){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let U=/^'([^']*)'$/.exec(A);return U?U[1].trim():A}static _deserializeRegexValue(A,F){if(Object(V.C)(A)){if(F)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let U=A.indexOf("/"),w=A.lastIndexOf("/");if(U===w||U<0){if(F)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let Y=A.slice(U+1,w),Z=A[w+1]==="i"?"i":"";try{return new RegExp(Y,Z)}catch(ce){if(F)throw new Error(`bad regexp-value '${A}', parse error: ${ce}`);return console.warn(`bad regexp-value '${A}', parse error: ${ce}`),null}}}function M(A,F){const U=A?A.substituteConstants():void 0,w=F?F.substituteConstants():void 0;return!U&&!w?!0:!U||!w?!1:U.equals(w)}function r(A,F){return A.cmp(F)}class P{constructor(){this.type=0}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!1}serialize(){return"false"}keys(){return[]}negate(){return x.INSTANCE}}P.INSTANCE=new P;class x{constructor(){this.type=1}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!0}serialize(){return"true"}keys(){return[]}negate(){return P.INSTANCE}}x.INSTANCE=new x;class p{constructor(A,F){this.key=A,this.negated=F,this.type=2}static create(A,F=null){const U=L.get(A);return typeof U=="boolean"?U?x.INSTANCE:P.INSTANCE:new p(A,F)}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=L.get(this.key);return typeof A=="boolean"?A?x.INSTANCE:P.INSTANCE:this}evaluate(A){return!!A.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this)),this.negated}}class m{constructor(A,F,U){this.key=A,this.value=F,this.negated=U,this.type=4}static create(A,F,U=null){if(typeof F=="boolean")return F?p.create(A,U):d.create(A,U);const w=L.get(A);if(typeof w=="boolean"){const Y=w?"true":"false";return F===Y?x.INSTANCE:P.INSTANCE}return new m(A,F,U)}cmp(A){return A.type!==this.type?this.type-A.type:b(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=L.get(this.key);if(typeof A=="boolean"){const F=A?"true":"false";return this.value===F?x.INSTANCE:P.INSTANCE}return this}evaluate(A){return A.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 c{constructor(A,F){this.key=A,this.valueKey=F,this.type=10,this.negated=null}static create(A,F){return new c(A,F)}cmp(A){return A.type!==this.type?this.type-A.type:b(this.key,this.valueKey,A.key,A.valueKey)}equals(A){return A.type===this.type?this.key===A.key&&this.valueKey===A.valueKey:!1}substituteConstants(){return this}evaluate(A){const F=A.getValue(this.valueKey),U=A.getValue(this.key);return Array.isArray(F)?F.indexOf(U)>=0:typeof U=="string"&&typeof F=="object"&&F!==null?D.call(F,U):!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(A){this._actual=A,this.type=11}static create(A){return new a(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class s{constructor(A,F,U){this.key=A,this.value=F,this.negated=U,this.type=5}static create(A,F,U=null){if(typeof F=="boolean")return F?d.create(A,U):p.create(A,U);const w=L.get(A);if(typeof w=="boolean"){const Y=w?"true":"false";return F===Y?P.INSTANCE:x.INSTANCE}return new s(A,F,U)}cmp(A){return A.type!==this.type?this.type-A.type:b(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=L.get(this.key);if(typeof A=="boolean"){const F=A?"true":"false";return this.value===F?P.INSTANCE:x.INSTANCE}return this}evaluate(A){return A.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class d{constructor(A,F){this.key=A,this.negated=F,this.type=3}static create(A,F=null){const U=L.get(A);return typeof U=="boolean"?U?P.INSTANCE:x.INSTANCE:new d(A,F)}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=L.get(this.key);return typeof A=="boolean"?A?P.INSTANCE:x.INSTANCE:this}evaluate(A){return!A.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 l(A,F){if(typeof A=="string"){const U=parseFloat(A);isNaN(U)||(A=U)}return typeof A=="string"||typeof A=="number"?F(A):P.INSTANCE}class i{constructor(A,F,U){this.key=A,this.value=F,this.negated=U,this.type=12}static create(A,F,U=null){return l(F,w=>new i(A,w,U))}cmp(A){return A.type!==this.type?this.type-A.type:b(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C.create(this.key,this.value,this)),this.negated}}class n{constructor(A,F,U){this.key=A,this.value=F,this.negated=U,this.type=13}static create(A,F,U=null){return l(F,w=>new n(A,w,U))}cmp(A){return A.type!==this.type?this.type-A.type:b(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}class O{constructor(A,F,U){this.key=A,this.value=F,this.negated=U,this.type=14}static create(A,F,U=null){return l(F,w=>new O(A,w,U))}cmp(A){return A.type!==this.type?this.type-A.type:b(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=n.create(this.key,this.value,this)),this.negated}}class C{constructor(A,F,U){this.key=A,this.value=F,this.negated=U,this.type=15}static create(A,F,U=null){return l(F,w=>new C(A,w,U))}cmp(A){return A.type!==this.type?this.type-A.type:b(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.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 T{constructor(A,F){this.key=A,this.regexp=F,this.type=7,this.negated=null}static create(A,F){return new T(A,F)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.key<A.key)return-1;if(this.key>A.key)return 1;const F=this.regexp?this.regexp.source:"",U=A.regexp?A.regexp.source:"";return F<U?-1:F>U?1:0}equals(A){if(A.type===this.type){const F=this.regexp?this.regexp.source:"",U=A.regexp?A.regexp.source:"";return this.key===A.key&&F===U}return!1}substituteConstants(){return this}evaluate(A){let F=A.getValue(this.key);return this.regexp?this.regexp.test(F):!1}serialize(){const A=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${A}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this)),this.negated}}class R{constructor(A){this._actual=A,this.type=8}static create(A){return new R(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function S(A){let F=null;for(let U=0,w=A.length;U<w;U++){const Y=A[U].substituteConstants();if(A[U]!==Y&&F===null){F=[];for(let Z=0;Z<U;Z++)F[Z]=A[Z]}F!==null&&(F[U]=Y)}return F===null?A:F}class y{constructor(A,F){this.expr=A,this.negated=F,this.type=6}static create(A,F){return y._normalizeArr(A,F)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let F=0,U=this.expr.length;F<U;F++){const w=r(this.expr[F],A.expr[F]);if(w!==0)return w}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let F=0,U=this.expr.length;F<U;F++)if(!this.expr[F].equals(A.expr[F]))return!1;return!0}return!1}substituteConstants(){const A=S(this.expr);return A===this.expr?this:y.create(A,this.negated)}evaluate(A){for(let F=0,U=this.expr.length;F<U;F++)if(!this.expr[F].evaluate(A))return!1;return!0}static _normalizeArr(A,F){const U=[];let w=!1;for(const Y of A){if(!Y)continue;if(Y.type===1){w=!0;continue}if(Y.type===0)return P.INSTANCE;if(Y.type===6){U.push(...Y.expr);continue}U.push(Y)}if(U.length===0&&w)return x.INSTANCE;if(U.length===0)return;if(U.length===1)return U[0];U.sort(r);for(let Y=1;Y<U.length;Y++)U[Y-1].equals(U[Y])&&(U.splice(Y,1),Y--);if(U.length===1)return U[0];for(;U.length>1;){const Y=U[U.length-1];if(Y.type!==9)break;U.pop();const Z=U.pop(),ce=U.length===0,be=E.create(Y.expr.map(Ze=>y.create([Ze,Z],null)),null,ce);be&&(U.push(be),U.sort(r))}return U.length===1?U[0]:new y(U,F)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let F of this.expr)A.push(...F.keys());return A}negate(){if(!this.negated){const A=[];for(let F of this.expr)A.push(F.negate());this.negated=E.create(A,this,!0)}return this.negated}}class E{constructor(A,F){this.expr=A,this.negated=F,this.type=9}static create(A,F,U){return E._normalizeArr(A,F,U)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let F=0,U=this.expr.length;F<U;F++){const w=r(this.expr[F],A.expr[F]);if(w!==0)return w}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let F=0,U=this.expr.length;F<U;F++)if(!this.expr[F].equals(A.expr[F]))return!1;return!0}return!1}substituteConstants(){const A=S(this.expr);return A===this.expr?this:E.create(A,this.negated,!1)}evaluate(A){for(let F=0,U=this.expr.length;F<U;F++)if(this.expr[F].evaluate(A))return!0;return!1}static _normalizeArr(A,F,U){let w=[],Y=!1;if(A){for(let Z=0,ce=A.length;Z<ce;Z++){const be=A[Z];if(!be)continue;if(be.type===0){Y=!0;continue}if(be.type===1)return x.INSTANCE;if(be.type===9){w=w.concat(be.expr);continue}w.push(be)}if(w.length===0&&Y)return P.INSTANCE;w.sort(r)}if(w.length===0)return;if(w.length===1)return w[0];for(let Z=1;Z<w.length;Z++)w[Z-1].equals(w[Z])&&(w.splice(Z,1),Z--);if(w.length===1)return w[0];if(U){for(let Z=0;Z<w.length;Z++)for(let ce=Z+1;ce<w.length;ce++)N(w[Z],w[ce])&&(w.splice(ce,1),ce--);if(w.length===1)return w[0]}return new E(w,F)}serialize(){return this.expr.map(A=>A.serialize()).join(" || ")}keys(){const A=[];for(let F of this.expr)A.push(...F.keys());return A}negate(){if(!this.negated){let A=[];for(let F of this.expr)A.push(F.negate());for(;A.length>1;){const F=A.shift(),U=A.shift(),w=[];for(const Z of H(F))for(const ce of H(U))w.push(y.create([Z,ce],null));const Y=A.length===0;A.unshift(E.create(w,null,Y))}this.negated=A[0]}return this.negated}}class f extends p{constructor(A,F,U){super(A,null);this._defaultValue=F,typeof U=="object"?f._info.push(Object.assign(Object.assign({},U),{key:A})):U!==!0&&f._info.push({key:A,description:U,type:F!=null?typeof F:void 0})}static all(){return f._info.values()}bindTo(A){return A.createKey(this.key,this._defaultValue)}getValue(A){return A.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(A){return m.create(this.key,A)}}f._info=[];const h=Object(I.c)("contextKeyService"),v="setContext";function g(A,F){return A<F?-1:A>F?1:0}function b(A,F,U,w){return A<U?-1:A>U?1:F<w?-1:F>w?1:0}function N(A,F){if(F.type===6&&A.type!==9&&A.type!==6){for(const Y of F.expr)if(A.equals(Y))return!0}const U=A.negate(),w=H(U).concat(H(F));w.sort(r);for(let Y=0;Y<w.length;Y++){const Z=w[Y],ce=Z.negate();for(let be=Y+1;be<w.length;be++){const Ze=w[be];if(ce.equals(Ze))return!0}}return!1}function H(A){return A.type===9?A.expr:[A]}},TXwP:function(Lt,ve,k){var ne,V;(function(){var I;(function(){"use strict";var L=[,,function(r){function P(m){this.__parent=m,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 m=new P(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},P.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},P.prototype.has_match=function(m){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(m))return!0;return!1},P.prototype.set_indent=function(m,c){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=c||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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__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(m){this.__items.push(m);var c=m.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=m.length-c:this.__character_count+=m.length},P.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function x(m,c){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),c=c||"",m.indent_level>0&&(c=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}x.prototype.get_indent_size=function(m,c){var a=this.__base_string_length;return c=c||0,m<0&&(a=0),a+=m*this.__indent_size,a+=c,a},x.prototype.get_indent_string=function(m,c){var a=this.__base_string;return c=c||0,m<0&&(m=0,a=""),c+=m*this.__indent_size,this.__ensure_cache(c),a+=this.__cache[c],a},x.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var m=this.__cache.length,c=0,a="";this.__indent_size&&m>=this.__indent_size&&(c=Math.floor(m/this.__indent_size),m-=c*this.__indent_size,a=new Array(c+1).join(this.__indent_string)),m&&(a+=new Array(m+1).join(" ")),this.__cache.push(a)};function p(m,c){this.__indent_cache=new x(m,c),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.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()}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(m,c){return this.__indent_cache.get_indent_string(m,c)},p.prototype.get_indent_size=function(m,c){return this.__indent_cache.get_indent_size(m,c)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(m){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 m!==`
|
|
`&&(a=a.replace(/[\n]/g,m)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(m,c){return m=m||0,c=c||0,this.next_line.set_indent(m,c),this.__lines.length>1?(this.current_line.set_indent(m,c),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var c=0;c<m.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),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(m){for(var c=this.__lines.length;m<c;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&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(m,c){for(var a=this.__lines.length-2;a>=0;){var s=this.__lines[a];if(s.is_empty())break;if(s.item(0).indexOf(m)!==0&&s.item(-1)!==c){this.__lines.splice(a+1,0,new P(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},r.exports.Output=p},,,,function(r){function P(m,c){this.raw_options=x(m,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"])}P.prototype._get_array=function(m,c){var a=this.raw_options[m],s=c||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(s=a.concat()):typeof a=="string"&&(s=a.split(/[^a-zA-Z0-9_\/\-]+/)),s},P.prototype._get_boolean=function(m,c){var a=this.raw_options[m],s=a===void 0?!!c:!!a;return s},P.prototype._get_characters=function(m,c){var a=this.raw_options[m],s=c||"";return typeof a=="string"&&(s=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),s},P.prototype._get_number=function(m,c){var a=this.raw_options[m];c=parseInt(c,10),isNaN(c)&&(c=0);var s=parseInt(a,10);return isNaN(s)&&(s=c),s},P.prototype._get_selection=function(m,c,a){var s=this._get_selection_list(m,c,a);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[m]+"'");return s[0]},P.prototype._get_selection_list=function(m,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 s=this._get_array(m,a);if(!this._is_valid_selection(s,c))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[m]+"'");return s},P.prototype._is_valid_selection=function(m,c){return m.length&&c.length&&!m.some(function(a){return c.indexOf(a)===-1})};function x(m,c){var a={};m=p(m);var s;for(s in m)s!==c&&(a[s]=m[s]);if(c&&m[c])for(s in m[c])a[s]=m[c][s];return a}function p(m){var c={},a;for(a in m){var s=a.replace(/-/g,"_");c[s]=m[a]}return c}r.exports.Options=P,r.exports.normalizeOpts=p,r.exports.mergeOpts=x},,function(r){var P=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 m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(m=this.__input.charAt(p)),m},x.prototype.__match=function(p,m){p.lastIndex=m;var c=p.exec(this.__input);return c&&!(P&&p.sticky)&&(c.index!==m&&(c=null)),c},x.prototype.test=function(p,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(p,m):!1},x.prototype.testChar=function(p,m){var c=this.peek(m);return p.lastIndex=0,c!==null&&p.test(c)},x.prototype.match=function(p){var m=this.__match(p,this.__position);return m?this.__position+=m[0].length:m=null,m},x.prototype.read=function(p,m,c){var a="",s;return p&&(s=this.match(p),s&&(a+=s[0])),m&&(s||!p)&&(a+=this.readUntil(m,c)),a},x.prototype.readUntil=function(p,m){var c="",a=this.__position;p.lastIndex=this.__position;var s=p.exec(this.__input);return s?(a=s.index,m&&(a+=s[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,m){var c=null,a="g";return m&&P&&(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 m=this.__position,c=this.readUntilAfter(p);return this.__position=m,c},x.prototype.lookBack=function(p){var m=this.__position-1;return m>=p.length&&this.__input.substring(m-p.length,m).toLowerCase()===p},r.exports.InputScanner=x},,,,,function(r){function P(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")}P.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(x);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(x);return p},P.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=P},,function(r,P,x){var p=x(16).Beautifier,m=x(17).Options;function c(a,s){var d=new p(a,s);return d.beautify()}r.exports=c,r.exports.defaultOptions=function(){return new m}},function(r,P,x){var p=x(17).Options,m=x(2).Output,c=x(8).InputScanner,a=x(13).Directives,s=new a(/\/\*/,/\*\//),d=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,i=/\s/,n=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,C=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(R,S){this._source_text=R||"",this._options=new p(S),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"]}T.prototype.eatString=function(R){var S="";for(this._ch=this._input.next();this._ch;){if(S+=this._ch,this._ch==="\\")S+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return S},T.prototype.eatWhitespace=function(R){for(var S=i.test(this._input.peek()),y=0;i.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===`
|
|
`&&((y===0||y<this._options.max_preserve_newlines)&&(y++,this._output.add_new_line(!0)));return S},T.prototype.foundNestedPseudoClass=function(){for(var R=0,S=1,y=this._input.peek(S);y;){if(y==="{")return!0;if(y==="(")R+=1;else if(y===")"){if(R===0)return!1;R-=1}else if(y===";"||y==="}")return!1;S++,y=this._input.peek(S)}return!1},T.prototype.print_string=function(R){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(R)},T.prototype.preserveSingleSpace=function(R){R&&(this._output.space_before_token=!0)},T.prototype.indent=function(){this._indentLevel++},T.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R=this._source_text,S=this._options.eol;S==="auto"&&(S=`
|
|
`,R&&d.test(R||"")&&(S=R.match(d)[0])),R=R.replace(l,`
|
|
`);var y=R.match(/^[\t ]*/)[0];this._output=new m(this._options,y),this._input=new c(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var E=0,f=!1,h=!1,v=!1,g=!1,b=!1,N=!1,H=this._ch,A=!1,F,U,w;F=this._input.read(n),U=F!=="",w=H,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),H=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var Y=this._input.read(O),Z=s.get_directives(Y);Z&&Z.ignore==="start"&&(Y+=s.readIgnored(this._input)),this.print_string(Y),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(C)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(U),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ce=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ce.match(/[ :]$/)&&(ce=this.eatString(": ").replace(/\s$/,""),this.print_string(ce),this._output.space_before_token=!0),ce=ce.replace(/\s$/,""),ce==="extend"?g=!0:ce==="import"&&(b=!0),ce in this.NESTED_AT_RULE?(this._nestedLevel+=1,ce in this.CONDITIONAL_GROUP_RULE&&(v=!0)):!f&&E===0&&ce.indexOf(":")!==-1&&(h=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")h&&(h=!1,this.outdent()),v?(v=!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)):(w==="("?this._output.space_before_token=!1:w!==","&&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(),w==="{"&&this._output.trim(!0),b=!1,g=!1,h&&(this.outdent(),h=!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 be=0;be<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;be++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[be])){A=!0;break}(f||v)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!g&&E===0?(this.print_string(":"),h||(h=!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 Ze=w==='"'||w==="'";this.preserveSingleSpace(Ze||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,E===0?(h&&(this.outdent(),h=!1),g=!1,b=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),E++,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(")")),E&&(E--,this.outdent()));else{var Ce=!1;this._input.lookBack("with")&&(Ce=!0),this.preserveSingleSpace(U||Ce),this.print_string(this._ch),h&&w==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),N=!0):(this.eatWhitespace(),E++,this.indent())}else if(this._ch===")")E&&(E--,this.outdent()),N&&this._input.peek()===";"&&this._options.selector_separator_newline&&(N=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!h||N)&&E===0&&!b&&!g?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!h&&E===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&i.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(U),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),i.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var We=w==='"'||w==="'";this.preserveSingleSpace(We||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&A&&this._output.add_new_line()}var Ve=this._output.get_code(S);return Ve},r.exports.Beautifier=T},function(r,P,x){var p=x(6).Options;function m(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 s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var d=0;d<s.length;d++)s[d]!=="expand"?this.brace_style="collapse":this.brace_style=s[d]}m.prototype=new p,r.exports.Options=m}],D={};function K(r){var P=D[r];if(P!==void 0)return P.exports;var x=D[r]={exports:{}};return L[r](x,x.exports,K),x.exports}var M=K(15);I=M})();var z=I;!(ne=[],V=function(){return{css_beautify:z}}.apply(ve,ne),V!==void 0&&(Lt.exports=V))})()},Vhoy:function(Lt,ve,k){"use strict";k.d(ve,"d",function(){return z}),k.d(ve,"e",function(){return L}),k.d(ve,"c",function(){return D}),k.d(ve,"b",function(){return K}),k.d(ve,"a",function(){return M});var ne=k("MI8n");class V{constructor(){this._icons=new Map,this._onDidRegister=new ne.b}add(r){const P=this._icons.get(r.id);P?r.description?P.description=r.description:console.error(`Duplicate registration of codicon ${r.id}`):(this._icons.set(r.id,r),this._onDidRegister.fire(r))}get(r){return this._icons.get(r)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const I=new V,z=I;function L(r,P){return new K(r,P)}function D(r){return r?r.replace(/\$\((.*?)\)/g,(P,x)=>` ${x} `).trim():""}class K{constructor(r,P,x){this.id=r,this.definition=P,this.description=x,I.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var M;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const P=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function x(c){if(c instanceof K)return["codicon","codicon-"+c.id];const a=P.exec(c.id);if(!a)return x(K.error);let[,s,d]=a;const l=["codicon","codicon-"+s];return d&&l.push("codicon-modifier-"+d.substr(1)),l}r.asClassNameArray=x;function p(c){return x(c).join(" ")}r.asClassName=p;function m(c){return"."+x(c).join(".")}r.asCSSSelector=m})(M||(M={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},"VrN/":function(Lt,ve,k){(function(ne,V){Lt.exports=V()})(this,function(){"use strict";var ne=navigator.userAgent,V=navigator.platform,I=/gecko\/\d/i.test(ne),z=/MSIE \d/.test(ne),L=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ne),D=/Edge\/(\d+)/.exec(ne),K=z||L||D,M=K&&(z?document.documentMode||6:+(D||L)[1]),r=!D&&/WebKit\//.test(ne),P=r&&/Qt\/\d+\.\d+/.test(ne),x=!D&&/Chrome\//.test(ne),p=/Opera\//.test(ne),m=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ne),a=/PhantomJS/.test(ne),s=!D&&/AppleWebKit/.test(ne)&&/Mobile\/\w+/.test(ne),d=/Android/.test(ne),l=s||d||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ne),i=s||/Mac/.test(V),n=/\bCrOS\b/.test(ne),O=/win/i.test(V),C=p&&ne.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(p=!1,r=!0);var T=i&&(P||p&&(C==null||C<12.11)),R=I||K&&M>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var y=function(e,t){var u=e.className,o=S(t).exec(u);if(o){var _=u.slice(o.index+o[0].length);e.className=u.slice(0,o.index)+(_?o[1]+_:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function f(e,t){return E(e).appendChild(t)}function h(e,t,u,o){var _=document.createElement(e);if(u&&(_.className=u),o&&(_.style.cssText=o),typeof t=="string")_.appendChild(document.createTextNode(t));else if(t)for(var B=0;B<t.length;++B)_.appendChild(t[B]);return _}function v(e,t,u,o){var _=h(e,t,u,o);return _.setAttribute("role","presentation"),_}var g;document.createRange?g=function(e,t,u,o){var _=document.createRange();return _.setEnd(o||e,u),_.setStart(e,t),_}:g=function(e,t,u){var o=document.body.createTextRange();try{o.moveToElementText(e.parentNode)}catch(_){return o}return o.collapse(!0),o.moveEnd("character",u),o.moveStart("character",t),o};function b(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function N(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function H(e,t){var u=e.className;S(t).test(u)||(e.className+=(u?" ":"")+t)}function A(e,t){for(var u=e.split(" "),o=0;o<u.length;o++)u[o]&&!S(u[o]).test(t)&&(t+=" "+u[o]);return t}var F=function(e){e.select()};s?F=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(F=function(e){try{e.select()}catch(t){}});function U(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function w(e,t,u){t||(t={});for(var o in e)e.hasOwnProperty(o)&&(u!==!1||!t.hasOwnProperty(o))&&(t[o]=e[o]);return t}function Y(e,t,u,o,_){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var B=o||0,$=_||0;;){var ee=e.indexOf(" ",B);if(ee<0||ee>=t)return $+(t-B);$+=ee-B,$+=u-$%u,B=ee+1}}var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,t){this.f=t;var u=+new Date+e;(!this.id||u<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=u)};function ce(e,t){for(var u=0;u<e.length;++u)if(e[u]==t)return u;return-1}var be=50,Ze={toString:function(){return"CodeMirror.Pass"}},Ce={scroll:!1},We={origin:"*mouse"},Ve={origin:"+move"};function Ye(e,t,u){for(var o=0,_=0;;){var B=e.indexOf(" ",o);B==-1&&(B=e.length);var $=B-o;if(B==e.length||_+$>=t)return o+Math.min($,t-_);if(_+=B-o,_+=u-_%u,o=B+1,_>=t)return o}}var we=[""];function X(e){for(;we.length<=e;)we.push(j(we)+" ");return we[e]}function j(e){return e[e.length-1]}function W(e,t){for(var u=[],o=0;o<e.length;o++)u[o]=t(e[o],o);return u}function Q(e,t,u){for(var o=0,_=u(t);o<e.length&&u(e[o])<=_;)o++;e.splice(o,0,t)}function re(){}function G(e,t){var u;return Object.create?u=Object.create(e):(re.prototype=e,u=new re),t&&w(t,u),u}var xe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ie(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||xe.test(e))}function tt(e,t){return t?t.source.indexOf("\\w")>-1&&Ie(e)?!0:t.test(e):Ie(e)}function le(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Se=/[\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 je(e){return e.charCodeAt(0)>=768&&Se.test(e)}function ze(e,t,u){for(;(u<0?t>0:t<e.length)&&je(e.charAt(t));)t+=u;return t}function yt(e,t,u){for(var o=t>u?-1:1;;){if(t==u)return t;var _=(t+u)/2,B=o<0?Math.ceil(_):Math.floor(_);if(B==t)return e(B)?t:u;e(B)?u=B:t=B+o}}function Ot(e,t,u,o){if(!e)return o(t,u,"ltr",0);for(var _=!1,B=0;B<e.length;++B){var $=e[B];($.from<u&&$.to>t||t==u&&$.to==t)&&(o(Math.max($.from,t),Math.min($.to,u),$.level==1?"rtl":"ltr",B),_=!0)}_||o(t,u,"ltr")}var Ut=null;function Qe(e,t,u){var o;Ut=null;for(var _=0;_<e.length;++_){var B=e[_];if(B.from<t&&B.to>t)return _;B.to==t&&(B.from!=B.to&&u=="before"?o=_:Ut=_),B.from==t&&(B.from!=B.to&&u!="before"?o=_:Ut=_)}return o!=null?o:Ut}var Bt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(he){return he<=247?e.charAt(he):1424<=he&&he<=1524?"R":1536<=he&&he<=1785?t.charAt(he-1536):1774<=he&&he<=2220?"r":8192<=he&&he<=8203?"w":he==8204?"b":"L"}var o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,_=/[stwN]/,B=/[LRr]/,$=/[Lb1n]/,ee=/[1n]/;function oe(he,ke,Fe){this.level=he,this.from=ke,this.to=Fe}return function(he,ke){var Fe=ke=="ltr"?"L":"R";if(he.length==0||ke=="ltr"&&!o.test(he))return!1;for(var ut=he.length,ot=[],Nt=0;Nt<ut;++Nt)ot.push(u(he.charCodeAt(Nt)));for(var rn=0,wn=Fe;rn<ut;++rn){var Dn=ot[rn];Dn=="m"?ot[rn]=wn:wn=Dn}for(var Nn=0,Ln=Fe;Nn<ut;++Nn){var Kn=ot[Nn];Kn=="1"&&Ln=="r"?ot[Nn]="n":B.test(Kn)&&(Ln=Kn,Kn=="r"&&(ot[Nn]="R"))}for(var fr=1,or=ot[0];fr<ut-1;++fr){var Rr=ot[fr];Rr=="+"&&or=="1"&&ot[fr+1]=="1"?ot[fr]="1":Rr==","&&or==ot[fr+1]&&(or=="1"||or=="n")&&(ot[fr]=or),or=Rr}for(var ti=0;ti<ut;++ti){var ji=ot[ti];if(ji==",")ot[ti]="N";else if(ji=="%"){var gi=void 0;for(gi=ti+1;gi<ut&&ot[gi]=="%";++gi);for(var aa=ti&&ot[ti-1]=="!"||gi<ut&&ot[gi]=="1"?"1":"N",ta=ti;ta<gi;++ta)ot[ta]=aa;ti=gi-1}}for(var Di=0,na=Fe;Di<ut;++Di){var Gi=ot[Di];na=="L"&&Gi=="1"?ot[Di]="L":B.test(Gi)&&(na=Gi)}for(var Mi=0;Mi<ut;++Mi)if(_.test(ot[Mi])){var Li=void 0;for(Li=Mi+1;Li<ut&&_.test(ot[Li]);++Li);for(var Ei=(Mi?ot[Mi-1]:Fe)=="L",ra=(Li<ut?ot[Li]:Fe)=="L",So=Ei==ra?Ei?"L":"R":Fe,to=Mi;to<Li;++to)ot[to]=So;Mi=Li-1}for(var Vi=[],Pa,Fi=0;Fi<ut;)if($.test(ot[Fi])){var ms=Fi;for(++Fi;Fi<ut&&$.test(ot[Fi]);++Fi);Vi.push(new oe(0,ms,Fi))}else{var Ga=Fi,lo=Vi.length,uo=ke=="rtl"?1:0;for(++Fi;Fi<ut&&ot[Fi]!="L";++Fi);for(var Xi=Ga;Xi<Fi;)if(ee.test(ot[Xi])){Ga<Xi&&(Vi.splice(lo,0,new oe(1,Ga,Xi)),lo+=uo);var Oo=Xi;for(++Xi;Xi<Fi&&ee.test(ot[Xi]);++Xi);Vi.splice(lo,0,new oe(2,Oo,Xi)),lo+=uo,Ga=Xi}else++Xi;Ga<Fi&&Vi.splice(lo,0,new oe(1,Ga,Fi))}return ke=="ltr"&&(Vi[0].level==1&&(Pa=he.match(/^\s+/))&&(Vi[0].from=Pa[0].length,Vi.unshift(new oe(0,0,Pa[0].length))),j(Vi).level==1&&(Pa=he.match(/\s+$/))&&(j(Vi).to-=Pa[0].length,Vi.push(new oe(0,ut-Pa[0].length,ut)))),ke=="rtl"?Vi.reverse():Vi}}();function ln(e,t){var u=e.order;return u==null&&(u=e.order=Bt(e.text,t)),u}var Ke=[],He=function(e,t,u){if(e.addEventListener)e.addEventListener(t,u,!1);else if(e.attachEvent)e.attachEvent("on"+t,u);else{var o=e._handlers||(e._handlers={});o[t]=(o[t]||Ke).concat(u)}};function ct(e,t){return e._handlers&&e._handlers[t]||Ke}function bt(e,t,u){if(e.removeEventListener)e.removeEventListener(t,u,!1);else if(e.detachEvent)e.detachEvent("on"+t,u);else{var o=e._handlers,_=o&&o[t];if(_){var B=ce(_,u);B>-1&&(o[t]=_.slice(0,B).concat(_.slice(B+1)))}}}function de(e,t){var u=ct(e,t);if(!u.length)return;for(var o=Array.prototype.slice.call(arguments,2),_=0;_<u.length;++_)u[_].apply(null,o)}function q(e,t,u){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),de(e,u||t.type,e,t),me(t)||t.codemirrorIgnore}function te(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var u=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),o=0;o<t.length;++o)ce(u,t[o])==-1&&u.push(t[o])}function se(e,t){return ct(e,t).length>0}function pe(e){e.prototype.on=function(t,u){He(this,t,u)},e.prototype.off=function(t,u){bt(this,t,u)}}function ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function me(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function _e(e){ae(e),ie(e)}function Ee(e){return e.target||e.srcElement}function Le(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),i&&e.ctrlKey&&t==1&&(t=3),t}var at=function(){if(K&&M<9)return!1;var e=h("div");return"draggable"in e||"dragDrop"in e}(),Ct;function Jt(e){if(Ct==null){var t=h("span","\u200B");f(e,h("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ct=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&M<8))}var u=Ct?h("span","\u200B"):h("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var lt;function Un(e){if(lt!=null)return lt;var t=f(e,document.createTextNode("A\u062EA")),u=g(t,0,1).getBoundingClientRect(),o=g(t,1,2).getBoundingClientRect();return E(e),!u||u.left==u.right?!1:lt=o.right-u.right<3}var Cn=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,u=[],o=e.length;t<=o;){var _=e.indexOf(`
|
|
`,t);_==-1&&(_=e.length);var B=e.slice(t,e.charAt(_-1)=="\r"?_-1:_),$=B.indexOf("\r");$!=-1?(u.push(B.slice(0,$)),t+=$+1):(u.push(B),t=_+1)}return u}:function(e){return e.split(/\r\n?|\n/)},vn=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(u){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},er=function(){var e=h("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),kn=null;function Yn(e){if(kn!=null)return kn;var t=f(e,h("span","x")),u=t.getBoundingClientRect(),o=g(t,0,1).getBoundingClientRect();return kn=Math.abs(u.left-o.left)>1}var vr={},Mn={};function Zn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),vr[e]=t}function dr(e,t){Mn[e]=t}function jt(e){if(typeof e=="string"&&Mn.hasOwnProperty(e))e=Mn[e];else if(e&&typeof e.name=="string"&&Mn.hasOwnProperty(e.name)){var t=Mn[e.name];typeof t=="string"&&(t={name:t}),e=G(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return jt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return jt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ft(e,t){t=jt(t);var u=vr[t.name];if(!u)return Ft(e,"text/plain");var o=u(e,t);if(zt.hasOwnProperty(t.name)){var _=zt[t.name];for(var B in _){if(!_.hasOwnProperty(B))continue;o.hasOwnProperty(B)&&(o["_"+B]=o[B]),o[B]=_[B]}}if(o.name=t.name,t.helperType&&(o.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)o[$]=t.modeProps[$];return o}var zt={};function dn(e,t){var u=zt.hasOwnProperty(e)?zt[e]:zt[e]={};w(t,u)}function yn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var u={};for(var o in t){var _=t[o];_ instanceof Array&&(_=_.concat([])),u[o]=_}return u}function bn(e,t){for(var u;e.innerMode&&!(u=e.innerMode(t),!u||u.mode==e);)t=u.state,e=u.mode;return u||{mode:e,state:t}}function _r(e,t,u){return e.startState?e.startState(t,u):!0}var Bn=function(e,t,u){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=u};Bn.prototype.eol=function(){return this.pos>=this.string.length},Bn.prototype.sol=function(){return this.pos==this.lineStart},Bn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Bn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Bn.prototype.eat=function(e){var t=this.string.charAt(this.pos),u;if(typeof e=="string"?u=t==e:u=t&&(e.test?e.test(t):e(t)),u)return++this.pos,t},Bn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Bn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Bn.prototype.skipToEnd=function(){this.pos=this.string.length},Bn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Bn.prototype.backUp=function(e){this.pos-=e},Bn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Y(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Bn.prototype.indentation=function(){return Y(this.string,null,this.tabSize)-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Bn.prototype.match=function(e,t,u){if(typeof e=="string"){var o=function($){return u?$.toLowerCase():$},_=this.string.substr(this.pos,e.length);if(o(_)==o(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)}},Bn.prototype.current=function(){return this.string.slice(this.start,this.pos)},Bn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Bn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Bn.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 u=e;!u.lines;)for(var o=0;;++o){var _=u.children[o],B=_.chunkSize();if(t<B){u=_;break}t-=B}return u.lines[t]}function Hn(e,t,u){var o=[],_=t.line;return e.iter(t.line,u.line+1,function(B){var $=B.text;_==u.line&&($=$.slice(0,u.ch)),_==t.line&&($=$.slice(t.ch)),o.push($),++_}),o}function lr(e,t,u){var o=[];return e.iter(t,u,function(_){o.push(_.text)}),o}function Sn(e,t){var u=t-e.height;if(u)for(var o=e;o;o=o.parent)o.height+=u}function zn(e){if(e.parent==null)return null;for(var t=e.parent,u=ce(t.lines,e),o=t.parent;o;t=o,o=o.parent)for(var _=0;!(o.children[_]==t);++_)u+=o.children[_].chunkSize();return u+t.first}function tr(e,t){var u=e.first;e:do{for(var o=0;o<e.children.length;++o){var _=e.children[o],B=_.height;if(t<B){e=_;continue e}t-=B,u+=_.chunkSize()}return u}while(!e.lines);for(var $=0;$<e.lines.length;++$){var ee=e.lines[$],oe=ee.height;if(t<oe)break;t-=oe}return u+$}function Gr(e,t){return t>=e.first&&t<e.first+e.size}function Ar(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Yt(e,t,u){if(u===void 0&&(u=null),!(this instanceof Yt))return new Yt(e,t,u);this.line=e,this.ch=t,this.sticky=u}function Vn(e,t){return e.line-t.line||e.ch-t.ch}function vi(e,t){return e.sticky==t.sticky&&Vn(e,t)==0}function Pi(e){return Yt(e.line,e.ch)}function ai(e,t){return Vn(e,t)<0?t:e}function Yr(e,t){return Vn(e,t)<0?e:t}function Lr(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Fn(e,t){if(t.line<e.first)return Yt(e.first,0);var u=e.first+e.size-1;return t.line>u?Yt(u,Qt(e,u).text.length):pi(t,Qt(e,t.line).text.length)}function pi(e,t){var u=e.ch;return u==null||u>t?Yt(e.line,t):u<0?Yt(e.line,0):e}function Zt(e,t){for(var u=[],o=0;o<t.length;o++)u[o]=Fn(e,t[o]);return u}var qr=function(e,t){this.state=e,this.lookAhead=t},zr=function(e,t,u,o){this.state=t,this.doc=e,this.line=u,this.maxLookAhead=o||0,this.baseTokens=null,this.baseTokenPos=1};zr.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},zr.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}},zr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},zr.fromSaved=function(e,t,u){return t instanceof qr?new zr(e,yn(e.mode,t.state),u,t.lookAhead):new zr(e,yn(e.mode,t),u)},zr.prototype.save=function(e){var t=e!==!1?yn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new qr(t,this.maxLookAhead):t};function xi(e,t,u,o){var _=[e.state.modeGen],B={};ci(e,t.text,e.doc.mode,u,function(he,ke){return _.push(he,ke)},B,o);for(var $=u.state,ee=function(he){u.baseTokens=_;var ke=e.state.overlays[he],Fe=1,ut=0;u.state=!0,ci(e,t.text,ke.mode,u,function(ot,Nt){for(var rn=Fe;ut<ot;){var wn=_[Fe];wn>ot&&_.splice(Fe,1,ot,_[Fe+1],wn),Fe+=2,ut=Math.min(ot,wn)}if(!Nt)return;if(ke.opaque)_.splice(rn,Fe-rn,ot,"overlay "+Nt),Fe=rn+2;else for(;rn<Fe;rn+=2){var Dn=_[rn+1];_[rn+1]=(Dn?Dn+" ":"")+"overlay "+Nt}},B),u.state=$,u.baseTokens=null,u.baseTokenPos=1},oe=0;oe<e.state.overlays.length;++oe)ee(oe);return{styles:_,classes:B.bgClass||B.textClass?B:null}}function mi(e,t,u){if(!t.styles||t.styles[0]!=e.state.modeGen){var o=ni(e,zn(t)),_=t.text.length>e.options.maxHighlightLength&&yn(e.doc.mode,o.state),B=xi(e,t,o);_&&(o.state=_),t.stateAfter=o.save(!_),t.styles=B.styles,B.classes?t.styleClasses=B.classes:t.styleClasses&&(t.styleClasses=null),u===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ni(e,t,u){var o=e.doc,_=e.display;if(!o.mode.startState)return new zr(o,!0,t);var B=_i(e,t,u),$=B>o.first&&Qt(o,B-1).stateAfter,ee=$?zr.fromSaved(o,$,B):new zr(o,_r(o.mode),B);return o.iter(B,t,function(oe){Bi(e,oe.text,ee);var he=ee.line;oe.stateAfter=he==t-1||he%5==0||he>=_.viewFrom&&he<_.viewTo?ee.save():null,ee.nextLine()}),u&&(o.modeFrontier=ee.line),ee}function Bi(e,t,u,o){var _=e.doc.mode,B=new Bn(t,e.options.tabSize,u);for(B.start=B.pos=o||0,t==""&&Hi(_,u.state);!B.eol();)ri(_,B,u.state),B.start=B.pos}function Hi(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var u=bn(e,t);if(u.mode.blankLine)return u.mode.blankLine(u.state)}function ri(e,t,u,o){for(var _=0;_<10;_++){o&&(o[0]=bn(e,u).mode);var B=e.token(t,u);if(t.pos>t.start)return B}throw new Error("Mode "+e.name+" failed to advance stream.")}var wr=function(e,t,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=u};function Si(e,t,u,o){var _=e.doc,B=_.mode,$;t=Fn(_,t);var ee=Qt(_,t.line),oe=ni(e,t.line,u),he=new Bn(ee.text,e.options.tabSize,oe),ke;for(o&&(ke=[]);(o||he.pos<t.ch)&&!he.eol();)he.start=he.pos,$=ri(B,he,oe.state),o&&ke.push(new wr(he,$,yn(_.mode,oe.state)));return o?ke:new wr(he,$,oe.state)}function Oi(e,t){if(e)for(;;){var u=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!u)break;e=e.slice(0,u.index)+e.slice(u.index+u[0].length);var o=u[1]?"bgClass":"textClass";t[o]==null?t[o]=u[2]:new RegExp("(?:^|\\s)"+u[2]+"(?:$|\\s)").test(t[o])||(t[o]+=" "+u[2])}return e}function ci(e,t,u,o,_,B,$){var ee=u.flattenSpans;ee==null&&(ee=e.options.flattenSpans);var oe=0,he=null,ke=new Bn(t,e.options.tabSize,o),Fe,ut=e.options.addModeClass&&[null];for(t==""&&Oi(Hi(u,o.state),B);!ke.eol();){if(ke.pos>e.options.maxHighlightLength?(ee=!1,$&&Bi(e,t,o,ke.pos),ke.pos=t.length,Fe=null):Fe=Oi(ri(u,ke,o.state,ut),B),ut){var ot=ut[0].name;ot&&(Fe="m-"+(Fe?ot+" "+Fe:ot))}if(!ee||he!=Fe){for(;oe<ke.start;)oe=Math.min(ke.start,oe+5e3),_(oe,he);he=Fe}ke.start=ke.pos}for(;oe<ke.pos;){var Nt=Math.min(ke.pos,oe+5e3);_(Nt,he),oe=Nt}}function _i(e,t,u){for(var o,_,B=e.doc,$=u?-1:t-(e.doc.mode.innerMode?1e3:100),ee=t;ee>$;--ee){if(ee<=B.first)return B.first;var oe=Qt(B,ee-1),he=oe.stateAfter;if(he&&(!u||ee+(he instanceof qr?he.lookAhead:0)<=B.modeFrontier))return ee;var ke=Y(oe.text,null,e.options.tabSize);(_==null||o>ke)&&(_=ee-1,o=ke)}return _}function oa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var u=e.first,o=t-1;o>u;o--){var _=Qt(e,o).stateAfter;if(_&&(!(_ instanceof qr)||o+_.lookAhead<t)){u=o+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}var $i=!1,yr=!1;function br(){$i=!0}function oi(){yr=!0}function kr(e,t,u){this.marker=e,this.from=t,this.to=u}function Tn(e,t){if(e)for(var u=0;u<e.length;++u){var o=e[u];if(o.marker==t)return o}}function qt(e,t){for(var u,o=0;o<e.length;++o)e[o]!=t&&(u||(u=[])).push(e[o]);return u}function fn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function tn(e,t,u){var o;if(e)for(var _=0;_<e.length;++_){var B=e[_],$=B.marker,ee=B.from==null||($.inclusiveLeft?B.from<=t:B.from<t);if(ee||B.from==t&&$.type=="bookmark"&&(!u||!B.marker.insertLeft)){var oe=B.to==null||($.inclusiveRight?B.to>=t:B.to>t);(o||(o=[])).push(new kr($,B.from,oe?null:B.to))}}return o}function Xn(e,t,u){var o;if(e)for(var _=0;_<e.length;++_){var B=e[_],$=B.marker,ee=B.to==null||($.inclusiveRight?B.to>=t:B.to>t);if(ee||B.from==t&&$.type=="bookmark"&&(!u||B.marker.insertLeft)){var oe=B.from==null||($.inclusiveLeft?B.from<=t:B.from<t);(o||(o=[])).push(new kr($,oe?null:B.from-t,B.to==null?null:B.to-t))}}return o}function Qn(e,t){if(t.full)return null;var u=Gr(e,t.from.line)&&Qt(e,t.from.line).markedSpans,o=Gr(e,t.to.line)&&Qt(e,t.to.line).markedSpans;if(!u&&!o)return null;var _=t.from.ch,B=t.to.ch,$=Vn(t.from,t.to)==0,ee=tn(u,_,$),oe=Xn(o,B,$),he=t.text.length==1,ke=j(t.text).length+(he?_:0);if(ee)for(var Fe=0;Fe<ee.length;++Fe){var ut=ee[Fe];if(ut.to==null){var ot=Tn(oe,ut.marker);ot?he&&(ut.to=ot.to==null?null:ot.to+ke):ut.to=_}}if(oe)for(var Nt=0;Nt<oe.length;++Nt){var rn=oe[Nt];if(rn.to!=null&&(rn.to+=ke),rn.from==null){var wn=Tn(ee,rn.marker);wn||(rn.from=ke,he&&(ee||(ee=[])).push(rn))}else rn.from+=ke,he&&(ee||(ee=[])).push(rn)}ee&&(ee=J(ee)),oe&&oe!=ee&&(oe=J(oe));var Dn=[ee];if(!he){var Nn=t.text.length-2,Ln;if(Nn>0&&ee)for(var Kn=0;Kn<ee.length;++Kn)ee[Kn].to==null&&(Ln||(Ln=[])).push(new kr(ee[Kn].marker,null,null));for(var fr=0;fr<Nn;++fr)Dn.push(Ln);Dn.push(oe)}return Dn}function J(e){for(var t=0;t<e.length;++t){var u=e[t];u.from!=null&&u.from==u.to&&u.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ge(e,t,u){var o=null;if(e.iter(t.line,u.line+1,function(ot){if(ot.markedSpans)for(var Nt=0;Nt<ot.markedSpans.length;++Nt){var rn=ot.markedSpans[Nt].marker;rn.readOnly&&(!o||ce(o,rn)==-1)&&(o||(o=[])).push(rn)}}),!o)return null;for(var _=[{from:t,to:u}],B=0;B<o.length;++B)for(var $=o[B],ee=$.find(0),oe=0;oe<_.length;++oe){var he=_[oe];if(Vn(he.to,ee.from)<0||Vn(he.from,ee.to)>0)continue;var ke=[oe,1],Fe=Vn(he.from,ee.from),ut=Vn(he.to,ee.to);(Fe<0||!$.inclusiveLeft&&!Fe)&&ke.push({from:he.from,to:ee.from}),(ut>0||!$.inclusiveRight&&!ut)&&ke.push({from:ee.to,to:he.to}),_.splice.apply(_,ke),oe+=ke.length-3}return _}function Oe(e){var t=e.markedSpans;if(!t)return;for(var u=0;u<t.length;++u)t[u].marker.detachLine(e);e.markedSpans=null}function Re(e,t){if(!t)return;for(var u=0;u<t.length;++u)t[u].marker.attachLine(e);e.markedSpans=t}function qe(e){return e.inclusiveLeft?-1:0}function Ue(e){return e.inclusiveRight?1:0}function Je(e,t){var u=e.lines.length-t.lines.length;if(u!=0)return u;var o=e.find(),_=t.find(),B=Vn(o.from,_.from)||qe(e)-qe(t);if(B)return-B;var $=Vn(o.to,_.to)||Ue(e)-Ue(t);return $||t.id-e.id}function dt(e,t){var u=yr&&e.markedSpans,o;if(u)for(var _=void 0,B=0;B<u.length;++B)_=u[B],_.marker.collapsed&&(t?_.from:_.to)==null&&(!o||Je(o,_.marker)<0)&&(o=_.marker);return o}function wt(e){return dt(e,!0)}function Tt(e){return dt(e,!1)}function Be(e,t){var u=yr&&e.markedSpans,o;if(u)for(var _=0;_<u.length;++_){var B=u[_];B.marker.collapsed&&(B.from==null||B.from<t)&&(B.to==null||B.to>t)&&(!o||Je(o,B.marker)<0)&&(o=B.marker)}return o}function ft(e,t,u,o,_){var B=Qt(e,t),$=yr&&B.markedSpans;if($)for(var ee=0;ee<$.length;++ee){var oe=$[ee];if(!oe.marker.collapsed)continue;var he=oe.marker.find(0),ke=Vn(he.from,u)||qe(oe.marker)-qe(_),Fe=Vn(he.to,o)||Ue(oe.marker)-Ue(_);if(ke>=0&&Fe<=0||ke<=0&&Fe>=0)continue;if(ke<=0&&(oe.marker.inclusiveRight&&_.inclusiveLeft?Vn(he.to,u)>=0:Vn(he.to,u)>0)||ke>=0&&(oe.marker.inclusiveRight&&_.inclusiveLeft?Vn(he.from,o)<=0:Vn(he.from,o)<0))return!0}}function et(e){for(var t;t=wt(e);)e=t.find(-1,!0).line;return e}function rt(e){for(var t;t=Tt(e);)e=t.find(1,!0).line;return e}function ht(e){for(var t,u;t=Tt(e);)e=t.find(1,!0).line,(u||(u=[])).push(e);return u}function _t(e,t){var u=Qt(e,t),o=et(u);return u==o?t:zn(o)}function st(e,t){if(t>e.lastLine())return t;var u=Qt(e,t),o;if(!Pt(e,u))return t;for(;o=Tt(u);)u=o.find(1,!0).line;return zn(u)+1}function Pt(e,t){var u=yr&&t.markedSpans;if(u)for(var o=void 0,_=0;_<u.length;++_){if(o=u[_],!o.marker.collapsed)continue;if(o.from==null)return!0;if(o.marker.widgetNode)continue;if(o.from==0&&o.marker.inclusiveLeft&&Wt(e,t,o))return!0}}function Wt(e,t,u){if(u.to==null){var o=u.marker.find(1,!0);return Wt(e,o.line,Tn(o.line.markedSpans,u.marker))}if(u.marker.inclusiveRight&&u.to==t.text.length)return!0;for(var _=void 0,B=0;B<t.markedSpans.length;++B)if(_=t.markedSpans[B],_.marker.collapsed&&!_.marker.widgetNode&&_.from==u.to&&(_.to==null||_.to!=u.from)&&(_.marker.inclusiveLeft||u.marker.inclusiveRight)&&Wt(e,t,_))return!0}function cn(e){e=et(e);for(var t=0,u=e.parent,o=0;o<u.lines.length;++o){var _=u.lines[o];if(_==e)break;t+=_.height}for(var B=u.parent;B;u=B,B=u.parent)for(var $=0;$<B.children.length;++$){var ee=B.children[$];if(ee==u)break;t+=ee.height}return t}function On(e){if(e.height==0)return 0;for(var t=e.text.length,u,o=e;u=wt(o);){var _=u.find(0,!0);o=_.from.line,t+=_.from.ch-_.to.ch}for(o=e;u=Tt(o);){var B=u.find(0,!0);t-=o.text.length-B.from.ch,o=B.to.line,t+=o.text.length-B.to.ch}return t}function an(e){var t=e.display,u=e.doc;t.maxLine=Qt(u,u.first),t.maxLineLength=On(t.maxLine),t.maxLineChanged=!0,u.iter(function(o){var _=On(o);_>t.maxLineLength&&(t.maxLineLength=_,t.maxLine=o)})}var mn=function(e,t,u){this.text=e,Re(this,t),this.height=u?u(this):1};mn.prototype.lineNo=function(){return zn(this)},pe(mn);function hn(e,t,u,o){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Oe(e),Re(e,u);var _=o?o(e):1;_!=e.height&&Sn(e,_)}function gt(e){e.parent=null,Oe(e)}var Kt={},St={};function pt(e,t){if(!e||/^\s*$/.test(e))return null;var u=t.addModeClass?St:Kt;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function gn(e,t){var u=v("span",null,null,r?"padding-right: .1px":null),o={pre:v("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var _=0;_<=(t.rest?t.rest.length:0);_++){var B=_?t.rest[_-1]:t.line,$=void 0;o.pos=0,o.addToken=Dt,Un(e.display.measure)&&($=ln(B,e.doc.direction))&&(o.addToken=_n(o.addToken,$)),o.map=[];var ee=t!=e.display.externalMeasured&&zn(B);In(B,o,mi(e,B,ee)),B.styleClasses&&(B.styleClasses.bgClass&&(o.bgClass=A(B.styleClasses.bgClass,o.bgClass||"")),B.styleClasses.textClass&&(o.textClass=A(B.styleClasses.textClass,o.textClass||""))),o.map.length==0&&o.map.push(0,0,o.content.appendChild(Jt(e.display.measure))),_==0?(t.measure.map=o.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(o.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(r){var oe=o.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(o.content.className="cm-tab-wrap-hack")}return de(e,"renderLine",e,t.line,o.pre),o.pre.className&&(o.textClass=A(o.pre.className,o.textClass||"")),o}function on(e){var t=h("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Dt(e,t,u,o,_,B,$){if(!t)return;var ee=e.splitSpaces?it(t,e.trailingSpace):t,oe=e.cm.state.specialChars,he=!1,ke;if(!oe.test(t))e.col+=t.length,ke=document.createTextNode(ee),e.map.push(e.pos,e.pos+t.length,ke),K&&M<9&&(he=!0),e.pos+=t.length;else{ke=document.createDocumentFragment();for(var Fe=0;;){oe.lastIndex=Fe;var ut=oe.exec(t),ot=ut?ut.index-Fe:t.length-Fe;if(ot){var Nt=document.createTextNode(ee.slice(Fe,Fe+ot));K&&M<9?ke.appendChild(h("span",[Nt])):ke.appendChild(Nt),e.map.push(e.pos,e.pos+ot,Nt),e.col+=ot,e.pos+=ot}if(!ut)break;Fe+=ot+1;var rn=void 0;if(ut[0]==" "){var wn=e.cm.options.tabSize,Dn=wn-e.col%wn;rn=ke.appendChild(h("span",X(Dn),"cm-tab")),rn.setAttribute("role","presentation"),rn.setAttribute("cm-text"," "),e.col+=Dn}else ut[0]=="\r"||ut[0]==`
|
|
`?(rn=ke.appendChild(h("span",ut[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),rn.setAttribute("cm-text",ut[0]),e.col+=1):(rn=e.cm.options.specialCharPlaceholder(ut[0]),rn.setAttribute("cm-text",ut[0]),K&&M<9?ke.appendChild(h("span",[rn])):ke.appendChild(rn),e.col+=1);e.map.push(e.pos,e.pos+1,rn),e.pos++}}if(e.trailingSpace=ee.charCodeAt(t.length-1)==32,u||o||_||he||B||$){var Nn=u||"";o&&(Nn+=o),_&&(Nn+=_);var Ln=h("span",[ke],Nn,B);if($)for(var Kn in $)$.hasOwnProperty(Kn)&&Kn!="style"&&Kn!="class"&&Ln.setAttribute(Kn,$[Kn]);return e.content.appendChild(Ln)}e.content.appendChild(ke)}function it(e,t){if(e.length>1&&!/ /.test(e))return e;for(var u=t,o="",_=0;_<e.length;_++){var B=e.charAt(_);B==" "&&u&&(_==e.length-1||e.charCodeAt(_+1)==32)&&(B="\xA0"),o+=B,u=B==" "}return o}function _n(e,t){return function(u,o,_,B,$,ee,oe){_=_?_+" cm-force-border":"cm-force-border";for(var he=u.pos,ke=he+o.length;;){for(var Fe=void 0,ut=0;ut<t.length&&!(Fe=t[ut],Fe.to>he&&Fe.from<=he);ut++);if(Fe.to>=ke)return e(u,o,_,B,$,ee,oe);e(u,o.slice(0,Fe.to-he),_,B,null,ee,oe),B=null,o=o.slice(Fe.to-he),he=Fe.to}}}function Gt(e,t,u,o){var _=!o&&u.widgetNode;_&&e.map.push(e.pos,e.pos+t,_),!o&&e.cm.display.input.needsContentAttribute&&(_||(_=e.content.appendChild(document.createElement("span"))),_.setAttribute("cm-marker",u.id)),_&&(e.cm.display.input.setUneditable(_),e.content.appendChild(_)),e.pos+=t,e.trailingSpace=!1}function In(e,t,u){var o=e.markedSpans,_=e.text,B=0;if(!o){for(var $=1;$<u.length;$+=2)t.addToken(t,_.slice(B,B=u[$]),pt(u[$+1],t.cm.options));return}for(var ee=_.length,oe=0,he=1,ke="",Fe,ut,ot=0,Nt,rn,wn,Dn,Nn;;){if(ot==oe){Nt=rn=wn=ut="",Nn=null,Dn=null,ot=Infinity;for(var Ln=[],Kn=void 0,fr=0;fr<o.length;++fr){var or=o[fr],Rr=or.marker;if(Rr.type=="bookmark"&&or.from==oe&&Rr.widgetNode)Ln.push(Rr);else if(or.from<=oe&&(or.to==null||or.to>oe||Rr.collapsed&&or.to==oe&&or.from==oe)){if(or.to!=null&&or.to!=oe&&ot>or.to&&(ot=or.to,rn=""),Rr.className&&(Nt+=" "+Rr.className),Rr.css&&(ut=(ut?ut+";":"")+Rr.css),Rr.startStyle&&or.from==oe&&(wn+=" "+Rr.startStyle),Rr.endStyle&&or.to==ot&&(Kn||(Kn=[])).push(Rr.endStyle,or.to),Rr.title&&((Nn||(Nn={})).title=Rr.title),Rr.attributes)for(var ti in Rr.attributes)(Nn||(Nn={}))[ti]=Rr.attributes[ti];Rr.collapsed&&(!Dn||Je(Dn.marker,Rr)<0)&&(Dn=or)}else or.from>oe&&ot>or.from&&(ot=or.from)}if(Kn)for(var ji=0;ji<Kn.length;ji+=2)Kn[ji+1]==ot&&(rn+=" "+Kn[ji]);if(!Dn||Dn.from==oe)for(var gi=0;gi<Ln.length;++gi)Gt(t,0,Ln[gi]);if(Dn&&(Dn.from||0)==oe){if(Gt(t,(Dn.to==null?ee+1:Dn.to)-oe,Dn.marker,Dn.from==null),Dn.to==null)return;Dn.to==oe&&(Dn=!1)}}if(oe>=ee)break;for(var aa=Math.min(ee,ot);;){if(ke){var ta=oe+ke.length;if(!Dn){var Di=ta>aa?ke.slice(0,aa-oe):ke;t.addToken(t,Di,Fe?Fe+Nt:Nt,wn,oe+Di.length==ot?rn:"",ut,Nn)}if(ta>=aa){ke=ke.slice(aa-oe),oe=aa;break}oe=ta,wn=""}ke=_.slice(B,B=u[he++]),Fe=pt(u[he++],t.cm.options)}}}function kt(e,t,u){this.line=t,this.rest=ht(t),this.size=this.rest?zn(j(this.rest))-u+1:1,this.node=this.text=null,this.hidden=Pt(e,t)}function sn(e,t,u){for(var o=[],_,B=t;B<u;B=_){var $=new kt(e.doc,Qt(e.doc,B),B);_=B+$.size,o.push($)}return o}var En=null;function $t(e){En?En.ops.push(e):e.ownsGroup=En={ops:[e],delayedCallbacks:[]}}function sr(e){var t=e.delayedCallbacks,u=0;do{for(;u<t.length;u++)t[u].call(null);for(var o=0;o<e.ops.length;o++){var _=e.ops[o];if(_.cursorActivityHandlers)for(;_.cursorActivityCalled<_.cursorActivityHandlers.length;)_.cursorActivityHandlers[_.cursorActivityCalled++].call(null,_.cm)}}while(u<t.length)}function un(e,t){var u=e.ownsGroup;if(!u)return;try{sr(u)}finally{En=null,t(u)}}var nn=null;function mt(e,t){var u=ct(e,t);if(!u.length)return;var o=Array.prototype.slice.call(arguments,2),_;En?_=En.delayedCallbacks:nn?_=nn:(_=nn=[],setTimeout(Xe,0));for(var B=function(ee){_.push(function(){return u[ee].apply(null,o)})},$=0;$<u.length;++$)B($)}function Xe(){var e=nn;nn=null;for(var t=0;t<e.length;++t)e[t]()}function Et(e,t,u,o){for(var _=0;_<t.changes.length;_++){var B=t.changes[_];B=="text"?pn(e,t):B=="gutter"?jn(e,t,u,o):B=="class"?Gn(e,t):B=="widget"&&mr(e,t,o)}t.changes=null}function vt(e){return e.node==e.text&&(e.node=h("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),K&&M<8&&(e.node.style.zIndex=2)),e.node}function Ht(e,t){var u=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(u&&(u+=" CodeMirror-linebackground"),t.background)u?t.background.className=u:(t.background.parentNode.removeChild(t.background),t.background=null);else if(u){var o=vt(t);t.background=o.insertBefore(h("div",null,u),o.firstChild),e.display.input.setUneditable(t.background)}}function Rn(e,t){var u=e.display.externalMeasured;return u&&u.line==t.line?(e.display.externalMeasured=null,t.measure=u.measure,u.built):gn(e,t)}function pn(e,t){var u=t.text.className,o=Rn(e,t);t.text==t.node&&(t.node=o.pre),t.text.parentNode.replaceChild(o.pre,t.text),t.text=o.pre,o.bgClass!=t.bgClass||o.textClass!=t.textClass?(t.bgClass=o.bgClass,t.textClass=o.textClass,Gn(e,t)):u&&(t.text.className=u)}function Gn(e,t){Ht(e,t),t.line.wrapClass?vt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var u=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=u||""}function jn(e,t,u,o){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 _=vt(t);t.gutterBackground=h("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px; width: "+o.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),_.insertBefore(t.gutterBackground,t.text)}var B=t.line.gutterMarkers;if(e.options.lineNumbers||B){var $=vt(t),ee=t.gutter=h("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ee),$.insertBefore(ee,t.text),t.line.gutterClass&&(ee.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!B||!B["CodeMirror-linenumbers"])&&(t.lineNumber=ee.appendChild(h("div",Ar(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+o.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),B)for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var he=e.display.gutterSpecs[oe].className,ke=B.hasOwnProperty(he)&&B[he];ke&&ee.appendChild(h("div",[ke],"CodeMirror-gutter-elt","left: "+o.gutterLeft[he]+"px; width: "+o.gutterWidth[he]+"px"))}}}function mr(e,t,u){t.alignable&&(t.alignable=null);for(var o=S("CodeMirror-linewidget"),_=t.node.firstChild,B=void 0;_;_=B)B=_.nextSibling,o.test(_.className)&&t.node.removeChild(_);ur(e,t,u)}function rr(e,t,u,o){var _=Rn(e,t);return t.text=t.node=_.pre,_.bgClass&&(t.bgClass=_.bgClass),_.textClass&&(t.textClass=_.textClass),Gn(e,t),jn(e,t,u,o),ur(e,t,o),t.node}function ur(e,t,u){if(Hr(e,t.line,t,u,!0),t.rest)for(var o=0;o<t.rest.length;o++)Hr(e,t.rest[o],t,u,!1)}function Hr(e,t,u,o,_){if(!t.widgets)return;for(var B=vt(u),$=0,ee=t.widgets;$<ee.length;++$){var oe=ee[$],he=h("div",[oe.node],"CodeMirror-linewidget"+(oe.className?" "+oe.className:""));oe.handleMouseEvents||he.setAttribute("cm-ignore-events","true"),Nr(oe,he,u,o),e.display.input.setUneditable(he),_&&oe.above?B.insertBefore(he,u.gutter||u.text):B.appendChild(he),mt(oe,"redraw")}}function Nr(e,t,u,o){if(e.noHScroll){(u.alignable||(u.alignable=[])).push(t);var _=o.wrapperWidth;t.style.left=o.fixedPos+"px",e.coverGutter||(_-=o.gutterTotalWidth,t.style.paddingLeft=o.gutterTotalWidth+"px"),t.style.width=_+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-o.gutterTotalWidth+"px"))}function Fr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!b(document.body,e.node)){var u="position: relative;";e.coverGutter&&(u+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(u+="width: "+t.display.wrapper.clientWidth+"px;"),f(t.display.measure,h("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function si(e,t){for(var u=Ee(t);u!=e.wrapper;u=u.parentNode)if(!u||u.nodeType==1&&u.getAttribute("cm-ignore-events")=="true"||u.parentNode==e.sizer&&u!=e.mover)return!0}function li(e){return e.lineSpace.offsetTop}function Te(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ne(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=f(e.measure,h("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return!isNaN(o.left)&&!isNaN(o.right)&&(e.cachedPaddingH=o),o}function Ge(e){return be-e.display.nativeBarWidth}function Ae(e){return e.display.scroller.clientWidth-Ge(e)-e.display.barWidth}function ue(e){return e.display.scroller.clientHeight-Ge(e)-e.display.barHeight}function ye(e,t,u){var o=e.options.lineWrapping,_=o&&Ae(e);if(!t.measure.heights||o&&t.measure.width!=_){var B=t.measure.heights=[];if(o){t.measure.width=_;for(var $=t.text.firstChild.getClientRects(),ee=0;ee<$.length-1;ee++){var oe=$[ee],he=$[ee+1];Math.abs(oe.bottom-he.bottom)>2&&B.push((oe.bottom+he.top)/2-u.top)}}B.push(u.bottom-u.top)}}function fe(e,t,u){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var o=0;o<e.rest.length;o++)if(e.rest[o]==t)return{map:e.measure.maps[o],cache:e.measure.caches[o]};for(var _=0;_<e.rest.length;_++)if(zn(e.rest[_])>u)return{map:e.measure.maps[_],cache:e.measure.caches[_],before:!0}}function De(e,t){t=et(t);var u=zn(t),o=e.display.externalMeasured=new kt(e.doc,t,u);o.lineN=u;var _=o.built=gn(e,o);return o.text=_.pre,f(e.display.lineMeasure,_.pre),o}function Pe(e,t,u,o){return nt(e,Me(e,t),u,o)}function $e(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Jr(e,t)];var u=e.display.externalMeasured;if(u&&t>=u.lineN&&t<u.lineN+u.size)return u}function Me(e,t){var u=zn(t),o=$e(e,u);o&&!o.text?o=null:o&&o.changes&&(Et(e,o,u,ar(e)),e.curOp.forceUpdate=!0),o||(o=De(e,t));var _=fe(o,t,u);return{line:t,view:o,rect:null,map:_.map,cache:_.cache,before:_.before,hasHeights:!1}}function nt(e,t,u,o,_){t.before&&(u=-1);var B=u+(o||""),$;return t.cache.hasOwnProperty(B)?$=t.cache[B]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ye(e,t.view,t.rect),t.hasHeights=!0),$=xn(e,t,u,o),$.bogus||(t.cache[B]=$)),{left:$.left,right:$.right,top:_?$.rtop:$.top,bottom:_?$.rbottom:$.bottom}}var xt={left:0,right:0,top:0,bottom:0};function It(e,t,u){for(var o,_,B,$,ee,oe,he=0;he<e.length;he+=3)if(ee=e[he],oe=e[he+1],t<ee?(_=0,B=1,$="left"):t<oe?(_=t-ee,B=_+1):(he==e.length-3||t==oe&&e[he+3]>t)&&(B=oe-ee,_=B-1,t>=oe&&($="right")),_!=null){if(o=e[he+2],ee==oe&&u==(o.insertLeft?"left":"right")&&($=u),u=="left"&&_==0)for(;he&&e[he-2]==e[he-3]&&e[he-1].insertLeft;)o=e[(he-=3)+2],$="left";if(u=="right"&&_==oe-ee)for(;he<e.length-3&&e[he+3]==e[he+4]&&!e[he+5].insertLeft;)o=e[(he+=3)+2],$="right";break}return{node:o,start:_,end:B,collapse:$,coverStart:ee,coverEnd:oe}}function Vt(e,t){var u=xt;if(t=="left")for(var o=0;o<e.length&&!((u=e[o]).left!=u.right);o++);else for(var _=e.length-1;_>=0&&!((u=e[_]).left!=u.right);_--);return u}function xn(e,t,u,o){var _=It(t.map,u,o),B=_.node,$=_.start,ee=_.end,oe=_.collapse,he;if(B.nodeType==3){for(var ke=0;ke<4;ke++){for(;$&&je(t.line.text.charAt(_.coverStart+$));)--$;for(;_.coverStart+ee<_.coverEnd&&je(t.line.text.charAt(_.coverStart+ee));)++ee;if(K&&M<9&&$==0&&ee==_.coverEnd-_.coverStart?he=B.parentNode.getBoundingClientRect():he=Vt(g(B,$,ee).getClientRects(),o),he.left||he.right||$==0)break;ee=$,$=$-1,oe="right"}K&&M<11&&(he=An(e.display.measure,he))}else{$>0&&(oe=o="right");var Fe;e.options.lineWrapping&&(Fe=B.getClientRects()).length>1?he=Fe[o=="right"?Fe.length-1:0]:he=B.getBoundingClientRect()}if(K&&M<9&&!$&&(!he||!he.left&&!he.right)){var ut=B.parentNode.getClientRects()[0];ut?he={left:ut.left,right:ut.left+Dr(e.display),top:ut.top,bottom:ut.bottom}:he=xt}for(var ot=he.top-t.rect.top,Nt=he.bottom-t.rect.top,rn=(ot+Nt)/2,wn=t.view.measure.heights,Dn=0;Dn<wn.length-1&&!(rn<wn[Dn]);Dn++);var Nn=Dn?wn[Dn-1]:0,Ln=wn[Dn],Kn={left:(oe=="right"?he.right:he.left)-t.rect.left,right:(oe=="left"?he.left:he.right)-t.rect.left,top:Nn,bottom:Ln};return!he.left&&!he.right&&(Kn.bogus=!0),e.options.singleCursorHeightPerLine||(Kn.rtop=ot,Kn.rbottom=Nt),Kn}function An(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Yn(e))return t;var u=screen.logicalXDPI/screen.deviceXDPI,o=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*u,right:t.right*u,top:t.top*o,bottom:t.bottom*o}}function qn(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 $n(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)qn(e.display.view[t])}function cr(e){$n(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function gr(){return x&&d?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ir(){return x&&d?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function hr(e){var t=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(t+=Fr(e.widgets[u]));return t}function Er(e,t,u,o,_){if(!_){var B=hr(t);u.top+=B,u.bottom+=B}if(o=="line")return u;o||(o="local");var $=cn(t);if(o=="local"?$+=li(e.display):$-=e.display.viewOffset,o=="page"||o=="window"){var ee=e.display.lineSpace.getBoundingClientRect();$+=ee.top+(o=="window"?0:ir());var oe=ee.left+(o=="window"?0:gr());u.left+=oe,u.right+=oe}return u.top+=$,u.bottom+=$,u}function Xt(e,t,u){if(u=="div")return t;var o=t.left,_=t.top;if(u=="page")o-=gr(),_-=ir();else if(u=="local"||!u){var B=e.display.sizer.getBoundingClientRect();o+=B.left,_+=B.top}var $=e.display.lineSpace.getBoundingClientRect();return{left:o-$.left,top:_-$.top}}function Mt(e,t,u,o,_){return o||(o=Qt(e.doc,t.line)),Er(e,o,Pe(e,o,t.ch,_),u)}function en(e,t,u,o,_,B){o=o||Qt(e.doc,t.line),_||(_=Me(e,o));function $(Nt,rn){var wn=nt(e,_,Nt,rn?"right":"left",B);return rn?wn.left=wn.right:wn.right=wn.left,Er(e,o,wn,u)}var ee=ln(o,e.doc.direction),oe=t.ch,he=t.sticky;if(oe>=o.text.length?(oe=o.text.length,he="before"):oe<=0&&(oe=0,he="after"),!ee)return $(he=="before"?oe-1:oe,he=="before");function ke(Nt,rn,wn){var Dn=ee[rn],Nn=Dn.level==1;return $(wn?Nt-1:Nt,Nn!=wn)}var Fe=Qe(ee,oe,he),ut=Ut,ot=ke(oe,Fe,he=="before");return ut!=null&&(ot.other=ke(oe,ut,he!="before")),ot}function Rt(e,t){var u=0;t=Fn(e.doc,t),e.options.lineWrapping||(u=Dr(e.display)*t.ch);var o=Qt(e.doc,t.line),_=cn(o)+li(e.display);return{left:u,right:u,top:_,bottom:_+o.height}}function At(e,t,u,o,_){var B=Yt(e,t,u);return B.xRel=_,o&&(B.outside=o),B}function nr(e,t,u){var o=e.doc;if(u+=e.display.viewOffset,u<0)return At(o.first,0,null,-1,-1);var _=tr(o,u),B=o.first+o.size-1;if(_>B)return At(o.first+o.size-1,Qt(o,B).text.length,null,1,1);t<0&&(t=0);for(var $=Qt(o,_);;){var ee=Xr(e,$,_,t,u),oe=Be($,ee.ch+(ee.xRel>0||ee.outside>0?1:0));if(!oe)return ee;var he=oe.find(1);if(he.line==_)return he;$=Qt(o,_=he.line)}}function xr(e,t,u,o){o-=hr(t);var _=t.text.length,B=yt(function($){return nt(e,u,$-1).bottom<=o},_,0);return _=yt(function($){return nt(e,u,$).top>o},B,_),{begin:B,end:_}}function Wn(e,t,u,o){u||(u=Me(e,t));var _=Er(e,t,nt(e,u,o),"line").top;return xr(e,t,u,_)}function Sr(e,t,u,o){return e.bottom<=u?!1:e.top>u?!0:(o?e.left:e.right)>t}function Xr(e,t,u,o,_){_-=cn(t);var B=Me(e,t),$=hr(t),ee=0,oe=t.text.length,he=!0,ke=ln(t,e.doc.direction);if(ke){var Fe=(e.options.lineWrapping?Ur:Or)(e,t,u,B,ke,o,_);he=Fe.level!=1,ee=he?Fe.from:Fe.to-1,oe=he?Fe.to:Fe.from-1}var ut=null,ot=null,Nt=yt(function(fr){var or=nt(e,B,fr);return or.top+=$,or.bottom+=$,Sr(or,o,_,!1)?(or.top<=_&&or.left<=o&&(ut=fr,ot=or),!0):!1},ee,oe),rn,wn,Dn=!1;if(ot){var Nn=o-ot.left<ot.right-o,Ln=Nn==he;Nt=ut+(Ln?0:1),wn=Ln?"after":"before",rn=Nn?ot.left:ot.right}else{!he&&(Nt==oe||Nt==ee)&&Nt++,wn=Nt==0?"after":Nt==t.text.length?"before":nt(e,B,Nt-(he?1:0)).bottom+$<=_==he?"after":"before";var Kn=en(e,Yt(u,Nt,wn),"line",t,B);rn=Kn.left,Dn=_<Kn.top?-1:_>=Kn.bottom?1:0}return Nt=ze(t.text,Nt,1),At(u,Nt,wn,Dn,o-rn)}function Or(e,t,u,o,_,B,$){var ee=yt(function(Fe){var ut=_[Fe],ot=ut.level!=1;return Sr(en(e,Yt(u,ot?ut.to:ut.from,ot?"before":"after"),"line",t,o),B,$,!0)},0,_.length-1),oe=_[ee];if(ee>0){var he=oe.level!=1,ke=en(e,Yt(u,he?oe.from:oe.to,he?"after":"before"),"line",t,o);Sr(ke,B,$,!0)&&ke.top>$&&(oe=_[ee-1])}return oe}function Ur(e,t,u,o,_,B,$){var ee=xr(e,t,o,$),oe=ee.begin,he=ee.end;/\s/.test(t.text.charAt(he-1))&&he--;for(var ke=null,Fe=null,ut=0;ut<_.length;ut++){var ot=_[ut];if(ot.from>=he||ot.to<=oe)continue;var Nt=ot.level!=1,rn=nt(e,o,Nt?Math.min(he,ot.to)-1:Math.max(oe,ot.from)).right,wn=rn<B?B-rn+1e9:rn-B;(!ke||Fe>wn)&&(ke=ot,Fe=wn)}return ke||(ke=_[_.length-1]),ke.from<oe&&(ke={from:oe,to:ke.to,level:ke.level}),ke.to>he&&(ke={from:ke.from,to:he,level:ke.level}),ke}var Mr;function Pr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Mr==null){Mr=h("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Mr.appendChild(document.createTextNode("x")),Mr.appendChild(h("br"));Mr.appendChild(document.createTextNode("x"))}f(e.measure,Mr);var u=Mr.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),E(e.measure),u||1}function Dr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=h("span","xxxxxxxxxx"),u=h("pre",[t],"CodeMirror-line-like");f(e.measure,u);var o=t.getBoundingClientRect(),_=(o.right-o.left)/10;return _>2&&(e.cachedCharWidth=_),_||10}function ar(e){for(var t=e.display,u={},o={},_=t.gutters.clientLeft,B=t.gutters.firstChild,$=0;B;B=B.nextSibling,++$){var ee=e.display.gutterSpecs[$].className;u[ee]=B.offsetLeft+B.clientLeft+_,o[ee]=B.clientWidth}return{fixedPos:ui(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:u,gutterWidth:o,wrapperWidth:t.wrapper.clientWidth}}function ui(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ji(e){var t=Pr(e.display),u=e.options.lineWrapping,o=u&&Math.max(5,e.display.scroller.clientWidth/Dr(e.display)-3);return function(_){if(Pt(e.doc,_))return 0;var B=0;if(_.widgets)for(var $=0;$<_.widgets.length;$++)_.widgets[$].height&&(B+=_.widgets[$].height);return u?B+(Math.ceil(_.text.length/o)||1)*t:B+t}}function Ii(e){var t=e.doc,u=Ji(e);t.iter(function(o){var _=u(o);_!=o.height&&Sn(o,_)})}function wi(e,t,u,o){var _=e.display;if(!u&&Ee(t).getAttribute("cm-not-content")=="true")return null;var B,$,ee=_.lineSpace.getBoundingClientRect();try{B=t.clientX-ee.left,$=t.clientY-ee.top}catch(Fe){return null}var oe=nr(e,B,$),he;if(o&&oe.xRel>0&&(he=Qt(e.doc,oe.line).text).length==oe.ch){var ke=Y(he,he.length,e.options.tabSize)-he.length;oe=Yt(oe.line,Math.max(0,Math.round((B-Ne(e.display).left)/Dr(e.display))-ke))}return oe}function Jr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var u=e.display.view,o=0;o<u.length;o++)if(t-=u[o].size,t<0)return o}function Wr(e,t,u,o){t==null&&(t=e.doc.first),u==null&&(u=e.doc.first+e.doc.size),o||(o=0);var _=e.display;if(o&&u<_.viewTo&&(_.updateLineNumbers==null||_.updateLineNumbers>t)&&(_.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=_.viewTo)yr&&_t(e.doc,t)<_.viewTo&&Qr(e);else if(u<=_.viewFrom)yr&&st(e.doc,u+o)>_.viewFrom?Qr(e):(_.viewFrom+=o,_.viewTo+=o);else if(t<=_.viewFrom&&u>=_.viewTo)Qr(e);else if(t<=_.viewFrom){var B=Ni(e,u,u+o,1);B?(_.view=_.view.slice(B.index),_.viewFrom=B.lineN,_.viewTo+=o):Qr(e)}else if(u>=_.viewTo){var $=Ni(e,t,t,-1);$?(_.view=_.view.slice(0,$.index),_.viewTo=$.lineN):Qr(e)}else{var ee=Ni(e,t,t,-1),oe=Ni(e,u,u+o,1);ee&&oe?(_.view=_.view.slice(0,ee.index).concat(sn(e,ee.lineN,oe.lineN)).concat(_.view.slice(oe.index)),_.viewTo+=o):Qr(e)}var he=_.externalMeasured;he&&(u<he.lineN?he.lineN+=o:t<he.lineN+he.size&&(_.externalMeasured=null))}function Vr(e,t,u){e.curOp.viewChanged=!0;var o=e.display,_=e.display.externalMeasured;if(_&&t>=_.lineN&&t<_.lineN+_.size&&(o.externalMeasured=null),t<o.viewFrom||t>=o.viewTo)return;var B=o.view[Jr(e,t)];if(B.node==null)return;var $=B.changes||(B.changes=[]);ce($,u)==-1&&$.push(u)}function Qr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ni(e,t,u,o){var _=Jr(e,t),B,$=e.display.view;if(!yr||u==e.doc.first+e.doc.size)return{index:_,lineN:u};for(var ee=e.display.viewFrom,oe=0;oe<_;oe++)ee+=$[oe].size;if(ee!=t){if(o>0){if(_==$.length-1)return null;B=ee+$[_].size-t,_++}else B=ee-t;t+=B,u+=B}for(;_t(e.doc,u)!=u;){if(_==(o<0?0:$.length-1))return null;u+=o*$[_-(o<0?1:0)].size,_+=o}return{index:_,lineN:u}}function ha(e,t,u){var o=e.display,_=o.view;_.length==0||t>=o.viewTo||u<=o.viewFrom?(o.view=sn(e,t,u),o.viewFrom=t):(o.viewFrom>t?o.view=sn(e,t,o.viewFrom).concat(o.view):o.viewFrom<t&&(o.view=o.view.slice(Jr(e,t))),o.viewFrom=t,o.viewTo<u?o.view=o.view.concat(sn(e,o.viewTo,u)):o.viewTo>u&&(o.view=o.view.slice(0,Jr(e,u)))),o.viewTo=u}function sa(e){for(var t=e.display.view,u=0,o=0;o<t.length;o++){var _=t[o];!_.hidden&&(!_.node||_.changes)&&++u}return u}function Kr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Qi(e,t){t===void 0&&(t=!0);for(var u=e.doc,o={},_=o.cursors=document.createDocumentFragment(),B=o.selection=document.createDocumentFragment(),$=0;$<u.sel.ranges.length;$++){if(!t&&$==u.sel.primIndex)continue;var ee=u.sel.ranges[$];if(ee.from().line>=e.display.viewTo||ee.to().line<e.display.viewFrom)continue;var oe=ee.empty();(oe||e.options.showCursorWhenSelecting)&&Zi(e,ee.head,_),oe||Br(e,ee,B)}return o}function Zi(e,t,u){var o=en(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),_=u.appendChild(h("div","\xA0","CodeMirror-cursor"));if(_.style.left=o.left+"px",_.style.top=o.top+"px",_.style.height=Math.max(0,o.bottom-o.top)*e.options.cursorHeight+"px",o.other){var B=u.appendChild(h("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));B.style.display="",B.style.left=o.other.left+"px",B.style.top=o.other.top+"px",B.style.height=(o.other.bottom-o.other.top)*.85+"px"}}function $r(e,t){return e.top-t.top||e.left-t.left}function Br(e,t,u){var o=e.display,_=e.doc,B=document.createDocumentFragment(),$=Ne(e.display),ee=$.left,oe=Math.max(o.sizerWidth,Ae(e)-o.sizer.offsetLeft)-$.right,he=_.direction=="ltr";function ke(Ln,Kn,fr,or){Kn<0&&(Kn=0),Kn=Math.round(Kn),or=Math.round(or),B.appendChild(h("div",null,"CodeMirror-selected","position: absolute; left: "+Ln+`px;
|
|
top: `+Kn+"px; width: "+(fr==null?oe-Ln:fr)+`px;
|
|
height: `+(or-Kn)+"px"))}function Fe(Ln,Kn,fr){var or=Qt(_,Ln),Rr=or.text.length,ti,ji;function gi(Di,na){return Mt(e,Yt(Ln,Di),"div",or,na)}function aa(Di,na,Gi){var Mi=Wn(e,or,null,Di),Li=na=="ltr"==(Gi=="after")?"left":"right",Ei=Gi=="after"?Mi.begin:Mi.end-(/\s/.test(or.text.charAt(Mi.end-1))?2:1);return gi(Ei,Li)[Li]}var ta=ln(or,_.direction);return Ot(ta,Kn||0,fr==null?Rr:fr,function(Di,na,Gi,Mi){var Li=Gi=="ltr",Ei=gi(Di,Li?"left":"right"),ra=gi(na-1,Li?"right":"left"),So=Kn==null&&Di==0,to=fr==null&&na==Rr,Vi=Mi==0,Pa=!ta||Mi==ta.length-1;if(ra.top-Ei.top<=3){var Fi=(he?So:to)&&Vi,ms=(he?to:So)&&Pa,Ga=Fi?ee:(Li?Ei:ra).left,lo=ms?oe:(Li?ra:Ei).right;ke(Ga,Ei.top,lo-Ga,Ei.bottom)}else{var uo,Xi,Oo,gs;Li?(uo=he&&So&&Vi?ee:Ei.left,Xi=he?oe:aa(Di,Gi,"before"),Oo=he?ee:aa(na,Gi,"after"),gs=he&&to&&Pa?oe:ra.right):(uo=he?aa(Di,Gi,"before"):ee,Xi=!he&&So&&Vi?oe:Ei.right,Oo=!he&&to&&Pa?ee:ra.left,gs=he?aa(na,Gi,"after"):oe),ke(uo,Ei.top,Xi-uo,Ei.bottom),Ei.bottom<ra.top&&ke(ee,Ei.bottom,null,ra.top),ke(Oo,ra.top,gs-Oo,ra.bottom)}(!ti||$r(Ei,ti)<0)&&(ti=Ei),$r(ra,ti)<0&&(ti=ra),(!ji||$r(Ei,ji)<0)&&(ji=Ei),$r(ra,ji)<0&&(ji=ra)}),{start:ti,end:ji}}var ut=t.from(),ot=t.to();if(ut.line==ot.line)Fe(ut.line,ut.ch,ot.ch);else{var Nt=Qt(_,ut.line),rn=Qt(_,ot.line),wn=et(Nt)==et(rn),Dn=Fe(ut.line,ut.ch,wn?Nt.text.length+1:null).end,Nn=Fe(ot.line,wn?0:null,ot.ch).start;wn&&(Dn.top<Nn.top-2?(ke(Dn.right,Dn.top,null,Dn.bottom),ke(ee,Nn.top,Nn.left,Nn.bottom)):ke(Dn.right,Dn.top,Nn.left-Dn.right,Dn.bottom)),Dn.bottom<Nn.top&&ke(ee,Dn.bottom,null,Nn.top)}u.appendChild(B)}function yi(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var u=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ta(e),t.cursorDiv.style.visibility=(u=!u)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function ka(e){e.state.focused||(e.display.input.focus(),la(e))}function no(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ta(e))},100)}function la(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(de(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),r&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),yi(e)}function Ta(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(de(e,"blur",e,t),e.state.focused=!1,y(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ca(e){for(var t=e.display,u=t.lineDiv.offsetTop,o=0;o<t.view.length;o++){var _=t.view[o],B=e.options.lineWrapping,$=void 0,ee=0;if(_.hidden)continue;if(K&&M<8){var oe=_.node.offsetTop+_.node.offsetHeight;$=oe-u,u=oe}else{var he=_.node.getBoundingClientRect();$=he.bottom-he.top,!B&&_.text.firstChild&&(ee=_.text.firstChild.getBoundingClientRect().right-he.left-1)}var ke=_.line.height-$;if((ke>.005||ke<-.005)&&(Sn(_.line,$),Sa(_.line),_.rest))for(var Fe=0;Fe<_.rest.length;Fe++)Sa(_.rest[Fe]);if(ee>e.display.sizerWidth){var ut=Math.ceil(ee/Dr(e.display));ut>e.display.maxLineLength&&(e.display.maxLineLength=ut,e.display.maxLine=_.line,e.display.maxLineChanged=!0)}}}function Sa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var u=e.widgets[t],o=u.node.parentNode;o&&(u.height=o.offsetHeight)}}function Ma(e,t,u){var o=u&&u.top!=null?Math.max(0,u.top):e.scroller.scrollTop;o=Math.floor(o-li(e));var _=u&&u.bottom!=null?u.bottom:o+e.wrapper.clientHeight,B=tr(t,o),$=tr(t,_);if(u&&u.ensure){var ee=u.ensure.from.line,oe=u.ensure.to.line;ee<B?(B=ee,$=tr(t,cn(Qt(t,ee))+e.wrapper.clientHeight)):Math.min(oe,t.lastLine())>=$&&(B=tr(t,cn(Qt(t,oe))-e.wrapper.clientHeight),$=oe)}return{from:B,to:Math.max($,B+1)}}function co(e,t){if(q(e,"scrollCursorIntoView"))return;var u=e.display,o=u.sizer.getBoundingClientRect(),_=null;if(t.top+o.top<0?_=!0:t.bottom+o.top>(window.innerHeight||document.documentElement.clientHeight)&&(_=!1),_!=null&&!a){var B=h("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-u.viewOffset-li(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Ge(e)+u.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(B),B.scrollIntoView(_),e.display.lineSpace.removeChild(B)}}function Ro(e,t,u,o){o==null&&(o=0);var _;!e.options.lineWrapping&&t==u&&(t=t.ch?Yt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,u=t.sticky=="before"?Yt(t.line,t.ch+1,"before"):t);for(var B=0;B<5;B++){var $=!1,ee=en(e,t),oe=!u||u==t?ee:en(e,u);_={left:Math.min(ee.left,oe.left),top:Math.min(ee.top,oe.top)-o,right:Math.max(ee.left,oe.left),bottom:Math.max(ee.bottom,oe.bottom)+o};var he=Oa(e,_),ke=e.doc.scrollTop,Fe=e.doc.scrollLeft;if(he.scrollTop!=null&&(Da(e,he.scrollTop),Math.abs(e.doc.scrollTop-ke)>1&&($=!0)),he.scrollLeft!=null&&(ki(e,he.scrollLeft),Math.abs(e.doc.scrollLeft-Fe)>1&&($=!0)),!$)break}return _}function za(e,t){var u=Oa(e,t);u.scrollTop!=null&&Da(e,u.scrollTop),u.scrollLeft!=null&&ki(e,u.scrollLeft)}function Oa(e,t){var u=e.display,o=Pr(e.display);t.top<0&&(t.top=0);var _=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,B=ue(e),$={};t.bottom-t.top>B&&(t.bottom=t.top+B);var ee=e.doc.height+Te(u),oe=t.top<o,he=t.bottom>ee-o;if(t.top<_)$.scrollTop=oe?0:t.top;else if(t.bottom>_+B){var ke=Math.min(t.top,(he?ee:t.bottom)-B);ke!=_&&($.scrollTop=ke)}var Fe=e.options.fixedGutter?0:u.gutters.offsetWidth,ut=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-Fe,ot=Ae(e)-u.gutters.offsetWidth,Nt=t.right-t.left>ot;return Nt&&(t.right=t.left+ot),t.left<10?$.scrollLeft=0:t.left<ut?$.scrollLeft=Math.max(0,t.left+Fe-(Nt?0:10)):t.right>ot+ut-3&&($.scrollLeft=t.right+(Nt?0:10)-ot),$}function Va(e,t){if(t==null)return;Ya(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function _a(e){Ya(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ra(e,t,u){(t!=null||u!=null)&&Ya(e),t!=null&&(e.curOp.scrollLeft=t),u!=null&&(e.curOp.scrollTop=u)}function ho(e,t){Ya(e),e.curOp.scrollToPos=t}function Ya(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var u=Rt(e,t.from),o=Rt(e,t.to);Aa(e,u,o,t.margin)}}function Aa(e,t,u,o){var _=Oa(e,{left:Math.min(t.left,u.left),top:Math.min(t.top,u.top)-o,right:Math.max(t.right,u.right),bottom:Math.max(t.bottom,u.bottom)+o});Ra(e,_.scrollLeft,_.scrollTop)}function Da(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;I||Ua(e,{top:t}),ya(e,t,!0),I&&Ua(e),Na(e,100)}function ya(e,t,u){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!u)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ki(e,t,u,o){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(u?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!o)return;e.doc.scrollLeft=t,Cr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function fa(e){var t=e.display,u=t.gutters.offsetWidth,o=Math.round(e.doc.height+Te(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?u:0,docHeight:o,scrollHeight:o+Ge(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:u}}var pa=function(e,t,u){this.cm=u;var o=this.vert=h("div",[h("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),_=this.horiz=h("div",[h("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");o.tabIndex=_.tabIndex=-1,e(o),e(_),He(o,"scroll",function(){o.clientHeight&&t(o.scrollTop,"vertical")}),He(_,"scroll",function(){_.clientWidth&&t(_.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&M<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};pa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,u=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;if(u){this.vert.style.display="block",this.vert.style.bottom=t?o+"px":"0";var _=e.viewHeight-(t?o:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+_)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=u?o+"px":"0",this.horiz.style.left=e.barLeft+"px";var B=e.viewWidth-e.barLeft-(u?o: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&&(o==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:u?o:0,bottom:t?o:0}},pa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},pa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},pa.prototype.zeroWidthHack=function(){var e=i&&!c?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Z,this.disableVert=new Z},pa.prototype.enableZeroWidthBar=function(e,t,u){e.style.pointerEvents="auto";function o(){var _=e.getBoundingClientRect(),B=u=="vert"?document.elementFromPoint(_.right-1,(_.top+_.bottom)/2):document.elementFromPoint((_.right+_.left)/2,_.bottom-1);B!=e?e.style.pointerEvents="none":t.set(1e3,o)}t.set(1e3,o)},pa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ba=function(){};ba.prototype.update=function(){return{bottom:0,right:0}},ba.prototype.setScrollLeft=function(){},ba.prototype.setScrollTop=function(){},ba.prototype.clear=function(){};function ma(e,t){t||(t=fa(e));var u=e.display.barWidth,o=e.display.barHeight;Xa(e,t);for(var _=0;_<4&&u!=e.display.barWidth||o!=e.display.barHeight;_++)u!=e.display.barWidth&&e.options.lineWrapping&&Ca(e),Xa(e,fa(e)),u=e.display.barWidth,o=e.display.barHeight}function Xa(e,t){var u=e.display,o=u.scrollbars.update(t);u.sizer.style.paddingRight=(u.barWidth=o.right)+"px",u.sizer.style.paddingBottom=(u.barHeight=o.bottom)+"px",u.heightForcer.style.borderBottom=o.bottom+"px solid transparent",o.right&&o.bottom?(u.scrollbarFiller.style.display="block",u.scrollbarFiller.style.height=o.bottom+"px",u.scrollbarFiller.style.width=o.right+"px"):u.scrollbarFiller.style.display="",o.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(u.gutterFiller.style.display="block",u.gutterFiller.style.height=o.bottom+"px",u.gutterFiller.style.width=t.gutterWidth+"px"):u.gutterFiller.style.display=""}var $a={native:pa,null:ba};function Ja(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&y(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new $a[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),He(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,u){u=="horizontal"?ki(e,t):Da(e,t)},e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var Ia=0;function ua(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:++Ia},$t(e.curOp)}function Ea(e){var t=e.curOp;t&&un(t,function(u){for(var o=0;o<u.ops.length;o++)u.ops[o].cm.curOp=null;ro(u)})}function ro(e){for(var t=e.ops,u=0;u<t.length;u++)Ao(t[u]);for(var o=0;o<t.length;o++)Do(t[o]);for(var _=0;_<t.length;_++)fo(t[_]);for(var B=0;B<t.length;B++)io(t[B]);for(var $=0;$<t.length;$++)po(t[$])}function Ao(e){var t=e.cm,u=t.display;ao(t),e.updateMaxLine&&an(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<u.viewFrom||e.scrollToPos.to.line>=u.viewTo)||u.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new qi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Do(e){e.updatedDisplay=e.mustUpdate&&xa(e.cm,e.update)}function fo(e){var t=e.cm,u=t.display;e.updatedDisplay&&Ca(t),e.barMeasure=fa(t),u.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Pe(t,u.maxLine,u.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(u.scroller.clientWidth,u.sizer.offsetLeft+e.adjustWidthTo+Ge(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-Ae(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.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&&ki(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var u=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ma(t,e.barMeasure),e.updatedDisplay&&jr(t,e.barMeasure),e.selectionChanged&&yi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),u&&ka(e.cm)}function po(e){var t=e.cm,u=t.display,o=t.doc;if(e.updatedDisplay&&Qa(t,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&ya(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ki(t,e.scrollLeft,!0,!0),e.scrollToPos){var _=Ro(t,Fn(o,e.scrollToPos.from),Fn(o,e.scrollToPos.to),e.scrollToPos.margin);co(t,_)}var B=e.maybeHiddenMarkers,$=e.maybeUnhiddenMarkers;if(B)for(var ee=0;ee<B.length;++ee)B[ee].lines.length||de(B[ee],"hide");if($)for(var oe=0;oe<$.length;++oe)$[oe].lines.length&&de($[oe],"unhide");u.wrapper.offsetHeight&&(o.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&de(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Wi(e,t){if(e.curOp)return t();ua(e);try{return t()}finally{Ea(e)}}function di(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ua(e);try{return t.apply(e,arguments)}finally{Ea(e)}}}function Ri(e){return function(){if(this.curOp)return e.apply(this,arguments);ua(this);try{return e.apply(this,arguments)}finally{Ea(this)}}}function hi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ua(t);try{return e.apply(this,arguments)}finally{Ea(t)}}}function Na(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,U(mo,e))}function mo(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var u=+new Date+e.options.workTime,o=ni(e,t.highlightFrontier),_=[];t.iter(o.line,Math.min(t.first+t.size,e.display.viewTo+500),function(B){if(o.line>=e.display.viewFrom){var $=B.styles,ee=B.text.length>e.options.maxHighlightLength?yn(t.mode,o.state):null,oe=xi(e,B,o,!0);ee&&(o.state=ee),B.styles=oe.styles;var he=B.styleClasses,ke=oe.classes;ke?B.styleClasses=ke:he&&(B.styleClasses=null);for(var Fe=!$||$.length!=B.styles.length||he!=ke&&(!he||!ke||he.bgClass!=ke.bgClass||he.textClass!=ke.textClass),ut=0;!Fe&&ut<$.length;++ut)Fe=$[ut]!=B.styles[ut];Fe&&_.push(o.line),B.stateAfter=o.save(),o.nextLine()}else B.text.length<=e.options.maxHighlightLength&&Bi(e,B.text,o),B.stateAfter=o.line%5==0?o.save():null,o.nextLine();if(+new Date>u)return Na(e,e.options.workDelay),!0}),t.highlightFrontier=o.line,t.modeFrontier=Math.max(t.modeFrontier,o.line),_.length&&Wi(e,function(){for(var B=0;B<_.length;B++)Vr(e,_[B],"text")})}var qi=function(e,t,u){var o=e.display;this.viewport=t,this.visible=Ma(o,e.doc,t),this.editorIsHidden=!o.wrapper.offsetWidth,this.wrapperHeight=o.wrapper.clientHeight,this.wrapperWidth=o.wrapper.clientWidth,this.oldDisplayWidth=Ae(e),this.force=u,this.dims=ar(e),this.events=[]};qi.prototype.signal=function(e,t){se(e,t)&&this.events.push(arguments)},qi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)de.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=Ge(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ge(e)+"px",t.scrollbarsClipped=!0)}function oo(e){if(e.hasFocus())return null;var t=N();if(!t||!b(e.display.lineDiv,t))return null;var u={activeElt:t};if(window.getSelection){var o=window.getSelection();o.anchorNode&&o.extend&&b(e.display.lineDiv,o.anchorNode)&&(u.anchorNode=o.anchorNode,u.anchorOffset=o.anchorOffset,u.focusNode=o.focusNode,u.focusOffset=o.focusOffset)}return u}function so(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&b(document.body,e.anchorNode)&&b(document.body,e.focusNode)){var t=window.getSelection(),u=document.createRange();u.setEnd(e.anchorNode,e.anchorOffset),u.collapse(!1),t.removeAllRanges(),t.addRange(u),t.extend(e.focusNode,e.focusOffset)}}function xa(e,t){var u=e.display,o=e.doc;if(t.editorIsHidden)return Qr(e),!1;if(!t.force&&t.visible.from>=u.viewFrom&&t.visible.to<=u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo)&&u.renderedView==u.view&&sa(e)==0)return!1;ii(e)&&(Qr(e),t.dims=ar(e));var _=o.first+o.size,B=Math.max(t.visible.from-e.options.viewportMargin,o.first),$=Math.min(_,t.visible.to+e.options.viewportMargin);u.viewFrom<B&&B-u.viewFrom<20&&(B=Math.max(o.first,u.viewFrom)),u.viewTo>$&&u.viewTo-$<20&&($=Math.min(_,u.viewTo)),yr&&(B=_t(e.doc,B),$=st(e.doc,$));var ee=B!=u.viewFrom||$!=u.viewTo||u.lastWrapHeight!=t.wrapperHeight||u.lastWrapWidth!=t.wrapperWidth;ha(e,B,$),u.viewOffset=cn(Qt(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var oe=sa(e);if(!ee&&oe==0&&!t.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var he=oo(e);return oe>4&&(u.lineDiv.style.display="none"),go(e,u.updateLineNumbers,t.dims),oe>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,so(he),E(u.cursorDiv),E(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,ee&&(u.lastWrapHeight=t.wrapperHeight,u.lastWrapWidth=t.wrapperWidth,Na(e,400)),u.updateLineNumbers=null,!0}function Qa(e,t){for(var u=t.viewport,o=!0;;o=!1){if(!o||!e.options.lineWrapping||t.oldDisplayWidth==Ae(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+Te(e.display)-ue(e),u.top)}),t.visible=Ma(e.display,e.doc,u),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else o&&(t.visible=Ma(e.display,e.doc,u));if(!xa(e,t))break;Ca(e);var _=fa(e);Kr(e),ma(e,_),jr(e,_),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 Ua(e,t){var u=new qi(e,t);if(xa(e,u)){Ca(e),Qa(e,u);var o=fa(e);Kr(e),ma(e,o),jr(e,o),u.finish()}}function go(e,t,u){var o=e.display,_=e.options.lineNumbers,B=o.lineDiv,$=B.firstChild;function ee(Nt){var rn=Nt.nextSibling;return r&&i&&e.display.currentWheelTarget==Nt?Nt.style.display="none":Nt.parentNode.removeChild(Nt),rn}for(var oe=o.view,he=o.viewFrom,ke=0;ke<oe.length;ke++){var Fe=oe[ke];if(!Fe.hidden)if(!Fe.node||Fe.node.parentNode!=B){var ut=rr(e,Fe,he,u);B.insertBefore(ut,$)}else{for(;$!=Fe.node;)$=ee($);var ot=_&&t!=null&&t<=he&&Fe.lineNumber;Fe.changes&&(ce(Fe.changes,"gutter")>-1&&(ot=!1),Et(e,Fe,he,u)),ot&&(E(Fe.lineNumber),Fe.lineNumber.appendChild(document.createTextNode(Ar(e.options,he)))),$=Fe.node.nextSibling}he+=Fe.size}for(;$;)$=ee($)}function Za(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function jr(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+Ge(e)+"px"}function Cr(e){var t=e.display,u=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var o=ui(t)-t.scroller.scrollLeft+e.doc.scrollLeft,_=t.gutters.offsetWidth,B=o+"px",$=0;$<u.length;$++)if(!u[$].hidden){e.options.fixedGutter&&(u[$].gutter&&(u[$].gutter.style.left=B),u[$].gutterBackground&&(u[$].gutterBackground.style.left=B));var ee=u[$].alignable;if(ee)for(var oe=0;oe<ee.length;oe++)ee[oe].style.left=B}e.options.fixedGutter&&(t.gutters.style.left=o+_+"px")}function ii(e){if(!e.options.lineNumbers)return!1;var t=e.doc,u=Ar(e.options,t.first+t.size-1),o=e.display;if(u.length!=o.lineNumChars){var _=o.measure.appendChild(h("div",[h("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),B=_.firstChild.offsetWidth,$=_.offsetWidth-B;return o.lineGutter.style.width="",o.lineNumInnerWidth=Math.max(B,o.lineGutter.offsetWidth-$)+1,o.lineNumWidth=o.lineNumInnerWidth+$,o.lineNumChars=o.lineNumInnerWidth?u.length:-1,o.lineGutter.style.width=o.lineNumWidth+"px",Za(e.display),!0}return!1}function Ui(e,t){for(var u=[],o=!1,_=0;_<e.length;_++){var B=e[_],$=null;if(typeof B!="string"&&($=B.style,B=B.className),B=="CodeMirror-linenumbers")if(t)o=!0;else continue;u.push({className:B,style:$})}return t&&!o&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function La(e){var t=e.gutters,u=e.gutterSpecs;E(t),e.lineGutter=null;for(var o=0;o<u.length;++o){var _=u[o],B=_.className,$=_.style,ee=t.appendChild(h("div",null,"CodeMirror-gutter "+B));$&&(ee.style.cssText=$),B=="CodeMirror-linenumbers"&&(e.lineGutter=ee,ee.style.width=(e.lineNumWidth||1)+"px")}t.style.display=u.length?"":"none",Za(e)}function ca(e){La(e.display),Wr(e),Cr(e)}function ja(e,t,u,o){var _=this;this.input=u,_.scrollbarFiller=h("div",null,"CodeMirror-scrollbar-filler"),_.scrollbarFiller.setAttribute("cm-not-content","true"),_.gutterFiller=h("div",null,"CodeMirror-gutter-filler"),_.gutterFiller.setAttribute("cm-not-content","true"),_.lineDiv=v("div",null,"CodeMirror-code"),_.selectionDiv=h("div",null,null,"position: relative; z-index: 1"),_.cursorDiv=h("div",null,"CodeMirror-cursors"),_.measure=h("div",null,"CodeMirror-measure"),_.lineMeasure=h("div",null,"CodeMirror-measure"),_.lineSpace=v("div",[_.measure,_.lineMeasure,_.selectionDiv,_.cursorDiv,_.lineDiv],null,"position: relative; outline: none");var B=v("div",[_.lineSpace],"CodeMirror-lines");_.mover=h("div",[B],null,"position: relative"),_.sizer=h("div",[_.mover],"CodeMirror-sizer"),_.sizerWidth=null,_.heightForcer=h("div",null,null,"position: absolute; height: "+be+"px; width: 1px;"),_.gutters=h("div",null,"CodeMirror-gutters"),_.lineGutter=null,_.scroller=h("div",[_.sizer,_.heightForcer,_.gutters],"CodeMirror-scroll"),_.scroller.setAttribute("tabIndex","-1"),_.wrapper=h("div",[_.scrollbarFiller,_.gutterFiller,_.scroller],"CodeMirror"),K&&M<8&&(_.gutters.style.zIndex=-1,_.scroller.style.paddingRight=0),!r&&!(I&&l)&&(_.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(_.wrapper):e(_.wrapper)),_.viewFrom=_.viewTo=t.first,_.reportedViewFrom=_.reportedViewTo=t.first,_.view=[],_.renderedView=null,_.externalMeasured=null,_.viewOffset=0,_.lastWrapHeight=_.lastWrapWidth=0,_.updateLineNumbers=null,_.nativeBarWidth=_.barHeight=_.barWidth=0,_.scrollbarsClipped=!1,_.lineNumWidth=_.lineNumInnerWidth=_.lineNumChars=null,_.alignWidgets=!1,_.cachedCharWidth=_.cachedTextHeight=_.cachedPaddingH=null,_.maxLine=null,_.maxLineLength=0,_.maxLineChanged=!1,_.wheelDX=_.wheelDY=_.wheelStartX=_.wheelStartY=null,_.shift=!1,_.selForContextMenu=null,_.activeTouch=null,_.gutterSpecs=Ui(o.gutters,o.lineNumbers),La(_),u.init(_)}var da=0,bi=null;K?bi=-.53:I?bi=15:x?bi=-.7:m&&(bi=-1/3);function Fa(e){var t=e.wheelDeltaX,u=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),u==null&&e.detail&&e.axis==e.VERTICAL_AXIS?u=e.detail:u==null&&(u=e.wheelDelta),{x:t,y:u}}function Ba(e){var t=Fa(e);return t.x*=bi,t.y*=bi,t}function Ha(e,t){var u=Fa(t),o=u.x,_=u.y,B=e.display,$=B.scroller,ee=$.scrollWidth>$.clientWidth,oe=$.scrollHeight>$.clientHeight;if(!(o&&ee||_&&oe))return;if(_&&i&&r){e:for(var he=t.target,ke=B.view;he!=$;he=he.parentNode)for(var Fe=0;Fe<ke.length;Fe++)if(ke[Fe].node==he){e.display.currentWheelTarget=he;break e}}if(o&&!I&&!p&&bi!=null){_&&oe&&Da(e,Math.max(0,$.scrollTop+_*bi)),ki(e,Math.max(0,$.scrollLeft+o*bi)),(!_||_&&oe)&&ae(t),B.wheelStartX=null;return}if(_&&bi!=null){var ut=_*bi,ot=e.doc.scrollTop,Nt=ot+B.wrapper.clientHeight;ut<0?ot=Math.max(0,ot+ut-50):Nt=Math.min(e.doc.height,Nt+ut+50),Ua(e,{top:ot,bottom:Nt})}da<20&&(B.wheelStartX==null?(B.wheelStartX=$.scrollLeft,B.wheelStartY=$.scrollTop,B.wheelDX=o,B.wheelDY=_,setTimeout(function(){if(B.wheelStartX==null)return;var rn=$.scrollLeft-B.wheelStartX,wn=$.scrollTop-B.wheelStartY,Dn=wn&&B.wheelDY&&wn/B.wheelDY||rn&&B.wheelDX&&rn/B.wheelDX;if(B.wheelStartX=B.wheelStartY=null,!Dn)return;bi=(bi*da+Dn)/(da+1),++da},200)):(B.wheelDX+=o,B.wheelDY+=_))}var Ki=function(e,t){this.ranges=e,this.primIndex=t};Ki.prototype.primary=function(){return this.ranges[this.primIndex]},Ki.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 u=this.ranges[t],o=e.ranges[t];if(!vi(u.anchor,o.anchor)||!vi(u.head,o.head))return!1}return!0},Ki.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ir(Pi(this.ranges[t].anchor),Pi(this.ranges[t].head));return new Ki(e,this.primIndex)},Ki.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ki.prototype.contains=function(e,t){t||(t=e);for(var u=0;u<this.ranges.length;u++){var o=this.ranges[u];if(Vn(t,o.from())>=0&&Vn(e,o.to())<=0)return u}return-1};var Ir=function(e,t){this.anchor=e,this.head=t};Ir.prototype.from=function(){return Yr(this.anchor,this.head)},Ir.prototype.to=function(){return ai(this.anchor,this.head)},Ir.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function pr(e,t,u){var o=e&&e.options.selectionsMayTouch,_=t[u];t.sort(function(ut,ot){return Vn(ut.from(),ot.from())}),u=ce(t,_);for(var B=1;B<t.length;B++){var $=t[B],ee=t[B-1],oe=Vn(ee.to(),$.from());if(o&&!$.empty()?oe>0:oe>=0){var he=Yr(ee.from(),$.from()),ke=ai(ee.to(),$.to()),Fe=ee.empty()?$.from()==$.head:ee.from()==ee.head;B<=u&&--u,t.splice(--B,2,new Ir(Fe?ke:he,Fe?he:ke))}}return new Ki(t,u)}function Pn(e,t){return new Ki([new Ir(e,t||e)],0)}function Jn(e){return e.text?Yt(e.from.line+e.text.length-1,j(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Tr(e,t){if(Vn(e,t.from)<0)return e;if(Vn(e,t.to)<=0)return Jn(t);var u=e.line+t.text.length-(t.to.line-t.from.line)-1,o=e.ch;return e.line==t.to.line&&(o+=Jn(t).ch-t.to.ch),Yt(u,o)}function ei(e,t){for(var u=[],o=0;o<e.sel.ranges.length;o++){var _=e.sel.ranges[o];u.push(new Ir(Tr(_.anchor,t),Tr(_.head,t)))}return pr(e.cm,u,e.sel.primIndex)}function ga(e,t,u){return e.line==t.line?Yt(u.line,e.ch-t.ch+u.ch):Yt(u.line+(e.line-t.line),e.ch)}function ia(e,t,u){for(var o=[],_=Yt(e.first,0),B=_,$=0;$<t.length;$++){var ee=t[$],oe=ga(ee.from,_,B),he=ga(Jn(ee),_,B);if(_=ee.to,B=he,u=="around"){var ke=e.sel.ranges[$],Fe=Vn(ke.head,ke.anchor)<0;o[$]=new Ir(Fe?he:oe,Fe?oe:he)}else o[$]=new Ir(oe,oe)}return new Ki(o,e.sel.primIndex)}function Ai(e){e.doc.mode=Ft(e.options,e.doc.modeOption),Yi(e)}function Yi(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,Na(e,100),e.state.modeGen++,e.curOp&&Wr(e)}function va(e,t){return t.from.ch==0&&t.to.ch==0&&j(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Wa(e,t,u,o){function _(Nn){return u?u[Nn]:null}function B(Nn,Ln,Kn){hn(Nn,Ln,Kn,o),mt(Nn,"change",Nn,t)}function $(Nn,Ln){for(var Kn=[],fr=Nn;fr<Ln;++fr)Kn.push(new mn(he[fr],_(fr),o));return Kn}var ee=t.from,oe=t.to,he=t.text,ke=Qt(e,ee.line),Fe=Qt(e,oe.line),ut=j(he),ot=_(he.length-1),Nt=oe.line-ee.line;if(t.full)e.insert(0,$(0,he.length)),e.remove(he.length,e.size-he.length);else if(va(e,t)){var rn=$(0,he.length-1);B(Fe,Fe.text,ot),Nt&&e.remove(ee.line,Nt),rn.length&&e.insert(ee.line,rn)}else if(ke==Fe)if(he.length==1)B(ke,ke.text.slice(0,ee.ch)+ut+ke.text.slice(oe.ch),ot);else{var wn=$(1,he.length-1);wn.push(new mn(ut+ke.text.slice(oe.ch),ot,o)),B(ke,ke.text.slice(0,ee.ch)+he[0],_(0)),e.insert(ee.line+1,wn)}else if(he.length==1)B(ke,ke.text.slice(0,ee.ch)+he[0]+Fe.text.slice(oe.ch),_(0)),e.remove(ee.line+1,Nt);else{B(ke,ke.text.slice(0,ee.ch)+he[0],_(0)),B(Fe,ut+Fe.text.slice(oe.ch),ot);var Dn=$(1,he.length-1);Nt>1&&e.remove(ee.line+1,Nt-1),e.insert(ee.line+1,Dn)}mt(e,"change",e,t)}function Ti(e,t,u){function o(_,B,$){if(_.linked)for(var ee=0;ee<_.linked.length;++ee){var oe=_.linked[ee];if(oe.doc==B)continue;var he=$&&oe.sharedHist;if(u&&!he)continue;t(oe.doc,he),o(oe.doc,_,he)}}o(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ii(e),Ai(e),_s(e),e.options.lineWrapping||an(e),e.options.mode=t.modeOption,Wr(e)}function _s(e){(e.doc.direction=="rtl"?H:y)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Wi(e,function(){_s(e),Wr(e)})}function Go(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 rs(e,t){var u={from:Pi(t.from),to:Jn(t),text:Hn(e,t.from,t.to)};return Es(e,u,t.from.line,t.to.line+1),Ti(e,function(o){return Es(o,u,t.from.line,t.to.line+1)},!0),u}function ys(e){for(;e.length;){var t=j(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ys(e.done),j(e.done);if(e.done.length&&!j(e.done).ranges)return j(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),j(e.done)}function bs(e,t,u,o){var _=e.history;_.undone.length=0;var B=+new Date,$,ee;if((_.lastOp==o||_.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&_.lastModTime>B-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(_,_.lastOp==o)))ee=j($.changes),Vn(t.from,t.to)==0&&Vn(t.from,ee.to)==0?ee.to=Jn(t):$.changes.push(rs(e,t));else{var oe=j(_.done);for((!oe||!oe.ranges)&&zo(e.sel,_.done),$={changes:[rs(e,t)],generation:_.generation},_.done.push($);_.done.length>_.undoDepth;)_.done.shift(),_.done[0].ranges||_.done.shift()}_.done.push(u),_.generation=++_.maxGeneration,_.lastModTime=_.lastSelTime=B,_.lastOp=_.lastSelOp=o,_.lastOrigin=_.lastSelOrigin=t.origin,ee||de(e,"historyAdded")}function ml(e,t,u,o){var _=t.charAt(0);return _=="*"||_=="+"&&u.ranges.length==o.ranges.length&&u.somethingSelected()==o.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,u,o){var _=e.history,B=o&&o.origin;u==_.lastSelOp||B&&_.lastSelOrigin==B&&(_.lastModTime==_.lastSelTime&&_.lastOrigin==B||ml(e,B,j(_.done),t))?_.done[_.done.length-1]=t:zo(t,_.done),_.lastSelTime=+new Date,_.lastSelOrigin=B,_.lastSelOp=u,o&&o.clearRedo!==!1&&ys(_.undone)}function zo(e,t){var u=j(t);u&&u.ranges&&u.equals(e)||t.push(e)}function Es(e,t,u,o){var _=t["spans_"+e.id],B=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,o),function($){$.markedSpans&&((_||(_=t["spans_"+e.id]={}))[B]=$.markedSpans),++B})}function vl(e){if(!e)return null;for(var t,u=0;u<e.length;++u)e[u].marker.explicitlyCleared?t||(t=e.slice(0,u)):t&&t.push(e[u]);return t?t.length?t:null:e}function _l(e,t){var u=t["spans_"+e.id];if(!u)return null;for(var o=[],_=0;_<t.text.length;++_)o.push(vl(u[_]));return o}function xs(e,t){var u=_l(e,t),o=Qn(e,t);if(!u)return o;if(!o)return u;for(var _=0;_<u.length;++_){var B=u[_],$=o[_];if(B&&$){e:for(var ee=0;ee<$.length;++ee){for(var oe=$[ee],he=0;he<B.length;++he)if(B[he].marker==oe.marker)continue e;B.push(oe)}}else $&&(u[_]=$)}return u}function vo(e,t,u){for(var o=[],_=0;_<e.length;++_){var B=e[_];if(B.ranges){o.push(u?Ki.prototype.deepCopy.call(B):B);continue}var $=B.changes,ee=[];o.push({changes:ee});for(var oe=0;oe<$.length;++oe){var he=$[oe],ke=void 0;if(ee.push({from:he.from,to:he.to,text:he.text}),t)for(var Fe in he)(ke=Fe.match(/^spans_(\d+)$/))&&(ce(t,Number(ke[1]))>-1&&(j(ee)[Fe]=he[Fe],delete he[Fe]))}}return o}function is(e,t,u,o){if(o){var _=e.anchor;if(u){var B=Vn(t,_)<0;B!=Vn(u,_)<0?(_=t,t=u):B!=Vn(t,u)<0&&(t=u)}return new Ir(_,t)}else return new Ir(u||t,t)}function Vo(e,t,u,o,_){_==null&&(_=e.cm&&(e.cm.display.shift||e.extend)),zi(e,new Ki([is(e.sel.primary(),t,u,_)],0),o)}function ws(e,t,u){for(var o=[],_=e.cm&&(e.cm.display.shift||e.extend),B=0;B<e.sel.ranges.length;B++)o[B]=is(e.sel.ranges[B],t[B],null,_);var $=pr(e.cm,o,e.sel.primIndex);zi(e,$,u)}function as(e,t,u,o){var _=e.sel.ranges.slice(0);_[t]=u,zi(e,pr(e.cm,_,e.sel.primIndex),o)}function Ts(e,t,u,o){zi(e,Pn(t,u),o)}function yl(e,t,u){var o={ranges:t.ranges,update:function(_){this.ranges=[];for(var B=0;B<_.length;B++)this.ranges[B]=new Ir(Fn(e,_[B].anchor),Fn(e,_[B].head))},origin:u&&u.origin};return de(e,"beforeSelectionChange",e,o),e.cm&&de(e.cm,"beforeSelectionChange",e.cm,o),o.ranges!=t.ranges?pr(e.cm,o.ranges,o.ranges.length-1):t}function Cs(e,t,u){var o=e.history.done,_=j(o);_&&_.ranges?(o[o.length-1]=t,Yo(e,t,u)):zi(e,t,u)}function zi(e,t,u){Yo(e,t,u),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function Yo(e,t,u){(se(e,"beforeSelectionChange")||e.cm&&se(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,u));var o=u&&u.bias||(Vn(t.primary().head,e.sel.primary().head)<0?-1:1);Ss(e,Rs(e,t,o,!0)),!(u&&u.scroll===!1)&&e.cm&&_a(e.cm)}function Ss(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,te(e.cm)),mt(e,"cursorActivity",e)}function Os(e){Ss(e,Rs(e,e.sel,null,!1))}function Rs(e,t,u,o){for(var _,B=0;B<t.ranges.length;B++){var $=t.ranges[B],ee=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[B],oe=Xo(e,$.anchor,ee&&ee.anchor,u,o),he=Xo(e,$.head,ee&&ee.head,u,o);(_||oe!=$.anchor||he!=$.head)&&(_||(_=t.ranges.slice(0,B)),_[B]=new Ir(oe,he))}return _?pr(e.cm,_,t.primIndex):t}function _o(e,t,u,o,_){var B=Qt(e,t.line);if(B.markedSpans)for(var $=0;$<B.markedSpans.length;++$){var ee=B.markedSpans[$],oe=ee.marker,he="selectLeft"in oe?!oe.selectLeft:oe.inclusiveLeft,ke="selectRight"in oe?!oe.selectRight:oe.inclusiveRight;if((ee.from==null||(he?ee.from<=t.ch:ee.from<t.ch))&&(ee.to==null||(ke?ee.to>=t.ch:ee.to>t.ch))){if(_&&(de(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(B.markedSpans){--$;continue}else break;if(!oe.atomic)continue;if(u){var Fe=oe.find(o<0?1:-1),ut=void 0;if((o<0?ke:he)&&(Fe=As(e,Fe,-o,Fe&&Fe.line==t.line?B:null)),Fe&&Fe.line==t.line&&(ut=Vn(Fe,u))&&(o<0?ut<0:ut>0))return _o(e,Fe,t,o,_)}var ot=oe.find(o<0?-1:1);return(o<0?he:ke)&&(ot=As(e,ot,o,ot.line==t.line?B:null)),ot?_o(e,ot,t,o,_):null}}return t}function Xo(e,t,u,o,_){var B=o||1,$=_o(e,t,u,B,_)||!_&&_o(e,t,u,B,!0)||_o(e,t,u,-B,_)||!_&&_o(e,t,u,-B,!0);return $||(e.cantEdit=!0,Yt(e.first,0))}function As(e,t,u,o){return u<0&&t.ch==0?t.line>e.first?Fn(e,Yt(t.line-1)):null:u>0&&t.ch==(o||Qt(e,t.line)).text.length?t.line<e.first+e.size-1?Yt(t.line+1,0):null:new Yt(t.line,t.ch+u)}function Ds(e){e.setSelection(Yt(e.firstLine(),0),Yt(e.lastLine()),Ce)}function Ls(e,t,u){var o={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return o.canceled=!0}};return u&&(o.update=function(_,B,$,ee){_&&(o.from=Fn(e,_)),B&&(o.to=Fn(e,B)),$&&(o.text=$),ee!==void 0&&(o.origin=ee)}),de(e,"beforeChange",e,o),e.cm&&de(e.cm,"beforeChange",e.cm,o),o.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:o.from,to:o.to,text:o.text,origin:o.origin}}function yo(e,t,u){if(e.cm){if(!e.cm.curOp)return di(e.cm,yo)(e,t,u);if(e.cm.state.suppressEdits)return}if((se(e,"beforeChange")||e.cm&&se(e.cm,"beforeChange"))&&(t=Ls(e,t,!0),!t))return;var o=$i&&!u&&ge(e,t.from,t.to);if(o)for(var _=o.length-1;_>=0;--_)Ps(e,{from:o[_].from,to:o[_].to,text:_?[""]:t.text,origin:t.origin});else Ps(e,t)}function Ps(e,t){if(t.text.length==1&&t.text[0]==""&&Vn(t.from,t.to)==0)return;var u=ei(e,t);bs(e,t,u,e.cm?e.cm.curOp.id:NaN),Lo(e,t,u,Qn(e,t));var o=[];Ti(e,function(_,B){!B&&ce(o,_.history)==-1&&(Ns(_.history,t),o.push(_.history)),Lo(_,t,null,Qn(_,t))})}function $o(e,t,u){var o=e.cm&&e.cm.state.suppressEdits;if(o&&!u)return;for(var _=e.history,B,$=e.sel,ee=t=="undo"?_.done:_.undone,oe=t=="undo"?_.undone:_.done,he=0;he<ee.length&&!(B=ee[he],u?B.ranges&&!B.equals(e.sel):!B.ranges);he++);if(he==ee.length)return;for(_.lastOrigin=_.lastSelOrigin=null;;)if(B=ee.pop(),B.ranges){if(zo(B,oe),u&&!B.equals(e.sel)){zi(e,B,{clearRedo:!1});return}$=B}else if(o){ee.push(B);return}else break;var ke=[];zo($,oe),oe.push({changes:ke,generation:_.generation}),_.generation=B.generation||++_.maxGeneration;for(var Fe=se(e,"beforeChange")||e.cm&&se(e.cm,"beforeChange"),ut=function(rn){var wn=B.changes[rn];if(wn.origin=t,Fe&&!Ls(e,wn,!1))return ee.length=0,{};ke.push(rs(e,wn));var Dn=rn?ei(e,wn):j(ee);Lo(e,wn,Dn,xs(e,wn)),!rn&&e.cm&&e.cm.scrollIntoView({from:wn.from,to:Jn(wn)});var Nn=[];Ti(e,function(Ln,Kn){!Kn&&ce(Nn,Ln.history)==-1&&(Ns(Ln.history,wn),Nn.push(Ln.history)),Lo(Ln,wn,null,xs(Ln,wn))})},ot=B.changes.length-1;ot>=0;--ot){var Nt=ut(ot);if(Nt)return Nt.v}}function ks(e,t){if(t==0)return;if(e.first+=t,e.sel=new Ki(W(e.sel.ranges,function(_){return new Ir(Yt(_.anchor.line+t,_.anchor.ch),Yt(_.head.line+t,_.head.ch))}),e.sel.primIndex),e.cm){Wr(e.cm,e.first,e.first-t,t);for(var u=e.cm.display,o=u.viewFrom;o<u.viewTo;o++)Vr(e.cm,o,"gutter")}}function Lo(e,t,u,o){if(e.cm&&!e.cm.curOp)return di(e.cm,Lo)(e,t,u,o);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 _=t.text.length-1-(e.first-t.from.line);ks(e,_),t={from:Yt(e.first,0),to:Yt(t.to.line+_,t.to.ch),text:[j(t.text)],origin:t.origin}}var B=e.lastLine();t.to.line>B&&(t={from:t.from,to:Yt(B,Qt(e,B).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Hn(e,t.from,t.to),u||(u=ei(e,t)),e.cm?bl(e.cm,t,o):Wa(e,t,o),Yo(e,u,Ce),e.cantEdit&&Xo(e,Yt(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,u){var o=e.doc,_=e.display,B=t.from,$=t.to,ee=!1,oe=B.line;e.options.lineWrapping||(oe=zn(et(Qt(o,B.line))),o.iter(oe,$.line+1,function(ot){if(ot==_.maxLine)return ee=!0,!0})),o.sel.contains(t.from,t.to)>-1&&te(e),Wa(o,t,u,Ji(e)),e.options.lineWrapping||(o.iter(oe,B.line+t.text.length,function(ot){var Nt=On(ot);Nt>_.maxLineLength&&(_.maxLine=ot,_.maxLineLength=Nt,_.maxLineChanged=!0,ee=!1)}),ee&&(e.curOp.updateMaxLine=!0)),oa(o,B.line),Na(e,400);var he=t.text.length-($.line-B.line)-1;t.full?Wr(e):B.line==$.line&&t.text.length==1&&!va(e.doc,t)?Vr(e,B.line,"text"):Wr(e,B.line,$.line+1,he);var ke=se(e,"changes"),Fe=se(e,"change");if(Fe||ke){var ut={from:B,to:$,text:t.text,removed:t.removed,origin:t.origin};Fe&&mt(e,"change",e,ut),ke&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ut)}e.display.selForContextMenu=null}function bo(e,t,u,o,_){var B;o||(o=u),Vn(o,u)<0&&(B=[o,u],u=B[0],o=B[1]),typeof t=="string"&&(t=e.splitLines(t)),yo(e,{from:u,to:o,text:t,origin:_})}function Ms(e,t,u,o){u<e.line?e.line+=o:t<e.line&&(e.line=t,e.ch=0)}function Is(e,t,u,o){for(var _=0;_<e.length;++_){var B=e[_],$=!0;if(B.ranges){B.copied||(B=e[_]=B.deepCopy(),B.copied=!0);for(var ee=0;ee<B.ranges.length;ee++)Ms(B.ranges[ee].anchor,t,u,o),Ms(B.ranges[ee].head,t,u,o);continue}for(var oe=0;oe<B.changes.length;++oe){var he=B.changes[oe];if(u<he.from.line)he.from=Yt(he.from.line+o,he.from.ch),he.to=Yt(he.to.line+o,he.to.ch);else if(t<=he.to.line){$=!1;break}}$||(e.splice(0,_+1),_=0)}}function Ns(e,t){var u=t.from.line,o=t.to.line,_=t.text.length-(o-u)-1;Is(e.done,u,o,_),Is(e.undone,u,o,_)}function Po(e,t,u,o){var _=t,B=t;return typeof t=="number"?B=Qt(e,Lr(e,t)):_=zn(t),_==null?null:(o(B,_)&&e.cm&&Vr(e.cm,_,u),B)}function ko(e){this.lines=e,this.parent=null;for(var t=0,u=0;u<e.length;++u)e[u].parent=this,t+=e[u].height;this.height=t}ko.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var u=e,o=e+t;u<o;++u){var _=this.lines[u];this.height-=_.height,gt(_),mt(_,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,u){this.height+=u,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var o=0;o<t.length;++o)t[o].parent=this},iterN:function(e,t,u){for(var o=e+t;e<o;++e)if(u(this.lines[e]))return!0}};function Mo(e){this.children=e;for(var t=0,u=0,o=0;o<e.length;++o){var _=e[o];t+=_.chunkSize(),u+=_.height,_.parent=this}this.size=t,this.height=u,this.parent=null}Mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var u=0;u<this.children.length;++u){var o=this.children[u],_=o.chunkSize();if(e<_){var B=Math.min(t,_-e),$=o.height;if(o.removeInner(e,B),this.height-=$-o.height,_==B&&(this.children.splice(u--,1),o.parent=null),(t-=B)==0)break;e=0}else e-=_}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ko))){var ee=[];this.collapse(ee),this.children=[new ko(ee)],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,u){this.size+=t.length,this.height+=u;for(var o=0;o<this.children.length;++o){var _=this.children[o],B=_.chunkSize();if(e<=B){if(_.insertInner(e,t,u),_.lines&&_.lines.length>50){for(var $=_.lines.length%25+25,ee=$;ee<_.lines.length;){var oe=new ko(_.lines.slice(ee,ee+=25));_.height-=oe.height,this.children.splice(++o,0,oe),oe.parent=this}_.lines=_.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),u=new Mo(t);if(e.parent){e.size-=u.size,e.height-=u.height;var _=ce(e.parent.children,e);e.parent.children.splice(_+1,0,u)}else{var o=new Mo(e.children);o.parent=e,e.children=[o,u],e=o}u.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,u){for(var o=0;o<this.children.length;++o){var _=this.children[o],B=_.chunkSize();if(e<B){var $=Math.min(t,B-e);if(_.iterN(e,$,u))return!0;if((t-=$)==0)break;e=0}else e-=B}}};var Io=function(e,t,u){if(u)for(var o in u)u.hasOwnProperty(o)&&(this[o]=u[o]);this.doc=e,this.node=t};Io.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,u=this.line,o=zn(u);if(o==null||!t)return;for(var _=0;_<t.length;++_)t[_]==this&&t.splice(_--,1);t.length||(u.widgets=null);var B=Fr(this);Sn(u,Math.max(0,u.height-B)),e&&(Wi(e,function(){Us(e,u,-B),Vr(e,o,"widget")}),mt(e,"lineWidgetCleared",e,this,o))},Io.prototype.changed=function(){var e=this,t=this.height,u=this.doc.cm,o=this.line;this.height=null;var _=Fr(this)-t;if(!_)return;Pt(this.doc,o)||Sn(o,o.height+_),u&&Wi(u,function(){u.curOp.forceUpdate=!0,Us(u,o,_),mt(u,"lineWidgetChanged",u,e,zn(o))})},pe(Io);function Us(e,t,u){cn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Va(e,u)}function El(e,t,u,o){var _=new Io(e,u,o),B=e.cm;return B&&_.noHScroll&&(B.display.alignWidgets=!0),Po(e,t,"widget",function($){var ee=$.widgets||($.widgets=[]);if(_.insertAt==null?ee.push(_):ee.splice(Math.min(ee.length-1,Math.max(0,_.insertAt)),0,_),_.line=$,B&&!Pt(e,$)){var oe=cn($)<e.scrollTop;Sn($,$.height+Fr(_)),oe&&Va(B,_.height),B.curOp.forceUpdate=!0}return!0}),B&&mt(B,"lineWidgetAdded",B,_,typeof t=="number"?t:zn(t)),_}var js=0,qa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++js};qa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ua(e),se(this,"clear")){var u=this.find();u&&mt(this,"clear",u.from,u.to)}for(var o=null,_=null,B=0;B<this.lines.length;++B){var $=this.lines[B],ee=Tn($.markedSpans,this);e&&!this.collapsed?Vr(e,zn($),"text"):e&&(ee.to!=null&&(_=zn($)),ee.from!=null&&(o=zn($))),$.markedSpans=qt($.markedSpans,ee),ee.from==null&&this.collapsed&&!Pt(this.doc,$)&&e&&Sn($,Pr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var oe=0;oe<this.lines.length;++oe){var he=et(this.lines[oe]),ke=On(he);ke>e.display.maxLineLength&&(e.display.maxLine=he,e.display.maxLineLength=ke,e.display.maxLineChanged=!0)}o!=null&&e&&this.collapsed&&Wr(e,o,_+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&mt(e,"markerCleared",e,this,o,_),t&&Ea(e),this.parent&&this.parent.clear()},qa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var u,o,_=0;_<this.lines.length;++_){var B=this.lines[_],$=Tn(B.markedSpans,this);if($.from!=null&&(u=Yt(t?B:zn(B),$.from),e==-1))return u;if($.to!=null&&(o=Yt(t?B:zn(B),$.to),e==1))return o}return u&&{from:u,to:o}},qa.prototype.changed=function(){var e=this,t=this.find(-1,!0),u=this,o=this.doc.cm;if(!t||!o)return;Wi(o,function(){var _=t.line,B=zn(t.line),$=$e(o,B);if($&&(qn($),o.curOp.selectionChanged=o.curOp.forceUpdate=!0),o.curOp.updateMaxLine=!0,!Pt(u.doc,_)&&u.height!=null){var ee=u.height;u.height=null;var oe=Fr(u)-ee;oe&&Sn(_,_.height+oe)}mt(o,"markerChanged",o,e)})},qa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ce(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qa.prototype.detachLine=function(e){if(this.lines.splice(ce(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},pe(qa);function Eo(e,t,u,o,_){if(o&&o.shared)return xl(e,t,u,o,_);if(e.cm&&!e.cm.curOp)return di(e.cm,Eo)(e,t,u,o,_);var B=new qa(e,_),$=Vn(t,u);if(o&&w(o,B,!1),$>0||$==0&&B.clearWhenEmpty!==!1)return B;if(B.replacedWith&&(B.collapsed=!0,B.widgetNode=v("span",[B.replacedWith],"CodeMirror-widget"),o.handleMouseEvents||B.widgetNode.setAttribute("cm-ignore-events","true"),o.insertLeft&&(B.widgetNode.insertLeft=!0)),B.collapsed){if(ft(e,t.line,t,u,B)||t.line!=u.line&&ft(e,u.line,t,u,B))throw new Error("Inserting collapsed marker partially overlapping an existing one");oi()}B.addToHistory&&bs(e,{from:t,to:u,origin:"markText"},e.sel,NaN);var ee=t.line,oe=e.cm,he;if(e.iter(ee,u.line+1,function(Fe){oe&&B.collapsed&&!oe.options.lineWrapping&&et(Fe)==oe.display.maxLine&&(he=!0),B.collapsed&&ee!=t.line&&Sn(Fe,0),fn(Fe,new kr(B,ee==t.line?t.ch:null,ee==u.line?u.ch:null)),++ee}),B.collapsed&&e.iter(t.line,u.line+1,function(Fe){Pt(e,Fe)&&Sn(Fe,0)}),B.clearOnEnter&&He(B,"beforeCursorEnter",function(){return B.clear()}),B.readOnly&&(br(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),B.collapsed&&(B.id=++js,B.atomic=!0),oe){if(he&&(oe.curOp.updateMaxLine=!0),B.collapsed)Wr(oe,t.line,u.line+1);else if(B.className||B.startStyle||B.endStyle||B.css||B.attributes||B.title)for(var ke=t.line;ke<=u.line;ke++)Vr(oe,ke,"text");B.atomic&&Os(oe.doc),mt(oe,"markerAdded",oe,B)}return B}var No=function(e,t){this.markers=e,this.primary=t;for(var u=0;u<e.length;++u)e[u].parent=this};No.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();mt(this,"clear")},No.prototype.find=function(e,t){return this.primary.find(e,t)},pe(No);function xl(e,t,u,o,_){o=w(o),o.shared=!1;var B=[Eo(e,t,u,o,_)],$=B[0],ee=o.widgetNode;return Ti(e,function(oe){ee&&(o.widgetNode=ee.cloneNode(!0)),B.push(Eo(oe,Fn(oe,t),Fn(oe,u),o,_));for(var he=0;he<oe.linked.length;++he)if(oe.linked[he].isParent)return;$=j(B)}),new No(B,$)}function Fs(e){return e.findMarks(Yt(e.first,0),e.clipPos(Yt(e.lastLine())),function(t){return t.parent})}function wl(e,t){for(var u=0;u<t.length;u++){var o=t[u],_=o.find(),B=e.clipPos(_.from),$=e.clipPos(_.to);if(Vn(B,$)){var ee=Eo(e,B,$,o.primary,o.primary.type);o.markers.push(ee),ee.parent=o}}}function Tl(e){for(var t=function(o){var _=e[o],B=[_.primary.doc];Ti(_.primary.doc,function(oe){return B.push(oe)});for(var $=0;$<_.markers.length;$++){var ee=_.markers[$];ce(B,ee.doc)==-1&&(ee.parent=null,_.markers.splice($--,1))}},u=0;u<e.length;u++)t(u)}var Cl=0,ea=function(e,t,u,o,_){if(!(this instanceof ea))return new ea(e,t,u,o,_);u==null&&(u=0),Mo.call(this,[new ko([new mn("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var B=Yt(u,0);this.sel=Pn(B),this.history=new Go(null),this.id=++Cl,this.modeOption=t,this.lineSep=o,this.direction=_=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Wa(this,{from:B,to:B,text:e}),zi(this,Pn(B),Ce)};ea.prototype=G(Mo.prototype,{constructor:ea,iter:function(e,t,u){u?this.iterN(e-this.first,t-e,u):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var u=0,o=0;o<t.length;++o)u+=t[o].height;this.insertInner(e-this.first,t,u)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=lr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:hi(function(e){var t=Yt(this.first,0),u=this.first+this.size-1;yo(this,{from:t,to:Yt(u,Qt(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ra(this.cm,0,0),zi(this,Pn(t),Ce)}),replaceRange:function(e,t,u,o){t=Fn(this,t),u=u?Fn(this,u):t,bo(this,e,t,u,o)},getRange:function(e,t,u){var o=Hn(this,Fn(this,e),Fn(this,t));return u===!1?o:o.join(u||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Gr(this,e))return Qt(this,e)},getLineNumber:function(e){return zn(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Qt(this,e)),et(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Fn(this,e)},getCursor:function(e){var t=this.sel.primary(),u;return e==null||e=="head"?u=t.head:e=="anchor"?u=t.anchor:e=="end"||e=="to"||e===!1?u=t.to():u=t.from(),u},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:hi(function(e,t,u){Ts(this,Fn(this,typeof e=="number"?Yt(e,t||0):e),null,u)}),setSelection:hi(function(e,t,u){Ts(this,Fn(this,e),Fn(this,t||e),u)}),extendSelection:hi(function(e,t,u){Vo(this,Fn(this,e),t&&Fn(this,t),u)}),extendSelections:hi(function(e,t){ws(this,Zt(this,e),t)}),extendSelectionsBy:hi(function(e,t){var u=W(this.sel.ranges,e);ws(this,Zt(this,u),t)}),setSelections:hi(function(e,t,u){if(!e.length)return;for(var o=[],_=0;_<e.length;_++)o[_]=new Ir(Fn(this,e[_].anchor),Fn(this,e[_].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),zi(this,pr(this.cm,o,t),u)}),addSelection:hi(function(e,t,u){var o=this.sel.ranges.slice(0);o.push(new Ir(Fn(this,e),Fn(this,t||e))),zi(this,pr(this.cm,o,o.length-1),u)}),getSelection:function(e){for(var t=this.sel.ranges,u,o=0;o<t.length;o++){var _=Hn(this,t[o].from(),t[o].to());u=u?u.concat(_):_}return e===!1?u:u.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],u=this.sel.ranges,o=0;o<u.length;o++){var _=Hn(this,u[o].from(),u[o].to());e!==!1&&(_=_.join(e||this.lineSeparator())),t[o]=_}return t},replaceSelection:function(e,t,u){for(var o=[],_=0;_<this.sel.ranges.length;_++)o[_]=e;this.replaceSelections(o,t,u||"+input")},replaceSelections:hi(function(e,t,u){for(var o=[],_=this.sel,B=0;B<_.ranges.length;B++){var $=_.ranges[B];o[B]={from:$.from(),to:$.to(),text:this.splitLines(e[B]),origin:u}}for(var ee=t&&t!="end"&&ia(this,o,t),oe=o.length-1;oe>=0;oe--)yo(this,o[oe]);ee?Cs(this,ee):this.cm&&_a(this.cm)}),undo:hi(function(){$o(this,"undo")}),redo:hi(function(){$o(this,"redo")}),undoSelection:hi(function(){$o(this,"undo",!0)}),redoSelection:hi(function(){$o(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,u=0,o=0;o<e.done.length;o++)e.done[o].ranges||++t;for(var _=0;_<e.undone.length;_++)e.undone[_].ranges||++u;return{undo:t,redo:u}},clearHistory:function(){var e=this;this.history=new Go(this.history.maxGeneration),Ti(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:vo(this.history.done),undone:vo(this.history.undone)}},setHistory:function(e){var t=this.history=new Go(this.history.maxGeneration);t.done=vo(e.done.slice(0),null,!0),t.undone=vo(e.undone.slice(0),null,!0)},setGutterMarker:hi(function(e,t,u){return Po(this,e,"gutter",function(o){var _=o.gutterMarkers||(o.gutterMarkers={});return _[t]=u,!u&&le(_)&&(o.gutterMarkers=null),!0})}),clearGutter:hi(function(e){var t=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&Po(t,u,"gutter",function(){return u.gutterMarkers[e]=null,le(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Gr(this,e))return null;if(t=e,e=Qt(this,e),!e)return null}else if(t=zn(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:hi(function(e,t,u){return Po(this,e,t=="gutter"?"gutter":"class",function(o){var _=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!o[_])o[_]=u;else{if(S(u).test(o[_]))return!1;o[_]+=" "+u}return!0})}),removeLineClass:hi(function(e,t,u){return Po(this,e,t=="gutter"?"gutter":"class",function(o){var _=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",B=o[_];if(B)if(u==null)o[_]=null;else{var $=B.match(S(u));if(!$)return!1;var ee=$.index+$[0].length;o[_]=B.slice(0,$.index)+(!$.index||ee==B.length?"":" ")+B.slice(ee)||null}else return!1;return!0})}),addLineWidget:hi(function(e,t,u){return El(this,e,t,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,u){return Eo(this,Fn(this,e),Fn(this,t),u,u&&u.type||"range")},setBookmark:function(e,t){var u={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Fn(this,e),Eo(this,e,e,u,"bookmark")},findMarksAt:function(e){e=Fn(this,e);var t=[],u=Qt(this,e.line).markedSpans;if(u)for(var o=0;o<u.length;++o){var _=u[o];(_.from==null||_.from<=e.ch)&&(_.to==null||_.to>=e.ch)&&t.push(_.marker.parent||_.marker)}return t},findMarks:function(e,t,u){e=Fn(this,e),t=Fn(this,t);var o=[],_=e.line;return this.iter(e.line,t.line+1,function(B){var $=B.markedSpans;if($)for(var ee=0;ee<$.length;ee++){var oe=$[ee];!(oe.to!=null&&_==e.line&&e.ch>=oe.to||oe.from==null&&_!=e.line||oe.from!=null&&_==t.line&&oe.from>=t.ch)&&(!u||u(oe.marker))&&o.push(oe.marker.parent||oe.marker)}++_}),o},getAllMarks:function(){var e=[];return this.iter(function(t){var u=t.markedSpans;if(u)for(var o=0;o<u.length;++o)u[o].from!=null&&e.push(u[o].marker)}),e},posFromIndex:function(e){var t,u=this.first,o=this.lineSeparator().length;return this.iter(function(_){var B=_.text.length+o;if(B>e)return t=e,!0;e-=B,++u}),Fn(this,Yt(u,t))},indexFromPos:function(e){e=Fn(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var u=this.lineSeparator().length;return this.iter(this.first,e.line,function(o){t+=o.text.length+u}),t},copy:function(e){var t=new ea(lr(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,u=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<u&&(u=e.to);var o=new ea(lr(this,t,u),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(o.history=this.history),(this.linked||(this.linked=[])).push({doc:o,sharedHist:e.sharedHist}),o.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(o,Fs(this)),o},unlinkDoc:function(e){if(e instanceof fi&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var u=this.linked[t];if(u.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(Fs(this));break}if(e.history==this.history){var o=[e.id];Ti(e,function(_){return o.push(_.id)},!0),e.history=new Go(null),e.history.done=vo(this.history.done,o),e.history.undone=vo(this.history.undone,o)}},iterLinkedDocs:function(e){Ti(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Cn(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:hi(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),ea.prototype.eachLine=ea.prototype.iter;var Bs=0;function Sl(e){var t=this;if(Hs(t),q(t,e)||si(t.display,e))return;ae(e),K&&(Bs=+new Date);var u=wi(t,e,!0),o=e.dataTransfer.files;if(!u||t.isReadOnly())return;if(o&&o.length&&window.FileReader&&window.File)for(var _=o.length,B=Array(_),$=0,ee=function(){++$==_&&di(t,function(){u=Fn(t.doc,u);var ot={from:u,to:u,text:t.doc.splitLines(B.filter(function(Nt){return Nt!=null}).join(t.doc.lineSeparator())),origin:"paste"};yo(t.doc,ot),Cs(t.doc,Pn(Fn(t.doc,u),Fn(t.doc,Jn(ot))))})()},oe=function(ot,Nt){if(t.options.allowDropFileTypes&&ce(t.options.allowDropFileTypes,ot.type)==-1){ee();return}var rn=new FileReader;rn.onerror=function(){return ee()},rn.onload=function(){var wn=rn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(wn)){ee();return}B[Nt]=wn,ee()},rn.readAsText(ot)},he=0;he<o.length;he++)oe(o[he],he);else{if(t.state.draggingText&&t.doc.sel.contains(u)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ke=e.dataTransfer.getData("Text");if(ke){var Fe;if(t.state.draggingText&&!t.state.draggingText.copy&&(Fe=t.listSelections()),Yo(t.doc,Pn(u,u)),Fe)for(var ut=0;ut<Fe.length;++ut)bo(t.doc,"",Fe[ut].anchor,Fe[ut].head,"drag");t.replaceSelection(ke,"around","paste"),t.display.input.focus()}}catch(ot){}}}function Ol(e,t){if(K&&(!e.state.draggingText||+new Date-Bs<100)){_e(t);return}if(q(e,t)||si(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var u=h("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),t.dataTransfer.setDragImage(u,0,0),p&&u.parentNode.removeChild(u)}}function Rl(e,t){var u=wi(e,t);if(!u)return;var o=document.createDocumentFragment();Zi(e,u,o),e.display.dragCursor||(e.display.dragCursor=h("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),f(e.display.dragCursor,o)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),u=[],o=0;o<t.length;o++){var _=t[o].CodeMirror;_&&u.push(_)}u.length&&u[0].operation(function(){for(var B=0;B<u.length;B++)e(u[B])})}var Ks=!1;function Al(){if(Ks)return;Dl(),Ks=!0}function Dl(){var e;He(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Ll)},100))}),He(window,"blur",function(){return Ws(Ta)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var eo={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"},Uo=0;Uo<10;Uo++)eo[Uo+48]=eo[Uo+96]=String(Uo);for(var Jo=65;Jo<=90;Jo++)eo[Jo]=String.fromCharCode(Jo);for(var jo=1;jo<=12;jo++)eo[jo+111]=eo[jo+63235]="F"+jo;var Ka={};Ka.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"},Ka.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"},Ka.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"},Ka.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"]},Ka.default=i?Ka.macDefault:Ka.pcDefault;function Pl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var u,o,_,B,$=0;$<t.length-1;$++){var ee=t[$];if(/^(cmd|meta|m)$/i.test(ee))B=!0;else if(/^a(lt)?$/i.test(ee))u=!0;else if(/^(c|ctrl|control)$/i.test(ee))o=!0;else if(/^s(hift)?$/i.test(ee))_=!0;else throw new Error("Unrecognized modifier name: "+ee)}return u&&(e="Alt-"+e),o&&(e="Ctrl-"+e),B&&(e="Cmd-"+e),_&&(e="Shift-"+e),e}function kl(e){var t={};for(var u in e)if(e.hasOwnProperty(u)){var o=e[u];if(/^(name|fallthrough|(de|at)tach)$/.test(u))continue;if(o=="..."){delete e[u];continue}for(var _=W(u.split(" "),Pl),B=0;B<_.length;B++){var $=void 0,ee=void 0;B==_.length-1?(ee=_.join(" "),$=o):(ee=_.slice(0,B+1).join(" "),$="...");var oe=t[ee];if(!oe)t[ee]=$;else if(oe!=$)throw new Error("Inconsistent bindings for "+ee)}delete e[u]}for(var he in t)e[he]=t[he];return e}function xo(e,t,u,o){t=Qo(t);var _=t.call?t.call(e,o):t[e];if(_===!1)return"nothing";if(_==="...")return"multi";if(_!=null&&u(_))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return xo(e,t.fallthrough,u,o);for(var B=0;B<t.fallthrough.length;B++){var $=xo(e,t.fallthrough[B],u,o);if($)return $}}}function Gs(e){var t=typeof e=="string"?e:eo[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function zs(e,t,u){var o=e;return t.altKey&&o!="Alt"&&(e="Alt-"+e),(T?t.metaKey:t.ctrlKey)&&o!="Ctrl"&&(e="Ctrl-"+e),(T?t.ctrlKey:t.metaKey)&&o!="Mod"&&(e="Cmd-"+e),!u&&t.shiftKey&&o!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(p&&e.keyCode==34&&e.char)return!1;var u=eo[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),zs(u,e,t))}function Qo(e){return typeof e=="string"?Ka[e]:e}function wo(e,t){for(var u=e.doc.sel.ranges,o=[],_=0;_<u.length;_++){for(var B=t(u[_]);o.length&&Vn(B.from,j(o).to)<=0;){var $=o.pop();if(Vn($.from,B.from)<0){B.from=$.from;break}}o.push(B)}Wi(e,function(){for(var ee=o.length-1;ee>=0;ee--)bo(e.doc,"",o[ee].from,o[ee].to,"+delete");_a(e)})}function os(e,t,u){var o=ze(e.text,t+u,u);return o<0||o>e.text.length?null:o}function ss(e,t,u){var o=os(e,t.ch,u);return o==null?null:new Yt(t.line,o,u<0?"after":"before")}function ls(e,t,u,o,_){if(e){t.doc.direction=="rtl"&&(_=-_);var B=ln(u,t.doc.direction);if(B){var $=_<0?j(B):B[0],ee=_<0==($.level==1),oe=ee?"after":"before",he;if($.level>0||t.doc.direction=="rtl"){var ke=Me(t,u);he=_<0?u.text.length-1:0;var Fe=nt(t,ke,he).top;he=yt(function(ut){return nt(t,ke,ut).top==Fe},_<0==($.level==1)?$.from:$.to-1,he),oe=="before"&&(he=os(u,he,1))}else he=_<0?$.to:$.from;return new Yt(o,he,oe)}}return new Yt(o,_<0?u.text.length:0,_<0?"before":"after")}function Ml(e,t,u,o){var _=ln(t,e.doc.direction);if(!_)return ss(t,u,o);u.ch>=t.text.length?(u.ch=t.text.length,u.sticky="before"):u.ch<=0&&(u.ch=0,u.sticky="after");var B=Qe(_,u.ch,u.sticky),$=_[B];if(e.doc.direction=="ltr"&&$.level%2==0&&(o>0?$.to>u.ch:$.from<u.ch))return ss(t,u,o);var ee=function(Dn,Nn){return os(t,Dn instanceof Yt?Dn.ch:Dn,Nn)},oe,he=function(Dn){return e.options.lineWrapping?(oe=oe||Me(e,t),Wn(e,t,oe,Dn)):{begin:0,end:t.text.length}},ke=he(u.sticky=="before"?ee(u,-1):u.ch);if(e.doc.direction=="rtl"||$.level==1){var Fe=$.level==1==o<0,ut=ee(u,Fe?1:-1);if(ut!=null&&(Fe?ut<=$.to&&ut<=ke.end:ut>=$.from&&ut>=ke.begin)){var ot=Fe?"before":"after";return new Yt(u.line,ut,ot)}}var Nt=function(Dn,Nn,Ln){for(var Kn=function(ti,ji){return ji?new Yt(u.line,ee(ti,1),"before"):new Yt(u.line,ti,"after")};Dn>=0&&Dn<_.length;Dn+=Nn){var fr=_[Dn],or=Nn>0==(fr.level!=1),Rr=or?Ln.begin:ee(Ln.end,-1);if(fr.from<=Rr&&Rr<fr.to)return Kn(Rr,or);if(Rr=or?fr.from:ee(fr.to,-1),Ln.begin<=Rr&&Rr<Ln.end)return Kn(Rr,or)}},rn=Nt(B+o,o,ke);if(rn)return rn;var wn=o>0?ke.end:ee(ke.begin,-1);return wn!=null&&!(o>0&&wn==t.text.length)&&(rn=Nt(o>0?0:_.length-1,o,he(wn)),rn)?rn:null}var Fo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ce)},killLine:function(e){return wo(e,function(t){if(t.empty()){var u=Qt(e.doc,t.head.line).text.length;return t.head.ch==u&&t.head.line<e.lastLine()?{from:t.head,to:Yt(t.head.line+1,0)}:{from:t.head,to:Yt(t.head.line,u)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return wo(e,function(t){return{from:Yt(t.from().line,0),to:Fn(e.doc,Yt(t.to().line+1,0))}})},delLineLeft:function(e){return wo(e,function(t){return{from:Yt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return wo(e,function(t){var u=e.charCoords(t.head,"div").top+5,o=e.coordsChar({left:0,top:u},"div");return{from:o,to:t.from()}})},delWrappedLineRight:function(e){return wo(e,function(t){var u=e.charCoords(t.head,"div").top+5,o=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div");return{from:t.from(),to:o}})},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(Yt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Yt(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 Xs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Il(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div")},Ve)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:u},"div")},Ve)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5,o=e.coordsChar({left:0,top:u},"div");return o.ch<e.getLine(o.line).search(/\S/)?Xs(e,t.head):o},Ve)},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=[],u=e.listSelections(),o=e.options.tabSize,_=0;_<u.length;_++){var B=u[_].from(),$=Y(e.getLine(B.line),B.ch,o);t.push(X(o-$%o))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Wi(e,function(){for(var t=e.listSelections(),u=[],o=0;o<t.length;o++){if(!t[o].empty())continue;var _=t[o].head,B=Qt(e.doc,_.line).text;if(B){if(_.ch==B.length&&(_=new Yt(_.line,_.ch-1)),_.ch>0)_=new Yt(_.line,_.ch+1),e.replaceRange(B.charAt(_.ch-1)+B.charAt(_.ch-2),Yt(_.line,_.ch-2),_,"+transpose");else if(_.line>e.doc.first){var $=Qt(e.doc,_.line-1).text;$&&(_=new Yt(_.line,1),e.replaceRange(B.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),Yt(_.line-1,$.length-1),_,"+transpose"))}}u.push(new Ir(_,_))}e.setSelections(u)})},newlineAndIndent:function(e){return Wi(e,function(){for(var t=e.listSelections(),u=t.length-1;u>=0;u--)e.replaceRange(e.doc.lineSeparator(),t[u].anchor,t[u].head,"+input");t=e.listSelections();for(var o=0;o<t.length;o++)e.indentLine(t[o].from().line,null,!0);_a(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ys(e,t){var u=Qt(e.doc,t),o=et(u);return o!=u&&(t=zn(o)),ls(!0,e,o,t,1)}function Il(e,t){var u=Qt(e.doc,t),o=rt(u);return o!=u&&(t=zn(o)),ls(!0,e,u,t,-1)}function Xs(e,t){var u=Ys(e,t.line),o=Qt(e.doc,u.line),_=ln(o,e.doc.direction);if(!_||_[0].level==0){var B=Math.max(u.ch,o.text.search(/\S/)),$=t.line==u.line&&t.ch<=B&&t.ch;return Yt(u.line,$?0:B,u.sticky)}return u}function Zo(e,t,u){if(typeof t=="string"&&(t=Fo[t],!t))return!1;e.display.input.ensurePolled();var o=e.display.shift,_=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u&&(e.display.shift=!1),_=t(e)!=Ze}finally{e.display.shift=o,e.state.suppressEdits=!1}return _}function Nl(e,t,u){for(var o=0;o<e.state.keyMaps.length;o++){var _=xo(t,e.state.keyMaps[o],u,e);if(_)return _}return e.options.extraKeys&&xo(t,e.options.extraKeys,u,e)||xo(t,e.options.keyMap,u,e)}var Ul=new Z;function Bo(e,t,u,o){var _=e.state.keySeq;if(_){if(Gs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==_&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,_+" "+t,u,o))return!0}return $s(e,t,u,o)}function $s(e,t,u,o){var _=Nl(e,t,o);return _=="multi"&&(e.state.keySeq=t),_=="handled"&&mt(e,"keyHandled",e,t,u),(_=="handled"||_=="multi")&&(ae(u),yi(e)),!!_}function Js(e,t){var u=Vs(t,!0);return u?t.shiftKey&&!e.state.keySeq?Bo(e,"Shift-"+u,t,function(o){return Zo(e,o,!0)})||Bo(e,u,t,function(o){if(typeof o=="string"?/^go[A-Z]/.test(o):o.motion)return Zo(e,o)}):Bo(e,u,t,function(o){return Zo(e,o)}):!1}function jl(e,t,u){return Bo(e,"'"+u+"'",t,function(o){return Zo(e,o,!0)})}var us=null;function Qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=N(),q(t,e))return;K&&M<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;t.display.shift=u==16||e.shiftKey;var o=Js(t,e);p&&(us=o?u:null,!o&&u==88&&!er&&(i?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),I&&!i&&!o&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;H(t,"CodeMirror-crosshair");function u(o){(o.keyCode==18||!o.altKey)&&(y(t,"CodeMirror-crosshair"),bt(document,"keyup",u),bt(document,"mouseover",u))}He(document,"keyup",u),He(document,"mouseover",u)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),q(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(si(t.display,e)||q(t,e)||e.ctrlKey&&!e.altKey||i&&e.metaKey)return;var u=e.keyCode,o=e.charCode;if(p&&u==us){us=null,ae(e);return}if(p&&(!e.which||e.which<10)&&Js(t,e))return;var _=String.fromCharCode(o==null?u:o);if(_=="\b")return;if(jl(t,e,_))return;t.display.input.onKeyPress(e)}var Bl=400,cs=function(e,t,u){this.time=e,this.pos=t,this.button=u};cs.prototype.compare=function(e,t,u){return this.time+Bl>e&&Vn(t,this.pos)==0&&u==this.button};var Ho,Wo;function Hl(e,t){var u=+new Date;return Wo&&Wo.compare(u,e,t)?(Ho=Wo=null,"triple"):Ho&&Ho.compare(u,e,t)?(Wo=new cs(u,e,t),Ho=null,"double"):(Ho=new cs(u,e,t),Wo=null,"single")}function el(e){var t=this,u=t.display;if(q(t,e)||u.activeTouch&&u.input.supportsTouch())return;if(u.input.ensurePolled(),u.shift=e.shiftKey,si(u,e)){r||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(ds(t,e))return;var o=wi(t,e),_=Le(e),B=o?Hl(o,_):"single";if(window.focus(),_==1&&t.state.selectingText&&t.state.selectingText(e),o&&Wl(t,_,o,B,e))return;_==1?o?Gl(t,o,B,e):Ee(e)==u.scroller&&ae(e):_==2?(o&&Vo(t.doc,o),setTimeout(function(){return u.input.focus()},20)):_==3&&(R?t.display.input.onContextMenu(e):no(t))}function Wl(e,t,u,o,_){var B="Click";return o=="double"?B="Double"+B:o=="triple"&&(B="Triple"+B),B=(t==1?"Left":t==2?"Middle":"Right")+B,Bo(e,zs(B,_),_,function($){if(typeof $=="string"&&($=Fo[$]),!$)return!1;var ee=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ee=$(e,u)!=Ze}finally{e.state.suppressEdits=!1}return ee})}function Kl(e,t,u){var o=e.getOption("configureMouse"),_=o?o(e,t,u):{};if(_.unit==null){var B=n?u.shiftKey&&u.metaKey:u.altKey;_.unit=B?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(_.extend==null||e.doc.extend)&&(_.extend=e.doc.extend||u.shiftKey),_.addNew==null&&(_.addNew=i?u.metaKey:u.ctrlKey),_.moveOnDrag==null&&(_.moveOnDrag=!(i?u.altKey:u.ctrlKey)),_}function Gl(e,t,u,o){K?setTimeout(U(ka,e),0):e.curOp.focus=N();var _=Kl(e,u,o),B=e.doc.sel,$;e.options.dragDrop&&at&&!e.isReadOnly()&&u=="single"&&($=B.contains(t))>-1&&(Vn(($=B.ranges[$]).from(),t)<0||t.xRel>0)&&(Vn($.to(),t)>0||t.xRel<0)?zl(e,o,t,_):Vl(e,o,t,_)}function zl(e,t,u,o){var _=e.display,B=!1,$=di(e,function(he){r&&(_.scroller.draggable=!1),e.state.draggingText=!1,bt(_.wrapper.ownerDocument,"mouseup",$),bt(_.wrapper.ownerDocument,"mousemove",ee),bt(_.scroller,"dragstart",oe),bt(_.scroller,"drop",$),B||(ae(he),o.addNew||Vo(e.doc,u,null,null,o.extend),r&&!m||K&&M==9?setTimeout(function(){_.wrapper.ownerDocument.body.focus({preventScroll:!0}),_.input.focus()},20):_.input.focus())}),ee=function(he){B=B||Math.abs(t.clientX-he.clientX)+Math.abs(t.clientY-he.clientY)>=10},oe=function(){return B=!0};r&&(_.scroller.draggable=!0),e.state.draggingText=$,$.copy=!o.moveOnDrag,_.scroller.dragDrop&&_.scroller.dragDrop(),He(_.wrapper.ownerDocument,"mouseup",$),He(_.wrapper.ownerDocument,"mousemove",ee),He(_.scroller,"dragstart",oe),He(_.scroller,"drop",$),no(e),setTimeout(function(){return _.input.focus()},20)}function tl(e,t,u){if(u=="char")return new Ir(t,t);if(u=="word")return e.findWordAt(t);if(u=="line")return new Ir(Yt(t.line,0),Fn(e.doc,Yt(t.line+1,0)));var o=u(e,t);return new Ir(o.from,o.to)}function Vl(e,t,u,o){var _=e.display,B=e.doc;ae(t);var $,ee,oe=B.sel,he=oe.ranges;if(o.addNew&&!o.extend?(ee=B.sel.contains(u),ee>-1?$=he[ee]:$=new Ir(u,u)):($=B.sel.primary(),ee=B.sel.primIndex),o.unit=="rectangle")o.addNew||($=new Ir(u,u)),u=wi(e,t,!0,!0),ee=-1;else{var ke=tl(e,u,o.unit);o.extend?$=is($,ke.anchor,ke.head,o.extend):$=ke}o.addNew?ee==-1?(ee=he.length,zi(B,pr(e,he.concat([$]),ee),{scroll:!1,origin:"*mouse"})):he.length>1&&he[ee].empty()&&o.unit=="char"&&!o.extend?(zi(B,pr(e,he.slice(0,ee).concat(he.slice(ee+1)),0),{scroll:!1,origin:"*mouse"}),oe=B.sel):as(B,ee,$,We):(ee=0,zi(B,new Ki([$],0),We),oe=B.sel);var Fe=u;function ut(Ln){if(Vn(Fe,Ln)==0)return;if(Fe=Ln,o.unit=="rectangle"){for(var Kn=[],fr=e.options.tabSize,or=Y(Qt(B,u.line).text,u.ch,fr),Rr=Y(Qt(B,Ln.line).text,Ln.ch,fr),ti=Math.min(or,Rr),ji=Math.max(or,Rr),gi=Math.min(u.line,Ln.line),aa=Math.min(e.lastLine(),Math.max(u.line,Ln.line));gi<=aa;gi++){var ta=Qt(B,gi).text,Di=Ye(ta,ti,fr);ti==ji?Kn.push(new Ir(Yt(gi,Di),Yt(gi,Di))):ta.length>Di&&Kn.push(new Ir(Yt(gi,Di),Yt(gi,Ye(ta,ji,fr))))}Kn.length||Kn.push(new Ir(u,u)),zi(B,pr(e,oe.ranges.slice(0,ee).concat(Kn),ee),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ln)}else{var na=$,Gi=tl(e,Ln,o.unit),Mi=na.anchor,Li;Vn(Gi.anchor,Mi)>0?(Li=Gi.head,Mi=Yr(na.from(),Gi.anchor)):(Li=Gi.anchor,Mi=ai(na.to(),Gi.head));var Ei=oe.ranges.slice(0);Ei[ee]=Yl(e,new Ir(Fn(B,Mi),Li)),zi(B,pr(e,Ei,ee),We)}}var ot=_.wrapper.getBoundingClientRect(),Nt=0;function rn(Ln){var Kn=++Nt,fr=wi(e,Ln,!0,o.unit=="rectangle");if(!fr)return;if(Vn(fr,Fe)!=0){e.curOp.focus=N(),ut(fr);var or=Ma(_,B);(fr.line>=or.to||fr.line<or.from)&&setTimeout(di(e,function(){Nt==Kn&&rn(Ln)}),150)}else{var Rr=Ln.clientY<ot.top?-20:Ln.clientY>ot.bottom?20:0;Rr&&setTimeout(di(e,function(){if(Nt!=Kn)return;_.scroller.scrollTop+=Rr,rn(Ln)}),50)}}function wn(Ln){e.state.selectingText=!1,Nt=Infinity,Ln&&(ae(Ln),_.input.focus()),bt(_.wrapper.ownerDocument,"mousemove",Dn),bt(_.wrapper.ownerDocument,"mouseup",Nn),B.history.lastSelOrigin=null}var Dn=di(e,function(Ln){Ln.buttons===0||!Le(Ln)?wn(Ln):rn(Ln)}),Nn=di(e,wn);e.state.selectingText=Nn,He(_.wrapper.ownerDocument,"mousemove",Dn),He(_.wrapper.ownerDocument,"mouseup",Nn)}function Yl(e,t){var u=t.anchor,o=t.head,_=Qt(e.doc,u.line);if(Vn(u,o)==0&&u.sticky==o.sticky)return t;var B=ln(_);if(!B)return t;var $=Qe(B,u.ch,u.sticky),ee=B[$];if(ee.from!=u.ch&&ee.to!=u.ch)return t;var oe=$+(ee.from==u.ch==(ee.level!=1)?0:1);if(oe==0||oe==B.length)return t;var he;if(o.line!=u.line)he=(o.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ke=Qe(B,o.ch,o.sticky),Fe=ke-$||(o.ch-u.ch)*(ee.level==1?-1:1);ke==oe-1||ke==oe?he=Fe<0:he=Fe>0}var ut=B[oe+(he?-1:0)],ot=he==(ut.level==1),Nt=ot?ut.from:ut.to,rn=ot?"after":"before";return u.ch==Nt&&u.sticky==rn?t:new Ir(new Yt(u.line,Nt,rn),o)}function nl(e,t,u,o){var _,B;if(t.touches)_=t.touches[0].clientX,B=t.touches[0].clientY;else try{_=t.clientX,B=t.clientY}catch(ut){return!1}if(_>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;o&&ae(t);var $=e.display,ee=$.lineDiv.getBoundingClientRect();if(B>ee.bottom||!se(e,u))return me(t);B-=ee.top-$.viewOffset;for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var he=$.gutters.childNodes[oe];if(he&&he.getBoundingClientRect().right>=_){var ke=tr(e.doc,B),Fe=e.display.gutterSpecs[oe];return de(e,u,e,ke,Fe.className,t),me(t)}}}function ds(e,t){return nl(e,t,"gutterClick",!0)}function rl(e,t){if(si(e.display,t)||Xl(e,t))return;if(q(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Xl(e,t){return se(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),cr(e)}var To={toString:function(){return"CodeMirror.Init"}},al={},qo={};function $l(e){var t=e.optionHandlers;function u(o,_,B,$){e.defaults[o]=_,B&&(t[o]=$?function(ee,oe,he){he!=To&&B(ee,oe,he)}:B)}e.defineOption=u,e.Init=To,u("value","",function(o,_){return o.setValue(_)},!0),u("mode",null,function(o,_){o.doc.modeOption=_,Ai(o)},!0),u("indentUnit",2,Ai,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(o){Yi(o),cr(o),Wr(o)},!0),u("lineSeparator",null,function(o,_){if(o.doc.lineSep=_,!_)return;var B=[],$=o.doc.first;o.doc.iter(function(oe){for(var he=0;;){var ke=oe.text.indexOf(_,he);if(ke==-1)break;he=ke+_.length,B.push(Yt($,ke))}$++});for(var ee=B.length-1;ee>=0;ee--)bo(o.doc,_,B[ee],Yt(B[ee].line,B[ee].ch+_.length))}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(o,_,B){o.state.specialChars=new RegExp(_.source+(_.test(" ")?"":"| "),"g"),B!=To&&o.refresh()}),u("specialCharPlaceholder",on,function(o){return o.refresh()},!0),u("electricChars",!0),u("inputStyle",l?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),u("spellcheck",!1,function(o,_){return o.getInputField().spellcheck=_},!0),u("autocorrect",!1,function(o,_){return o.getInputField().autocorrect=_},!0),u("autocapitalize",!1,function(o,_){return o.getInputField().autocapitalize=_},!0),u("rtlMoveVisually",!O),u("wholeLineUpdateBefore",!0),u("theme","default",function(o){il(o),ca(o)},!0),u("keyMap","default",function(o,_,B){var $=Qo(_),ee=B!=To&&Qo(B);ee&&ee.detach&&ee.detach(o,$),$.attach&&$.attach(o,ee||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,Ql,!0),u("gutters",[],function(o,_){o.display.gutterSpecs=Ui(_,o.options.lineNumbers),ca(o)},!0),u("fixedGutter",!0,function(o,_){o.display.gutters.style.left=_?ui(o.display)+"px":"0",o.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(o){return ma(o)},!0),u("scrollbarStyle","native",function(o){Ja(o),ma(o),o.display.scrollbars.setScrollTop(o.doc.scrollTop),o.display.scrollbars.setScrollLeft(o.doc.scrollLeft)},!0),u("lineNumbers",!1,function(o,_){o.display.gutterSpecs=Ui(o.options.gutters,_),ca(o)},!0),u("firstLineNumber",1,ca,!0),u("lineNumberFormatter",function(o){return o},ca,!0),u("showCursorWhenSelecting",!1,Kr,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(o,_){_=="nocursor"&&(Ta(o),o.display.input.blur()),o.display.input.readOnlyChanged(_)}),u("screenReaderLabel",null,function(o,_){_=_===""?null:_,o.display.input.screenReaderLabelChanged(_)}),u("disableInput",!1,function(o,_){_||o.display.input.reset()},!0),u("dragDrop",!0,Jl),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,Kr,!0),u("singleCursorHeightPerLine",!0,Kr,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,Yi,!0),u("addModeClass",!1,Yi,!0),u("pollInterval",100),u("undoDepth",200,function(o,_){return o.doc.history.undoDepth=_}),u("historyEventDelay",1250),u("viewportMargin",10,function(o){return o.refresh()},!0),u("maxHighlightLength",1e4,Yi,!0),u("moveInputWithCursor",!0,function(o,_){_||o.display.input.resetPosition()}),u("tabindex",null,function(o,_){return o.display.input.getField().tabIndex=_||""}),u("autofocus",null),u("direction","ltr",function(o,_){return o.doc.setDirection(_)},!0),u("phrases",null)}function Jl(e,t,u){var o=u&&u!=To;if(!t!=!o){var _=e.display.dragFunctions,B=t?He:bt;B(e.display.scroller,"dragstart",_.start),B(e.display.scroller,"dragenter",_.enter),B(e.display.scroller,"dragover",_.over),B(e.display.scroller,"dragleave",_.leave),B(e.display.scroller,"drop",_.drop)}}function Ql(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(y(e.display.wrapper,"CodeMirror-wrap"),an(e)),Ii(e),Wr(e),cr(e),setTimeout(function(){return ma(e)},100)}function fi(e,t){var u=this;if(!(this instanceof fi))return new fi(e,t);this.options=t=t?w(t):{},w(al,t,!1);var o=t.value;typeof o=="string"?o=new ea(o,t.mode,null,t.lineSeparator,t.direction):t.mode&&(o.modeOption=t.mode),this.doc=o;var _=new fi.inputStyles[t.inputStyle](this),B=this.display=new ja(e,o,_,t);B.wrapper.CodeMirror=this,il(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ja(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 Z,keySeq:null,specialChars:null},t.autofocus&&!l&&B.input.focus(),K&&M<11&&setTimeout(function(){return u.display.input.reset(!0)},20),Zl(this),Al(),ua(this),this.curOp.forceUpdate=!0,vs(this,o),t.autofocus&&!l||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&la(u)},20):Ta(this);for(var $ in qo)qo.hasOwnProperty($)&&qo[$](this,t[$],To);ii(this),t.finishInit&&t.finishInit(this);for(var ee=0;ee<hs.length;++ee)hs[ee](this);Ea(this),r&&t.lineWrapping&&getComputedStyle(B.lineDiv).textRendering=="optimizelegibility"&&(B.lineDiv.style.textRendering="auto")}fi.defaults=al,fi.optionHandlers=qo;function Zl(e){var t=e.display;He(t.scroller,"mousedown",di(e,el)),K&&M<11?He(t.scroller,"dblclick",di(e,function(oe){if(q(e,oe))return;var he=wi(e,oe);if(!he||ds(e,oe)||si(e.display,oe))return;ae(oe);var ke=e.findWordAt(he);Vo(e.doc,ke.anchor,ke.head)})):He(t.scroller,"dblclick",function(oe){return q(e,oe)||ae(oe)}),He(t.scroller,"contextmenu",function(oe){return rl(e,oe)}),He(t.input.getField(),"contextmenu",function(oe){t.scroller.contains(oe.target)||rl(e,oe)});var u,o={end:0};function _(){t.activeTouch&&(u=setTimeout(function(){return t.activeTouch=null},1e3),o=t.activeTouch,o.end=+new Date)}function B(oe){if(oe.touches.length!=1)return!1;var he=oe.touches[0];return he.radiusX<=1&&he.radiusY<=1}function $(oe,he){if(he.left==null)return!0;var ke=he.left-oe.left,Fe=he.top-oe.top;return ke*ke+Fe*Fe>20*20}He(t.scroller,"touchstart",function(oe){if(!q(e,oe)&&!B(oe)&&!ds(e,oe)){t.input.ensurePolled(),clearTimeout(u);var he=+new Date;t.activeTouch={start:he,moved:!1,prev:he-o.end<=300?o:null},oe.touches.length==1&&(t.activeTouch.left=oe.touches[0].pageX,t.activeTouch.top=oe.touches[0].pageY)}}),He(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),He(t.scroller,"touchend",function(oe){var he=t.activeTouch;if(he&&!si(t,oe)&&he.left!=null&&!he.moved&&new Date-he.start<300){var ke=e.coordsChar(t.activeTouch,"page"),Fe;!he.prev||$(he,he.prev)?Fe=new Ir(ke,ke):!he.prev.prev||$(he,he.prev.prev)?Fe=e.findWordAt(ke):Fe=new Ir(Yt(ke.line,0),Fn(e.doc,Yt(ke.line+1,0))),e.setSelection(Fe.anchor,Fe.head),e.focus(),ae(oe)}_()}),He(t.scroller,"touchcancel",_),He(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Da(e,t.scroller.scrollTop),ki(e,t.scroller.scrollLeft,!0),de(e,"scroll",e))}),He(t.scroller,"mousewheel",function(oe){return Ha(e,oe)}),He(t.scroller,"DOMMouseScroll",function(oe){return Ha(e,oe)}),He(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(oe){q(e,oe)||_e(oe)},over:function(oe){q(e,oe)||(Rl(e,oe),_e(oe))},start:function(oe){return Ol(e,oe)},drop:di(e,Sl),leave:function(oe){q(e,oe)||Hs(e)}};var ee=t.input.getField();He(ee,"keyup",function(oe){return Zs.call(e,oe)}),He(ee,"keydown",di(e,Qs)),He(ee,"keypress",di(e,qs)),He(ee,"focus",function(oe){return la(e,oe)}),He(ee,"blur",function(oe){return Ta(e,oe)})}var hs=[];fi.defineInitHook=function(e){return hs.push(e)};function Ko(e,t,u,o){var _=e.doc,B;u==null&&(u="add"),u=="smart"&&(_.mode.indent?B=ni(e,t).state:u="prev");var $=e.options.tabSize,ee=Qt(_,t),oe=Y(ee.text,null,$);ee.stateAfter&&(ee.stateAfter=null);var he=ee.text.match(/^\s*/)[0],ke;if(!o&&!/\S/.test(ee.text))ke=0,u="not";else if(u=="smart"&&(ke=_.mode.indent(B,ee.text.slice(he.length),ee.text),ke==Ze||ke>150)){if(!o)return;u="prev"}u=="prev"?t>_.first?ke=Y(Qt(_,t-1).text,null,$):ke=0:u=="add"?ke=oe+e.options.indentUnit:u=="subtract"?ke=oe-e.options.indentUnit:typeof u=="number"&&(ke=oe+u),ke=Math.max(0,ke);var Fe="",ut=0;if(e.options.indentWithTabs)for(var ot=Math.floor(ke/$);ot;--ot)ut+=$,Fe+=" ";if(ut<ke&&(Fe+=X(ke-ut)),Fe!=he)return bo(_,Fe,Yt(t,0),Yt(t,he.length),"+input"),ee.stateAfter=null,!0;for(var Nt=0;Nt<_.sel.ranges.length;Nt++){var rn=_.sel.ranges[Nt];if(rn.head.line==t&&rn.head.ch<he.length){var wn=Yt(t,he.length);as(_,Nt,new Ir(wn,wn));break}}}var wa=null;function es(e){wa=e}function fs(e,t,u,o,_){var B=e.doc;e.display.shift=!1,o||(o=B.sel);var $=+new Date-200,ee=_=="paste"||e.state.pasteIncoming>$,oe=Cn(t),he=null;if(ee&&o.ranges.length>1)if(wa&&wa.text.join(`
|
|
`)==t){if(o.ranges.length%wa.text.length==0){he=[];for(var ke=0;ke<wa.text.length;ke++)he.push(B.splitLines(wa.text[ke]))}}else oe.length==o.ranges.length&&e.options.pasteLinesPerSelection&&(he=W(oe,function(Dn){return[Dn]}));for(var Fe=e.curOp.updateInput,ut=o.ranges.length-1;ut>=0;ut--){var ot=o.ranges[ut],Nt=ot.from(),rn=ot.to();ot.empty()&&(u&&u>0?Nt=Yt(Nt.line,Nt.ch-u):e.state.overwrite&&!ee?rn=Yt(rn.line,Math.min(Qt(B,rn.line).text.length,rn.ch+j(oe).length)):ee&&wa&&wa.lineWise&&wa.text.join(`
|
|
`)==oe.join(`
|
|
`)&&(Nt=rn=Yt(Nt.line,0)));var wn={from:Nt,to:rn,text:he?he[ut%he.length]:oe,origin:_||(ee?"paste":e.state.cutIncoming>$?"cut":"+input")};yo(e.doc,wn),mt(e,"inputRead",e,wn)}t&&!ee&&sl(e,t),_a(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Fe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Wi(t,function(){return fs(t,u,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var u=e.doc.sel,o=u.ranges.length-1;o>=0;o--){var _=u.ranges[o];if(_.head.ch>100||o&&u.ranges[o-1].head.line==_.head.line)continue;var B=e.getModeAt(_.head),$=!1;if(B.electricChars){for(var ee=0;ee<B.electricChars.length;ee++)if(t.indexOf(B.electricChars.charAt(ee))>-1){$=Ko(e,_.head.line,"smart");break}}else B.electricInput&&(B.electricInput.test(Qt(e.doc,_.head.line).text.slice(0,_.head.ch))&&($=Ko(e,_.head.line,"smart")));$&&mt(e,"electricInput",e,_.head.line)}}function ll(e){for(var t=[],u=[],o=0;o<e.doc.sel.ranges.length;o++){var _=e.doc.sel.ranges[o].head.line,B={anchor:Yt(_,0),head:Yt(_+1,0)};u.push(B),t.push(e.getRange(B.anchor,B.head))}return{text:t,ranges:u}}function ul(e,t,u,o){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",o?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=h("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=h("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return r?e.style.width="1000px":e.setAttribute("wrap","off"),s&&(e.style.border="1px solid black"),ul(e),t}function ql(e){var t=e.optionHandlers,u=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(o,_){var B=this.options,$=B[o];if(B[o]==_&&o!="mode")return;B[o]=_,t.hasOwnProperty(o)&&di(this,t[o])(this,_,$),de(this,"optionChange",this,o)},getOption:function(o){return this.options[o]},getDoc:function(){return this.doc},addKeyMap:function(o,_){this.state.keyMaps[_?"push":"unshift"](Qo(o))},removeKeyMap:function(o){for(var _=this.state.keyMaps,B=0;B<_.length;++B)if(_[B]==o||_[B].name==o)return _.splice(B,1),!0},addOverlay:Ri(function(o,_){var B=o.token?o:e.getMode(this.options,o);if(B.startState)throw new Error("Overlays may not be stateful.");Q(this.state.overlays,{mode:B,modeSpec:o,opaque:_&&_.opaque,priority:_&&_.priority||0},function($){return $.priority}),this.state.modeGen++,Wr(this)}),removeOverlay:Ri(function(o){for(var _=this.state.overlays,B=0;B<_.length;++B){var $=_[B].modeSpec;if($==o||typeof o=="string"&&$.name==o){_.splice(B,1),this.state.modeGen++,Wr(this);return}}}),indentLine:Ri(function(o,_,B){typeof _!="string"&&typeof _!="number"&&(_==null?_=this.options.smartIndent?"smart":"prev":_=_?"add":"subtract"),Gr(this.doc,o)&&Ko(this,o,_,B)}),indentSelection:Ri(function(o){for(var _=this.doc.sel.ranges,B=-1,$=0;$<_.length;$++){var ee=_[$];if(ee.empty())ee.head.line>B&&(Ko(this,ee.head.line,o,!0),B=ee.head.line,$==this.doc.sel.primIndex&&_a(this));else{var oe=ee.from(),he=ee.to(),ke=Math.max(B,oe.line);B=Math.min(this.lastLine(),he.line-(he.ch?0:1))+1;for(var Fe=ke;Fe<B;++Fe)Ko(this,Fe,o);var ut=this.doc.sel.ranges;oe.ch==0&&_.length==ut.length&&ut[$].from().ch>0&&as(this.doc,$,new Ir(oe,ut[$].to()),Ce)}}}),getTokenAt:function(o,_){return Si(this,o,_)},getLineTokens:function(o,_){return Si(this,Yt(o),_,!0)},getTokenTypeAt:function(o){o=Fn(this.doc,o);var _=mi(this,Qt(this.doc,o.line)),B=0,$=(_.length-1)/2,ee=o.ch,oe;if(ee==0)oe=_[2];else for(;;){var he=B+$>>1;if((he?_[he*2-1]:0)>=ee)$=he;else if(_[he*2+1]<ee)B=he+1;else{oe=_[he*2+2];break}}var ke=oe?oe.indexOf("overlay "):-1;return ke<0?oe:ke==0?null:oe.slice(0,ke-1)},getModeAt:function(o){var _=this.doc.mode;return _.innerMode?e.innerMode(_,this.getTokenAt(o).state).mode:_},getHelper:function(o,_){return this.getHelpers(o,_)[0]},getHelpers:function(o,_){var B=[];if(!u.hasOwnProperty(_))return B;var $=u[_],ee=this.getModeAt(o);if(typeof ee[_]=="string")$[ee[_]]&&B.push($[ee[_]]);else if(ee[_])for(var oe=0;oe<ee[_].length;oe++){var he=$[ee[_][oe]];he&&B.push(he)}else ee.helperType&&$[ee.helperType]?B.push($[ee.helperType]):$[ee.name]&&B.push($[ee.name]);for(var ke=0;ke<$._global.length;ke++){var Fe=$._global[ke];Fe.pred(ee,this)&&ce(B,Fe.val)==-1&&B.push(Fe.val)}return B},getStateAfter:function(o,_){var B=this.doc;return o=Lr(B,o==null?B.first+B.size-1:o),ni(this,o+1,_).state},cursorCoords:function(o,_){var B,$=this.doc.sel.primary();return o==null?B=$.head:typeof o=="object"?B=Fn(this.doc,o):B=o?$.from():$.to(),en(this,B,_||"page")},charCoords:function(o,_){return Mt(this,Fn(this.doc,o),_||"page")},coordsChar:function(o,_){return o=Xt(this,o,_||"page"),nr(this,o.left,o.top)},lineAtHeight:function(o,_){return o=Xt(this,{top:o,left:0},_||"page").top,tr(this.doc,o+this.display.viewOffset)},heightAtLine:function(o,_,B){var $=!1,ee;if(typeof o=="number"){var oe=this.doc.first+this.doc.size-1;o<this.doc.first?o=this.doc.first:o>oe&&(o=oe,$=!0),ee=Qt(this.doc,o)}else ee=o;return Er(this,ee,{top:0,left:0},_||"page",B||$).top+($?this.doc.height-cn(ee):0)},defaultTextHeight:function(){return Pr(this.display)},defaultCharWidth:function(){return Dr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(o,_,B,$,ee){var oe=this.display;o=en(this,Fn(this.doc,o));var he=o.bottom,ke=o.left;if(_.style.position="absolute",_.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(_),oe.sizer.appendChild(_),$=="over")he=o.top;else if($=="above"||$=="near"){var Fe=Math.max(oe.wrapper.clientHeight,this.doc.height),ut=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);($=="above"||o.bottom+_.offsetHeight>Fe)&&o.top>_.offsetHeight?he=o.top-_.offsetHeight:o.bottom+_.offsetHeight<=Fe&&(he=o.bottom),ke+_.offsetWidth>ut&&(ke=ut-_.offsetWidth)}_.style.top=he+"px",_.style.left=_.style.right="",ee=="right"?(ke=oe.sizer.clientWidth-_.offsetWidth,_.style.right="0px"):(ee=="left"?ke=0:ee=="middle"&&(ke=(oe.sizer.clientWidth-_.offsetWidth)/2),_.style.left=ke+"px"),B&&za(this,{left:ke,top:he,right:ke+_.offsetWidth,bottom:he+_.offsetHeight})},triggerOnKeyDown:Ri(Qs),triggerOnKeyPress:Ri(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Ri(el),execCommand:function(o){if(Fo.hasOwnProperty(o))return Fo[o].call(null,this)},triggerElectric:Ri(function(o){sl(this,o)}),findPosH:function(o,_,B,$){var ee=1;_<0&&(ee=-1,_=-_);for(var oe=Fn(this.doc,o),he=0;he<_&&!(oe=ps(this.doc,oe,ee,B,$),oe.hitSide);++he);return oe},moveH:Ri(function(o,_){var B=this;this.extendSelectionsBy(function($){return B.display.shift||B.doc.extend||$.empty()?ps(B.doc,$.head,o,_,B.options.rtlMoveVisually):o<0?$.from():$.to()},Ve)}),deleteH:Ri(function(o,_){var B=this.doc.sel,$=this.doc;B.somethingSelected()?$.replaceSelection("",null,"+delete"):wo(this,function(ee){var oe=ps($,ee.head,o,_,!1);return o<0?{from:oe,to:ee.head}:{from:ee.head,to:oe}})}),findPosV:function(o,_,B,$){var ee=1,oe=$;_<0&&(ee=-1,_=-_);for(var he=Fn(this.doc,o),ke=0;ke<_;++ke){var Fe=en(this,he,"div");if(oe==null?oe=Fe.left:Fe.left=oe,he=dl(this,Fe,ee,B),he.hitSide)break}return he},moveV:Ri(function(o,_){var B=this,$=this.doc,ee=[],oe=!this.display.shift&&!$.extend&&$.sel.somethingSelected();if($.extendSelectionsBy(function(ke){if(oe)return o<0?ke.from():ke.to();var Fe=en(B,ke.head,"div");ke.goalColumn!=null&&(Fe.left=ke.goalColumn),ee.push(Fe.left);var ut=dl(B,Fe,o,_);return _=="page"&&ke==$.sel.primary()&&Va(B,Mt(B,ut,"div").top-Fe.top),ut},Ve),ee.length)for(var he=0;he<$.sel.ranges.length;he++)$.sel.ranges[he].goalColumn=ee[he]}),findWordAt:function(o){var _=this.doc,B=Qt(_,o.line).text,$=o.ch,ee=o.ch;if(B){var oe=this.getHelper(o,"wordChars");(o.sticky=="before"||ee==B.length)&&$?--$:++ee;for(var he=B.charAt($),ke=tt(he,oe)?function(Fe){return tt(Fe,oe)}:/\s/.test(he)?function(Fe){return/\s/.test(Fe)}:function(Fe){return!/\s/.test(Fe)&&!tt(Fe)};$>0&&ke(B.charAt($-1));)--$;for(;ee<B.length&&ke(B.charAt(ee));)++ee}return new Ir(Yt(o.line,$),Yt(o.line,ee))},toggleOverwrite:function(o){if(o!=null&&o==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?H(this.display.cursorDiv,"CodeMirror-overwrite"):y(this.display.cursorDiv,"CodeMirror-overwrite"),de(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ri(function(o,_){Ra(this,o,_)}),getScrollInfo:function(){var o=this.display.scroller;return{left:o.scrollLeft,top:o.scrollTop,height:o.scrollHeight-Ge(this)-this.display.barHeight,width:o.scrollWidth-Ge(this)-this.display.barWidth,clientHeight:ue(this),clientWidth:Ae(this)}},scrollIntoView:Ri(function(o,_){o==null?(o={from:this.doc.sel.primary().head,to:null},_==null&&(_=this.options.cursorScrollMargin)):typeof o=="number"?o={from:Yt(o,0),to:null}:o.from==null&&(o={from:o,to:null}),o.to||(o.to=o.from),o.margin=_||0,o.from.line!=null?ho(this,o):Aa(this,o.from,o.to,o.margin)}),setSize:Ri(function(o,_){var B=this,$=function(oe){return typeof oe=="number"||/^\d+$/.test(String(oe))?oe+"px":oe};o!=null&&(this.display.wrapper.style.width=$(o)),_!=null&&(this.display.wrapper.style.height=$(_)),this.options.lineWrapping&&$n(this);var ee=this.display.viewFrom;this.doc.iter(ee,this.display.viewTo,function(oe){if(oe.widgets){for(var he=0;he<oe.widgets.length;he++)if(oe.widgets[he].noHScroll){Vr(B,ee,"widget");break}}++ee}),this.curOp.forceUpdate=!0,de(this,"refresh",this)}),operation:function(o){return Wi(this,o)},startOperation:function(){return ua(this)},endOperation:function(){return Ea(this)},refresh:Ri(function(){var o=this.display.cachedTextHeight;Wr(this),this.curOp.forceUpdate=!0,cr(this),Ra(this,this.doc.scrollLeft,this.doc.scrollTop),Za(this.display),(o==null||Math.abs(o-Pr(this.display))>.5||this.options.lineWrapping)&&Ii(this),de(this,"refresh",this)}),swapDoc:Ri(function(o){var _=this.doc;return _.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,o),cr(this),this.display.input.reset(),Ra(this,o.scrollLeft,o.scrollTop),this.curOp.forceScroll=!0,mt(this,"swapDoc",this,_),_}),phrase:function(o){var _=this.options.phrases;return _&&Object.prototype.hasOwnProperty.call(_,o)?_[o]:o},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}},pe(e),e.registerHelper=function(o,_,B){u.hasOwnProperty(o)||(u[o]=e[o]={_global:[]}),u[o][_]=B},e.registerGlobalHelper=function(o,_,B,$){e.registerHelper(o,_,$),u[o]._global.push({pred:B,val:$})}}function ps(e,t,u,o,_){var B=t,$=u,ee=Qt(e,t.line),oe=_&&e.direction=="rtl"?-u:u;function he(){var Nn=t.line+oe;return Nn<e.first||Nn>=e.first+e.size?!1:(t=new Yt(Nn,t.ch,t.sticky),ee=Qt(e,Nn))}function ke(Nn){var Ln;if(o=="codepoint"){var Kn=ee.text.charCodeAt(t.ch+(o>0?0:-1));isNaN(Kn)?Ln=null:Ln=new Yt(t.line,Math.max(0,Math.min(ee.text.length,t.ch+u*(Kn>=55296&&Kn<56320?2:1))),-u)}else _?Ln=Ml(e.cm,ee,t,u):Ln=ss(ee,t,u);if(Ln==null)if(!Nn&&he())t=ls(_,e.cm,ee,t.line,oe);else return!1;else t=Ln;return!0}if(o=="char"||o=="codepoint")ke();else if(o=="column")ke(!0);else if(o=="word"||o=="group")for(var Fe=null,ut=o=="group",ot=e.cm&&e.cm.getHelper(t,"wordChars"),Nt=!0;!(u<0&&!ke(!Nt));Nt=!1){var rn=ee.text.charAt(t.ch)||`
|
|
`,wn=tt(rn,ot)?"w":ut&&rn==`
|
|
`?"n":!ut||/\s/.test(rn)?null:"p";if(ut&&!Nt&&!wn&&(wn="s"),Fe&&Fe!=wn){u<0&&(u=1,ke(),t.sticky="after");break}if(wn&&(Fe=wn),u>0&&!ke(!Nt))break}var Dn=Xo(e,t,B,$,!0);return vi(B,Dn)&&(Dn.hitSide=!0),Dn}function dl(e,t,u,o){var _=e.doc,B=t.left,$;if(o=="page"){var ee=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),oe=Math.max(ee-.5*Pr(e.display),3);$=(u>0?t.bottom:t.top)+u*oe}else o=="line"&&($=u>0?t.bottom+3:t.top-3);for(var he;!(he=nr(e,B,$),!he.outside);){if(u<0?$<=0:$>=_.height){he.hitSide=!0;break}$+=u*5}return he}var Zr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Zr.prototype.init=function(e){var t=this,u=this,o=u.cm,_=u.div=e.lineDiv;ul(_,o.options.spellcheck,o.options.autocorrect,o.options.autocapitalize);function B(ee){for(var oe=ee.target;oe;oe=oe.parentNode){if(oe==_)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}He(_,"paste",function(ee){if(!B(ee)||q(o,ee)||ol(ee,o))return;M<=11&&setTimeout(di(o,function(){return t.updateFromDOM()}),20)}),He(_,"compositionstart",function(ee){t.composing={data:ee.data,done:!1}}),He(_,"compositionupdate",function(ee){t.composing||(t.composing={data:ee.data,done:!1})}),He(_,"compositionend",function(ee){t.composing&&(ee.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),He(_,"touchstart",function(){return u.forceCompositionEnd()}),He(_,"input",function(){t.composing||t.readFromDOMSoon()});function $(ee){if(!B(ee)||q(o,ee))return;if(o.somethingSelected())es({lineWise:!1,text:o.getSelections()}),ee.type=="cut"&&o.replaceSelection("",null,"cut");else if(o.options.lineWiseCopyCut){var oe=ll(o);es({lineWise:!0,text:oe.text}),ee.type=="cut"&&o.operation(function(){o.setSelections(oe.ranges,0,Ce),o.replaceSelection("",null,"cut")})}else return;if(ee.clipboardData){ee.clipboardData.clearData();var he=wa.text.join(`
|
|
`);if(ee.clipboardData.setData("Text",he),ee.clipboardData.getData("Text")==he){ee.preventDefault();return}}var ke=cl(),Fe=ke.firstChild;o.display.lineSpace.insertBefore(ke,o.display.lineSpace.firstChild),Fe.value=wa.text.join(`
|
|
`);var ut=document.activeElement;F(Fe),setTimeout(function(){o.display.lineSpace.removeChild(ke),ut.focus(),ut==_&&u.showPrimarySelection()},50)}He(_,"copy",$),He(_,"cut",$)},Zr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Zr.prototype.prepareSelection=function(){var e=Qi(this.cm,!1);return e.focus=document.activeElement==this.div,e},Zr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Zr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Zr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,u=t.doc.sel.primary(),o=u.from(),_=u.to();if(t.display.viewTo==t.display.viewFrom||o.line>=t.display.viewTo||_.line<t.display.viewFrom){e.removeAllRanges();return}var B=ts(t,e.anchorNode,e.anchorOffset),$=ts(t,e.focusNode,e.focusOffset);if(B&&!B.bad&&$&&!$.bad&&Vn(Yr(B,$),o)==0&&Vn(ai(B,$),_)==0)return;var ee=t.display.view,oe=o.line>=t.display.viewFrom&&hl(t,o)||{node:ee[0].measure.map[2],offset:0},he=_.line<t.display.viewTo&&hl(t,_);if(!he){var ke=ee[ee.length-1].measure,Fe=ke.maps?ke.maps[ke.maps.length-1]:ke.map;he={node:Fe[Fe.length-1],offset:Fe[Fe.length-2]-Fe[Fe.length-3]}}if(!oe||!he){e.removeAllRanges();return}var ut=e.rangeCount&&e.getRangeAt(0),ot;try{ot=g(oe.node,oe.offset,he.offset,he.node)}catch(Nt){}ot&&(!I&&t.state.focused?(e.collapse(oe.node,oe.offset),ot.collapsed||(e.removeAllRanges(),e.addRange(ot))):(e.removeAllRanges(),e.addRange(ot)),ut&&e.anchorNode==null?e.addRange(ut):I&&this.startGracePeriod()),this.rememberSelection()},Zr.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)},Zr.prototype.showMultipleSelections=function(e){f(this.cm.display.cursorDiv,e.cursors),f(this.cm.display.selectionDiv,e.selection)},Zr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Zr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return b(this.div,t)},Zr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Zr.prototype.blur=function(){this.div.blur()},Zr.prototype.getField=function(){return this.div},Zr.prototype.supportsTouch=function(){return!0},Zr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Wi(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Zr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Zr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(d&&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 u=ts(t,e.anchorNode,e.anchorOffset),o=ts(t,e.focusNode,e.focusOffset);u&&o&&Wi(t,function(){zi(t.doc,Pn(u,o),Ce),(u.bad||o.bad)&&(t.curOp.selectionChanged=!0)})},Zr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,u=e.doc.sel.primary(),o=u.from(),_=u.to();if(o.ch==0&&o.line>e.firstLine()&&(o=Yt(o.line-1,Qt(e.doc,o.line-1).length)),_.ch==Qt(e.doc,_.line).text.length&&_.line<e.lastLine()&&(_=Yt(_.line+1,0)),o.line<t.viewFrom||_.line>t.viewTo-1)return!1;var B,$,ee;o.line==t.viewFrom||(B=Jr(e,o.line))==0?($=zn(t.view[0].line),ee=t.view[0].node):($=zn(t.view[B].line),ee=t.view[B-1].node.nextSibling);var oe=Jr(e,_.line),he,ke;if(oe==t.view.length-1?(he=t.viewTo-1,ke=t.lineDiv.lastChild):(he=zn(t.view[oe+1].line)-1,ke=t.view[oe+1].node.previousSibling),!ee)return!1;for(var Fe=e.doc.splitLines(tu(e,ee,ke,$,he)),ut=Hn(e.doc,Yt($,0),Yt(he,Qt(e.doc,he).text.length));Fe.length>1&&ut.length>1;)if(j(Fe)==j(ut))Fe.pop(),ut.pop(),he--;else if(Fe[0]==ut[0])Fe.shift(),ut.shift(),$++;else break;for(var ot=0,Nt=0,rn=Fe[0],wn=ut[0],Dn=Math.min(rn.length,wn.length);ot<Dn&&rn.charCodeAt(ot)==wn.charCodeAt(ot);)++ot;for(var Nn=j(Fe),Ln=j(ut),Kn=Math.min(Nn.length-(Fe.length==1?ot:0),Ln.length-(ut.length==1?ot:0));Nt<Kn&&Nn.charCodeAt(Nn.length-Nt-1)==Ln.charCodeAt(Ln.length-Nt-1);)++Nt;if(Fe.length==1&&ut.length==1&&$==o.line)for(;ot&&ot>o.ch&&Nn.charCodeAt(Nn.length-Nt-1)==Ln.charCodeAt(Ln.length-Nt-1);)ot--,Nt++;Fe[Fe.length-1]=Nn.slice(0,Nn.length-Nt).replace(/^\u200b+/,""),Fe[0]=Fe[0].slice(ot).replace(/\u200b+$/,"");var fr=Yt($,ot),or=Yt(he,ut.length?j(ut).length-Nt:0);if(Fe.length>1||Fe[0]||Vn(fr,or))return bo(e.doc,Fe,fr,or,"+input"),!0},Zr.prototype.ensurePolled=function(){this.forceCompositionEnd()},Zr.prototype.reset=function(){this.forceCompositionEnd()},Zr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Zr.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)},Zr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Wi(this.cm,function(){return Wr(e.cm)})},Zr.prototype.setUneditable=function(e){e.contentEditable="false"},Zr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||di(this.cm,fs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Zr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Zr.prototype.onContextMenu=function(){},Zr.prototype.resetPosition=function(){},Zr.prototype.needsContentAttribute=!0;function hl(e,t){var u=$e(e,t.line);if(!u||u.hidden)return null;var o=Qt(e.doc,t.line),_=fe(u,o,t.line),B=ln(o,e.doc.direction),$="left";if(B){var ee=Qe(B,t.ch);$=ee%2?"right":"left"}var oe=It(_.map,t.ch,$);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Co(e,t){return t&&(e.bad=!0),e}function tu(e,t,u,o,_){var B="",$=!1,ee=e.doc.lineSeparator(),oe=!1;function he(ot){return function(Nt){return Nt.id==ot}}function ke(){$&&(B+=ee,oe&&(B+=ee),$=oe=!1)}function Fe(ot){ot&&(ke(),B+=ot)}function ut(ot){if(ot.nodeType==1){var Nt=ot.getAttribute("cm-text");if(Nt){Fe(Nt);return}var rn=ot.getAttribute("cm-marker"),wn;if(rn){var Dn=e.findMarks(Yt(o,0),Yt(_+1,0),he(+rn));Dn.length&&(wn=Dn[0].find(0))&&Fe(Hn(e.doc,wn.from,wn.to).join(ee));return}if(ot.getAttribute("contenteditable")=="false")return;var Nn=/^(pre|div|p|li|table|br)$/i.test(ot.nodeName);if(!/^br$/i.test(ot.nodeName)&&ot.textContent.length==0)return;Nn&&ke();for(var Ln=0;Ln<ot.childNodes.length;Ln++)ut(ot.childNodes[Ln]);/^(pre|p)$/i.test(ot.nodeName)&&(oe=!0),Nn&&($=!0)}else ot.nodeType==3&&Fe(ot.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ut(t),t==u);)t=t.nextSibling,oe=!1;return B}function ts(e,t,u){var o;if(t==e.display.lineDiv){if(o=e.display.lineDiv.childNodes[u],!o)return Co(e.clipPos(Yt(e.display.viewTo-1)),!0);t=null,u=0}else for(o=t;;o=o.parentNode){if(!o||o==e.display.lineDiv)return null;if(o.parentNode&&o.parentNode==e.display.lineDiv)break}for(var _=0;_<e.display.view.length;_++){var B=e.display.view[_];if(B.node==o)return nu(B,t,u)}}function nu(e,t,u){var o=e.text.firstChild,_=!1;if(!t||!b(o,t))return Co(Yt(zn(e.line),0),!0);if(t==o&&(_=!0,t=o.childNodes[u],u=0,!t)){var B=e.rest?j(e.rest):e.line;return Co(Yt(zn(B),B.text.length),_)}var $=t.nodeType==3?t:null,ee=t;for(!$&&t.childNodes.length==1&&t.firstChild.nodeType==3&&($=t.firstChild,u&&(u=$.nodeValue.length));ee.parentNode!=o;)ee=ee.parentNode;var oe=e.measure,he=oe.maps;function ke(wn,Dn,Nn){for(var Ln=-1;Ln<(he?he.length:0);Ln++)for(var Kn=Ln<0?oe.map:he[Ln],fr=0;fr<Kn.length;fr+=3){var or=Kn[fr+2];if(or==wn||or==Dn){var Rr=zn(Ln<0?e.line:e.rest[Ln]),ti=Kn[fr]+Nn;return(Nn<0||or!=wn)&&(ti=Kn[fr+(Nn?1:0)]),Yt(Rr,ti)}}}var Fe=ke($,ee,u);if(Fe)return Co(Fe,_);for(var ut=ee.nextSibling,ot=$?$.nodeValue.length-u:0;ut;ut=ut.nextSibling){if(Fe=ke(ut,ut.firstChild,0),Fe)return Co(Yt(Fe.line,Fe.ch-ot),_);ot+=ut.textContent.length}for(var Nt=ee.previousSibling,rn=u;Nt;Nt=Nt.previousSibling){if(Fe=ke(Nt,Nt.firstChild,-1),Fe)return Co(Yt(Fe.line,Fe.ch+rn),_);rn+=Nt.textContent.length}}var Ci=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Z,this.hasSelection=!1,this.composing=null};Ci.prototype.init=function(e){var t=this,u=this,o=this.cm;this.createField(e);var _=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),s&&(_.style.width="0px"),He(_,"input",function(){K&&M>=9&&t.hasSelection&&(t.hasSelection=null),u.poll()}),He(_,"paste",function($){if(q(o,$)||ol($,o))return;o.state.pasteIncoming=+new Date,u.fastPoll()});function B($){if(q(o,$))return;if(o.somethingSelected())es({lineWise:!1,text:o.getSelections()});else if(o.options.lineWiseCopyCut){var ee=ll(o);es({lineWise:!0,text:ee.text}),$.type=="cut"?o.setSelections(ee.ranges,null,Ce):(u.prevInput="",_.value=ee.text.join(`
|
|
`),F(_))}else return;$.type=="cut"&&(o.state.cutIncoming=+new Date)}He(_,"cut",B),He(_,"copy",B),He(e.scroller,"paste",function($){if(si(e,$)||q(o,$))return;if(!_.dispatchEvent){o.state.pasteIncoming=+new Date,u.focus();return}var ee=new Event("paste");ee.clipboardData=$.clipboardData,_.dispatchEvent(ee)}),He(e.lineSpace,"selectstart",function($){si(e,$)||ae($)}),He(_,"compositionstart",function(){var $=o.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:$,range:o.markText($,o.getCursor("to"),{className:"CodeMirror-composing"})}}),He(_,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Ci.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},Ci.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ci.prototype.prepareSelection=function(){var e=this.cm,t=e.display,u=e.doc,o=Qi(e);if(e.options.moveInputWithCursor){var _=en(e,u.sel.primary().head,"div"),B=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();o.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,_.top+$.top-B.top)),o.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,_.left+$.left-B.left))}return o},Ci.prototype.showSelection=function(e){var t=this.cm,u=t.display;f(u.cursorDiv,e.cursors),f(u.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ci.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var u=t.getSelection();this.textarea.value=u,t.state.focused&&F(this.textarea),K&&M>=9&&(this.hasSelection=u)}else e||(this.prevInput=this.textarea.value="",K&&M>=9&&(this.hasSelection=null))},Ci.prototype.getField=function(){return this.textarea},Ci.prototype.supportsTouch=function(){return!1},Ci.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!l||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ci.prototype.blur=function(){this.textarea.blur()},Ci.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ci.prototype.receivedFocus=function(){this.slowPoll()},Ci.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()})},Ci.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function u(){var o=t.poll();!o&&!e?(e=!0,t.polling.set(60,u)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,u)},Ci.prototype.poll=function(){var e=this,t=this.cm,u=this.textarea,o=this.prevInput;if(this.contextMenuPending||!t.state.focused||vn(u)&&!o&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var _=u.value;if(_==o&&!t.somethingSelected())return!1;if(K&&M>=9&&this.hasSelection===_||i&&/[\uf700-\uf7ff]/.test(_))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var B=_.charCodeAt(0);if(B==8203&&!o&&(o="\u200B"),B==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,ee=Math.min(o.length,_.length);$<ee&&o.charCodeAt($)==_.charCodeAt($);)++$;return Wi(t,function(){fs(t,_.slice($),o.length-$,null,e.composing?"*compose":null),_.length>1e3||_.indexOf(`
|
|
`)>-1?u.value=e.prevInput="":e.prevInput=_,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ci.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ci.prototype.onKeyPress=function(){K&&M>=9&&(this.hasSelection=null),this.fastPoll()},Ci.prototype.onContextMenu=function(e){var t=this,u=t.cm,o=u.display,_=t.textarea;t.contextMenuPending&&t.contextMenuPending();var B=wi(u,e),$=o.scroller.scrollTop;if(!B||p)return;var ee=u.options.resetSelectionOnContextMenu;ee&&u.doc.sel.contains(B)==-1&&di(u,zi)(u.doc,Pn(B),Ce);var oe=_.style.cssText,he=t.wrapper.style.cssText,ke=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",_.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-ke.top-5)+"px; left: "+(e.clientX-ke.left-5)+`px;
|
|
z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Fe;r&&(Fe=window.scrollY),o.input.focus(),r&&window.scrollTo(null,Fe),o.input.reset(),u.somethingSelected()||(_.value=t.prevInput=" "),t.contextMenuPending=ot,o.selForContextMenu=u.doc.sel,clearTimeout(o.detectingSelectAll);function ut(){if(_.selectionStart!=null){var rn=u.somethingSelected(),wn="\u200B"+(rn?_.value:"");_.value="\u21DA",_.value=wn,t.prevInput=rn?"":"\u200B",_.selectionStart=1,_.selectionEnd=wn.length,o.selForContextMenu=u.doc.sel}}function ot(){if(t.contextMenuPending!=ot)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=he,_.style.cssText=oe,K&&M<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=$),_.selectionStart!=null){(!K||K&&M<9)&&ut();var rn=0,wn=function(){o.selForContextMenu==u.doc.sel&&_.selectionStart==0&&_.selectionEnd>0&&t.prevInput=="\u200B"?di(u,Ds)(u):rn++<10?o.detectingSelectAll=setTimeout(wn,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(wn,200)}}if(K&&M>=9&&ut(),R){_e(e);var Nt=function(){bt(window,"mouseup",Nt),setTimeout(ot,20)};He(window,"mouseup",Nt)}else setTimeout(ot,50)},Ci.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ci.prototype.setUneditable=function(){},Ci.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?w(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 u=N();t.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function o(){e.value=ee.getValue()}var _;if(e.form&&(He(e.form,"submit",o),!t.leaveSubmitMethodAlone)){var B=e.form;_=B.submit;try{var $=B.submit=function(){o(),B.submit=_,B.submit(),B.submit=$}}catch(oe){}}t.finishInit=function(oe){oe.save=o,oe.getTextArea=function(){return e},oe.toTextArea=function(){oe.toTextArea=isNaN,o(),e.parentNode.removeChild(oe.getWrapperElement()),e.style.display="",e.form&&(bt(e.form,"submit",o),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=_))}},e.style.display="none";var ee=fi(function(oe){return e.parentNode.insertBefore(oe,e.nextSibling)},t);return ee}function iu(e){e.off=bt,e.on=He,e.wheelEventPixels=Ba,e.Doc=ea,e.splitLines=Cn,e.countColumn=Y,e.findColumn=Ye,e.isWordChar=Ie,e.Pass=Ze,e.signal=de,e.Line=mn,e.changeEnd=Jn,e.scrollbarModel=$a,e.Pos=Yt,e.cmpPos=Vn,e.modes=vr,e.mimeModes=Mn,e.resolveMode=jt,e.getMode=Ft,e.modeExtensions=zt,e.extendMode=dn,e.copyState=yn,e.startState=_r,e.innerMode=bn,e.commands=Fo,e.keyMap=Ka,e.keyName=Vs,e.isModifierKey=Gs,e.lookupKey=xo,e.normalizeKeyMap=kl,e.StringStream=Bn,e.SharedTextMarker=No,e.TextMarker=qa,e.LineWidget=Io,e.e_preventDefault=ae,e.e_stopPropagation=ie,e.e_stop=_e,e.addClass=H,e.contains=b,e.rmClass=y,e.keyNames=eo}$l(fi),ql(fi);var au="iter insert remove copy getEditor constructor".split(" ");for(var ns in ea.prototype)ea.prototype.hasOwnProperty(ns)&&ce(au,ns)<0&&(fi.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(ea.prototype[ns]));return pe(ea),fi.inputStyles={textarea:Ci,contenteditable:Zr},fi.defineMode=function(e){!fi.defaults.mode&&e!="null"&&(fi.defaults.mode=e),Zn.apply(this,arguments)},fi.defineMIME=dr,fi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),fi.defineMIME("text/plain","null"),fi.defineExtension=function(e,t){fi.prototype[e]=t},fi.defineDocExtension=function(e,t){ea.prototype[e]=t},fi.fromTextArea=ru,iu(fi),fi.version="5.58.2",fi})},WaYH:function(Lt,ve,k){"use strict";var ne=k("rePB"),V=k("Ff2n"),I=k("VTBJ"),z=k("1OyB"),L=k("vuIU"),D=k("JX7q"),K=k("Ji7U"),M=k("LK+K"),r=k("q1tI"),P=k("TSYQ"),x=k.n(P),p=k("sboe"),m=k("OZM5"),c=function(R){var S=R.prefixCls,y=R.level,E=R.isStart,f=R.isEnd;if(!y)return null;for(var h="".concat(S,"-indent-unit"),v=[],g=0;g<y;g+=1){var b;v.push(r.createElement("span",{key:g,className:x()(h,(b={},Object(ne.a)(b,"".concat(h,"-start"),E[g+1]),Object(ne.a)(b,"".concat(h,"-end"),f[g+1]),Object(ne.a)(b,"".concat(h,"-end-first-level"),!g&&f[0]),b))}))}return r.createElement("span",{"aria-hidden":"true",className:"".concat(S,"-indent")},v)},a=c,s=k("815F"),d="open",l="close",i="---",n=function(T){Object(K.a)(S,T);var R=Object(M.a)(S);function S(){var y;return Object(z.a)(this,S),y=R.apply(this,arguments),y.state={dragNodeHighlight:!1},y.onSelectorClick=function(E){var f=y.props.context.onNodeClick;f(E,Object(s.b)(y.props)),y.isSelectable()?y.onSelect(E):y.onCheck(E)},y.onSelectorDoubleClick=function(E){var f=y.props.context.onNodeDoubleClick;f(E,Object(s.b)(y.props))},y.onSelect=function(E){if(y.isDisabled())return;var f=y.props.context.onNodeSelect;E.preventDefault(),f(E,Object(s.b)(y.props))},y.onCheck=function(E){if(y.isDisabled())return;var f=y.props,h=f.disableCheckbox,v=f.checked,g=y.props.context.onNodeCheck;if(!y.isCheckable()||h)return;E.preventDefault();var b=!v;g(E,Object(s.b)(y.props),b)},y.onMouseEnter=function(E){var f=y.props.context.onNodeMouseEnter;f(E,Object(s.b)(y.props))},y.onMouseLeave=function(E){var f=y.props.context.onNodeMouseLeave;f(E,Object(s.b)(y.props))},y.onContextMenu=function(E){var f=y.props.context.onNodeContextMenu;f(E,Object(s.b)(y.props))},y.onDragStart=function(E){var f=y.props.context.onNodeDragStart;E.stopPropagation(),y.setState({dragNodeHighlight:!0}),f(E,Object(D.a)(y));try{E.dataTransfer.setData("text/plain","")}catch(h){}},y.onDragEnter=function(E){var f=y.props.context.onNodeDragEnter;E.preventDefault(),E.stopPropagation(),f(E,Object(D.a)(y))},y.onDragOver=function(E){var f=y.props.context.onNodeDragOver;E.preventDefault(),E.stopPropagation(),f(E,Object(D.a)(y))},y.onDragLeave=function(E){var f=y.props.context.onNodeDragLeave;E.stopPropagation(),f(E,Object(D.a)(y))},y.onDragEnd=function(E){var f=y.props.context.onNodeDragEnd;E.stopPropagation(),y.setState({dragNodeHighlight:!1}),f(E,Object(D.a)(y))},y.onDrop=function(E){var f=y.props.context.onNodeDrop;E.preventDefault(),E.stopPropagation(),y.setState({dragNodeHighlight:!1}),f(E,Object(D.a)(y))},y.onExpand=function(E){var f=y.props.context.onNodeExpand;f(E,Object(s.b)(y.props))},y.setSelectHandle=function(E){y.selectHandle=E},y.getNodeState=function(){var E=y.props.expanded;return y.isLeaf()?null:E?d:l},y.hasChildren=function(){var E=y.props.eventKey,f=y.props.context.keyEntities,h=f[E]||{},v=h.children;return!!(v||[]).length},y.isLeaf=function(){var E=y.props,f=E.isLeaf,h=E.loaded,v=y.props.context.loadData,g=y.hasChildren();return f===!1?!1:f||!v&&!g||v&&h&&!g},y.isDisabled=function(){var E=y.props.disabled,f=y.props.context.disabled;return!!(f||E)},y.isCheckable=function(){var E=y.props.checkable,f=y.props.context.checkable;return!f||E===!1?!1:f},y.syncLoadData=function(E){var f=E.expanded,h=E.loading,v=E.loaded,g=y.props.context,b=g.loadData,N=g.onNodeLoad;if(h)return;b&&f&&!y.isLeaf()&&(!y.hasChildren()&&!v&&N(Object(s.b)(y.props)))},y.renderSwitcher=function(){var E=y.props,f=E.expanded,h=E.switcherIcon,v=y.props.context,g=v.prefixCls,b=v.switcherIcon,N=h||b;if(y.isLeaf())return r.createElement("span",{className:x()("".concat(g,"-switcher"),"".concat(g,"-switcher-noop"))},typeof N=="function"?N(Object(I.a)(Object(I.a)({},y.props),{},{isLeaf:!0})):N);var H=x()("".concat(g,"-switcher"),"".concat(g,"-switcher_").concat(f?d:l));return r.createElement("span",{onClick:y.onExpand,className:H},typeof N=="function"?N(Object(I.a)(Object(I.a)({},y.props),{},{isLeaf:!1})):N)},y.renderCheckbox=function(){var E=y.props,f=E.checked,h=E.halfChecked,v=E.disableCheckbox,g=y.props.context.prefixCls,b=y.isDisabled(),N=y.isCheckable();if(!N)return null;var H=typeof N!="boolean"?N:null;return r.createElement("span",{className:x()("".concat(g,"-checkbox"),f&&"".concat(g,"-checkbox-checked"),!f&&h&&"".concat(g,"-checkbox-indeterminate"),(b||v)&&"".concat(g,"-checkbox-disabled")),onClick:y.onCheck},H)},y.renderIcon=function(){var E=y.props.loading,f=y.props.context.prefixCls;return r.createElement("span",{className:x()("".concat(f,"-iconEle"),"".concat(f,"-icon__").concat(y.getNodeState()||"docu"),E&&"".concat(f,"-icon_loading"))})},y.renderSelector=function(){var E=y.state.dragNodeHighlight,f=y.props,h=f.title,v=f.selected,g=f.icon,b=f.loading,N=f.data,H=y.props.context,A=H.prefixCls,F=H.showIcon,U=H.icon,w=H.draggable,Y=H.loadData,Z=H.titleRender,ce=y.isDisabled(),be="".concat(A,"-node-content-wrapper"),Ze;if(F){var Ce=g||U;Ze=Ce?r.createElement("span",{className:x()("".concat(A,"-iconEle"),"".concat(A,"-icon__customize"))},typeof Ce=="function"?Ce(y.props):Ce):y.renderIcon()}else Y&&b&&(Ze=y.renderIcon());var We;typeof h=="function"?We=h(N):Z?We=Z(N):We=h;var Ve=r.createElement("span",{className:"".concat(A,"-title")},We);return r.createElement("span",{ref:y.setSelectHandle,title:typeof h=="string"?h:"",className:x()("".concat(be),"".concat(be,"-").concat(y.getNodeState()||"normal"),!ce&&(v||E)&&"".concat(A,"-node-selected"),!ce&&w&&"draggable"),draggable:!ce&&w||void 0,"aria-grabbed":!ce&&w||void 0,onMouseEnter:y.onMouseEnter,onMouseLeave:y.onMouseLeave,onContextMenu:y.onContextMenu,onClick:y.onSelectorClick,onDoubleClick:y.onSelectorDoubleClick,onDragStart:w?y.onDragStart:void 0},Ze,Ve)},y}return Object(L.a)(S,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var E=this.props.selectable,f=this.props.context.selectable;return typeof E=="boolean"?E:f}},{key:"render",value:function(){var E,f=this.props,h=f.eventKey,v=f.className,g=f.style,b=f.dragOver,N=f.dragOverGapTop,H=f.dragOverGapBottom,A=f.isLeaf,F=f.isStart,U=f.isEnd,w=f.expanded,Y=f.selected,Z=f.checked,ce=f.halfChecked,be=f.loading,Ze=f.domRef,Ce=f.active,We=f.onMouseMove,Ve=Object(V.a)(f,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ye=this.props.context,we=Ye.prefixCls,X=Ye.filterTreeNode,j=Ye.draggable,W=Ye.keyEntities,Q=this.isDisabled(),re=Object(m.f)(Ve),G=W[h]||{},xe=G.level,Ie=U[U.length-1];return r.createElement("div",Object.assign({ref:Ze,className:x()(v,"".concat(we,"-treenode"),(E={},Object(ne.a)(E,"".concat(we,"-treenode-disabled"),Q),Object(ne.a)(E,"".concat(we,"-treenode-switcher-").concat(w?"open":"close"),!A),Object(ne.a)(E,"".concat(we,"-treenode-checkbox-checked"),Z),Object(ne.a)(E,"".concat(we,"-treenode-checkbox-indeterminate"),ce),Object(ne.a)(E,"".concat(we,"-treenode-selected"),Y),Object(ne.a)(E,"".concat(we,"-treenode-loading"),be),Object(ne.a)(E,"".concat(we,"-treenode-active"),Ce),Object(ne.a)(E,"".concat(we,"-treenode-leaf-last"),Ie),Object(ne.a)(E,"drag-over",!Q&&b),Object(ne.a)(E,"drag-over-gap-top",!Q&&N),Object(ne.a)(E,"drag-over-gap-bottom",!Q&&H),Object(ne.a)(E,"filter-node",X&&X(Object(s.b)(this.props))),E)),style:g,onDragEnter:j?this.onDragEnter:void 0,onDragOver:j?this.onDragOver:void 0,onDragLeave:j?this.onDragLeave:void 0,onDrop:j?this.onDrop:void 0,onDragEnd:j?this.onDragEnd:void 0,onMouseMove:We},re),r.createElement(a,{prefixCls:we,level:xe,isStart:F,isEnd:U}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),S}(r.Component),O=function(R){return r.createElement(p.a.Consumer,null,function(S){return r.createElement(n,Object.assign({},R,{context:S}))})};O.displayName="TreeNode",O.defaultProps={title:i},O.isTreeNode=1;var C=ve.a=O},XpUO:function(Lt,ve,k){"use strict";var ne=k("2qtc"),V=k("kLXV"),I=k("sRBo"),z=k("kaz8"),L=k("jCWc"),D=k("kPKH"),K=k("iQDF"),M=k("+eQT"),r=k("giR+"),P=k("fyUT"),x=k("14J3"),p=k("BMrR"),m=k("7Kak"),c=k("9yH6"),a=k("miYZ"),s=k("tsqr"),d=k("jrin"),l=k("9og8"),i=k("k1fw"),n=k("oBTY"),O=k("y8nQ"),C=k("Vl3Y"),T=k("tJVT"),R=k("PpiC"),S=k("WmNS"),y=k.n(S),E=k("q1tI"),f=k.n(E),h=k("wd/R"),v=k.n(h),g=k("ErOA"),b=k("xKgJ"),N=k("1vsH"),H=k("Ty5D"),A=k("9kvl"),F=k("4wi7"),U=k("oUNq"),w=k("eozf"),Y=function(ce){var be,Ze,Ce,We,Ve,Ye,we,X,j,W,Q,re,G,xe,Ie,tt,le,Se,je,ze,yt,Ot,Ut,Qe,Bt,ln,Ke,He,ct,bt,de,q,te,se,pe,ae,ie,me,_e,Ee=ce.classroomList,Le=ce.dispatch,at=ce.courseEndTime,Ct=Object(R.a)(ce,["classroomList","dispatch","courseEndTime"]),Jt=Object(H.i)(),lt=C.a.useForm(),Un=Object(T.a)(lt,1),Cn=Un[0],vn=Object(E.useState)(1),er=Object(T.a)(vn,2),kn=er[0],Yn=er[1],vr=Object(E.useState)([]),Mn=Object(T.a)(vr,2),Zn=Mn[0],dr=Mn[1],jt=Object(E.useState)(0),Ft=Object(T.a)(jt,2),zt=Ft[0],dn=Ft[1],yn=Object(E.useState)(2e3),bn=Object(T.a)(yn,2),_r=bn[0],Bn=bn[1],Qt=Object(E.useState)(!0),Hn=Object(T.a)(Qt,2),lr=Hn[0],Sn=Hn[1],zn=Object(E.useState)(!1),tr=Object(T.a)(zn,2),Gr=tr[0],Ar=tr[1],Yt=Object(E.useState)(!1),Vn=Object(T.a)(Yt,2),vi=Vn[0],Pi=Vn[1],ai=Object(E.useState)([]),Yr=Object(T.a)(ai,2),Lr=Yr[0],Fn=Yr[1],pi=Object(E.useState)(!0),Zt=Object(T.a)(pi,2),qr=Zt[0],zr=Zt[1],xi=Object(E.useState)(!((be=Ee.actionTabs)!==null&&be!==void 0&&(Ze=be.selectArrsAll)!==null&&Ze!==void 0&&(Ce=Ze[0])!==null&&Ce!==void 0&&Ce.send_type)),mi=Object(T.a)(xi,2),ni=mi[0],Bi=mi[1],Hi=Object(E.useState)([0,0,0]),ri=Object(T.a)(Hi,2),wr=ri[0],Si=ri[1];Object(E.useEffect)(function(){if(Ee.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03"){var yr,br,oi,kr,Tn,qt;if((yr=Ee.actionTabs)!==null&&yr!==void 0&&(br=yr.selectArrsAll)!==null&&br!==void 0&&(oi=br[0])!==null&&oi!==void 0&&oi.can_publish){var Qn,J,ge;Si(Object(n.a)((Qn=Ee.actionTabs)===null||Qn===void 0||((J=Qn.selectArrsAll)===null||J===void 0||((ge=J[0])===null||ge===void 0))?void 0:ge.difficult_count))}else{var fn,tn,Xn;Si(Object(n.a)((fn=Ee.actionTabs)===null||fn===void 0||((tn=fn.selectArrsAll)===null||tn===void 0||((Xn=tn[0])===null||Xn===void 0))?void 0:Xn.difficult_settings))}if(Bi(!((kr=Ee.actionTabs)!==null&&kr!==void 0&&(Tn=kr.selectArrsAll)!==null&&Tn!==void 0&&(qt=Tn[0])!==null&&qt!==void 0&&qt.send_type)),Oi(),Ee.actionTabs.type===2){var Oe,Re=(Oe=Ee.actionTabs.selectArrsAll)===null||Oe===void 0?void 0:Oe[0];zr(Re.unified_setting)}}},[Ee.actionTabs]),Object(E.useEffect)(function(){if(Gr){if(vi)return;Le({type:"classroomList/setActionTabs",payload:{}}),Object(b.c)()?(Le({type:"classroomList/getClassroomTeacherCommonList",payload:Object(i.a)(Object(i.a)({},Ee.actionTabs.params),{},{type:1})}),Le({type:"shixunHomeworks/getWorkList",payload:Object(i.a)({},Jt)})):Le({type:"classroomList/getClassroomCommonList",payload:Object(i.a)({},Ee.actionTabs.params)})}},[Gr]);var Oi=function(){var yr=Object(l.a)(y.a.mark(function br(oi){var kr,Tn;return y.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return Sn(!0),fn.next=3,Object(U.D)(Object(i.a)(Object(i.a)({},Jt),{},{page:oi||kn,limit:2e4,homework_id:Ee.actionTabs.type===1?"":Ee.actionTabs.selectArrs[0]}));case 3:kr=fn.sent,kr==null||kr.course_groups.map(function(tn,Xn){tn.key=tn.id,tn.title=tn.name,tn.disabled=tn.is_published}),kr&&(dr(Object(n.a)(kr==null?void 0:kr.course_groups)),dn(kr==null?void 0:kr.course_groups_count),Sn(!1),oi||Cn.setFieldsValue((Tn={},Object(d.a)(Tn,"publish_time",v()(v()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Object(d.a)(Tn,"end_time",v()(v()(new Date(Object(N.b)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))),Tn)));case 6:case"end":return fn.stop()}},br)}));return function(oi){return yr.apply(this,arguments)}}(),ci=function(){Object(b.c)()?Ee.actionTabs.detail?(Le({type:"shixunHomeworks/setActionTabs",payload:{}}),Le({type:"shixunHomeworks/getWorkList",payload:Object(i.a)({},Jt)}),Le({type:"shixunHomeworks/getWorkSetting",payload:Object(i.a)({},Jt)})):Le({type:"classroomList/getClassroomTeacherCommonList",payload:Object(i.a)(Object(i.a)({},Ee.actionTabs.params),{},{type:5})}):Le({type:"classroomList/getClassroomCommonList",payload:Object(i.a)({},Ee.actionTabs.params)})},_i=function(){var yr=Object(l.a)(y.a.mark(function br(){var oi,kr,Tn,qt;return y.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:if(kr=Object(i.a)({},Cn.getFieldsValue()),!(kr.end_time<=kr.publish_time)){tn.next=4;break}return s.b.info("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u6216\u7B49\u4E8E\u53D1\u5E03\u65F6\u95F4"),tn.abrupt("return");case 4:if(!((Lr==null?void 0:Lr.length)<=0&&!qr&&Zn.length>0)){tn.next=7;break}return s.b.info("\u53D1\u5E03\u73ED\u7EA7\u4E0D\u80FD\u4E3A\u7A7A"),tn.abrupt("return");case 7:if(!(wr.reduce(function(Xn,Qn){return Xn+Qn})===0&&!ni)){tn.next=10;break}return s.b.info("\u7B80\u5355\u9002\u4E2D\u56F0\u96BE\u9898\u6570\u76F8\u52A0\u4E0D\u80FD\u4E3A0"),tn.abrupt("return");case 10:return Tn={homework_ids:Object(n.a)(Ee.actionTabs.selectArrs),group_ids:Lr.length>0?Lr.map(function(Xn){return Xn.id}):(oi=Ee.detailCommonHomeworksList)===null||oi===void 0?void 0:oi.course_groups,end_time:v()(kr.end_time).format("YYYY-MM-DD HH:mm"),publish_time:v()(kr.publish_time).format("YYYY-MM-DD HH:mm"),difficult_settings:wr==null?void 0:wr.map(function(Xn){return Xn}),send_type:ni?"0":"1",unified_setting:!Lr.length},tn.next=13,Object(g.a)("/api/courses/".concat(Jt.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:Object(i.a)({},Tn)});case 13:qt=tn.sent,qt.status===0&&(Object(N.db)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u53D1\u5E03"]),s.b.success("\u53D1\u5E03\u6210\u529F"),Le({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Ct.onCallback&&Ct.onCallback(),ci(),localStorage.getItem("Noviceguide")==="0"||Le({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5E95\u90E8\u5F39\u7A97",type:13,text:f.a.createElement("div",null,"\u6700\u540E\uFF0C\u54B1\u4EEC\u7ED9\u6559\u5B66\u8BFE\u5802\u6DFB\u52A0\u4E00\u540D\u5B66\u751F~\u70B9\u51FB\u201C\u6DFB\u52A0\u5B66\u751F\u201D\uFF0C\u5728\u5F39\u7A97\u9875\u9762\u4E2D\u8F93\u5165\u5E76\u641C\u7D22\u5B66\u751F\u59D3\u540D\uFF0C\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u5C31\u53EF\u4EE5\u4E3A\u60A8\u7684\u8BFE\u5802\u6DFB\u52A0\u7B2C\u4E00\u4F4D\u5B66\u751F\u5566~")}}));case 15:case"end":return tn.stop()}},br)}));return function(){return yr.apply(this,arguments)}}(),oa=function(){Yn(1),dr([]),Fn([])},$i=zt>kn*_r;return f.a.createElement(V.a,{width:600,centered:!0,title:"\u53D1\u5E03\u4F5C\u4E1A",visible:Ee.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03",okText:"\u53D1\u5E03\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u53D1\u5E03",onOk:_i,onCancel:function(){oa(),ci(),Le({type:"classroomList/setActionTabs",payload:{}})}},f.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u4F5C\u4E1A",f.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u672A\u53D1\u5E03"\u7684\u4F5C\u4E1A\u6709\u6548'),Zn&&f.a.createElement(C.a,{form:Cn},f.a.createElement("div",{style:{paddingLeft:0}},Ee.actionTabs.type===2&&f.a.createElement(p.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{className:"mr5"},"\u8BD5\u9898\u53D1\u9001:"),f.a.createElement(c.a.Group,{value:ni,disabled:!((We=Ee.actionTabs)!==null&&We!==void 0&&(Ve=We.selectArrsAll)!==null&&Ve!==void 0&&(Ye=Ve[0])!==null&&Ye!==void 0&&Ye.can_publish),onChange:function(br){Bi(br.target.value)}},f.a.createElement(c.a,{value:!0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),f.a.createElement(c.a,{className:"ml20",value:!1},"\u968F\u673A\u62BD\u53D6"))),!ni&&f.a.createElement(p.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{style:{marginRight:65}}),f.a.createElement("span",null,"\u7B80\u5355\u9898\u6570"," ",f.a.createElement(P.a,{value:wr[0],onChange:function(br){wr[0]=br,Si(Object(n.a)(wr))},min:0,disabled:!((we=Ee.actionTabs)!==null&&we!==void 0&&(X=we.selectArrsAll)!==null&&X!==void 0&&(j=X[0])!==null&&j!==void 0&&j.can_publish),placeholder:"\u6700\u5927".concat((W=Ee.actionTabs)===null||W===void 0||((Q=W.selectArrsAll)===null||Q===void 0||((re=Q[0])===null||re===void 0||((G=re.difficult_count)===null||G===void 0)))?void 0:G[0]),max:(xe=Ee.actionTabs)===null||xe===void 0||((Ie=xe.selectArrsAll)===null||Ie===void 0||((tt=Ie[0])===null||tt===void 0||((le=tt.difficult_count)===null||le===void 0)))?void 0:le[0],style:{width:60}})),f.a.createElement("span",{style:{margin:"0px 40px"}},"\u9002\u4E2D\u9898\u6570"," ",f.a.createElement(P.a,{value:wr[1],onChange:function(br){wr[1]=br,Si(Object(n.a)(wr))},min:0,disabled:!((Se=Ee.actionTabs)!==null&&Se!==void 0&&(je=Se.selectArrsAll)!==null&&je!==void 0&&(ze=je[0])!==null&&ze!==void 0&&ze.can_publish),max:(yt=Ee.actionTabs)===null||yt===void 0||((Ot=yt.selectArrsAll)===null||Ot===void 0||((Ut=Ot[0])===null||Ut===void 0||((Qe=Ut.difficult_count)===null||Qe===void 0)))?void 0:Qe[1],placeholder:"\u6700\u5927".concat((Bt=Ee.actionTabs)===null||Bt===void 0||((ln=Bt.selectArrsAll)===null||ln===void 0||((Ke=ln[0])===null||Ke===void 0||((He=Ke.difficult_count)===null||He===void 0)))?void 0:He[1]),style:{width:60}})),f.a.createElement("span",null,"\u56F0\u96BE\u9898\u6570"," ",f.a.createElement(P.a,{value:wr[2],onChange:function(br){wr[2]=br,Si(Object(n.a)(wr))},min:0,disabled:!((ct=Ee.actionTabs)!==null&&ct!==void 0&&(bt=ct.selectArrsAll)!==null&&bt!==void 0&&(de=bt[0])!==null&&de!==void 0&&de.can_publish),placeholder:"\u6700\u5927".concat((q=Ee.actionTabs)===null||q===void 0||((te=q.selectArrsAll)===null||te===void 0||((se=te[0])===null||se===void 0||((pe=se.difficult_count)===null||pe===void 0)))?void 0:pe[2]),max:(ae=Ee.actionTabs)===null||ae===void 0||((ie=ae.selectArrsAll)===null||ie===void 0||((me=ie[0])===null||me===void 0||((_e=me.difficult_count)===null||_e===void 0)))?void 0:_e[2],style:{width:60}}))),f.a.createElement(p.a,{className:"mt30",align:"middle"},f.a.createElement(D.a,null,f.a.createElement(C.a.Item,{name:"publish_time",label:"\u53D1\u5E03\u65F6\u95F4"},f.a.createElement(M.a,{style:{width:155,marginRight:"25px"},getPopupContainer:function(br){return br.parentNode},disabledDate:function(br){return Object(w.b)(br,at)},disabledTime:function(br){return Object(w.c)(br)},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:v()(Object(N.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),f.a.createElement(D.a,{className:"ml20"},f.a.createElement(C.a.Item,{name:"end_time",label:"\u622A\u6B62\u65F6\u95F4"},f.a.createElement(M.a,{style:{width:170},getPopupContainer:function(br){return br.parentNode},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:v()(Object(N.d)(),"HH:mm")},disabledDate:function(br){return Object(w.b)(br,at,Cn.getFieldValue("publish_time"))},disabledTime:function(br){return Object(w.c)(br,Cn.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})))),Ee.actionTabs.type===2&&f.a.createElement(p.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{className:"mr5"},"\u53D1\u5E03\u8BBE\u7F6E:"),f.a.createElement(c.a.Group,{value:qr,onChange:function(br){zr(br.target.value),Fn([])}},f.a.createElement(c.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),f.a.createElement(c.a,{className:"ml20",disabled:Zn.length<=0,value:!1},"\u5206\u73ED\u53D1\u5E03"))),Zn.length<=0&&Ee.actionTabs.type===2&&f.a.createElement("span",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},'\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03"')),(Ee.actionTabs.type===1||!qr)&&Zn.length>0&&f.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"}},f.a.createElement("span",{style:{flex:1}},f.a.createElement(z.a,{checked:Lr.length===Zn.length,onChange:function(br){Lr.length===Zn.length?Fn([]):Fn(Zn.filter(function(oi){return!oi.is_published}))}},"\u5168\u9009")," "),f.a.createElement("span",{style:{width:16}}),f.a.createElement("span",{style:{flex:1}},"\u5DF2\u9009\u62E9",Lr.length||0,"\u4E2A\u5206\u73ED")),(Ee.actionTabs.type===1||!qr)&&Zn.length>0&&f.a.createElement(F.a,{data:Zn,selectedRowKeys:Lr,setSelectedRowKeys:Fn})))};ve.a=Object(A.a)(function(Z){var ce=Z.classroomList;return{classroomList:ce}})(Y)},Y1PL:function(Lt,ve,k){"use strict";k.r(ve),k.d(ve,"ResizableTextArea",function(){return ce});var ne=k("wx14"),V=k("1OyB"),I=k("vuIU"),z=k("Ji7U"),L=k("LK+K"),D=k("q1tI"),K=k("VTBJ"),M=k("rePB"),r=k("Zm9Q"),P=k("Kwbf"),x=k("c+Xe"),p=k("m+aA"),m=k("bdgK"),c=new Map;function a(Ce){Ce.forEach(function(We){var Ve,Ye=We.target;(Ve=c.get(Ye))===null||Ve===void 0||Ve.forEach(function(we){return we(Ye)})})}var s=new m.default(a),d=null,l=null;function i(Ce,We){c.has(Ce)||(c.set(Ce,new Set),s.observe(Ce)),c.get(Ce).add(We)}function n(Ce,We){c.has(Ce)&&(c.get(Ce).delete(We),c.get(Ce).size||(s.unobserve(Ce),c.delete(Ce)))}var O=function(Ce){Object(z.a)(Ve,Ce);var We=Object(L.a)(Ve);function Ve(){return Object(V.a)(this,Ve),We.apply(this,arguments)}return Object(I.a)(Ve,[{key:"render",value:function(){return this.props.children}}]),Ve}(D.Component),C=D.createContext(null);function T(Ce){var We=Ce.children,Ve=Ce.onBatchResize,Ye=D.useRef(0),we=D.useRef([]),X=D.useContext(C),j=D.useCallback(function(W,Q,re){Ye.current+=1;var G=Ye.current;we.current.push({size:W,element:Q,data:re}),Promise.resolve().then(function(){G===Ye.current&&(Ve==null||Ve(we.current),we.current=[])}),X==null||X(W,Q,re)},[Ve,X]);return D.createElement(C.Provider,{value:j},We)}function R(Ce){var We=Ce.children,Ve=Ce.disabled,Ye=D.useRef(null),we=D.useRef(null),X=D.useContext(C),j=D.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),W=D.isValidElement(We)&&Object(x.c)(We),Q=W?We.ref:null,re=D.useMemo(function(){return Object(x.a)(Q,Ye)},[Q,Ye]),G=D.useRef(Ce);G.current=Ce;var xe=D.useCallback(function(Ie){var tt=G.current,le=tt.onResize,Se=tt.data,je=Ie.getBoundingClientRect(),ze=je.width,yt=je.height,Ot=Ie.offsetWidth,Ut=Ie.offsetHeight,Qe=Math.floor(ze),Bt=Math.floor(yt);if(j.current.width!==Qe||j.current.height!==Bt||j.current.offsetWidth!==Ot||j.current.offsetHeight!==Ut){var ln={width:Qe,height:Bt,offsetWidth:Ot,offsetHeight:Ut};j.current=ln;var Ke=Ot===Math.round(ze)?ze:Ot,He=Ut===Math.round(yt)?yt:Ut,ct=Object(K.a)(Object(K.a)({},ln),{},{offsetWidth:Ke,offsetHeight:He});X==null||X(ct,Ie,Se),le&&Promise.resolve().then(function(){le(ct,Ie)})}},[]);return D.useEffect(function(){var Ie=Object(p.a)(Ye.current)||Object(p.a)(we.current);return Ie&&!Ve&&i(Ie,xe),function(){return n(Ie,xe)}},[Ye.current,Ve]),D.createElement(O,{ref:we},W?D.cloneElement(We,{ref:re}):We)}var S="rc-observer-key";function y(Ce){var We=Ce.children,Ve=Object(r.a)(We);return Ve.map(function(Ye,we){var X=(Ye==null?void 0:Ye.key)||"".concat(S,"-").concat(we);return D.createElement(R,Object(ne.a)({},Ce,{key:X}),Ye)})}y.Collection=T;var E=y,f=k("bT9E"),h=k("TSYQ"),v=k.n(h),g=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,b=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],N={},H;function A(Ce){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ve=Ce.getAttribute("id")||Ce.getAttribute("data-reactid")||Ce.getAttribute("name");if(We&&N[Ve])return N[Ve];var Ye=window.getComputedStyle(Ce),we=Ye.getPropertyValue("box-sizing")||Ye.getPropertyValue("-moz-box-sizing")||Ye.getPropertyValue("-webkit-box-sizing"),X=parseFloat(Ye.getPropertyValue("padding-bottom"))+parseFloat(Ye.getPropertyValue("padding-top")),j=parseFloat(Ye.getPropertyValue("border-bottom-width"))+parseFloat(Ye.getPropertyValue("border-top-width")),W=b.map(function(re){return"".concat(re,":").concat(Ye.getPropertyValue(re))}).join(";"),Q={sizingStyle:W,paddingSize:X,borderSize:j,boxSizing:we};return We&&Ve&&(N[Ve]=Q),Q}function F(Ce){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ye=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;H||(H=document.createElement("textarea"),H.setAttribute("tab-index","-1"),H.setAttribute("aria-hidden","true"),document.body.appendChild(H)),Ce.getAttribute("wrap")?H.setAttribute("wrap",Ce.getAttribute("wrap")):H.removeAttribute("wrap");var we=A(Ce,We),X=we.paddingSize,j=we.borderSize,W=we.boxSizing,Q=we.sizingStyle;H.setAttribute("style","".concat(Q,";").concat(g)),H.value=Ce.value||Ce.placeholder||"";var re=Number.MIN_SAFE_INTEGER,G=Number.MAX_SAFE_INTEGER,xe=H.scrollHeight,Ie;if(W==="border-box"?xe+=j:W==="content-box"&&(xe-=X),Ve!==null||Ye!==null){H.value=" ";var tt=H.scrollHeight-X;Ve!==null&&(re=tt*Ve,W==="border-box"&&(re=re+X+j),xe=Math.max(re,xe)),Ye!==null&&(G=tt*Ye,W==="border-box"&&(G=G+X+j),Ie=xe>G?"":"hidden",xe=Math.min(G,xe))}return{height:xe,minHeight:re,maxHeight:G,overflowY:Ie,resize:"none"}}var U=k("Gytx"),w=k.n(U),Y;(function(Ce){Ce[Ce.NONE=0]="NONE",Ce[Ce.RESIZING=1]="RESIZING",Ce[Ce.RESIZED=2]="RESIZED"})(Y||(Y={}));var Z=function(Ce){Object(z.a)(Ve,Ce);var We=Object(L.a)(Ve);function Ve(Ye){var we;return Object(V.a)(this,Ve),we=We.call(this,Ye),we.nextFrameActionId=void 0,we.resizeFrameId=void 0,we.textArea=void 0,we.saveTextArea=function(X){we.textArea=X},we.handleResize=function(X){var j=we.state.resizeStatus,W=we.props,Q=W.autoSize,re=W.onResize;if(j!==Y.NONE)return;typeof re=="function"&&re(X),Q&&we.resizeOnNextFrame()},we.resizeOnNextFrame=function(){cancelAnimationFrame(we.nextFrameActionId),we.nextFrameActionId=requestAnimationFrame(we.resizeTextarea)},we.resizeTextarea=function(){var X=we.props.autoSize;if(!X||!we.textArea)return;var j=X.minRows,W=X.maxRows,Q=F(we.textArea,!1,j,W);we.setState({textareaStyles:Q,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(we.resizeFrameId),we.resizeFrameId=requestAnimationFrame(function(){we.setState({resizeStatus:Y.RESIZED},function(){we.resizeFrameId=requestAnimationFrame(function(){we.setState({resizeStatus:Y.NONE}),we.fixFirefoxAutoScroll()})})})})},we.renderTextArea=function(){var X=we.props,j=X.prefixCls,W=j===void 0?"rc-textarea":j,Q=X.autoSize,re=X.onResize,G=X.className,xe=X.disabled,Ie=we.state,tt=Ie.textareaStyles,le=Ie.resizeStatus,Se=Object(f.a)(we.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),je=v()(W,G,Object(M.a)({},"".concat(W,"-disabled"),xe));"value"in Se&&(Se.value=Se.value||"");var ze=Object(K.a)(Object(K.a)(Object(K.a)({},we.props.style),tt),le===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return D.createElement(E,{onResize:we.handleResize,disabled:!(Q||re)},D.createElement("textarea",Object(ne.a)({},Se,{className:je,style:ze,ref:we.saveTextArea})))},we.state={textareaStyles:{},resizeStatus:Y.NONE},we}return Object(I.a)(Ve,[{key:"componentDidUpdate",value:function(we){(we.value!==this.props.value||!w()(we.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 we=this.textArea.selectionStart,X=this.textArea.selectionEnd;this.textArea.setSelectionRange(we,X)}}catch(j){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ve}(D.Component),ce=Z,be=function(Ce){Object(z.a)(Ve,Ce);var We=Object(L.a)(Ve);function Ve(Ye){var we;Object(V.a)(this,Ve),we=We.call(this,Ye),we.resizableTextArea=void 0,we.focus=function(){we.resizableTextArea.textArea.focus()},we.saveTextArea=function(j){we.resizableTextArea=j},we.handleChange=function(j){var W=we.props.onChange;we.setValue(j.target.value,function(){we.resizableTextArea.resizeTextarea()}),W&&W(j)},we.handleKeyDown=function(j){var W=we.props,Q=W.onPressEnter,re=W.onKeyDown;j.keyCode===13&&Q&&Q(j),re&&re(j)};var X=typeof Ye.value=="undefined"||Ye.value===null?Ye.defaultValue:Ye.value;return we.state={value:X},we}return Object(I.a)(Ve,[{key:"setValue",value:function(we,X){"value"in this.props||this.setState({value:we},X)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return D.createElement(ce,Object(ne.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(we){return"value"in we?{value:we.value}:null}}]),Ve}(D.Component),Ze=ve.default=be},ZW9T:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return U});var ne=k("k1fw"),V=k("oBTY"),I=k("miYZ"),z=k("tsqr"),L=k("rAM+"),D=k("tJVT"),K=k("PpiC"),M=k("q1tI"),r=k.n(M),P=k("bdgK"),x=k("9og8"),p=k("WmNS"),m=k.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"]},s={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(`
|
|
`)}]},d={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},l=k("5VLF"),i=k.n(l),n={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},O=function(Y,Z){return Z.map(function(ce){return{label:ce,kind:Y.languages.CompletionItemKind.Keyword,insertText:ce}})},C=function(Y){return Object.keys(n.tables).map(function(Z){return{label:Z,kind:Y.languages.CompletionItemKind.Variable,insertText:Z}})},T=function(Y,Z){var ce=n.tables[Y];return ce?ce.map(function(be){return{label:be,kind:Z.languages.CompletionItemKind.Field,insertText:be}}):[]};function R(w,Y,Z,ce,be){var Ze=Y.getWordUntilPosition(Z),Ce={startLineNumber:Z.lineNumber,endLineNumber:Z.lineNumber,startColumn:Ze.startColumn,endColumn:Ze.endColumn},We=ce.map(function(Ve){return{label:Ve,kind:w.languages.CompletionItemKind.Keyword,insertText:Ve,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}});return be.map(function(Ve){We.push(Object(ne.a)(Object(ne.a)({},Ve),{},{range:Ce}))}),We}var S=function(w){n.languages.map(function(be){return w.languages.registerDocumentFormattingEditProvider(be,{provideDocumentFormattingEdits:function(Ce,We,Ve){return Object(x.a)(m.a.mark(function Ye(){var we;return m.a.wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return we=i()(Ce.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}),j.abrupt("return",[{range:Ce.getFullModelRange(),text:we}]);case 2:case"end":return j.stop()}},Ye)}))()}}),be});var Y=s.quickKey.map(function(be){return{label:be.label,kind:w.languages.CompletionItemKind.Method,insertText:be.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Z=d.quickKey.map(function(be){return{label:be.label,kind:w.languages.CompletionItemKind.Method,insertText:be.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ce=a.quickKey.map(function(be){return{label:be.label,kind:w.languages.CompletionItemKind.Method,insertText:be.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}});w.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Ze,Ce){var We=Ze.getWordUntilPosition(Ce),Ve={startLineNumber:Ce.lineNumber,endLineNumber:Ce.lineNumber,startColumn:We.startColumn,endColumn:We.endColumn},Ye=Ze.getLineContent(Ce.lineNumber).substring(We.startColumn-2,We.endColumn);return{suggestions:[].concat(Object(V.a)(s.keywords.map(function(we){return{label:we,kind:w.languages.CompletionItemKind.Function,documentation:we,insertText:we,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ve}})),Object(V.a)(s.quickKey.map(function(we){return{label:we.label,kind:w.languages.CompletionItemKind.Function,documentation:we.content,insertText:Ye.startsWith("#")?we.content.replace(/#/,""):we.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ve}})))}}}),w.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Ze,Ce){var We=Ze.getWordUntilPosition(Ce),Ve={startLineNumber:Ce.lineNumber,endLineNumber:Ce.lineNumber,startColumn:We.startColumn,endColumn:We.endColumn};return{suggestions:Object(V.a)(c.keywords.map(function(Ye){return{label:Ye,kind:w.languages.CompletionItemKind.Function,documentation:Ye,insertText:Ye,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ve}}))}}}),w.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Ze,Ce){var We=Ze.getWordUntilPosition(Ce),Ve={startLineNumber:Ce.lineNumber,endLineNumber:Ce.lineNumber,startColumn:We.startColumn,endColumn:We.endColumn},Ye=Ze.getLineContent(Ce.lineNumber).substring(We.startColumn-2,We.endColumn);return{suggestions:[].concat(Object(V.a)(a.keywords.map(function(we){return{label:we,kind:w.languages.CompletionItemKind.Function,documentation:we,insertText:we,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ve}})),Object(V.a)(a.quickKey.map(function(we){return{label:we.label,kind:w.languages.CompletionItemKind.Function,documentation:we.content,insertText:Ye.startsWith("#")?we.content.replace(/#/,""):we.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ve}})))}}}),w.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Ze,Ce){var We=Ze.getWordUntilPosition(Ce),Ve={startLineNumber:Ce.lineNumber,endLineNumber:Ce.lineNumber,startColumn:We.startColumn,endColumn:We.endColumn},Ye=Ze.getLineContent(Ce.lineNumber).substring(We.startColumn-2,We.endColumn);return{suggestions:[].concat(Object(V.a)(d.keywords.map(function(we){return{label:we,kind:w.languages.CompletionItemKind.Function,documentation:we,insertText:we,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ve}})),Object(V.a)(d.quickKey.map(function(we){return{label:we.label,kind:w.languages.CompletionItemKind.Function,documentation:we.content,insertText:Ye.startsWith("#")?we.content.replace(/#/,""):we.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ve}})))}}})},y="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",E=k("fjLI"),f=k("LvDl"),h=k("+ua5");function v(w){return/^\d+$/.test(w)?"".concat(w,"px"):w}function g(){}var b=!1,N={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function H(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Y=w;if(Array.isArray(w)){for(var Z=0;Z<w.length;Z++){var ce=N[w[Z]];if(ce)return ce}return Y[0]}return N[Y]||Y}var A=null,F=ve.b=function(w){var Y=w.width,Z=Y===void 0?"100%":Y,ce=w.height,be=ce===void 0?"100%":ce,Ze=w.value,Ce=w.language,We=Ce===void 0?"javascript":Ce,Ve=w.style,Ye=Ve===void 0?{}:Ve,we=w.options,X=we===void 0?{}:we,j=w.overrideServices,W=j===void 0?{}:j,Q=w.theme,re=Q===void 0?"vs-dark":Q,G=w.onEditBlur,xe=w.onSave,Ie=w.autoHeight,tt=Ie===void 0?!1:Ie,le=w.forbidCopy,Se=le===void 0?!1:le,je=w.onChange,ze=je===void 0?g:je,yt=w.editorDidMount,Ot=yt===void 0?g:yt,Ut=w.onFocus,Qe=Ut===void 0?g:Ut,Bt=w.filename,ln=Bt===void 0?"educoder.txt":Bt,Ke=w.errorLine,He=w.errorContent,ct=He===void 0?"":He,bt=Object(K.a)(w,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),de=Object(M.useRef)(),q=Object(M.useRef)({}),te=Object(M.useRef)(),se=Object(M.useRef)(),pe=Object(M.useRef)(!1),ae=Object(M.useRef)(),ie=Object(M.useState)(!1),me=Object(D.a)(ie,2),_e=me[0],Ee=me[1];function Le(){var zt;return de.current&&(zt=new P.default(function(dn){var yn=Object(L.a)(dn),bn;try{for(yn.s();!(bn=yn.n()).done;){var _r=bn.value;(_r.target.offsetHeight>0||_r.target.offsetWidth>0)&&q.current.instance.layout()}}catch(Bn){yn.e(Bn)}finally{yn.f()}}),zt.observe(de.current)),zt}function at(){z.b.warn(decodeURIComponent(y))}var Ct=function(){var dn=q.current.instance;if(Ze!=null&&dn&&_e){var yn=dn.getModel();yn&&Ze!==yn.getValue()&&(b=!0,yn.setValue(Ze),dn.layout(),b=!1)}};Object(M.useEffect)(function(){se.current&&clearTimeout(se.current),se.current=setTimeout(function(){Ct()},500)},[Ze,_e,q.current]),Object(M.useEffect)(function(){if(Ke&&q.current&&q.current.instance){var zt=q.current.instance;zt.changeViewZones(function(yn){var bn=document.createElement("div");bn.style.padding="10px 20px",bn.style.width="calc(100% - 20px)",bn.className="my-error-line-wrp",bn.innerHTML=ct,yn.addZone({afterLineNumber:Ke||11,heightInLines:3,domNode:bn})});var dn={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}};zt.addOverlayWidget(dn),zt.revealPositionInCenter({lineNumber:20,column:1})}},[Ke,q.current,_e]);function Jt(){var zt=q.current.instance;if(zt){var dn=zt.getSelection(),yn=q.current.pastePos||{},bn=new A.Range(yn.startLineNumber||dn.endLineNumber,yn.startColumn||dn.endColumn,yn.endLineNumber||dn.endLineNumber,yn.endColumn||dn.endColumn);setTimeout(function(){zt.executeEdits("",[{range:bn,text:""}])},300)}}function lt(zt){(window.navigator.platform.match("Mac")?zt.metaKey:zt.ctrlKey)&&zt.keyCode==83&&(zt.preventDefault(),xe())}var Un=function(){if(tt&&q.current.instance){var dn=q.current.instance.getContentHeight();jt(dn<be?be:dn)}else jt(be)};function Cn(zt){var dn=document.createEvent("MouseEvents");dn.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),zt.dispatchEvent(dn)}function vn(zt,dn){var yn=window.URL||window.webkitURL||window,bn=new Blob([dn]),_r=document.createElementNS("http://www.w3.org/1999/xhtml","a");_r.href=yn.createObjectURL(bn),_r.download=zt,Cn(_r)}Object(M.useEffect)(function(){Un()},[Un]),Object(M.useEffect)(function(){de.current&&!_e&&Promise.all([k.e(17),k.e(29)]).then(k.t.bind(null,"M/lh",7)).then(function(zt){try{A=zt,q.current.instance=A.editor.create(de.current,{value:Ze,language:H(We),theme:re,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},W);var dn=q.current.instance,yn=E.d._menuItems,bn=Object(V.a)(yn).find(function(lr){return lr[0]._debugName=="EditorContext"}),_r=bn[1],Bn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Qt=function(Sn,zn){var tr=Sn._first;do{var Gr,Ar,Yt=zn.includes((Gr=tr.element)===null||Gr===void 0||((Ar=Gr.command)===null||Ar===void 0)?void 0:Ar.id);Yt&&Sn._remove(tr)}while(tr=tr.next)};if(Ot(dn,A),setTimeout(function(){Un(),q.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){vn(ln||"educoder.txt",dn.getValue())}}),dn.getDomNode().addEventListener("input",function(){te.current.autoFormat&&dn.getAction("editor.action.formatDocument").run()})},500),q.current.subscription=dn.onDidChangeModelContent(function(lr){pe.current?clearTimeout(ae.current):(Un(),ze(dn.getValue(),lr)),ae.current=setTimeout(function(){pe.current=!1},500)}),window.Monaco||S(A,H(We)),Se&&(Qt(_r,Bn),de.current.classList.add("noCopyPaste"),dn.onKeyDown(function(lr){var Sn=lr.keyCode,zn=lr.ctrlKey,tr=lr.metaKey;(Sn===33||Sn===52)&&(tr||zn)&&(at(),lr.preventDefault())})),window.Monaco=A,G&&dn.onDidBlurEditorWidget(function(){G(dn.getValue())}),Qe&&dn.onDidFocusEditorText(function(){Qe(dn.getValue())}),Se){dn.addCommand(A.KeyMod.CtrlCmd|A.KeyCode.KEY_V,function(){return at(),null}),dn.onDidPaste(function(lr){q.current.pastePos=lr});try{window.addEventListener("paste",Jt)}catch(lr){}}var Hn=Le();return Ee(!0),function(){var lr=q.current.instance;lr.dispose();var Sn=lr.getModel();Sn&&Sn.dispose(),q.current.subscription&&q.current.subscription.dispose(),Se&&window.removeEventListener("paste",Jt),Hn.unobserve(de.current)}}catch(lr){}})},[]),Object(M.useEffect)(function(){var zt=q.current.instance;if(zt&&_e)return document.addEventListener("keydown",lt,!1),function(){document.removeEventListener("keydown",lt)}},[xe,_e]),Object(M.useEffect)(function(){var zt=q.current.instance;if(zt&&_e){var dn=H(We);A.editor.setModelLanguage(zt.getModel(),dn),console.log("language:",We,zt.getModel(),dn)}},[We,_e]),Object(M.useEffect)(function(){var zt=q.current.instance;zt&&_e&&A.editor.setTheme(re)},[re,_e]),Object(M.useEffect)(function(){var zt=q.current.instance;te.current=X,zt&&_e&&(zt.updateOptions(Object(ne.a)({},X)),setTimeout(function(){zt.getModel().updateOptions(Object(ne.a)({},X))},200))},[JSON.stringify(X),_e]),Object(M.useEffect)(function(){var zt=q.current.instance;zt&&_e&&zt.layout()},[Z,be,_e]);var er=Object(M.useState)(v(Z)),kn=Object(D.a)(er,2),Yn=kn[0],vr=kn[1],Mn=Object(M.useState)(v(be)),Zn=Object(D.a)(Mn,2),dr=Zn[0],jt=Zn[1],Ft=Object(ne.a)(Object(ne.a)({},Ye),{},{width:Yn,height:dr});return r.a.createElement("div",{className:"my-monaco-editor",ref:de,style:Ft})};function U(w){var Y=w.width,Z=Y===void 0?"100%":Y,ce=w.height,be=ce===void 0?"100%":ce,Ze=w.original,Ce=w.modified,We=w.language,Ve=w.options,Ye=Ve===void 0?{}:Ve,we=Object(M.useRef)(),X=Object(M.useState)(null),j=Object(D.a)(X,2),W=j[0],Q=j[1];function re(tt){var le;return we.current&&(le=new P.default(function(Se){var je=Object(L.a)(Se),ze;try{for(je.s();!(ze=je.n()).done;){var yt=ze.value;(yt.target.offsetHeight>0||yt.target.offsetWidth>0)&&tt.layout()}}catch(Ot){je.e(Ot)}finally{je.f()}}),le.observe(we.current)),le}Object(M.useEffect)(function(){we.current&&Promise.all([k.e(17),k.e(29)]).then(k.t.bind(null,"M/lh",7)).then(function(tt){A=tt;var le=A.editor.createDiffEditor(we.current,Object(ne.a)(Object(ne.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},Ye),{},{wordWrap:!0}));Q(le);var Se=re(le);return function(){le.dispose();var je=le.getModel();je&&je.dispose(),Se.unobserve(we.current)}})},[]),Object(M.useEffect)(function(){W&&W.setModel({original:A.editor.createModel(Ze,We),modified:A.editor.createModel(Ce,We)})},[Ze,Ce,We,W]);var G=v(Z),xe=v(be),Ie={width:G,height:xe};return r.a.createElement("div",{className:"my-diff-editor",ref:we,style:Ie})}},bT9E:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return V});var ne=k("VTBJ");function V(I,z){var L=Object(ne.a)({},I);return Array.isArray(z)&&z.forEach(function(D){delete L[D]}),L}},bTeP:function(Lt,ve,k){Lt.exports={flex_box_center:"flex_box_center___14Ki3",flex_space_between:"flex_space_between___3TSad",flex_box_vertical_center:"flex_box_vertical_center___3pQXk",flex_box_center_end:"flex_box_center_end___29_cn",flex_box_column:"flex_box_column___16am0",title:"title___2mVJs",workListTabWrap:"workListTabWrap___1JlOB",workListTabButton:"workListTabButton___3umfp",tables:"tables___hLy6a",checkboxgroup:"checkboxgroup___2xMgu"}},biw7:function(Lt,ve,k){"use strict";var ne=k("q1tI"),V=k.n(ne),I=ne.createContext(null);ve.a=I},c5Ni:function(Lt,ve,k){},deN7:function(Lt,ve,k){"use strict";var ne=k("/zsF"),V=k("PArb"),I=k("14J3"),z=k("BMrR"),L=k("jCWc"),D=k("kPKH"),K=k("+L6B"),M=k("2/Rp"),r=k("miYZ"),P=k("tsqr"),x=k("9og8"),p=k("giR+"),m=k("fyUT"),c=k("2qtc"),a=k("kLXV"),s=k("7Kak"),d=k("9yH6"),l=k("tJVT"),i=k("k1fw"),n=k("OaEy"),O=k("2fM7"),C=k("WmNS"),T=k.n(C),R=k("q1tI"),S=k.n(R),y=k("ZW9T"),E=k("F0VM"),f=k.n(E),h=k("xKgJ"),v=k("J66h"),g=k.n(v),b=k("ErOA"),N=k("Ty5D"),H=k("9Bee"),A=k("XYT7"),F=k("RCxd"),U=k("/MfK"),w=O.a.Option,Y={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1},Z;(function(be){be[be.SET_PATH=0]="SET_PATH",be[be.GET_PASSED_CONTENT=1]="GET_PASSED_CONTENT"})(Z||(Z={}));function ce(be,Ze){switch(Ze.type){case Z.SET_PATH:return Object(i.a)(Object(i.a)({},be),{},{selectedPath:Ze.payload});case Z.GET_PASSED_CONTENT:return Object(i.a)(Object(i.a)({},be),{},{passedContent:Ze.payload});default:throw new Error}}ve.a=function(be){var Ze=be.language,Ce=be.dispatch,We=be.shixunWorkReport,Ve=be.v,Ye=be.languages,we=be.onPathChange,X=be.autoHeight,j=be.diff_code_count,W=be.data,Q=Object(R.useState)(Ye==null?void 0:Ye[0]),re=Object(l.a)(Q,2),G=re[0],xe=re[1],Ie=We!="shixunWorkReport"&&Object(N.i)();return Object(R.useEffect)(function(){xe(Ye==null?void 0:Ye[0])},[]),Object(R.useEffect)(function(){var tt;xe(Ye==null||((tt=Ye.filter(function(le){return le.language===(G==null?void 0:G.language)}))===null||tt===void 0)?void 0:tt[0])},[Ye]),S.a.createElement(S.a.Fragment,null,S.a.createElement("h2",null," ",S.a.createElement("span",null,S.a.createElement("span",null,"\u6700\u540E\u901A\u5173\u7684\u4EE3\u7801"),(Ye==null?void 0:Ye.length)>1&&S.a.createElement(d.a.Group,{defaultValue:Ze,style:{marginLeft:10},onChange:function(le){var Se;xe(Ye==null||((Se=Ye.filter(function(je){return je.language===le.target.value}))===null||Se===void 0)?void 0:Se[0])}},Ye==null?void 0:Ye.map(function(tt){return S.a.createElement(d.a,{value:tt==null?void 0:tt.language},tt==null?void 0:tt.language)}))),Object(h.c)()&&We!="shixunWorkReport"&&S.a.createElement("span",null,S.a.createElement("span",null,"\u5F97\u5206 ",G==null?void 0:G.score,"/",G==null?void 0:G.total_score),S.a.createElement(M.a,{style:{margin:"0px 10px"},onClick:function(){var le=G==null?void 0:G.score;a.a.confirm({title:"\u8C03\u5206",content:S.a.createElement("div",null,S.a.createElement("p",null,"\u5F97\u5206\uFF1A",G==null?void 0:G.score,"/",G==null?void 0:G.total_score),S.a.createElement("p",null,"\u8C03\u5206\uFF1A",S.a.createElement(m.a,{min:0,max:G==null?void 0:G.total_score,defaultValue:G==null?void 0:G.score,onChange:function(je){le=je}}))),okText:"\u786E\u8BA4",onOk:function(){var Se=Object(x.a)(T.a.mark(function ze(){var yt;return T.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Object(b.a)("/api/courses/".concat(Ie==null?void 0:Ie.coursesId,"/homework_commons/update_hack_score"),{method:"put",body:{course_id:Ie==null?void 0:Ie.coursesId,hack_user_code_id:G==null?void 0:G.hack_user_id,score:le}});case 2:yt=Ut.sent,yt.status===0&&(P.b.success("\u8C03\u5206\u6210\u529F"),Ce({type:"shixunHomeworks/setActionTabs",payload:{}}),Ce({type:"shixunHomeworks/getShixunWorkReports",payload:Object(i.a)({},Ie)}));case 4:case"end":return Ut.stop()}},ze)}));function je(){return Se.apply(this,arguments)}return je}(),cancelText:"\u53D6\u6D88"})},type:"primary"},"\u8C03\u5206"),Object(h.c)()&&We!="shixunWorkReport"&&S.a.createElement(M.a,{onClick:function(){Ce({type:"shixunHomeworks/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:We.user_id,type:"1",language:G==null?void 0:G.language,v:Ve,data:Object(i.a)({},We)}}})}},"\u70B9\u8BC4\u4EE3\u7801"))),S.a.createElement(y.b,{height:300,language:G==null?void 0:G.language,value:v.Base64.decode(G==null?void 0:G.code),autoHeight:X,theme:"default",options:Y}),((G==null?void 0:G.comment)||(G==null?void 0:G.hidden_comment))&&S.a.createElement("div",null,S.a.createElement(z.a,{align:"middle",style:{borderTop:"1px solid #eee"}},S.a.createElement(D.a,{flex:1},S.a.createElement("h1",{className:f.a.title},"\u70B9\u8BC4\u5185\u5BB9")),S.a.createElement(D.a,{className:"pr30"},Object(h.c)()&&S.a.createElement(M.a,{onClick:Object(x.a)(T.a.mark(function tt(){return T.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:a.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:S.a.createElement(F.a,null),content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onOk:function(){return Object(x.a)(T.a.mark(function ze(){var yt;return T.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Object(A.m)({comment_id:G==null?void 0:G.comment_id,homeworkId:Ie.homeworkId,type:"hack"});case 2:yt=Ut.sent,yt.status===0&&(P.b.success("\u5220\u9664\u6210\u529F"),Ce({type:"shixunHomeworks/getShixunWorkReports",payload:Object(i.a)({},Ie)}));case 4:case"end":return Ut.stop()}},ze)}))()}});case 1:case"end":return Se.stop()}},tt)}))},S.a.createElement(U.a,null),"\u5220\u9664"))),S.a.createElement(V.a,{style:{margin:0}}),(G==null?void 0:G.comment)&&S.a.createElement("aside",{className:"pl30 pr30 mt20"},S.a.createElement("span",{className:"c-light-black font12"},"# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),S.a.createElement("br",null),S.a.createElement(H.a,{value:G==null?void 0:G.comment})),(G==null?void 0:G.hidden_comment)&&S.a.createElement("aside",{className:"pl30 pr30 mt20"},S.a.createElement("span",{className:"c-light-black font12"},"# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),S.a.createElement("br",null),S.a.createElement(H.a,{value:G==null?void 0:G.hidden_comment}))))}},dejd:function(Lt,ve,k){},dmUQ:function(Lt,ve,k){"use strict";var ne=k("Ff2n"),V=k("rePB"),I=k("1OyB"),z=k("vuIU"),L=k("Ji7U"),D=k("md7G"),K=k("foSv"),M=k("q1tI"),r=k.n(M),P=k("TSYQ"),x=k.n(P),p=k("4IlW");function m(f,h){var v=Object.keys(f);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(f);h&&(g=g.filter(function(b){return Object.getOwnPropertyDescriptor(f,b).enumerable})),v.push.apply(v,g)}return v}function c(f){for(var h=1;h<arguments.length;h++){var v=arguments[h]!=null?arguments[h]:{};h%2?m(Object(v),!0).forEach(function(g){Object(V.a)(f,g,v[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(v)):m(Object(v)).forEach(function(g){Object.defineProperty(f,g,Object.getOwnPropertyDescriptor(v,g))})}return f}function a(f){var h=s();return function(){var g=Object(K.a)(f),b;if(h){var N=Object(K.a)(this).constructor;b=Reflect.construct(g,arguments,N)}else b=g.apply(this,arguments);return Object(D.a)(this,b)}}function s(){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 d(){}function l(f){f.preventDefault()}var i=function(h){return h.replace(/[^\w.-]+/g,"")},n=200,O=600,C=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(h){return h!=null},R=function(h,v){return v===h||typeof v=="number"&&typeof h=="number"&&isNaN(v)&&isNaN(h)},S=function(f){Object(L.a)(v,f);var h=a(v);function v(g){var b;Object(I.a)(this,v),b=h.call(this,g),b.onKeyDown=function(A){var F=b.props,U=F.onKeyDown,w=F.onPressEnter;if(A.keyCode===p.a.UP){var Y=b.getRatio(A);b.up(A,Y,null),b.stop()}else if(A.keyCode===p.a.DOWN){var Z=b.getRatio(A);b.down(A,Z,null),b.stop()}else A.keyCode===p.a.ENTER&&w&&w(A);if(b.recordCursorPosition(),b.lastKeyCode=A.keyCode,U){for(var ce=arguments.length,be=new Array(ce>1?ce-1:0),Ze=1;Ze<ce;Ze++)be[Ze-1]=arguments[Ze];U.apply(void 0,[A].concat(be))}},b.onKeyUp=function(A){var F=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),F){for(var U=arguments.length,w=new Array(U>1?U-1:0),Y=1;Y<U;Y++)w[Y-1]=arguments[Y];F.apply(void 0,[A].concat(w))}},b.onChange=function(A){var F=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(A)),b.setState({inputValue:b.rawInput}),F(b.toNumber(b.rawInput))},b.onMouseUp=function(){var A=b.props.onMouseUp;b.recordCursorPosition(),A&&A.apply(void 0,arguments)},b.onFocus=function(){var A;b.setState({focused:!0}),(A=b.props).onFocus.apply(A,arguments)},b.onBlur=function(){var A=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var F=b.getCurrentValidValue(b.state.inputValue),U=b.setValue(F,d);if(A){var w=b.input.value,Y=b.getInputDisplayValue({focus:!1,value:U});b.input.value=Y&&Number(Y),A.apply(void 0,arguments),b.input.value=w}},b.getRatio=function(A){var F=1;return A.metaKey||A.ctrlKey?F=.1:A.shiftKey&&(F=10),F},b.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},b.getPrecision=function(A){if(T(b.props.precision))return b.props.precision;var F=String(A);if(F.indexOf("e-")>=0)return parseInt(F.slice(F.indexOf("e-")+2),10);var U=0;return F.indexOf(".")>=0&&(U=F.length-F.indexOf(".")-1),U},b.getInputDisplayValue=function(A){var F=A||b.state,U=F.focused,w=F.inputValue,Y=F.value,Z;U?Z=w:Z=b.toPrecisionAsStep(Y),Z==null&&(Z="");var ce=b.formatWrapper(Z);return T(b.props.decimalSeparator)&&(ce=ce.toString().replace(".",b.props.decimalSeparator)),ce},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(A){}},b.restoreByAfter=function(A){if(A===void 0)return!1;var F=b.input.value,U=F.lastIndexOf(A);if(U===-1)return!1;var w=b.cursorBefore.length;return b.lastKeyCode===p.a.DELETE&&b.cursorBefore.charAt(w-1)===A[0]?(b.fixCaret(w,w),!0):U+A.length===F.length?(b.fixCaret(U,U),!0):!1},b.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(F,U){var w=A.substring(U);return b.restoreByAfter(w)})},b.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(A,F,U){b.pressingUpOrDown=!0,b.step("down",A,F,U)},b.up=function(A,F,U){b.pressingUpOrDown=!0,b.step("up",A,F,U)},b.saveInput=function(A){b.input=A};var N=g.value;N===void 0&&(N=g.defaultValue),b.state={focused:g.autoFocus};var H=b.getValidValue(b.toNumber(N));return b.state=c(c({},b.state),{},{inputValue:b.toPrecisionAsStep(H),value:H}),b}return Object(z.a)(v,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var N=this.props,H=N.value,A=N.onChange,F=N.max,U=N.min,w=this.state.focused;if(b){if(!R(b.value,H)||!R(b.max,F)||!R(b.min,U)){var Y=w?H:this.getValidValue(H),Z;this.pressingUpOrDown?Z=Y:this.inputting?Z=this.rawInput:Z=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:Z})}var ce="value"in this.props?H:this.state.value;"max"in this.props&&b.max!==F&&typeof ce=="number"&&ce>F&&A&&A(F),"min"in this.props&&b.min!==U&&typeof ce=="number"&&ce<U&&A&&A(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var be=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?be=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(be=this.cursorStart):be=this.input.value.length,this.fixCaret(be,be)}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(Ze){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(b){var N=b;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(b){var N=b.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(b);return isNaN(A)?b:(A<N&&(A=N),A>H&&(A=H),A)}},{key:"setValue",value:function(b,N){var H=this.props.precision,A=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),F=this.state.value,U=F===void 0?null:F,w=this.state.inputValue,Y=w===void 0?null:w,Z=typeof A=="number"?A.toFixed(H):"".concat(A),ce=A!==U||Z!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},N)):this.setState({value:A,inputValue:this.toPrecisionAsStep(b)},N),ce&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.props,A=H.precision,F=H.step;if(T(A))return A;var U=this.getPrecision(N),w=this.getPrecision(F),Y=this.getPrecision(b);return b?Math.max(Y,U+w):U+w}},{key:"getPrecisionFactor",value:function(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.getMaxPrecision(b,N);return Math.pow(10,H)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var N=Math.abs(this.getMaxPrecision(b));return isNaN(N)?b.toString():Number(b).toFixed(N)}},{key:"toNumber",value:function(b){var N=this.props.precision,H=this.state.focused,A=b&&b.length>16&&H;return this.isNotCompleteNumber(b)||A?b:T(N)?Math.round(b*Math.pow(10,N))/Math.pow(10,N):Number(b)}},{key:"upStep",value:function(b,N){var H=this.props.step,A=this.getPrecisionFactor(b,N),F=Math.abs(this.getMaxPrecision(b,N)),U=((A*b+A*H*N)/A).toFixed(F);return this.toNumber(U)}},{key:"downStep",value:function(b,N){var H=this.props.step,A=this.getPrecisionFactor(b,N),F=Math.abs(this.getMaxPrecision(b,N)),U=((A*b-A*H*N)/A).toFixed(F);return this.toNumber(U)}},{key:"step",value:function(b,N){var H=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,F=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var U=this.props;if(U.disabled)return;var w=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(w))return;var Y=this["".concat(b,"Step")](w,A),Z=Y>U.max||Y<U.min;if(Y>U.max?Y=U.max:Y<U.min&&(Y=U.min),this.setValue(Y,null),this.setState({focused:!0},function(){H.pressingUpOrDown=!1}),Z)return;this.autoStepTimer=setTimeout(function(){H[b](N,A,!0)},F?n:O)}},{key:"fixCaret",value:function(b,N){if(b===void 0||N===void 0||!this.input||!this.input.value)return;try{var H=this.input.selectionStart,A=this.input.selectionEnd;(b!==H||N!==A)&&this.input.setSelectionRange(b,N)}catch(F){}}},{key:"render",value:function(){var b,N=this.props,H=N.prefixCls,A=N.disabled,F=N.readOnly,U=N.useTouch,w=N.autoComplete,Y=N.upHandler,Z=N.downHandler,ce=N.className,be=N.max,Ze=N.min,Ce=N.style,We=N.title,Ve=N.onMouseEnter,Ye=N.onMouseLeave,we=N.onMouseOver,X=N.onMouseOut,j=N.required,W=N.onClick,Q=N.tabIndex,re=N.type,G=N.placeholder,xe=N.id,Ie=N.inputMode,tt=N.pattern,le=N.step,Se=N.maxLength,je=N.autoFocus,ze=N.name,yt=N.onPaste,Ot=N.onInput,Ut=Object(ne.a)(N,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Qe=this.state,Bt=Qe.value,ln=Qe.focused,Ke=x()(H,(b={},Object(V.a)(b,ce,!!ce),Object(V.a)(b,"".concat(H,"-disabled"),A),Object(V.a)(b,"".concat(H,"-focused"),ln),b)),He={};Object.keys(Ut).forEach(function(_e){(_e.substr(0,5)==="data-"||_e.substr(0,5)==="aria-"||_e==="role")&&(He[_e]=Ut[_e])});var ct=!F&&!A,bt=this.getInputDisplayValue(null),de=(Bt||Bt===0)&&(isNaN(Bt)||Number(Bt)>=be),q=(Bt||Bt===0)&&(isNaN(Bt)||Number(Bt)<=Ze),te=de||A||F,se=q||A||F,pe=x()("".concat(H,"-handler"),"".concat(H,"-handler-up"),Object(V.a)({},"".concat(H,"-handler-up-disabled"),te)),ae=x()("".concat(H,"-handler"),"".concat(H,"-handler-down"),Object(V.a)({},"".concat(H,"-handler-down-disabled"),se)),ie=U?{onTouchStart:te?d:this.up,onTouchEnd:this.stop}:{onMouseDown:te?d:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},me=U?{onTouchStart:se?d:this.down,onTouchEnd:this.stop}:{onMouseDown:se?d:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:Ke,style:Ce,title:We,onMouseEnter:Ve,onMouseLeave:Ye,onMouseOver:we,onMouseOut:X,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(H,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":te,className:pe}),Y||r.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-up-inner"),onClick:l})),r.a.createElement("span",Object.assign({unselectable:"on"},me,{role:"button","aria-label":"Decrease Value","aria-disabled":se,className:ae}),Z||r.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-down-inner"),onClick:l}))),r.a.createElement("div",{className:"".concat(H,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ze,"aria-valuemax":be,"aria-valuenow":Bt,required:j,type:re,placeholder:G,onPaste:yt,onClick:W,onMouseUp:this.onMouseUp,className:"".concat(H,"-input"),tabIndex:Q,autoComplete:w,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ct?this.onKeyDown:d,onKeyUp:ct?this.onKeyUp:d,autoFocus:je,maxLength:Se,readOnly:F,disabled:A,max:be,min:Ze,step:le,name:ze,title:We,id:xe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(bt),pattern:tt,inputMode:Ie,onInput:Ot},He))))}}]),v}(r.a.Component);S.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:C,min:-C,step:1,style:{},onChange:d,onKeyDown:d,onPressEnter:d,onFocus:d,onBlur:d,parser:i,required:!1,autoComplete:"off"};var y=S,E=ve.a=y},eozf:function(Lt,ve,k){"use strict";k.d(ve,"b",function(){return Ye}),k.d(ve,"c",function(){return we});var ne=k("sRBo"),V=k("kaz8"),I=k("5Dmo"),z=k("3S7+"),L=k("/zsF"),D=k("PArb"),K=k("7Kak"),M=k("9yH6"),r=k("14J3"),P=k("BMrR"),x=k("+L6B"),p=k("2/Rp"),m=k("jCWc"),c=k("kPKH"),a=k("2qtc"),s=k("kLXV"),d=k("9og8"),l=k("miYZ"),i=k("tsqr"),n=k("oBTY"),O=k("k1fw"),C=k("tJVT"),T=k("OaEy"),R=k("2fM7"),S=k("iQDF"),y=k("+eQT"),E=k("WmNS"),f=k.n(E),h=k("q1tI"),v=k.n(h),g=k("/MfK"),b=k("w5pM"),N=k("Lyp1"),H=k("wd/R"),A=k.n(H),F=k("xKgJ"),U=k("ErOA"),w=k("LvDl"),Y=k.n(w),Z=k("1vsH"),ce=k("zetH"),be=k.n(ce),Ze=k("Ty5D"),Ce=k("9kvl"),We=k("AHFd");function Ve(Q,re){for(var G=[],xe=Q;xe<re;xe++)G.push(xe);return G}var Ye=function(re,G,xe){var Ie=re<A()().startOf("day"),tt=re>A()(G).endOf("day"),le=re<A()(xe).startOf("day");return G?xe?A()()<=A()(xe)?le||tt:Ie||tt:re&&Ie||tt:xe&&A()()<=A()(xe)?le:Ie},we=function(re,G){var xe=parseInt(A()(re).format("HH")),Ie=parseInt(A()().format("HH")),tt=parseInt(A()().format("mm"));if(!re)return{disabledHours:function(){return Ve(0,Ie)},disabledMinutes:function(){return Ve(0,tt)}};if(G){var le=parseInt(A()(G).format("HH")),Se=parseInt(A()(G).format("mm"));return A()(re).isSame(A()(G),"day")?{disabledHours:function(){return Ve(0,le)},disabledMinutes:function(){return xe<=le?Ve(0,Se):[]}}:void 0}return A()(re).isSame(A()(),"day")?{disabledHours:function(){return Ve(0,Ie)},disabledMinutes:function(){return A()(re).isSame(A()(),"hour")&&xe<=Ie?Ve(0,tt):[]}}:void 0},X=y.a.RangePicker,j=R.a.Option,W=function(re){var G,xe,Ie,tt,le,Se,je,ze=re.shixunHomeworks,yt=re.loading,Ot=re.dispatch,Ut=Object(Ze.i)(),Qe=ze.workSetting,Bt=ze.workList,ln=ze.changeData,Ke=Object(h.useState)(!0),He=Object(C.a)(Ke,2),ct=He[0],bt=He[1],de=Object(h.useState)(!1),q=Object(C.a)(de,2),te=q[0],se=q[1],pe=Object(h.useState)([]),ae=Object(C.a)(pe,2),ie=ae[0],me=ae[1],_e=Object(h.useState)([]),Ee=Object(C.a)(_e,2),Le=Ee[0],at=Ee[1],Ct=Object(h.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,penalty_type:We.a.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0}),Jt=Object(C.a)(Ct,2),lt=Jt[0],Un=Jt[1];Object(h.useEffect)(function(){return Cn(),function(){me([].concat())}},[]);var Cn=function(){Ot({type:"shixunHomeworks/getWorkSetting",payload:Object(O.a)({},Ut)})};Object(h.useEffect)(function(){var jt;if(!(Qe!=null&&Qe.course_id))return;Object.keys(lt).map(function(Ft){lt[Ft]=Qe[Ft]}),(!lt.allow_late||!lt.unified_late)&&(lt.late_penalty=20,lt.penalty_type=We.a.Percent),lt.unified_setting||(lt.unified_late=!1,lt.unified_anonymous_comment=!1,lt.unified_anonymous_appeal=!1),ie=JSON.parse(JSON.stringify(Qe.group_settings.map(function(Ft){return Object(O.a)(Object(O.a)({},Ft),{},{group_name:[Ft.group_name]})}).filter(function(Ft){return Ft.publish_time!==null}))),Le=JSON.parse(JSON.stringify(Qe.allow_late_settings.map(function(Ft){return Object(O.a)(Object(O.a)({},Ft),{},{group_name:[Ft.group_name]})}).filter(function(Ft){return Ft.late_time!==null}))),Un(Object(O.a)({},lt)),me(Object(n.a)(ie)),((jt=Le)===null||jt===void 0?void 0:jt.length)<=0?at([{penalty_type:We.a.Percent,late_penalty:20}]):at(Object(n.a)(Le))},[Qe]);var vn=function(){var Ft,zt,dn=JSON.parse(JSON.stringify(lt));if(dn.challenge_settings.filter(function(bn){return!bn.hide}),dn.categoryId=Ut.categoryId,(Ft=dn.challenge_settings)!==null&&Ft!==void 0&&Ft.every(function(bn){return!bn.checked})){i.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}if(lt.unified_setting||(ie=(zt=ie)===null||zt===void 0?void 0:zt.map(function(bn){var _r;if(!bn.publish_time||!bn.end_time)throw i.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!bn.group_name)throw i.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return bn.group_name=typeof(bn==null?void 0:bn.group_name)=="string"?[bn==null?void 0:bn.group_name]:bn==null?void 0:bn.group_name,bn.group_id=(_r=Qe.group_settings)===null||_r===void 0?void 0:_r.filter(function(Bn){var Qt;return bn==null||((Qt=bn.group_name)===null||Qt===void 0)?void 0:Qt.includes(Bn.group_name)}).map(function(Bn){return Bn.group_id||Bn.id}).toString().split(","),bn})),dn.group_settings=ie,lt.allow_late)if(lt.unified_late){if(lt.late_penalty===null||lt.late_penalty===void 0||lt.late_penalty<0||lt.late_penalty>100)throw i.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!lt.late_time)throw i.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574")}else{var yn;Le=(yn=Le)===null||yn===void 0?void 0:yn.map(function(bn){var _r,Bn;if(bn.late_penalty===null||bn.late_penalty===void 0||bn.late_penalty<0||bn.late_penalty>100)throw i.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!bn.late_time)throw i.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!bn.group_name)throw i.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return bn.group_name=typeof(bn==null?void 0:bn.group_name)=="string"?[bn==null?void 0:bn.group_name]:bn==null?void 0:bn.group_name,bn.group_id=bn==null||((_r=bn.group_name)===null||_r===void 0||((Bn=_r.map(function(Qt){var Hn,lr,Sn=(Hn=Qe.group_settings)===null||Hn===void 0||((lr=Hn.filter(function(zn){return(zn==null?void 0:zn.group_name)===Qt}))===null||lr===void 0)?void 0:lr[0];return Sn==null?void 0:Sn.group_id}))===null||Bn===void 0))?void 0:Bn.toString().split(","),bn}),dn.allow_late_settings=Le}er(dn)},er=function(Ft){var zt,dn;if(Ft.total_score===null){i.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Ft!=null&&Ft.work_efficiency&&Ft.eff_score===null){i.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var yn=Ft.challenge_settings.reduce(function(Bn,Qt){return Bn+Number(Qt.challenge_score)},0);if((yn==null?void 0:yn.toFixed(10))!==((zt=Ft.total_score-Ft.eff_score)===null||zt===void 0?void 0:zt.toFixed(10))){i.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(Ft.total_score,"\u5206"));return}var bn={shixun_evaluation:Ft.shixun_evaluation,challenge_settings:Ft.challenge_settings},_r=function(){var Bn=Object(d.a)(f.a.mark(function Qt(){var Hn;return f.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return se(!0),Sn.next=3,Object(U.a)("/api/homework_commons/".concat(Ut.categoryId,"/publish_setting.json"),{method:"post",body:Object(O.a)({},Ft)});case 3:Hn=Sn.sent,Hn.status===0&&(i.b.success("\u66F4\u65B0\u6210\u529F"),bt(!0),Cn(),Ot({type:"shixunHomeworks/getWorkList",payload:Object(O.a)({},Ut)})),se(!1);case 6:case"end":return Sn.stop()}},Qt)}));return function(){return Bn.apply(this,arguments)}}();!Object(w.isEqual)(ln,bn)&&!(Bt!=null&&(dn=Bt.homework_status)!==null&&dn!==void 0&&dn.includes("\u672A\u53D1\u5E03"))?s.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5173\u5361\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:_r}):_r()},kn=function(Ft,zt){var dn,yn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return zt?zt.find(function(bn){return bn[yn]===Ft}):Qe==null||((dn=Qe.group_settings)===null||dn===void 0)?void 0:dn.find(function(bn){return bn.group_id[0]===Ft})},Yn=(Qe==null?void 0:Qe.allow_late)||(Qe==null?void 0:Qe.anonymous_comment),vr=function(Ft){var zt=kn(Ft,Qe==null?void 0:Qe.allow_late_settings,"id"),dn=kn(Ft,Qe==null?void 0:Qe.anonymous_comment_settings);return(Qe==null?void 0:Qe.allow_late)&&zt&&(zt==null?void 0:zt.late_time)!==null||(Qe==null?void 0:Qe.anonymous_comment)&&dn&&(dn==null?void 0:dn.evaluation_start)!==null},Mn=Object(h.useMemo)(function(){var jt;if(Qe!=null&&Qe.unified_setting){var Ft;return!(Bt!=null&&(Ft=Bt.homework_status)!==null&&Ft!==void 0&&Ft.includes("\u5DF2\u622A\u6B62"))||(Qe==null?void 0:Qe.allow_late)||(Qe==null?void 0:Qe.anonymous_comment)}var zt=Qe==null||((jt=Qe.group_settings)===null||jt===void 0)?void 0:jt.some(function(dn){return A()(dn.end_time)<=A()()});return!zt||(Qe==null?void 0:Qe.allow_late)||(Qe==null?void 0:Qe.all_group_late)},[Qe,Bt]),Zn=Qe==null?void 0:Qe.anonymous_comment,dr=function(Ft){if(!Ft)return!1;var zt=kn(Ft,Qe==null?void 0:Qe.anonymous_comment_settings);return(Qe==null?void 0:Qe.anonymous_comment)&&zt&&(zt==null?void 0:zt.evaluation_start)!==null};return v.a.createElement("section",{className:[be.a.form," bg-white pl30 pr30 pt10"].join(" ")},v.a.createElement(P.a,null,v.a.createElement(c.a,{span:24},v.a.createElement(P.a,{align:"middle"},v.a.createElement(c.a,{flex:"1"}),v.a.createElement(c.a,null,Object(F.c)()&&ct&&v.a.createElement(p.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return bt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),v.a.createElement("div",null,v.a.createElement("label",null,"\u53D1\u5E03\u65B9\u5F0F\uFF1A")," ",v.a.createElement(M.a.Group,{disabled:ct||!(Bt!=null&&(G=Bt.homework_status)!==null&&G!==void 0&&G.includes("\u672A\u53D1\u5E03")),value:lt.unified_setting,onChange:function(Ft){var zt;if(!(Bt!=null&&(zt=Bt.homework_status)!==null&&zt!==void 0&&zt.includes("\u672A\u53D1\u5E03"))){i.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(lt.unified_setting=!lt.unified_setting,lt.unified_setting||(lt.unified_late=!1),Un(Object.assign({},lt)),lt.unified_setting===!1&&ie==""){me(ie.concat({}));return}lt.unified_setting&&(me([]),at([{late_penalty:5}]))}},v.a.createElement(M.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),v.a.createElement(M.a,{disabled:(Qe==null||((xe=Qe.group_settings)===null||xe===void 0)?void 0:xe.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(Qe==null||((Ie=Qe.group_settings)===null||Ie===void 0)?void 0:Ie.length)===0&&v.a.createElement("p",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},"\uFF08\u672C\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03\u201C\uFF09"))),lt.unified_setting&&v.a.createElement("div",null,v.a.createElement(P.a,{align:"middle",className:"mt25 pl30"},v.a.createElement(c.a,null,"\u53D1\u5E03\u65F6\u95F4:"),v.a.createElement(c.a,{className:"ml5"},v.a.createElement(y.a,{disabled:ct||!(Bt!=null&&(tt=Bt.homework_status)!==null&&tt!==void 0&&tt.includes("\u672A\u53D1\u5E03")||Bt!=null&&(le=Bt.homework_status)!==null&&le!==void 0&&le.includes("\u672A\u5F00\u59CB")),style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:function(Ft){return Ye(Ft,Qe==null?void 0:Qe.course_end_date)},disabledTime:function(Ft){return we(Ft)},value:lt.publish_time?A()(lt.publish_time):"",onChange:function(Ft,zt){lt.publish_time=zt,(lt.end_time==""||!lt.end_time)&<.unified_setting&&(lt.end_time=A()(Ft).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),Un(Object.assign({},lt))}})),v.a.createElement(c.a,null,v.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),v.a.createElement(P.a,{align:"middle",className:"mt25 pl30"},v.a.createElement(c.a,null,"\u622A\u6B62\u65F6\u95F4:"),v.a.createElement(c.a,{className:"ml5"},v.a.createElement(y.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:A()(Object(Z.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:ct||Yn,disabledDate:function(Ft){return Ye(Ft,Qe==null?void 0:Qe.course_end_date,lt.publish_time)},disabledTime:function(Ft){return we(Ft,lt.publish_time)},value:lt.end_time?A()(lt.end_time):"",onChange:function(Ft,zt){lt.end_time=zt,Un(Object.assign({},lt))}})),v.a.createElement(c.a,null,v.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!lt.unified_setting&&((Se=ie)===null||Se===void 0?void 0:Se.length)>0&&v.a.createElement(P.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},v.a.createElement(c.a,{span:24},v.a.createElement(P.a,null,v.a.createElement(c.a,{span:10}),v.a.createElement(c.a,{span:10},v.a.createElement(P.a,{className:"c-grey-c ml30"},v.a.createElement(c.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),v.a.createElement(c.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),v.a.createElement(c.a,{span:4}))),ie&&ie.map(function(jt,Ft){var zt,dn,yn,bn,_r;return v.a.createElement(c.a,{span:24,key:Ft},v.a.createElement(P.a,{gutter:[8,16]},v.a.createElement(c.a,{span:10},v.a.createElement(P.a,{gutter:[8,16]},v.a.createElement(c.a,null,"\u53D1\u5E03\u89C4\u5219 ",Ft+1),v.a.createElement(c.a,{flex:"1",style:{maxWidth:300}},v.a.createElement(R.a,{disabled:ct||!(Bt!=null&&(zt=Bt.homework_status)!==null&&zt!==void 0&&zt.includes("\u672A\u53D1\u5E03"))&&jt.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:jt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Qt){ie[Ft].group_name=Qt,ie[Ft].group_id=jt.group_id;var Hn=Object(w.flattenDeep)(ie.map(function(Sn){return Sn.group_name})),lr=Le.map(function(Sn){var zn=(Sn==null?void 0:Sn.group_name)||[];return Object(O.a)(Object(O.a)({},Sn),{},{group_name:Object(w.remove)(zn,function(tr){return Hn.includes(tr)})})});at(lr),me(ie.slice())}},Qe.group_settings&&Qe.group_settings.map(function(Bn){var Qt=ie.map(function(Hn){return Hn.group_name}).flat();if(!Qt.includes(Bn.group_name))return v.a.createElement(j,{value:Bn.group_name,key:Bn.id},Bn.group_name)}))))),v.a.createElement(c.a,{span:10},v.a.createElement("div",{className:"ml30"},v.a.createElement(X,{ranges:{\u6B64\u523B:[jt.publish_time?A()(jt.publish_time):A()(),A()()]},allowClear:!1,disabled:ct||(A()()<=A()((dn=kn((yn=jt.group_id)===null||yn===void 0?void 0:yn[0]))===null||dn===void 0?void 0:dn.publish_time)?!1:[!0,vr((bn=jt.group_id)===null||bn===void 0?void 0:bn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(Qt){return Ye(Qt,Qe==null?void 0:Qe.course_end_date)},disabledTime:function(Qt){return we(Qt)},showTime:{showNow:!0,format:"HH:mm",defaultValue:[A()(Object(Z.d)(),"HH:mm"),A()(Object(Z.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:jt.publish_time&&[A()(jt.publish_time),jt.end_time?A()(jt.end_time):void 0],onChange:function(Qt,Hn){ie[Ft].publish_time=Hn[0],ie[Ft].end_time=Hn[1],me(Object(n.a)(ie))}}))),!ct&&v.a.createElement(c.a,{span:4},Ft>0&&!jt.id&&v.a.createElement(g.a,{onClick:function(){ie=ie.filter(function(Qt,Hn){return Ft!==Hn}),me(ie.slice()),setTimeout(function(){return me(ie.slice())},10)}}),ie.length<(Qe==null||((_r=Qe.group_settings)===null||_r===void 0)?void 0:_r.length)&&v.a.createElement(b.a,{className:"c-green ml20",onClick:function(){me(ie.concat({}))}}))))})),v.a.createElement(D.a,null),v.a.createElement(P.a,null,v.a.createElement(c.a,null,v.a.createElement("strong",null,"\u8865\u4EA4\u8BBE\u7F6E"),v.a.createElement(z.a,{placement:"right",title:"\u4F5C\u4E1A\u622A\u6B62\u540E\u624D\u53EF\u5F00\u542F\u8865\u4EA4\uFF0C\u5F00\u542F\u8865\u4EA4\u540E\u4E0D\u53EF\u53D8\u66F4\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3002"},v.a.createElement(N.a,{style:{marginLeft:4,cursor:"pointer"}}))),v.a.createElement(c.a,{span:24,className:"mt15 pl30"},v.a.createElement(V.a,{checked:lt.allow_late,disabled:ct||Mn,onChange:function(){lt.allow_late=!lt.allow_late,Le==""&&at([{late_penalty:5}]),Un(Object.assign({},lt))}},v.a.createElement("strong",null,"\u5F00\u542F\u8865\u4EA4")),v.a.createElement(z.a,{overlayStyle:{width:380,maxWidth:380},title:v.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},v.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),v.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4\uFF0C\u5B66\u751F\u53EA\u5728\u8865\u4EA4\u65F6\u95F4\u5185\u624D\u901A\u5173\u5219\u6263\u9664\u5206\u503C\uFF0C\u672A\u901A\u5173\u4E0D\u6263\u5206\uFF1B"),v.a.createElement("span",null,"\u5B66\u751F\u5728\u6B63\u5E38\u4F5C\u4E1A\u89C4\u5B9A\u65F6\u95F4\u5185\u901A\u5173\uFF0C\u5728\u8865\u4EA4\u9636\u6BB5\u518D\u6B21\u901A\u5173\u4E0D\u6263\u5206\u3002"))},v.a.createElement(N.a,null)))),(lt==null?void 0:lt.allow_late)&&v.a.createElement("div",{style:{marginLeft:22}},v.a.createElement("div",{className:"ml30 mt20"},v.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),v.a.createElement(M.a.Group,{disabled:ct||(Qe==null?void 0:Qe.anonymous_comment)||(Qe==null?void 0:Qe.allow_late),value:lt.unified_late,onChange:function(Ft){lt.unified_late=Ft.target.value,Le==""&&!Ft.target.value&&at([{penalty_type:We.a.Percent,late_penalty:20}]),Un(Object(O.a)({},lt))}},(lt==null?void 0:lt.unified_setting)&&v.a.createElement(M.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(Qe==null||((je=Qe.group_settings)===null||je===void 0)?void 0:je.length)>0&&v.a.createElement(M.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),lt!=null&<.unified_late?v.a.createElement(v.a.Fragment,null,v.a.createElement(P.a,{align:"middle",className:"mt25 pl30"},v.a.createElement(c.a,null,"\u8865\u4EA4\u6263\u5206:"),v.a.createElement(c.a,{className:"ml5"},v.a.createElement(We.b,{disabled:ct||Zn,value:{type:lt.penalty_type,inputValue:lt.late_penalty},onChange:function(Ft){Un(Object(O.a)(Object(O.a)({},lt),{},{late_penalty:Ft.inputValue,penalty_type:Ft.type}))}})),v.a.createElement(c.a,{flex:"1",className:"ml5"},v.a.createElement("span",{className:"c-grey-c ml10"},lt.penalty_type===We.a.Number?"(\u8865\u4EA4\u65F6\u6309\u7167\u5B66\u751F\u603B\u6210\u7EE9\u6263\u5206)":"(\u5B66\u751F\u6210\u7EE9\u5C06\u6263\u9664\u8865\u4EA4\u5173\u5361\u5206\u503C\u7684\u767E\u5206\u6BD4)"))),v.a.createElement(P.a,{align:"middle",className:"mt25 pl30"},v.a.createElement(c.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),v.a.createElement(c.a,{className:"ml5"},v.a.createElement(y.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:A()(Object(Z.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:ct||Zn,value:lt.late_time?A()(lt.late_time):"",disabledDate:function(Ft){return Ye(Ft,Qe==null?void 0:Qe.course_end_date)},onChange:function(Ft,zt){lt.late_time=zt,Un(Object.assign({},lt))}})),v.a.createElement(c.a,null,v.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):Le.map(function(jt,Ft){var zt;return v.a.createElement(c.a,{span:24,key:Ft},v.a.createElement(P.a,{className:"mt25"},v.a.createElement(c.a,{style:{marginLeft:30}},v.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",Ft+1,"\uFF1A"),v.a.createElement(R.a,{disabled:ct||!(Bt!=null&&(zt=Bt.homework_status)!==null&&zt!==void 0&&zt.includes("\u672A\u53D1\u5E03"))&&jt.id||(Qe==null?void 0:Qe.anonymous_comment),mode:"multiple",style:{width:306},value:typeof jt.group_name=="string"?[jt.group_name]:jt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(yn){Le[Ft].group_name=yn,Le[Ft].group_id=jt.group_id,at(Le.slice())}},Qe.group_settings&&Qe.group_settings.map(function(dn){var yn=Le.map(function(_r){return _r.group_name}).flat(),bn=ie.map(function(_r){return _r.group_name}).flat();if(lt!=null&<.unified_setting){if(!yn.includes(dn.group_name))return v.a.createElement(j,{value:dn.group_name,key:dn.id},dn.group_name)}else if(bn.includes(dn.group_name)&&(!yn.includes(dn.group_name)&&A()(dn.end_time)<=A()()))return v.a.createElement(j,{value:dn.group_name,key:dn.id},dn.group_name)}))),v.a.createElement(c.a,{className:"ml20"},v.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),v.a.createElement(We.b,{disabled:ct||dr(jt.id),value:{type:jt.penalty_type,inputValue:jt.late_penalty},onChange:function(yn){Le[Ft].late_penalty=yn.inputValue,Le[Ft].penalty_type=yn.type,at(Object(n.a)(Le))}})),v.a.createElement(c.a,{className:"ml20"},v.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),v.a.createElement(y.a,{disabled:ct||dr(jt.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:A()(Object(Z.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(yn){return Ye(yn,Qe==null?void 0:Qe.course_end_date)},format:"YYYY-MM-DD HH:mm",value:jt!=null&&jt.late_time?A()(jt.late_time):void 0,onChange:function(yn,bn){Le[Ft].late_time=bn,at(Object(n.a)(Le))}})),!ct&&v.a.createElement(c.a,{className:"ml20"},Ft>0&&!jt.id&&v.a.createElement(g.a,{onClick:function(){Le=Le.filter(function(yn,bn){return Ft!==bn}),at(Le.slice()),setTimeout(function(){return at(Le.slice())},10)}}),v.a.createElement(b.a,{className:"c-green ml20",onClick:function(){at(Le.concat({penalty_type:We.a.Percent,late_minus_score:20}))}}))))})),v.a.createElement(D.a,null),!ct&&v.a.createElement(c.a,{className:"mb50"},v.a.createElement(p.a,{type:"primary",size:"large",style:{marginTop:"40px"},loading:te,onClick:function(){return vn()}},"\u63D0\u4EA4"),v.a.createElement(p.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){bt(!0),Cn()}},"\u53D6\u6D88")))};ve.a=Object(Ce.a)(function(Q){var re=Q.shixunHomeworks,G=Q.loading;return{shixunHomeworks:re,loading:G.effects}})(W)},fjLI:function(Lt,ve,k){"use strict";k.d(ve,"f",function(){return m}),k.d(ve,"b",function(){return c}),k.d(ve,"a",function(){return a}),k.d(ve,"d",function(){return s}),k.d(ve,"e",function(){return d}),k.d(ve,"c",function(){return l});var ne=k("8HAY"),V=k("Vhoy"),I=k("MI8n"),z=k("JYp7"),L=k("pmY6"),D=k("24hK"),K=k("nnTU"),M=k("T8No"),r=k("Cg/j"),P=k("t9D7"),x=function(i,n,O,C){var T=arguments.length,R=T<3?n:C===null?C=Object.getOwnPropertyDescriptor(n,O):C,S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(i,n,O,C);else for(var y=i.length-1;y>=0;y--)(S=i[y])&&(R=(T<3?S(R):T>3?S(n,O,R):S(n,O))||R);return T>3&&R&&Object.defineProperty(n,O,R),R},p=function(i,n){return function(O,C){n(O,C,i)}};function m(i){return i.command!==void 0}class c{constructor(i){this.id=c._idPool++,this._debugName=i}}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(r.c)("menuService"),s=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new I.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===c.CommandPalette}}addCommand(i){return this.addCommands(z.a.single(i))}addCommands(i){for(const n of i)this._commands.set(n.id,n);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(L.i)(()=>{let n=!1;for(const O of i)n=this._commands.delete(O.id)||n;n&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((n,O)=>i.set(O,n)),i}appendMenuItem(i,n){return this.appendMenuItems(z.a.single({id:i,item:n}))}appendMenuItems(i){const n=new Set,O=new D.a;for(const{id:C,item:T}of i){let R=this._menuItems.get(C);R||(R=new D.a,this._menuItems.set(C,R)),O.push(R.push(T)),n.add(C)}return this._onDidChangeMenu.fire(n),Object(L.i)(()=>{if(O.size>0){for(let C of O)C();this._onDidChangeMenu.fire(n),O.clear()}})}getMenuItems(i){let n;return this._menuItems.has(i)?n=[...this._menuItems.get(i)]:n=[],i===c.CommandPalette&&this._appendImplicitItems(n),n}_appendImplicitItems(i){const n=new Set;for(const O of i)m(O)&&(n.add(O.command.id),O.alt&&n.add(O.alt.id));this._commands.forEach((O,C)=>{n.has(C)||i.push({command:O})})}};class d extends ne.e{constructor(i,n,O,C){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=n,this._contextKeyService=O,this._options=C}get actions(){const i=[],n=this._menuService.createMenu(this.item.submenu,this._contextKeyService),O=n.getActions(this._options);n.dispose();for(const[,C]of O)C.length>0&&(i.push(...C),i.push(new ne.d));return i.length&&i.pop(),i}}let l=class i{constructor(n,O,C,T,R){var S,y;if(this._commandService=R,this.id=n.id,this.label=(C==null?void 0:C.renderShortTitle)&&n.shortTitle?typeof n.shortTitle=="string"?n.shortTitle:n.shortTitle.value:typeof n.title=="string"?n.title:n.title.value,this.tooltip=(y=typeof n.tooltip=="string"?n.tooltip:(S=n.tooltip)===null||S===void 0?void 0:S.value)!==null&&y!==void 0?y:"",this.enabled=!n.precondition||T.contextMatchesRules(n.precondition),this.checked=void 0,n.toggled){const E=n.toggled.condition?n.toggled:{condition:n.toggled};this.checked=T.contextMatchesRules(E.condition),this.checked&&E.tooltip&&(this.tooltip=typeof E.tooltip=="string"?E.tooltip:E.tooltip.value),E.title&&(this.label=typeof E.title=="string"?E.title:E.title.value)}this.item=n,this.alt=O?new i(O,void 0,C,T,R):void 0,this._options=C,P.d.isThemeIcon(n.icon)&&(this.class=V.a.asClassName(n.icon))}dispose(){}run(...n){var O,C;let T=[];return((O=this._options)===null||O===void 0?void 0:O.arg)&&(T=[...T,this._options.arg]),((C=this._options)===null||C===void 0?void 0:C.shouldForwardArgs)&&(T=[...T,...n]),this._commandService.executeCommand(this.id,...T)}};l=x([p(3,M.b),p(4,K.b)],l)},fyJ8:function(Lt,ve,k){"use strict";var ne=k("rePB"),V=k("VTBJ"),I=k("Ff2n"),z=k("U8pU"),L=k("q1tI"),D=k.n(L),K=k("TSYQ"),M=k.n(K),r=k("c+Xe"),P=k("sR1s");function x(s){return s&&Object(z.a)(s)==="object"&&!Array.isArray(s)&&!L.isValidElement(s)}function p(s){return typeof s=="string"?!0:Object(r.c)(s)}function m(s,d){var l,i=s.prefixCls,n=s.className,O=s.record,C=s.index,T=s.dataIndex,R=s.render,S=s.children,y=s.component,E=y===void 0?"td":y,f=s.colSpan,h=s.rowSpan,v=s.fixLeft,g=s.fixRight,b=s.firstFixLeft,N=s.lastFixLeft,H=s.firstFixRight,A=s.lastFixRight,F=s.appendNode,U=s.additionalProps,w=U===void 0?{}:U,Y=s.ellipsis,Z=s.align,ce=s.rowType,be=s.isSticky,Ze="".concat(i,"-cell"),Ce,We;if(S)We=S;else{var Ve=Object(P.b)(O,T);if(We=Ve,R){var Ye=R(Ve,O,C);x(Ye)?(We=Ye.children,Ce=Ye.props):We=Ye}}Object(z.a)(We)==="object"&&!Array.isArray(We)&&!L.isValidElement(We)&&(We=null),Y&&(N||H)&&(We=L.createElement("span",{className:"".concat(Ze,"-content")},We));var we=Ce||{},X=we.colSpan,j=we.rowSpan,W=we.style,Q=we.className,re=Object(I.a)(we,["colSpan","rowSpan","style","className"]),G=X!==void 0?X:f,xe=j!==void 0?j:h;if(G===0||xe===0)return null;var Ie={},tt=typeof v=="number",le=typeof g=="number";tt&&(Ie.position="sticky",Ie.left=v),le&&(Ie.position="sticky",Ie.right=g);var Se={};Z&&(Se.textAlign=Z);var je,ze=Y===!0?{showTitle:!0}:Y;ze&&(ze.showTitle||ce==="header")&&(typeof We=="string"||typeof We=="number"?je=We.toString():L.isValidElement(We)&&typeof We.props.children=="string"&&(je=We.props.children));var yt=Object(V.a)(Object(V.a)(Object(V.a)({title:je},re),w),{},{colSpan:G&&G!==1?G:null,rowSpan:xe&&xe!==1?xe:null,className:M()(Ze,n,(l={},Object(ne.a)(l,"".concat(Ze,"-fix-left"),tt),Object(ne.a)(l,"".concat(Ze,"-fix-left-first"),b),Object(ne.a)(l,"".concat(Ze,"-fix-left-last"),N),Object(ne.a)(l,"".concat(Ze,"-fix-right"),le),Object(ne.a)(l,"".concat(Ze,"-fix-right-first"),H),Object(ne.a)(l,"".concat(Ze,"-fix-right-last"),A),Object(ne.a)(l,"".concat(Ze,"-ellipsis"),Y),Object(ne.a)(l,"".concat(Ze,"-with-append"),F),Object(ne.a)(l,"".concat(Ze,"-fix-sticky"),(tt||le)&&be),l),w.className,Q),style:Object(V.a)(Object(V.a)(Object(V.a)(Object(V.a)({},w.style),Se),Ie),W),ref:p(E)?d:null});return L.createElement(E,Object.assign({},yt),F,We)}var c=L.forwardRef(m);c.displayName="Cell";var a=L.memo(c,function(s,d){return d.shouldCellUpdate?!d.shouldCellUpdate(d.record,s.record):!1});ve.a=a},hW8S:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return z}),k.d(ve,"c",function(){return L}),k.d(ve,"b",function(){return D});var ne=k("VTBJ"),V=k("Ff2n"),I=k("Kwbf"),z="RC_TABLE_INTERNAL_COL_DEFINE";function L(K){var M=K.expandable,r=Object(V.a)(K,["expandable"]);return"expandable"in K?Object(ne.a)(Object(ne.a)({},r),M):r}function D(K){return Object.keys(K).reduce(function(M,r){return(r.substr(0,5)==="data-"||r.substr(0,5)==="aria-")&&(M[r]=K[r]),M},{})}},iF7n:function(Lt,ve,k){Lt.exports={flex_box_center:"flex_box_center___1Hyu4",flex_space_between:"flex_space_between___3ssyf",flex_box_vertical_center:"flex_box_vertical_center___1Gkv-",flex_box_center_end:"flex_box_center_end___1fs_5",flex_box_column:"flex_box_column___3KImt",top:"top___FkMRG",desc:"desc___zZgSM",liked:"liked___1eBGI",likedActive:"likedActive___1i_lJ",reply:"reply___1mww8",replyList:"replyList___3NmMj",comment:"comment___1kF3h"}},ic2d:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return z});var ne=k("FWmy"),V=k("746U");class I{constructor(){this.data=new Map}add(L,D){ne.a(V.l(L)),ne.a(V.k(D)),ne.a(!this.data.has(L),"There is already an extension with this id"),this.data.set(L,D)}as(L){return this.data.get(L)||null}}const z=new I},k3GJ:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return rr});var ne=k("rePB"),V=k("ODXe"),I=k("Ff2n"),z=k("VTBJ"),L=k("q1tI"),D=k("TSYQ"),K=k.n(D),M=k("Zm9Q"),r=k("6cGi"),P=k("KQm4"),x=k("xEkU"),p=k.n(x),m=k("t23M");function c(Te){var Ne=Object(L.useRef)(),Ge=Object(L.useRef)(!1);function Ae(){for(var ue=arguments.length,ye=new Array(ue),fe=0;fe<ue;fe++)ye[fe]=arguments[fe];Ge.current||(p.a.cancel(Ne.current),Ne.current=p()(function(){Te.apply(void 0,ye)}))}return Object(L.useEffect)(function(){return function(){Ge.current=!0,p.a.cancel(Ne.current)}},[]),Ae}function a(Te){var Ne=Object(L.useRef)([]),Ge=Object(L.useState)({}),Ae=Object(V.a)(Ge,2),ue=Ae[1],ye=Object(L.useRef)(typeof Te=="function"?Te():Te),fe=c(function(){var Pe=ye.current;Ne.current.forEach(function($e){Pe=$e(Pe)}),Ne.current=[],ye.current=Pe,ue({})});function De(Pe){Ne.current.push(Pe),fe()}return[ye.current,De]}var s=k("4IlW");function d(Te,Ne){var Ge,Ae=Te.prefixCls,ue=Te.id,ye=Te.active,fe=Te.rtl,De=Te.tab,Pe=De.key,$e=De.tab,Me=De.disabled,nt=De.closeIcon,xt=Te.tabBarGutter,It=Te.tabPosition,Vt=Te.closable,xn=Te.renderWrapper,An=Te.removeAriaLabel,qn=Te.editable,$n=Te.onClick,cr=Te.onRemove,gr=Te.onFocus,ir="".concat(Ae,"-tab");L.useEffect(function(){return cr},[]);var hr={};It==="top"||It==="bottom"?hr[fe?"marginLeft":"marginRight"]=xt:hr.marginBottom=xt;var Er=qn&&Vt!==!1&&!Me;function Xt(Rt){if(Me)return;$n(Rt)}function Mt(Rt){Rt.preventDefault(),Rt.stopPropagation(),qn.onEdit("remove",{key:Pe,event:Rt})}var en=L.createElement("div",{key:Pe,ref:Ne,className:K()(ir,(Ge={},Object(ne.a)(Ge,"".concat(ir,"-with-remove"),Er),Object(ne.a)(Ge,"".concat(ir,"-active"),ye),Object(ne.a)(Ge,"".concat(ir,"-disabled"),Me),Ge)),style:hr,onClick:Xt},L.createElement("div",{role:"tab","aria-selected":ye,id:ue&&"".concat(ue,"-tab-").concat(Pe),className:"".concat(ir,"-btn"),"aria-controls":ue&&"".concat(ue,"-panel-").concat(Pe),"aria-disabled":Me,tabIndex:Me?null:0,onClick:function(At){At.stopPropagation(),Xt(At)},onKeyDown:function(At){[s.a.SPACE,s.a.ENTER].includes(At.which)&&(At.preventDefault(),Xt(At))},onFocus:gr},$e),Er&&L.createElement("button",{type:"button","aria-label":An||"remove",tabIndex:0,className:"".concat(ir,"-remove"),onClick:function(At){At.stopPropagation(),Mt(At)}},nt||qn.removeIcon||"\xD7"));return xn&&(en=xn(en)),en}var l=L.forwardRef(d),i={width:0,height:0,left:0,top:0};function n(Te,Ne,Ge){return Object(L.useMemo)(function(){for(var Ae,ue=new Map,ye=Ne.get((Ae=Te[0])===null||Ae===void 0?void 0:Ae.key)||i,fe=ye.left+ye.width,De=0;De<Te.length;De+=1){var Pe=Te[De].key,$e=Ne.get(Pe);if(!$e){var Me;$e=Ne.get((Me=Te[De-1])===null||Me===void 0?void 0:Me.key)||i}var nt=ue.get(Pe)||Object(z.a)({},$e);nt.right=fe-nt.left-nt.width,ue.set(Pe,nt)}return ue},[Te.map(function(Ae){return Ae.key}).join("_"),Ne,Ge])}var O={width:0,height:0,left:0,top:0,right:0};function C(Te,Ne,Ge,Ae,ue){var ye=ue.tabs,fe=ue.tabPosition,De=ue.rtl,Pe,$e,Me;["top","bottom"].includes(fe)?(Pe="width",$e=De?"right":"left",Me=Math.abs(Ne.left)):(Pe="height",$e="top",Me=-Ne.top);var nt=Ne[Pe],xt=Ge[Pe],It=Ae[Pe],Vt=nt;return xt+It>nt&&(Vt=nt-It),Object(L.useMemo)(function(){if(!ye.length)return[0,0];for(var xn=ye.length,An=xn,qn=0;qn<xn;qn+=1){var $n=Te.get(ye[qn].key)||O;if($n[$e]+$n[Pe]>Me+Vt){An=qn-1;break}}for(var cr=0,gr=xn-1;gr>=0;gr-=1){var ir=Te.get(ye[gr].key)||O;if(ir[$e]<Me){cr=gr+1;break}}return[cr,An]},[Te,Me,Vt,fe,ye.map(function(xn){return xn.key}).join("_"),De])}var T=k("wx14"),R=k("1OyB"),S=k("vuIU"),y=k("JX7q"),E=k("Ji7U"),f=k("LK+K"),h=k("I8Z2"),v=k("bT9E"),g=k("2GS6"),b=k("Gytx"),N=k.n(b),H=k("U8pU"),A=/iPhone/i,F=/iPod/i,U=/iPad/i,w=/\bAndroid(?:.+)Mobile\b/i,Y=/Android/i,Z=/\bAndroid(?:.+)SD4930UR\b/i,ce=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,be=/Windows Phone/i,Ze=/\bWindows(?:.+)ARM\b/i,Ce=/BlackBerry/i,We=/BB10/i,Ve=/Opera Mini/i,Ye=/\b(CriOS|Chrome)(?:.+)Mobile/i,we=/Mobile(?:.+)Firefox\b/i;function X(Te,Ne){return Te.test(Ne)}function j(Te){var Ne=Te||(typeof navigator!="undefined"?navigator.userAgent:""),Ge=(Ne||"").split("[FBAN");if(typeof Ge[1]!="undefined"){var Ae=Ge,ue=Object(V.a)(Ae,1);Ne=ue[0]}if(Ge=Ne.split("Twitter"),typeof Ge[1]!="undefined"){var ye=Ge,fe=Object(V.a)(ye,1);Ne=fe[0]}var De={apple:{phone:X(A,Ne)&&!X(be,Ne),ipod:X(F,Ne),tablet:!X(A,Ne)&&X(U,Ne)&&!X(be,Ne),device:(X(A,Ne)||X(F,Ne)||X(U,Ne))&&!X(be,Ne)},amazon:{phone:X(Z,Ne),tablet:!X(Z,Ne)&&X(ce,Ne),device:X(Z,Ne)||X(ce,Ne)},android:{phone:!X(be,Ne)&&X(Z,Ne)||!X(be,Ne)&&X(w,Ne),tablet:!X(be,Ne)&&!X(Z,Ne)&&!X(w,Ne)&&(X(ce,Ne)||X(Y,Ne)),device:!X(be,Ne)&&(X(Z,Ne)||X(ce,Ne)||X(w,Ne)||X(Y,Ne))||X(/\bokhttp\b/i,Ne)},windows:{phone:X(be,Ne),tablet:X(Ze,Ne),device:X(be,Ne)||X(Ze,Ne)},other:{blackberry:X(Ce,Ne),blackberry10:X(We,Ne),opera:X(Ve,Ne),firefox:X(we,Ne),chrome:X(Ye,Ne),device:X(Ce,Ne)||X(We,Ne)||X(Ve,Ne)||X(we,Ne)||X(Ye,Ne)},any:null,phone:null,tablet:null};return De.any=De.apple.device||De.android.device||De.windows.device||De.other.device,De.phone=De.apple.phone||De.android.phone||De.windows.phone,De.tablet=De.apple.tablet||De.android.tablet||De.windows.tablet,De}var W=Object(z.a)(Object(z.a)({},j()),{},{isMobile:j}),Q=W;function re(){}function G(Te,Ne,Ge){var Ae=Ne||"";return Te.key||"".concat(Ae,"item_").concat(Ge)}function xe(Te){return"".concat(Te,"-menu-")}function Ie(Te,Ne){var Ge=-1;L.Children.forEach(Te,function(Ae){Ge+=1,Ae&&Ae.type&&Ae.type.isMenuItemGroup?L.Children.forEach(Ae.props.children,function(ue){Ge+=1,Ne(ue,Ge)}):Ne(Ae,Ge)})}function tt(Te,Ne,Ge){if(!Te||Ge.find)return;L.Children.forEach(Te,function(Ae){if(Ae){var ue=Ae.type;if(!ue||!(ue.isSubMenu||ue.isMenuItem||ue.isMenuItemGroup))return;Ne.indexOf(Ae.key)!==-1?Ge.find=!0:Ae.props.children&&tt(Ae.props.children,Ne,Ge)}})}var le=["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"],Se=function(Ne){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=Ne&&typeof Ne.getBoundingClientRect=="function"&&Ne.getBoundingClientRect().width;if(Ae){if(Ge){var ue=getComputedStyle(Ne),ye=ue.marginLeft,fe=ue.marginRight;Ae+=+ye.replace("px","")+ +fe.replace("px","")}Ae=+Ae.toFixed(6)}return Ae||0},je=function(Ne,Ge,Ae){Ne&&Object(H.a)(Ne.style)==="object"&&(Ne.style[Ge]=Ae)},ze=function(){return Q.any},yt=k("bdgK"),Ot=k("i8i4"),Ut=k.n(Ot),Qe=k("wgJM"),Bt=k("l4aY"),ln=k("m+aA"),Ke=k("c+Xe"),He=k("zT1h"),ct=k("QC+M");function bt(Te,Ne,Ge){return Ge?Te[0]===Ne[0]:Te[0]===Ne[0]&&Te[1]===Ne[1]}function de(Te,Ne,Ge){var Ae=Te[Ne]||{};return Object(z.a)(Object(z.a)({},Ae),Ge)}function q(Te,Ne,Ge,Ae){for(var ue=Ge.points,ye=Object.keys(Te),fe=0;fe<ye.length;fe+=1){var De=ye[fe];if(bt(Te[De].points,ue,Ae))return"".concat(Ne,"-placement-").concat(De)}return""}var te=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Te=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(Te)||/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(Te==null?void 0:Te.substr(0,4)))},se=k("MNnm");function pe(Te,Ne){var Ge={};return Ge[Te.toLowerCase()]=Ne.toLowerCase(),Ge["Webkit".concat(Te)]="webkit".concat(Ne),Ge["Moz".concat(Te)]="moz".concat(Ne),Ge["ms".concat(Te)]="MS".concat(Ne),Ge["O".concat(Te)]="o".concat(Ne.toLowerCase()),Ge}function ae(Te,Ne){var Ge={animationend:pe("Animation","AnimationEnd"),transitionend:pe("Transition","TransitionEnd")};return Te&&("AnimationEvent"in Ne||delete Ge.animationend.animation,"TransitionEvent"in Ne||delete Ge.transitionend.transition),Ge}var ie=ae(Object(se.a)(),typeof window!="undefined"?window:{}),me={};if(Object(se.a)()){var _e=document.createElement("div");me=_e.style}var Ee={};function Le(Te){if(Ee[Te])return Ee[Te];var Ne=ie[Te];if(Ne)for(var Ge=Object.keys(Ne),Ae=Ge.length,ue=0;ue<Ae;ue+=1){var ye=Ge[ue];if(Object.prototype.hasOwnProperty.call(Ne,ye)&&ye in me)return Ee[Te]=Ne[ye],Ee[Te]}return""}var at=Le("animationend"),Ct=Le("transitionend"),Jt=!!(at&&Ct),lt=at||"animationend",Un=Ct||"transitionend";function Cn(Te,Ne){if(!Te)return null;if(Object(H.a)(Te)==="object"){var Ge=Ne.replace(/-\w/g,function(Ae){return Ae[1].toUpperCase()});return Te[Ge]}return"".concat(Te,"-").concat(Ne)}var vn="none",er="appear",kn="enter",Yn="leave",vr="none",Mn="prepare",Zn="start",dr="active",jt="end";function Ft(Te){var Ne=Object(L.useRef)(!1),Ge=Object(L.useState)(Te),Ae=Object(V.a)(Ge,2),ue=Ae[0],ye=Ae[1];function fe(De){Ne.current||ye(De)}return Object(L.useEffect)(function(){return function(){Ne.current=!0}},[]),[ue,fe]}var zt=Object(se.a)()?L.useLayoutEffect:L.useEffect,dn=zt,yn=function(){var Te=L.useRef(null);function Ne(){Qe.a.cancel(Te.current)}function Ge(Ae){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Ne();var ye=Object(Qe.a)(function(){ue<=1?Ae({isCanceled:function(){return ye!==Te.current}}):Ge(Ae,ue-1)});Te.current=ye}return L.useEffect(function(){return function(){Ne()}},[]),[Ge,Ne]},bn=[Mn,Zn,dr,jt],_r=!1,Bn=!0;function Qt(Te){return Te===dr||Te===jt}var Hn=function(Te,Ne){var Ge=L.useState(vr),Ae=Object(V.a)(Ge,2),ue=Ae[0],ye=Ae[1],fe=yn(),De=Object(V.a)(fe,2),Pe=De[0],$e=De[1];function Me(){ye(Mn)}return dn(function(){if(ue!==vr&&ue!==jt){var nt=bn.indexOf(ue),xt=bn[nt+1],It=Ne(ue);It===_r?ye(xt):Pe(function(Vt){function xn(){if(Vt.isCanceled())return;ye(xt)}It===!0?xn():Promise.resolve(It).then(xn)})}},[Te,ue]),L.useEffect(function(){return function(){$e()}},[]),[Me,ue]},lr=function(Te){var Ne=Object(L.useRef)(),Ge=Object(L.useRef)(Te);Ge.current=Te;var Ae=L.useCallback(function(fe){Ge.current(fe)},[]);function ue(fe){fe&&(fe.removeEventListener(Un,Ae),fe.removeEventListener(lt,Ae))}function ye(fe){Ne.current&&Ne.current!==fe&&ue(Ne.current),fe&&fe!==Ne.current&&(fe.addEventListener(Un,Ae),fe.addEventListener(lt,Ae),Ne.current=fe)}return L.useEffect(function(){return function(){ue(Ne.current)}},[]),[ye,ue]};function Sn(Te,Ne,Ge,Ae){var ue=Ae.motionEnter,ye=ue===void 0?!0:ue,fe=Ae.motionAppear,De=fe===void 0?!0:fe,Pe=Ae.motionLeave,$e=Pe===void 0?!0:Pe,Me=Ae.motionDeadline,nt=Ae.motionLeaveImmediately,xt=Ae.onAppearPrepare,It=Ae.onEnterPrepare,Vt=Ae.onLeavePrepare,xn=Ae.onAppearStart,An=Ae.onEnterStart,qn=Ae.onLeaveStart,$n=Ae.onAppearActive,cr=Ae.onEnterActive,gr=Ae.onLeaveActive,ir=Ae.onAppearEnd,hr=Ae.onEnterEnd,Er=Ae.onLeaveEnd,Xt=Ae.onVisibleChanged,Mt=Ft(),en=Object(V.a)(Mt,2),Rt=en[0],At=en[1],nr=Ft(vn),xr=Object(V.a)(nr,2),Wn=xr[0],Sr=xr[1],Xr=Ft(null),Or=Object(V.a)(Xr,2),Ur=Or[0],Mr=Or[1],Pr=Object(L.useRef)(!1),Dr=Object(L.useRef)(null),ar=Object(L.useRef)(!1),ui=Object(L.useRef)(null);function Ji(){var $r=Ge();return $r||ui.current}var Ii=Object(L.useRef)(!1);function wi($r){var Br=Ji();if($r&&!$r.deadline&&$r.target!==Br)return;var yi;Wn===er&&Ii.current?yi=ir==null?void 0:ir(Br,$r):Wn===kn&&Ii.current?yi=hr==null?void 0:hr(Br,$r):Wn===Yn&&Ii.current&&(yi=Er==null?void 0:Er(Br,$r)),yi!==!1&&!ar.current&&(Sr(vn),Mr(null))}var Jr=lr(wi),Wr=Object(V.a)(Jr,1),Vr=Wr[0],Qr=L.useMemo(function(){var $r,Br,yi;switch(Wn){case"appear":return $r={},Object(ne.a)($r,Mn,xt),Object(ne.a)($r,Zn,xn),Object(ne.a)($r,dr,$n),$r;case"enter":return Br={},Object(ne.a)(Br,Mn,It),Object(ne.a)(Br,Zn,An),Object(ne.a)(Br,dr,cr),Br;case"leave":return yi={},Object(ne.a)(yi,Mn,Vt),Object(ne.a)(yi,Zn,qn),Object(ne.a)(yi,dr,gr),yi;default:return{}}},[Wn]),Ni=Hn(Wn,function($r){if($r===Mn){var Br=Qr[Mn];return Br?Br(Ji()):_r}if(Kr in Qr){var yi;Mr(((yi=Qr[Kr])===null||yi===void 0?void 0:yi.call(Qr,Ji(),null))||null)}return Kr===dr&&(Vr(Ji()),Me>0&&(clearTimeout(Dr.current),Dr.current=setTimeout(function(){wi({deadline:!0})},Me))),Bn}),ha=Object(V.a)(Ni,2),sa=ha[0],Kr=ha[1],Qi=Qt(Kr);Ii.current=Qi,dn(function(){At(Ne);var $r=Pr.current;if(Pr.current=!0,!Te)return;var Br;!$r&&Ne&&De&&(Br=er),$r&&Ne&&ye&&(Br=kn),($r&&!Ne&&$e||!$r&&nt&&!Ne&&$e)&&(Br=Yn),Br&&(Sr(Br),sa())},[Ne]),Object(L.useEffect)(function(){(Wn===er&&!De||Wn===kn&&!ye||Wn===Yn&&!$e)&&Sr(vn)},[De,ye,$e]),Object(L.useEffect)(function(){return function(){clearTimeout(Dr.current),ar.current=!0}},[]),Object(L.useEffect)(function(){Rt!==void 0&&Wn===vn&&(Xt==null||Xt(Rt))},[Rt,Wn]);var Zi=Ur;return Qr[Mn]&&Kr===Zn&&(Zi=Object(z.a)({transition:"none"},Zi)),[Wn,Kr,Zi,Rt!=null?Rt:Ne]}var zn=function(Te){Object(E.a)(Ge,Te);var Ne=Object(f.a)(Ge);function Ge(){return Object(R.a)(this,Ge),Ne.apply(this,arguments)}return Object(S.a)(Ge,[{key:"render",value:function(){return this.props.children}}]),Ge}(L.Component),tr=zn;function Gr(Te){var Ne=Te;Object(H.a)(Te)==="object"&&(Ne=Te.transitionSupport);function Ge(ue){return!!(ue.motionName&&Ne)}var Ae=L.forwardRef(function(ue,ye){var fe=ue.visible,De=fe===void 0?!0:fe,Pe=ue.removeOnLeave,$e=Pe===void 0?!0:Pe,Me=ue.forceRender,nt=ue.children,xt=ue.motionName,It=ue.leavedClassName,Vt=ue.eventProps,xn=Ge(ue),An=Object(L.useRef)(),qn=Object(L.useRef)();function $n(){try{return Object(ln.a)(An.current||qn.current)}catch(Sr){return null}}var cr=Sn(xn,De,$n,ue),gr=Object(V.a)(cr,4),ir=gr[0],hr=gr[1],Er=gr[2],Xt=gr[3],Mt=L.useRef(Xt);Xt&&(Mt.current=!0);var en=Object(L.useRef)(ye);en.current=ye;var Rt=L.useCallback(function(Sr){An.current=Sr,Object(Ke.b)(en.current,Sr)},[]),At,nr=Object(z.a)(Object(z.a)({},Vt),{},{visible:De});if(!nt)At=null;else if(ir===vn||!Ge(ue))Xt?At=nt(Object(z.a)({},nr),Rt):!$e&&Mt.current?At=nt(Object(z.a)(Object(z.a)({},nr),{},{className:It}),Rt):Me?At=nt(Object(z.a)(Object(z.a)({},nr),{},{style:{display:"none"}}),Rt):At=null;else{var xr,Wn;hr===Mn?Wn="prepare":Qt(hr)?Wn="active":hr===Zn&&(Wn="start"),At=nt(Object(z.a)(Object(z.a)({},nr),{},{className:K()(Cn(xt,ir),(xr={},Object(ne.a)(xr,Cn(xt,"".concat(ir,"-").concat(Wn)),Wn),Object(ne.a)(xr,xt,typeof xt=="string"),xr)),style:Er}),Rt)}return L.createElement(tr,{ref:qn},At)});return Ae.displayName="CSSMotion",Ae}var Ar=Gr(Jt),Yt="add",Vn="keep",vi="remove",Pi="removed";function ai(Te){var Ne;return Te&&Object(H.a)(Te)==="object"&&"key"in Te?Ne=Te:Ne={key:Te},Object(z.a)(Object(z.a)({},Ne),{},{key:String(Ne.key)})}function Yr(){var Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Te.map(ai)}function Lr(){var Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ge=[],Ae=0,ue=Ne.length,ye=Yr(Te),fe=Yr(Ne);ye.forEach(function($e){for(var Me=!1,nt=Ae;nt<ue;nt+=1){var xt=fe[nt];if(xt.key===$e.key){Ae<nt&&(Ge=Ge.concat(fe.slice(Ae,nt).map(function(It){return Object(z.a)(Object(z.a)({},It),{},{status:Yt})})),Ae=nt),Ge.push(Object(z.a)(Object(z.a)({},xt),{},{status:Vn})),Ae+=1,Me=!0;break}}Me||Ge.push(Object(z.a)(Object(z.a)({},$e),{},{status:vi}))}),Ae<ue&&(Ge=Ge.concat(fe.slice(Ae).map(function($e){return Object(z.a)(Object(z.a)({},$e),{},{status:Yt})})));var De={};Ge.forEach(function($e){var Me=$e.key;De[Me]=(De[Me]||0)+1});var Pe=Object.keys(De).filter(function($e){return De[$e]>1});return Pe.forEach(function($e){Ge=Ge.filter(function(Me){var nt=Me.key,xt=Me.status;return nt!==$e||xt!==vi}),Ge.forEach(function(Me){Me.key===$e&&(Me.status=Vn)})}),Ge}var Fn=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function pi(Te){var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ar,Ge=function(Ae){Object(E.a)(ye,Ae);var ue=Object(f.a)(ye);function ye(){var fe;return Object(R.a)(this,ye),fe=ue.apply(this,arguments),fe.state={keyEntities:[]},fe.removeKey=function(De){fe.setState(function(Pe){var $e=Pe.keyEntities;return{keyEntities:$e.map(function(Me){return Me.key!==De?Me:Object(z.a)(Object(z.a)({},Me),{},{status:Pi})})}})},fe}return Object(S.a)(ye,[{key:"render",value:function(){var De=this,Pe=this.state.keyEntities,$e=this.props,Me=$e.component,nt=$e.children,xt=$e.onVisibleChanged,It=Object(I.a)($e,["component","children","onVisibleChanged"]),Vt=Me||L.Fragment,xn={};return Fn.forEach(function(An){xn[An]=It[An],delete It[An]}),delete It.keys,L.createElement(Vt,It,Pe.map(function(An){var qn=An.status,$n=Object(I.a)(An,["status"]),cr=qn===Yt||qn===Vn;return L.createElement(Ne,Object(T.a)({},xn,{key:$n.key,visible:cr,eventProps:$n,onVisibleChanged:function(ir){xt==null||xt(ir,{key:$n.key}),ir||De.removeKey($n.key)}}),nt)}))}}],[{key:"getDerivedStateFromProps",value:function(De,Pe){var $e=De.keys,Me=Pe.keyEntities,nt=Yr($e),xt=Lr(Me,nt);return{keyEntities:xt.filter(function(It){var Vt=Me.find(function(xn){var An=xn.key;return It.key===An});return!(Vt&&Vt.status===Pi&&It.status===vi)})}}}]),ye}(L.Component);return Ge.defaultProps={component:"div"},Ge}var Zt=pi(Jt),qr=Ar;function zr(Te){var Ne=Te.prefixCls,Ge=Te.motion,Ae=Te.animation,ue=Te.transitionName;return Ge||(Ae?{motionName:"".concat(Ne,"-").concat(Ae)}:ue?{motionName:ue}:null)}function xi(Te){var Ne=Te.prefixCls,Ge=Te.visible,Ae=Te.zIndex,ue=Te.mask,ye=Te.maskMotion,fe=Te.maskAnimation,De=Te.maskTransitionName;if(!ue)return null;var Pe={};return(ye||De||fe)&&(Pe=Object(z.a)({motionAppear:!0},zr({motion:ye,prefixCls:Ne,transitionName:De,animation:fe}))),L.createElement(qr,Object(T.a)({},Pe,{visible:Ge,removeOnLeave:!0}),function($e){var Me=$e.className;return L.createElement("div",{style:{zIndex:Ae},className:K()("".concat(Ne,"-mask"),Me)})})}var mi=k("9mu1"),ni=k("o0o1"),Bi=k.n(ni),Hi=k("HaE+"),ri=["measure","align",null,"motion"],wr=function(Te,Ne){var Ge=Object(L.useState)(null),Ae=Object(V.a)(Ge,2),ue=Ae[0],ye=Ae[1],fe=Object(L.useRef)(),De=Object(L.useRef)(!1);function Pe(nt){De.current||ye(nt)}function $e(){Qe.a.cancel(fe.current)}function Me(nt){$e(),fe.current=Object(Qe.a)(function(){Pe(function(xt){switch(ue){case"align":return"motion";case"motion":return"stable";default:}return xt}),nt==null||nt()})}return Object(L.useEffect)(function(){Pe("measure")},[Te]),Object(L.useEffect)(function(){switch(ue){case"measure":Ne();break;default:}ue&&(fe.current=Object(Qe.a)(Object(Hi.a)(Bi.a.mark(function nt(){var xt,It;return Bi.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:xt=ri.indexOf(ue),It=ri[xt+1],It&&xt!==-1&&Pe(It);case 3:case"end":return xn.stop()}},nt)}))))},[ue]),Object(L.useEffect)(function(){return function(){De.current=!0,$e()}},[]),[ue,Me]},Si=function(Te){var Ne=L.useState({width:0,height:0}),Ge=Object(V.a)(Ne,2),Ae=Ge[0],ue=Ge[1];function ye(De){ue({width:De.offsetWidth,height:De.offsetHeight})}var fe=L.useMemo(function(){var De={};if(Te){var Pe=Ae.width,$e=Ae.height;Te.indexOf("height")!==-1&&$e?De.height=$e:Te.indexOf("minHeight")!==-1&&$e&&(De.minHeight=$e),Te.indexOf("width")!==-1&&Pe?De.width=Pe:Te.indexOf("minWidth")!==-1&&Pe&&(De.minWidth=Pe)}return De},[Te,Ae]);return[fe,ye]},Oi=L.forwardRef(function(Te,Ne){var Ge=Te.visible,Ae=Te.prefixCls,ue=Te.className,ye=Te.style,fe=Te.children,De=Te.zIndex,Pe=Te.stretch,$e=Te.destroyPopupOnHide,Me=Te.forceRender,nt=Te.align,xt=Te.point,It=Te.getRootDomNode,Vt=Te.getClassNameFromAlign,xn=Te.onAlign,An=Te.onMouseEnter,qn=Te.onMouseLeave,$n=Te.onMouseDown,cr=Te.onTouchStart,gr=Object(L.useRef)(),ir=Object(L.useRef)(),hr=Object(L.useState)(),Er=Object(V.a)(hr,2),Xt=Er[0],Mt=Er[1],en=Si(Pe),Rt=Object(V.a)(en,2),At=Rt[0],nr=Rt[1];function xr(){Pe&&nr(It())}var Wn=wr(Ge,xr),Sr=Object(V.a)(Wn,2),Xr=Sr[0],Or=Sr[1],Ur=Object(L.useRef)();function Mr(){return xt||It}function Pr(){var Jr;(Jr=gr.current)===null||Jr===void 0||Jr.forceAlign()}function Dr(Jr,Wr){var Vr=Vt(Wr);Xt!==Vr&&Mt(Vr),Xr==="align"&&(Xt!==Vr?Promise.resolve().then(function(){Pr()}):Or(function(){var Qr;(Qr=Ur.current)===null||Qr===void 0||Qr.call(Ur)}),xn==null||xn(Jr,Wr))}var ar=Object(z.a)({},zr(Te));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Jr){var Wr=ar[Jr];ar[Jr]=function(Vr,Qr){return Or(),Wr==null?void 0:Wr(Vr,Qr)}});function ui(){return new Promise(function(Jr){Ur.current=Jr})}L.useEffect(function(){!ar.motionName&&Xr==="motion"&&Or()},[ar.motionName,Xr]),L.useImperativeHandle(Ne,function(){return{forceAlign:Pr,getElement:function(){return ir.current}}});var Ji=Object(z.a)(Object(z.a)({},At),{},{zIndex:De,opacity:Xr==="motion"||Xr==="stable"||!Ge?void 0:0,pointerEvents:Xr==="stable"?void 0:"none"},ye),Ii=!0;(nt==null?void 0:nt.points)&&(Xr==="align"||Xr==="stable")&&(Ii=!1);var wi=fe;return L.Children.count(fe)>1&&(wi=L.createElement("div",{className:"".concat(Ae,"-content")},fe)),L.createElement(qr,Object(T.a)({visible:Ge,ref:ir,leavedClassName:"".concat(Ae,"-hidden")},ar,{onAppearPrepare:ui,onEnterPrepare:ui,removeOnLeave:$e,forceRender:Me}),function(Jr,Wr){var Vr=Jr.className,Qr=Jr.style,Ni=K()(Ae,ue,Xt,Vr);return L.createElement(mi.a,{target:Mr(),key:"popup",ref:gr,monitorWindowResize:!0,disabled:Ii,align:nt,onAlign:Dr},L.createElement("div",{ref:Wr,className:Ni,onMouseEnter:An,onMouseLeave:qn,onMouseDownCapture:$n,onTouchStartCapture:cr,style:Object(z.a)(Object(z.a)({},Qr),Ji)},wi))})});Oi.displayName="PopupInner";var ci=Oi,_i=L.forwardRef(function(Te,Ne){var Ge=Te.prefixCls,Ae=Te.visible,ue=Te.zIndex,ye=Te.children,fe=Te.mobile;fe=fe===void 0?{}:fe;var De=fe.popupClassName,Pe=fe.popupStyle,$e=fe.popupMotion,Me=$e===void 0?{}:$e,nt=fe.popupRender,xt=L.useRef();L.useImperativeHandle(Ne,function(){return{forceAlign:function(){},getElement:function(){return xt.current}}});var It=Object(z.a)({zIndex:ue},Pe),Vt=ye;return L.Children.count(ye)>1&&(Vt=L.createElement("div",{className:"".concat(Ge,"-content")},ye)),nt&&(Vt=nt(Vt)),L.createElement(qr,Object(T.a)({visible:Ae,ref:xt,removeOnLeave:!0},Me),function(xn,An){var qn=xn.className,$n=xn.style,cr=K()(Ge,De,qn);return L.createElement("div",{ref:An,className:cr,style:Object(z.a)(Object(z.a)({},$n),It)},Vt)})});_i.displayName="MobilePopupInner";var oa=_i,$i=["visible","mobile"],yr=L.forwardRef(function(Te,Ne){var Ge=Te.visible,Ae=Te.mobile,ue=Object(I.a)(Te,$i),ye=Object(L.useState)(Ge),fe=Object(V.a)(ye,2),De=fe[0],Pe=fe[1],$e=Object(L.useState)(!1),Me=Object(V.a)($e,2),nt=Me[0],xt=Me[1],It=Object(z.a)(Object(z.a)({},ue),{},{visible:De});Object(L.useEffect)(function(){Pe(Ge),Ge&&Ae&&xt(te())},[Ge,Ae]);var Vt=nt?L.createElement(oa,Object(T.a)({},It,{mobile:Ae,ref:Ne})):L.createElement(ci,Object(T.a)({},It,{ref:Ne}));return L.createElement("div",null,L.createElement(xi,It),Vt)});yr.displayName="Popup";var br=yr,oi=L.createContext(null),kr=oi;function Tn(){}function qt(){return""}function fn(Te){return Te?Te.ownerDocument:window.document}var tn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Xn(Te){var Ne=function(Ge){Object(E.a)(ue,Ge);var Ae=Object(f.a)(ue);function ue(ye){var fe;Object(R.a)(this,ue),fe=Ae.call(this,ye),fe.popupRef=L.createRef(),fe.triggerRef=L.createRef(),fe.attachId=void 0,fe.clickOutsideHandler=void 0,fe.touchOutsideHandler=void 0,fe.contextMenuOutsideHandler1=void 0,fe.contextMenuOutsideHandler2=void 0,fe.mouseDownTimeout=void 0,fe.focusTime=void 0,fe.preClickTime=void 0,fe.preTouchTime=void 0,fe.delayTimer=void 0,fe.hasPopupMouseDown=void 0,fe.onMouseEnter=function(Pe){var $e=fe.props.mouseEnterDelay;fe.fireEvents("onMouseEnter",Pe),fe.delaySetPopupVisible(!0,$e,$e?null:Pe)},fe.onMouseMove=function(Pe){fe.fireEvents("onMouseMove",Pe),fe.setPoint(Pe)},fe.onMouseLeave=function(Pe){fe.fireEvents("onMouseLeave",Pe),fe.delaySetPopupVisible(!1,fe.props.mouseLeaveDelay)},fe.onPopupMouseEnter=function(){fe.clearDelayTimer()},fe.onPopupMouseLeave=function(Pe){var $e;if(Pe.relatedTarget&&!Pe.relatedTarget.setTimeout&&Object(Bt.a)(($e=fe.popupRef.current)===null||$e===void 0?void 0:$e.getElement(),Pe.relatedTarget))return;fe.delaySetPopupVisible(!1,fe.props.mouseLeaveDelay)},fe.onFocus=function(Pe){fe.fireEvents("onFocus",Pe),fe.clearDelayTimer(),fe.isFocusToShow()&&(fe.focusTime=Date.now(),fe.delaySetPopupVisible(!0,fe.props.focusDelay))},fe.onMouseDown=function(Pe){fe.fireEvents("onMouseDown",Pe),fe.preClickTime=Date.now()},fe.onTouchStart=function(Pe){fe.fireEvents("onTouchStart",Pe),fe.preTouchTime=Date.now()},fe.onBlur=function(Pe){fe.fireEvents("onBlur",Pe),fe.clearDelayTimer(),fe.isBlurToHide()&&fe.delaySetPopupVisible(!1,fe.props.blurDelay)},fe.onContextMenu=function(Pe){Pe.preventDefault(),fe.fireEvents("onContextMenu",Pe),fe.setPopupVisible(!0,Pe)},fe.onContextMenuClose=function(){fe.isContextMenuToShow()&&fe.close()},fe.onClick=function(Pe){if(fe.fireEvents("onClick",Pe),fe.focusTime){var $e;if(fe.preClickTime&&fe.preTouchTime?$e=Math.min(fe.preClickTime,fe.preTouchTime):fe.preClickTime?$e=fe.preClickTime:fe.preTouchTime&&($e=fe.preTouchTime),Math.abs($e-fe.focusTime)<20)return;fe.focusTime=0}fe.preClickTime=0,fe.preTouchTime=0,fe.isClickToShow()&&(fe.isClickToHide()||fe.isBlurToHide())&&Pe&&Pe.preventDefault&&Pe.preventDefault();var Me=!fe.state.popupVisible;(fe.isClickToHide()&&!Me||Me&&fe.isClickToShow())&&fe.setPopupVisible(!fe.state.popupVisible,Pe)},fe.onPopupMouseDown=function(){if(fe.hasPopupMouseDown=!0,clearTimeout(fe.mouseDownTimeout),fe.mouseDownTimeout=window.setTimeout(function(){fe.hasPopupMouseDown=!1},0),fe.context){var Pe;(Pe=fe.context).onPopupMouseDown.apply(Pe,arguments)}},fe.onDocumentClick=function(Pe){if(fe.props.mask&&!fe.props.maskClosable)return;var $e=Pe.target,Me=fe.getRootDomNode(),nt=fe.getPopupDomNode();(!Object(Bt.a)(Me,$e)||fe.isContextMenuOnly())&&!Object(Bt.a)(nt,$e)&&!fe.hasPopupMouseDown&&fe.close()},fe.getRootDomNode=function(){var Pe=fe.props.getTriggerDOMNode;if(Pe)return Pe(fe.triggerRef.current);try{var $e=Object(ln.a)(fe.triggerRef.current);if($e)return $e}catch(Me){}return Ut.a.findDOMNode(Object(y.a)(fe))},fe.getPopupClassNameFromAlign=function(Pe){var $e=[],Me=fe.props,nt=Me.popupPlacement,xt=Me.builtinPlacements,It=Me.prefixCls,Vt=Me.alignPoint,xn=Me.getPopupClassNameFromAlign;return nt&&xt&&$e.push(q(xt,It,Pe,Vt)),xn&&$e.push(xn(Pe)),$e.join(" ")},fe.getComponent=function(){var Pe=fe.props,$e=Pe.prefixCls,Me=Pe.destroyPopupOnHide,nt=Pe.popupClassName,xt=Pe.onPopupAlign,It=Pe.popupMotion,Vt=Pe.popupAnimation,xn=Pe.popupTransitionName,An=Pe.popupStyle,qn=Pe.mask,$n=Pe.maskAnimation,cr=Pe.maskTransitionName,gr=Pe.maskMotion,ir=Pe.zIndex,hr=Pe.popup,Er=Pe.stretch,Xt=Pe.alignPoint,Mt=Pe.mobile,en=Pe.forceRender,Rt=fe.state,At=Rt.popupVisible,nr=Rt.point,xr=fe.getPopupAlign(),Wn={};return fe.isMouseEnterToShow()&&(Wn.onMouseEnter=fe.onPopupMouseEnter),fe.isMouseLeaveToHide()&&(Wn.onMouseLeave=fe.onPopupMouseLeave),Wn.onMouseDown=fe.onPopupMouseDown,Wn.onTouchStart=fe.onPopupMouseDown,L.createElement(br,Object(T.a)({prefixCls:$e,destroyPopupOnHide:Me,visible:At,point:Xt&&nr,className:nt,align:xr,onAlign:xt,animation:Vt,getClassNameFromAlign:fe.getPopupClassNameFromAlign},Wn,{stretch:Er,getRootDomNode:fe.getRootDomNode,style:An,mask:qn,zIndex:ir,transitionName:xn,maskAnimation:$n,maskTransitionName:cr,maskMotion:gr,ref:fe.popupRef,motion:It,mobile:Mt,forceRender:en}),typeof hr=="function"?hr():hr)},fe.attachParent=function(Pe){Qe.a.cancel(fe.attachId);var $e=fe.props,Me=$e.getPopupContainer,nt=$e.getDocument,xt=fe.getRootDomNode(),It;Me?(xt||Me.length===0)&&(It=Me(xt)):It=nt(fe.getRootDomNode()).body,It?It.appendChild(Pe):fe.attachId=Object(Qe.a)(function(){fe.attachParent(Pe)})},fe.getContainer=function(){var Pe=fe.props.getDocument,$e=Pe(fe.getRootDomNode()).createElement("div");return $e.style.position="absolute",$e.style.top="0",$e.style.left="0",$e.style.width="100%",fe.attachParent($e),$e},fe.setPoint=function(Pe){var $e=fe.props.alignPoint;if(!$e||!Pe)return;fe.setState({point:{pageX:Pe.pageX,pageY:Pe.pageY}})},fe.handlePortalUpdate=function(){fe.state.prevPopupVisible!==fe.state.popupVisible&&fe.props.afterPopupVisibleChange(fe.state.popupVisible)},fe.triggerContextValue={onPopupMouseDown:fe.onPopupMouseDown};var De;return"popupVisible"in ye?De=!!ye.popupVisible:De=!!ye.defaultPopupVisible,fe.state={prevPopupVisible:De,popupVisible:De},tn.forEach(function(Pe){fe["fire".concat(Pe)]=function($e){fe.fireEvents(Pe,$e)}}),fe}return Object(S.a)(ue,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var fe=this.props,De=this.state;if(De.popupVisible){var Pe;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Pe=fe.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(He.a)(Pe,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Pe=Pe||fe.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(He.a)(Pe,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Pe=Pe||fe.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(He.a)(Pe,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(He.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Qe.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var fe;return((fe=this.popupRef.current)===null||fe===void 0?void 0:fe.getElement())||null}},{key:"getPopupAlign",value:function(){var fe=this.props,De=fe.popupPlacement,Pe=fe.popupAlign,$e=fe.builtinPlacements;return De&&$e?de($e,De,Pe):Pe}},{key:"setPopupVisible",value:function(fe,De){var Pe=this.props.alignPoint,$e=this.state.popupVisible;this.clearDelayTimer(),$e!==fe&&("popupVisible"in this.props||this.setState({popupVisible:fe,prevPopupVisible:$e}),this.props.onPopupVisibleChange(fe)),Pe&&De&&fe&&this.setPoint(De)}},{key:"delaySetPopupVisible",value:function(fe,De,Pe){var $e=this,Me=De*1e3;if(this.clearDelayTimer(),Me){var nt=Pe?{pageX:Pe.pageX,pageY:Pe.pageY}:null;this.delayTimer=window.setTimeout(function(){$e.setPopupVisible(fe,nt),$e.clearDelayTimer()},Me)}else this.setPopupVisible(fe,Pe)}},{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(fe){var De=this.props.children.props,Pe=this.props;return De[fe]&&Pe[fe]?this["fire".concat(fe)]:De[fe]||Pe[fe]}},{key:"isClickToShow",value:function(){var fe=this.props,De=fe.action,Pe=fe.showAction;return De.indexOf("click")!==-1||Pe.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var fe=this.props.action;return fe==="contextMenu"||fe.length===1&&fe[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var fe=this.props,De=fe.action,Pe=fe.showAction;return De.indexOf("contextMenu")!==-1||Pe.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var fe=this.props,De=fe.action,Pe=fe.hideAction;return De.indexOf("click")!==-1||Pe.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var fe=this.props,De=fe.action,Pe=fe.showAction;return De.indexOf("hover")!==-1||Pe.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var fe=this.props,De=fe.action,Pe=fe.hideAction;return De.indexOf("hover")!==-1||Pe.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var fe=this.props,De=fe.action,Pe=fe.showAction;return De.indexOf("focus")!==-1||Pe.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var fe=this.props,De=fe.action,Pe=fe.hideAction;return De.indexOf("focus")!==-1||Pe.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var fe;(fe=this.popupRef.current)===null||fe===void 0||fe.forceAlign()}}},{key:"fireEvents",value:function(fe,De){var Pe=this.props.children.props[fe];Pe&&Pe(De);var $e=this.props[fe];$e&&$e(De)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var fe=this.state.popupVisible,De=this.props,Pe=De.children,$e=De.forceRender,Me=De.alignPoint,nt=De.className,xt=De.autoDestroy,It=L.Children.only(Pe),Vt={key:"trigger"};this.isContextMenuToShow()?Vt.onContextMenu=this.onContextMenu:Vt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(Vt.onClick=this.onClick,Vt.onMouseDown=this.onMouseDown,Vt.onTouchStart=this.onTouchStart):(Vt.onClick=this.createTwoChains("onClick"),Vt.onMouseDown=this.createTwoChains("onMouseDown"),Vt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(Vt.onMouseEnter=this.onMouseEnter,Me&&(Vt.onMouseMove=this.onMouseMove)):Vt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?Vt.onMouseLeave=this.onMouseLeave:Vt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(Vt.onFocus=this.onFocus,Vt.onBlur=this.onBlur):(Vt.onFocus=this.createTwoChains("onFocus"),Vt.onBlur=this.createTwoChains("onBlur"));var xn=K()(It&&It.props&&It.props.className,nt);xn&&(Vt.className=xn);var An=Object(z.a)({},Vt);Object(Ke.c)(It)&&(An.ref=Object(Ke.a)(this.triggerRef,It.ref));var qn=L.cloneElement(It,An),$n;return(fe||this.popupRef.current||$e)&&($n=L.createElement(Te,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!fe&&xt&&($n=null),L.createElement(kr.Provider,{value:this.triggerContextValue},qn,$n)}}],[{key:"getDerivedStateFromProps",value:function(fe,De){var Pe=fe.popupVisible,$e={};return Pe!==void 0&&De.popupVisible!==Pe&&($e.popupVisible=Pe,$e.prevPopupVisible=De.popupVisible),$e}}]),ue}(L.Component);return Ne.contextType=kr,Ne.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:qt,getDocument:fn,onPopupVisibleChange:Tn,afterPopupVisibleChange:Tn,onPopupAlign:Tn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Ne}var Qn=Xn(ct.a),J={adjustX:1,adjustY:1},ge={topLeft:{points:["bl","tl"],overflow:J,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:J,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:J,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:J,offset:[4,0]}},Oe={topLeft:{points:["bl","tl"],overflow:J,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:J,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:J,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:J,offset:[4,0]}},Re=ge,qe=0,Ue={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Je=function(Ne,Ge,Ae){var ue=xe(Ge),ye=Ne.getState();Ne.setState({defaultActiveFirst:Object(z.a)(Object(z.a)({},ye.defaultActiveFirst),{},Object(ne.a)({},ue,Ae))})},dt=function(Te){Object(E.a)(Ge,Te);var Ne=Object(f.a)(Ge);function Ge(Ae){var ue;Object(R.a)(this,Ge),ue=Ne.call(this,Ae),ue.onDestroy=function(Me){ue.props.onDestroy(Me)},ue.onKeyDown=function(Me){var nt=Me.keyCode,xt=ue.menuInstance,It=ue.props.store,Vt=ue.getVisible();if(nt===s.a.ENTER)return ue.onTitleClick(Me),Je(It,ue.props.eventKey,!0),!0;if(nt===s.a.RIGHT)return Vt?xt.onKeyDown(Me):(ue.triggerOpenChange(!0),Je(It,ue.props.eventKey,!0)),!0;if(nt===s.a.LEFT){var xn;if(Vt)xn=xt.onKeyDown(Me);else return;return xn||(ue.triggerOpenChange(!1),xn=!0),xn}return Vt&&(nt===s.a.UP||nt===s.a.DOWN)?xt.onKeyDown(Me):void 0},ue.onOpenChange=function(Me){ue.props.onOpenChange(Me)},ue.onPopupVisibleChange=function(Me){ue.triggerOpenChange(Me,Me?"mouseenter":"mouseleave")},ue.onMouseEnter=function(Me){var nt=ue.props,xt=nt.eventKey,It=nt.onMouseEnter,Vt=nt.store;Je(Vt,ue.props.eventKey,!1),It({key:xt,domEvent:Me})},ue.onMouseLeave=function(Me){var nt=ue.props,xt=nt.parentMenu,It=nt.eventKey,Vt=nt.onMouseLeave;xt.subMenuInstance=Object(y.a)(ue),Vt({key:It,domEvent:Me})},ue.onTitleMouseEnter=function(Me){var nt=ue.props,xt=nt.eventKey,It=nt.onItemHover,Vt=nt.onTitleMouseEnter;It({key:xt,hover:!0}),Vt({key:xt,domEvent:Me})},ue.onTitleMouseLeave=function(Me){var nt=ue.props,xt=nt.parentMenu,It=nt.eventKey,Vt=nt.onItemHover,xn=nt.onTitleMouseLeave;xt.subMenuInstance=Object(y.a)(ue),Vt({key:It,hover:!1}),xn({key:It,domEvent:Me})},ue.onTitleClick=function(Me){var nt=Object(y.a)(ue),xt=nt.props;if(xt.onTitleClick({key:xt.eventKey,domEvent:Me}),xt.triggerSubMenuAction==="hover")return;ue.triggerOpenChange(!ue.getVisible(),"click"),Je(xt.store,ue.props.eventKey,!1)},ue.onSubMenuClick=function(Me){typeof ue.props.onClick=="function"&&ue.props.onClick(ue.addKeyPath(Me))},ue.onSelect=function(Me){ue.props.onSelect(Me)},ue.onDeselect=function(Me){ue.props.onDeselect(Me)},ue.getPrefixCls=function(){return"".concat(ue.props.rootPrefixCls,"-submenu")},ue.getActiveClassName=function(){return"".concat(ue.getPrefixCls(),"-active")},ue.getDisabledClassName=function(){return"".concat(ue.getPrefixCls(),"-disabled")},ue.getSelectedClassName=function(){return"".concat(ue.getPrefixCls(),"-selected")},ue.getOpenClassName=function(){return"".concat(ue.props.rootPrefixCls,"-submenu-open")},ue.getVisible=function(){return ue.state.isOpen},ue.getMode=function(){return ue.state.mode},ue.saveMenuInstance=function(Me){ue.menuInstance=Me},ue.addKeyPath=function(Me){return Object(z.a)(Object(z.a)({},Me),{},{keyPath:(Me.keyPath||[]).concat(ue.props.eventKey)})},ue.triggerOpenChange=function(Me,nt){var xt=ue.props.eventKey,It=function(){ue.onOpenChange({key:xt,item:Object(y.a)(ue),trigger:nt,open:Me})};nt==="mouseenter"?ue.mouseenterTimeout=setTimeout(function(){It()},0):It()},ue.isChildrenSelected=function(){var Me={find:!1};return tt(ue.props.children,ue.props.selectedKeys,Me),Me.find},ue.isInlineMode=function(){return ue.getMode()==="inline"},ue.adjustWidth=function(){if(!ue.subMenuTitle||!ue.menuInstance)return;var Me=Ot.findDOMNode(ue.menuInstance);if(Me.offsetWidth>=ue.subMenuTitle.offsetWidth)return;Me.style.minWidth="".concat(ue.subMenuTitle.offsetWidth,"px")},ue.saveSubMenuTitle=function(Me){ue.subMenuTitle=Me},ue.getBaseProps=function(){var Me=Object(y.a)(ue),nt=Me.props,xt=ue.getMode();return{mode:xt==="horizontal"?"vertical":xt,visible:ue.getVisible(),level:nt.level+1,inlineIndent:nt.inlineIndent,focusable:!1,onClick:ue.onSubMenuClick,onSelect:ue.onSelect,onDeselect:ue.onDeselect,onDestroy:ue.onDestroy,selectedKeys:nt.selectedKeys,eventKey:"".concat(nt.eventKey,"-menu-"),openKeys:nt.openKeys,motion:nt.motion,onOpenChange:ue.onOpenChange,subMenuOpenDelay:nt.subMenuOpenDelay,parentMenu:Object(y.a)(ue),subMenuCloseDelay:nt.subMenuCloseDelay,forceSubMenuRender:nt.forceSubMenuRender,triggerSubMenuAction:nt.triggerSubMenuAction,builtinPlacements:nt.builtinPlacements,defaultActiveFirst:nt.store.getState().defaultActiveFirst[xe(nt.eventKey)],multiple:nt.multiple,prefixCls:nt.rootPrefixCls,id:ue.internalMenuId,manualRef:ue.saveMenuInstance,itemIcon:nt.itemIcon,expandIcon:nt.expandIcon,direction:nt.direction}},ue.getMotion=function(Me,nt){var xt=Object(y.a)(ue),It=xt.haveRendered,Vt=ue.props,xn=Vt.motion,An=Vt.rootPrefixCls,qn=Object(z.a)(Object(z.a)({},xn),{},{leavedClassName:"".concat(An,"-hidden"),removeOnLeave:!1,motionAppear:It||!nt||Me!=="inline"});return qn};var ye=Ae.store,fe=Ae.eventKey,De=ye.getState(),Pe=De.defaultActiveFirst;ue.isRootMenu=!1;var $e=!1;return Pe&&($e=Pe[fe]),Je(ye,fe,$e),ue.state={mode:Ae.mode,isOpen:Ae.isOpen},ue}return Object(S.a)(Ge,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ue=this,ye=this.props,fe=ye.mode,De=ye.parentMenu,Pe=ye.manualRef,$e=ye.isOpen,Me=function(){ue.setState({mode:fe,isOpen:$e})},nt=$e!==this.state.isOpen,xt=fe!==this.state.mode;if((xt||nt)&&(Qe.a.cancel(this.updateStateRaf),xt?this.updateStateRaf=Object(Qe.a)(Me):Me()),Pe&&Pe(this),fe!=="horizontal"||!(De==null?void 0:De.isRootMenu)||!$e)return;this.minWidthTimeout=setTimeout(function(){return ue.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ue=this.props,ye=ue.onDestroy,fe=ue.eventKey;ye&&ye(fe),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Qe.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(ue,ye){var fe=this.getBaseProps();return L.createElement(an,Object(T.a)({},fe,{id:this.internalMenuId,className:ue,style:ye}),this.props.children)}},{key:"renderChildren",value:function(){var ue=this,ye=this.getBaseProps(),fe=ye.mode,De=ye.visible,Pe=ye.forceSubMenuRender,$e=ye.direction,Me=this.getMotion(fe,De);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||De||Pe,!this.haveOpened)return L.createElement("div",null);var nt=K()("".concat(ye.prefixCls,"-sub"),Object(ne.a)({},"".concat(ye.prefixCls,"-rtl"),$e==="rtl"));return this.isInlineMode()?L.createElement(qr,Object(T.a)({visible:ye.visible,forceRender:Pe},Me),function(xt){var It=xt.className,Vt=xt.style,xn=K()(nt,It);return ue.renderPopupMenu(xn,Vt)}):this.renderPopupMenu(nt)}},{key:"render",value:function(){var ue,ye,fe,De=Object(z.a)({},this.props),Pe=this.getVisible(),$e=this.getPrefixCls(),Me=this.isInlineMode(),nt=this.getMode(),xt=K()($e,"".concat($e,"-").concat(nt),(ue={},Object(ne.a)(ue,De.className,!!De.className),Object(ne.a)(ue,this.getOpenClassName(),Pe),Object(ne.a)(ue,this.getActiveClassName(),De.active||Pe&&!Me),Object(ne.a)(ue,this.getDisabledClassName(),De.disabled),Object(ne.a)(ue,this.getSelectedClassName(),this.isChildrenSelected()),ue));this.internalMenuId||(De.eventKey?this.internalMenuId="".concat(De.eventKey,"$Menu"):(qe+=1,this.internalMenuId="$__$".concat(qe,"$Menu")));var It={},Vt={},xn={};De.disabled||(It={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Vt={onClick:this.onTitleClick},xn={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var An={},qn=De.direction,$n=qn==="rtl";Me&&($n?An.paddingRight=De.inlineIndent*De.level:An.paddingLeft=De.inlineIndent*De.level);var cr={};this.getVisible()&&(cr={"aria-owns":this.internalMenuId});var gr=null;nt!=="horizontal"&&(gr=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(gr=L.createElement(this.props.expandIcon,Object(z.a)({},this.props))));var ir=L.createElement("div",Object(T.a)({ref:this.saveSubMenuTitle,style:An,className:"".concat($e,"-title"),role:"button"},xn,Vt,{"aria-expanded":Pe},cr,{"aria-haspopup":"true",title:typeof De.title=="string"?De.title:void 0}),De.title,gr||L.createElement("i",{className:"".concat($e,"-arrow")})),hr=this.renderChildren(),Er=((ye=De.parentMenu)===null||ye===void 0?void 0:ye.isRootMenu)?De.parentMenu.props.getPopupContainer:function(Mr){return Mr.parentNode},Xt=Ue[nt],Mt=De.popupOffset?{offset:De.popupOffset}:{},en=K()((fe={},Object(ne.a)(fe,De.popupClassName,De.popupClassName&&!Me),Object(ne.a)(fe,"".concat($e,"-rtl"),$n),fe)),Rt=De.disabled,At=De.triggerSubMenuAction,nr=De.subMenuOpenDelay,xr=De.forceSubMenuRender,Wn=De.subMenuCloseDelay,Sr=De.builtinPlacements;le.forEach(function(Mr){return delete De[Mr]}),delete De.onClick;var Xr=$n?Object(z.a)(Object(z.a)({},Oe),Sr):Object(z.a)(Object(z.a)({},ge),Sr);delete De.direction;var Or=this.getBaseProps(),Ur=Me?null:this.getMotion(Or.mode,Or.visible);return L.createElement("li",Object(T.a)({},De,It,{className:xt,role:"menuitem"}),L.createElement(Qn,{prefixCls:$e,popupClassName:K()("".concat($e,"-popup"),en),getPopupContainer:Er,builtinPlacements:Xr,popupPlacement:Xt,popupVisible:Me?!1:Pe,popupAlign:Mt,popup:Me?null:hr,action:Rt||Me?[]:[At],mouseEnterDelay:nr,mouseLeaveDelay:Wn,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:xr,popupMotion:Ur},ir),Me?hr:null)}}]),Ge}(L.Component);dt.defaultProps={onMouseEnter:re,onMouseLeave:re,onTitleMouseEnter:re,onTitleMouseLeave:re,onTitleClick:re,manualRef:re,mode:"vertical",title:""};var wt=Object(h.b)(function(Te,Ne){var Ge=Te.openKeys,Ae=Te.activeKey,ue=Te.selectedKeys,ye=Ne.eventKey,fe=Ne.subMenuKey;return{isOpen:Ge.indexOf(ye)>-1,active:Ae[fe]===ye,selectedKeys:ue}})(dt);wt.isSubMenu=!0;var Tt=wt,Be="menuitem-overflowed",ft=.5,et=function(Te){Object(E.a)(Ge,Te);var Ne=Object(f.a)(Ge);function Ge(){var Ae;return Object(R.a)(this,Ge),Ae=Ne.apply(this,arguments),Ae.resizeObserver=null,Ae.mutationObserver=null,Ae.originalTotalWidth=0,Ae.overflowedItems=[],Ae.menuItemSizes=[],Ae.cancelFrameId=null,Ae.state={lastVisibleIndex:void 0},Ae.childRef=L.createRef(),Ae.getMenuItemNodes=function(){var ue=Ae.props.prefixCls,ye=Ae.childRef.current;return ye?[].slice.call(ye.children).filter(function(fe){return fe.className.split(" ").indexOf("".concat(ue,"-overflowed-submenu"))<0}):[]},Ae.getOverflowedSubMenuItem=function(ue,ye,fe){var De=Ae.props,Pe=De.overflowedIndicator,$e=De.level,Me=De.mode,nt=De.prefixCls,xt=De.theme;if($e!==1||Me!=="horizontal")return null;var It=Ae.props.children[0],Vt=It.props,xn=Vt.children,An=Vt.title,qn=Vt.style,$n=Object(I.a)(Vt,["children","title","style"]),cr=Object(z.a)({},qn),gr="".concat(ue,"-overflowed-indicator"),ir="".concat(ue,"-overflowed-indicator");ye.length===0&&fe!==!0?cr=Object(z.a)(Object(z.a)({},cr),{},{display:"none"}):fe&&(cr=Object(z.a)(Object(z.a)({},cr),{},{visibility:"hidden",position:"absolute"}),gr="".concat(gr,"-placeholder"),ir="".concat(ir,"-placeholder"));var hr=xt?"".concat(nt,"-").concat(xt):"",Er={};return le.forEach(function(Xt){$n[Xt]!==void 0&&(Er[Xt]=$n[Xt])}),L.createElement(Tt,Object(T.a)({title:Pe,className:"".concat(nt,"-overflowed-submenu"),popupClassName:hr},Er,{key:gr,eventKey:ir,disabled:!1,style:cr}),ye)},Ae.setChildrenWidthAndResize=function(){if(Ae.props.mode!=="horizontal")return;var ue=Ae.childRef.current;if(!ue)return;var ye=ue.children;if(!ye||ye.length===0)return;var fe=ue.children[ye.length-1];je(fe,"display","inline-block");var De=Ae.getMenuItemNodes(),Pe=De.filter(function($e){return $e.className.split(" ").indexOf(Be)>=0});Pe.forEach(function($e){je($e,"display","inline-block")}),Ae.menuItemSizes=De.map(function($e){return Se($e,!0)}),Pe.forEach(function($e){je($e,"display","none")}),Ae.overflowedIndicatorWidth=Se(ue.children[ue.children.length-1],!0),Ae.originalTotalWidth=Ae.menuItemSizes.reduce(function($e,Me){return $e+Me},0),Ae.handleResize(),je(fe,"display","none")},Ae.handleResize=function(){if(Ae.props.mode!=="horizontal")return;var ue=Ae.childRef.current;if(!ue)return;var ye=Se(ue);Ae.overflowedItems=[];var fe=0,De;Ae.originalTotalWidth>ye+ft&&(De=-1,Ae.menuItemSizes.forEach(function(Pe){fe+=Pe,fe+Ae.overflowedIndicatorWidth<=ye&&(De+=1)})),Ae.setState({lastVisibleIndex:De})},Ae}return Object(S.a)(Ge,[{key:"componentDidMount",value:function(){var ue=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ye=this.childRef.current;if(!ye)return;this.resizeObserver=new yt.default(function(fe){fe.forEach(function(){var De=ue.cancelFrameId;cancelAnimationFrame(De),ue.cancelFrameId=requestAnimationFrame(ue.setChildrenWidthAndResize)})}),[].slice.call(ye.children).concat(ye).forEach(function(fe){ue.resizeObserver.observe(fe)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ue.resizeObserver.disconnect(),[].slice.call(ye.children).concat(ye).forEach(function(fe){ue.resizeObserver.observe(fe)}),ue.setChildrenWidthAndResize()}),this.mutationObserver.observe(ye,{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(ue){var ye=this,fe=this.state.lastVisibleIndex;return(ue||[]).reduce(function(De,Pe,$e){var Me=Pe;if(ye.props.mode==="horizontal"){var nt=ye.getOverflowedSubMenuItem(Pe.props.eventKey,[]);fe!==void 0&&ye.props.className.indexOf("".concat(ye.props.prefixCls,"-root"))!==-1&&($e>fe&&(Me=L.cloneElement(Pe,{style:{display:"none"},eventKey:"".concat(Pe.props.eventKey,"-hidden"),className:"".concat(Be)})),$e===fe+1&&(ye.overflowedItems=ue.slice(fe+1).map(function(It){return L.cloneElement(It,{key:It.props.eventKey,mode:"vertical-left"})}),nt=ye.getOverflowedSubMenuItem(Pe.props.eventKey,ye.overflowedItems)));var xt=[].concat(Object(P.a)(De),[nt,Me]);return $e===ue.length-1&&xt.push(ye.getOverflowedSubMenuItem(Pe.props.eventKey,[],!0)),xt}return[].concat(Object(P.a)(De),[Me])},[])}},{key:"render",value:function(){var ue=this.props,ye=ue.visible,fe=ue.prefixCls,De=ue.overflowedIndicator,Pe=ue.mode,$e=ue.level,Me=ue.tag,nt=ue.children,xt=ue.theme,It=Object(I.a)(ue,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Vt=Me;return L.createElement(Vt,Object(T.a)({ref:this.childRef},It),this.renderChildren(nt))}}]),Ge}(L.Component);et.defaultProps={tag:"div",className:""};var rt=et;function ht(Te){return Te.length?Te.every(function(Ne){return!!Ne.props.disabled}):!0}function _t(Te,Ne,Ge){var Ae=Te.getState();Te.setState({activeKey:Object(z.a)(Object(z.a)({},Ae.activeKey),{},Object(ne.a)({},Ne,Ge))})}function st(Te){return Te.eventKey||"0-menu-"}function Pt(Te,Ne){var Ge=Ne,Ae=Te.children,ue=Te.eventKey;if(Ge){var ye;if(Ie(Ae,function(fe,De){fe&&fe.props&&!fe.props.disabled&&Ge===G(fe,ue,De)&&(ye=!0)}),ye)return Ge}return Ge=null,Te.defaultActiveFirst&&Ie(Ae,function(fe,De){!Ge&&fe&&!fe.props.disabled&&(Ge=G(fe,ue,De))}),Ge}function Wt(Te){if(!Te)return;var Ne=this.instanceArray.indexOf(Te);Ne!==-1?this.instanceArray[Ne]=Te:this.instanceArray.push(Te)}var cn=function(Te){Object(E.a)(Ge,Te);var Ne=Object(f.a)(Ge);function Ge(Ae){var ue;return Object(R.a)(this,Ge),ue=Ne.call(this,Ae),ue.onKeyDown=function(ye,fe){var De=ye.keyCode,Pe;if(ue.getFlatInstanceArray().forEach(function(Me){Me&&Me.props.active&&Me.onKeyDown&&(Pe=Me.onKeyDown(ye))}),Pe)return 1;var $e=null;return(De===s.a.UP||De===s.a.DOWN)&&($e=ue.step(De===s.a.UP?-1:1)),$e?(ye.preventDefault(),_t(ue.props.store,st(ue.props),$e.props.eventKey),typeof fe=="function"&&fe($e),1):void 0},ue.onItemHover=function(ye){var fe=ye.key,De=ye.hover;_t(ue.props.store,st(ue.props),De?fe:null)},ue.onDeselect=function(ye){ue.props.onDeselect(ye)},ue.onSelect=function(ye){ue.props.onSelect(ye)},ue.onClick=function(ye){ue.props.onClick(ye)},ue.onOpenChange=function(ye){ue.props.onOpenChange(ye)},ue.onDestroy=function(ye){ue.props.onDestroy(ye)},ue.getFlatInstanceArray=function(){return ue.instanceArray},ue.step=function(ye){var fe=ue.getFlatInstanceArray(),De=ue.props.store.getState().activeKey[st(ue.props)],Pe=fe.length;if(!Pe)return null;ye<0&&(fe=fe.concat().reverse());var $e=-1;if(fe.every(function(It,Vt){return It&&It.props.eventKey===De?($e=Vt,!1):!0}),!ue.props.defaultActiveFirst&&$e!==-1&&ht(fe.slice($e,Pe-1)))return;var Me=($e+1)%Pe,nt=Me;do{var xt=fe[nt];if(!xt||xt.props.disabled)nt=(nt+1)%Pe;else return xt}while(nt!==Me);return null},ue.renderCommonMenuItem=function(ye,fe,De){var Pe=ue.props.store.getState(),$e=Object(y.a)(ue),Me=$e.props,nt=G(ye,Me.eventKey,fe),xt=ye.props;if(!xt||typeof ye.type=="string")return ye;var It=nt===Pe.activeKey,Vt=Object(z.a)(Object(z.a)({mode:xt.mode||Me.mode,level:Me.level,inlineIndent:Me.inlineIndent,renderMenuItem:ue.renderMenuItem,rootPrefixCls:Me.prefixCls,index:fe,parentMenu:Me.parentMenu,manualRef:xt.disabled?void 0:Object(g.a)(ye.ref,Wt.bind(Object(y.a)(ue))),eventKey:nt,active:!xt.disabled&&It,multiple:Me.multiple,onClick:function(An){(xt.onClick||re)(An),ue.onClick(An)},onItemHover:ue.onItemHover,motion:Me.motion,subMenuOpenDelay:Me.subMenuOpenDelay,subMenuCloseDelay:Me.subMenuCloseDelay,forceSubMenuRender:Me.forceSubMenuRender,onOpenChange:ue.onOpenChange,onDeselect:ue.onDeselect,onSelect:ue.onSelect,builtinPlacements:Me.builtinPlacements,itemIcon:xt.itemIcon||ue.props.itemIcon,expandIcon:xt.expandIcon||ue.props.expandIcon},De),{},{direction:Me.direction});return(Me.mode==="inline"||ze())&&(Vt.triggerSubMenuAction="click"),L.cloneElement(ye,Object(z.a)(Object(z.a)({},Vt),{},{key:nt||fe}))},ue.renderMenuItem=function(ye,fe,De){if(!ye)return null;var Pe=ue.props.store.getState(),$e={openKeys:Pe.openKeys,selectedKeys:Pe.selectedKeys,triggerSubMenuAction:ue.props.triggerSubMenuAction,subMenuKey:De};return ue.renderCommonMenuItem(ye,fe,$e)},Ae.store.setState({activeKey:Object(z.a)(Object(z.a)({},Ae.store.getState().activeKey),{},Object(ne.a)({},Ae.eventKey,Pt(Ae,Ae.activeKey)))}),ue.instanceArray=[],ue}return Object(S.a)(Ge,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ue){return this.props.visible||ue.visible||this.props.className!==ue.className||!N()(this.props.style,ue.style)}},{key:"componentDidUpdate",value:function(ue){var ye=this.props,fe="activeKey"in ye?ye.activeKey:ye.store.getState().activeKey[st(ye)],De=Pt(ye,fe);if(De!==fe)_t(ye.store,st(ye),De);else if("activeKey"in ue){var Pe=Pt(ue,ue.activeKey);De!==Pe&&_t(ye.store,st(ye),De)}}},{key:"render",value:function(){var ue=this,ye=Object(T.a)({},this.props);this.instanceArray=[];var fe=K()(ye.prefixCls,ye.className,"".concat(ye.prefixCls,"-").concat(ye.mode)),De={className:fe,role:ye.role||"menu"};ye.id&&(De.id=ye.id),ye.focusable&&(De.tabIndex=0,De.onKeyDown=this.onKeyDown);var Pe=ye.prefixCls,$e=ye.eventKey,Me=ye.visible,nt=ye.level,xt=ye.mode,It=ye.overflowedIndicator,Vt=ye.theme;return le.forEach(function(xn){return delete ye[xn]}),delete ye.onClick,L.createElement(rt,Object(T.a)({},ye,{prefixCls:Pe,mode:xt,tag:"ul",level:nt,theme:Vt,visible:Me,overflowedIndicator:It},De),Object(M.a)(ye.children).map(function(xn,An){return ue.renderMenuItem(xn,An,$e||"0-menu-")}))}}]),Ge}(L.Component);cn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:re};var On=Object(h.b)()(cn),an=On,mn=k("Kwbf");function hn(Te,Ne,Ge){var Ae=Te.prefixCls,ue=Te.motion,ye=Te.defaultMotions,fe=ye===void 0?{}:ye,De=Te.openAnimation,Pe=Te.openTransitionName,$e=Ne.switchingModeFromInline;if(ue)return ue;if(Object(H.a)(De)==="object"&&De)Object(mn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof De=="string")return{motionName:"".concat(Ae,"-open-").concat(De)};if(Pe)return{motionName:Pe};var Me=fe[Ge];return Me||($e?null:fe.other)}var gt=function(Te){Object(E.a)(Ge,Te);var Ne=Object(f.a)(Ge);function Ge(Ae){var ue;Object(R.a)(this,Ge),ue=Ne.call(this,Ae),ue.onSelect=function(De){var Pe=Object(y.a)(ue),$e=Pe.props;if($e.selectable){var Me=ue.store.getState(),nt=Me.selectedKeys,xt=De.key;$e.multiple?nt=nt.concat([xt]):nt=[xt],"selectedKeys"in $e||ue.store.setState({selectedKeys:nt}),$e.onSelect(Object(z.a)(Object(z.a)({},De),{},{selectedKeys:nt}))}},ue.onClick=function(De){var Pe=ue.getRealMenuMode(),$e=Object(y.a)(ue),Me=$e.store,nt=$e.props.onOpenChange;Pe!=="inline"&&!("openKeys"in ue.props)&&(Me.setState({openKeys:[]}),nt([])),ue.props.onClick(De)},ue.onKeyDown=function(De,Pe){ue.innerMenu.getWrappedInstance().onKeyDown(De,Pe)},ue.onOpenChange=function(De){var Pe=Object(y.a)(ue),$e=Pe.props,Me=ue.store.getState().openKeys.concat(),nt=!1,xt=function(Vt){var xn=!1;if(Vt.open)xn=Me.indexOf(Vt.key)===-1,xn&&Me.push(Vt.key);else{var An=Me.indexOf(Vt.key);xn=An!==-1,xn&&Me.splice(An,1)}nt=nt||xn};Array.isArray(De)?De.forEach(xt):xt(De),nt&&("openKeys"in ue.props||ue.store.setState({openKeys:Me}),$e.onOpenChange(Me))},ue.onDeselect=function(De){var Pe=Object(y.a)(ue),$e=Pe.props;if($e.selectable){var Me=ue.store.getState().selectedKeys.concat(),nt=De.key,xt=Me.indexOf(nt);xt!==-1&&Me.splice(xt,1),"selectedKeys"in $e||ue.store.setState({selectedKeys:Me}),$e.onDeselect(Object(z.a)(Object(z.a)({},De),{},{selectedKeys:Me}))}},ue.onMouseEnter=function(De){ue.restoreModeVerticalFromInline();var Pe=ue.props.onMouseEnter;Pe&&Pe(De)},ue.onTransitionEnd=function(De){var Pe=De.propertyName==="width"&&De.target===De.currentTarget,$e=De.target.className,Me=Object.prototype.toString.call($e)==="[object SVGAnimatedString]"?$e.animVal:$e,nt=De.propertyName==="font-size"&&Me.indexOf("anticon")>=0;(Pe||nt)&&ue.restoreModeVerticalFromInline()},ue.setInnerMenu=function(De){ue.innerMenu=De},ue.isRootMenu=!0;var ye=Ae.defaultSelectedKeys,fe=Ae.defaultOpenKeys;return"selectedKeys"in Ae&&(ye=Ae.selectedKeys||[]),"openKeys"in Ae&&(fe=Ae.openKeys||[]),ue.store=Object(h.c)({selectedKeys:ye,openKeys:fe,activeKey:{"0-menu-":Pt(Ae,Ae.activeKey)}}),ue.state={switchingModeFromInline:!1,prevProps:Ae,inlineOpenKeys:[],store:ue.store},ue}return Object(S.a)(Ge,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ue){var ye=this.props,fe=ye.siderCollapsed,De=ye.inlineCollapsed,Pe=ye.onOpenChange;(!ue.inlineCollapsed&&De||!ue.siderCollapsed&&fe)&&Pe([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ue=this.props.collapsedWidth,ye=this.store,fe=this.prevOpenKeys,De=this.getInlineCollapsed()&&(ue===0||ue==="0"||ue==="0px");De?(this.prevOpenKeys=ye.getState().openKeys.concat(),this.store.setState({openKeys:[]})):fe&&(this.store.setState({openKeys:fe}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ue=this.props.mode,ye=this.state.switchingModeFromInline,fe=this.getInlineCollapsed();return ye&&fe?"inline":fe?"vertical":ue}},{key:"getInlineCollapsed",value:function(){var ue=this.props,ye=ue.inlineCollapsed,fe=ue.siderCollapsed;return fe!==void 0?fe:ye}},{key:"restoreModeVerticalFromInline",value:function(){var ue=this.state.switchingModeFromInline;ue&&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 ue=Object(z.a)({},Object(v.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ye=this.getRealMenuMode();return ue.className+=" ".concat(ue.prefixCls,"-root"),ue.direction==="rtl"&&(ue.className+=" ".concat(ue.prefixCls,"-rtl")),ue=Object(z.a)(Object(z.a)({},ue),{},{mode:ye,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:hn(this.props,this.state,ye)}),delete ue.openAnimation,delete ue.openTransitionName,L.createElement(h.a,{store:this.store},L.createElement(an,Object(T.a)({},ue,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(ue,ye){var fe=ye.prevProps,De=ye.store,Pe=De.getState(),$e={},Me={prevProps:ue};return fe.mode==="inline"&&ue.mode!=="inline"&&(Me.switchingModeFromInline=!0),"openKeys"in ue?$e.openKeys=ue.openKeys||[]:((ue.inlineCollapsed&&!fe.inlineCollapsed||ue.siderCollapsed&&!fe.siderCollapsed)&&(Me.switchingModeFromInline=!0,Me.inlineOpenKeys=Pe.openKeys,$e.openKeys=[]),(!ue.inlineCollapsed&&fe.inlineCollapsed||!ue.siderCollapsed&&fe.siderCollapsed)&&($e.openKeys=ye.inlineOpenKeys,Me.inlineOpenKeys=[])),Object.keys($e).length&&De.setState($e),Me}}]),Ge}(L.Component);gt.defaultProps={selectable:!0,onClick:re,onSelect:re,onOpenChange:re,onDeselect:re,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:L.createElement("span",null,"\xB7\xB7\xB7")};var Kt=gt,St=function(Te){Object(E.a)(Ge,Te);var Ne=Object(f.a)(Ge);function Ge(){var Ae;return Object(R.a)(this,Ge),Ae=Ne.apply(this,arguments),Ae.onKeyDown=function(ue){var ye=ue.keyCode;return ye===s.a.ENTER?(Ae.onClick(ue),!0):void 0},Ae.onMouseLeave=function(ue){var ye=Ae.props,fe=ye.eventKey,De=ye.onItemHover,Pe=ye.onMouseLeave;De({key:fe,hover:!1}),Pe({key:fe,domEvent:ue})},Ae.onMouseEnter=function(ue){var ye=Ae.props,fe=ye.eventKey,De=ye.onItemHover,Pe=ye.onMouseEnter;De({key:fe,hover:!0}),Pe({key:fe,domEvent:ue})},Ae.onClick=function(ue){var ye=Ae.props,fe=ye.eventKey,De=ye.multiple,Pe=ye.onClick,$e=ye.onSelect,Me=ye.onDeselect,nt=ye.isSelected,xt={key:fe,keyPath:[fe],item:Object(y.a)(Ae),domEvent:ue};Pe(xt),De?nt?Me(xt):$e(xt):nt||$e(xt)},Ae.saveNode=function(ue){Ae.node=ue},Ae}return Object(S.a)(Ge,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ue=this.props;ue.onDestroy&&ue.onDestroy(ue.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 ue,ye=Object(z.a)({},this.props),fe=K()(this.getPrefixCls(),ye.className,(ue={},Object(ne.a)(ue,this.getActiveClassName(),!ye.disabled&&ye.active),Object(ne.a)(ue,this.getSelectedClassName(),ye.isSelected),Object(ne.a)(ue,this.getDisabledClassName(),ye.disabled),ue)),De=Object(z.a)(Object(z.a)({},ye.attribute),{},{title:typeof ye.title=="string"?ye.title:void 0,className:fe,role:ye.role||"menuitem","aria-disabled":ye.disabled});ye.role==="option"?De=Object(z.a)(Object(z.a)({},De),{},{role:"option","aria-selected":ye.isSelected}):(ye.role===null||ye.role==="none")&&(De.role="none");var Pe={onClick:ye.disabled?null:this.onClick,onMouseLeave:ye.disabled?null:this.onMouseLeave,onMouseEnter:ye.disabled?null:this.onMouseEnter},$e=Object(z.a)({},ye.style);ye.mode==="inline"&&(ye.direction==="rtl"?$e.paddingRight=ye.inlineIndent*ye.level:$e.paddingLeft=ye.inlineIndent*ye.level),le.forEach(function(nt){return delete ye[nt]}),delete ye.direction;var Me=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Me=L.createElement(this.props.itemIcon,this.props)),L.createElement("li",Object(T.a)({},Object(v.a)(ye,["onClick","onMouseEnter","onMouseLeave","onSelect"]),De,Pe,{style:$e,ref:this.saveNode}),ye.children,Me)}}]),Ge}(L.Component);St.isMenuItem=!0,St.defaultProps={onSelect:re,onMouseEnter:re,onMouseLeave:re,manualRef:re};var pt=Object(h.b)(function(Te,Ne){var Ge=Te.activeKey,Ae=Te.selectedKeys,ue=Ne.eventKey,ye=Ne.subMenuKey;return{active:Ge[ye]===ue,isSelected:Array.isArray(Ae)?Ae.indexOf(ue)!==-1:Ae===ue}})(St),gn=pt,on=function(Te){Object(E.a)(Ge,Te);var Ne=Object(f.a)(Ge);function Ge(){var Ae;return Object(R.a)(this,Ge),Ae=Ne.apply(this,arguments),Ae.renderInnerMenuItem=function(ue){var ye=Ae.props,fe=ye.renderMenuItem,De=ye.index;return fe(ue,De,Ae.props.subMenuKey)},Ae}return Object(S.a)(Ge,[{key:"render",value:function(){var ue=Object(T.a)({},this.props),ye=ue.className,fe=ye===void 0?"":ye,De=ue.rootPrefixCls,Pe="".concat(De,"-item-group-title"),$e="".concat(De,"-item-group-list"),Me=ue.title,nt=ue.children;return le.forEach(function(xt){return delete ue[xt]}),delete ue.direction,L.createElement("li",Object(T.a)({},ue,{onClick:function(It){return It.stopPropagation()},className:"".concat(fe," ").concat(De,"-item-group")}),L.createElement("div",{className:Pe,title:typeof Me=="string"?Me:void 0},Me),L.createElement("ul",{className:$e},L.Children.map(nt,this.renderInnerMenuItem)))}}]),Ge}(L.Component);on.isMenuItemGroup=!0,on.defaultProps={disabled:!0};var Dt=on,it=function(Ne){var Ge=Ne.className,Ae=Ne.rootPrefixCls,ue=Ne.style;return L.createElement("li",{className:"".concat(Ge," ").concat(Ae,"-item-divider"),style:ue})};it.defaultProps={disabled:!0,className:"",style:{}};var _n=it,Gt=Kt,In=k("eDIo");function kt(Te,Ne){var Ge=Te.prefixCls,Ae=Te.editable,ue=Te.locale,ye=Te.style;return!Ae||Ae.showAdd===!1?null:L.createElement("button",{ref:Ne,type:"button",className:"".concat(Ge,"-nav-add"),style:ye,"aria-label":(ue==null?void 0:ue.addAriaLabel)||"Add tab",onClick:function(De){Ae.onEdit("add",{event:De})}},Ae.addIcon||"+")}var sn=L.forwardRef(kt);function En(Te,Ne){var Ge=Te.prefixCls,Ae=Te.id,ue=Te.tabs,ye=Te.locale,fe=Te.mobile,De=Te.moreIcon,Pe=De===void 0?"More":De,$e=Te.moreTransitionName,Me=Te.style,nt=Te.className,xt=Te.editable,It=Te.tabBarGutter,Vt=Te.rtl,xn=Te.onTabClick,An=Object(L.useState)(!1),qn=Object(V.a)(An,2),$n=qn[0],cr=qn[1],gr=Object(L.useState)(null),ir=Object(V.a)(gr,2),hr=ir[0],Er=ir[1],Xt="".concat(Ae,"-more-popup"),Mt="".concat(Ge,"-dropdown"),en=hr!==null?"".concat(Xt,"-").concat(hr):null,Rt=ye==null?void 0:ye.dropdownAriaLabel,At=L.createElement(Gt,{onClick:function(Ur){var Mr=Ur.key,Pr=Ur.domEvent;xn(Mr,Pr),cr(!1)},id:Xt,tabIndex:-1,role:"listbox","aria-activedescendant":en,selectedKeys:[hr],"aria-label":Rt!==void 0?Rt:"expanded dropdown"},ue.map(function(Or){return L.createElement(gn,{key:Or.key,id:"".concat(Xt,"-").concat(Or.key),role:"option","aria-controls":Ae&&"".concat(Ae,"-panel-").concat(Or.key),disabled:Or.disabled},Or.tab)}));function nr(Or){for(var Ur=ue.filter(function(ui){return!ui.disabled}),Mr=Ur.findIndex(function(ui){return ui.key===hr})||0,Pr=Ur.length,Dr=0;Dr<Pr;Dr+=1){Mr=(Mr+Or+Pr)%Pr;var ar=Ur[Mr];if(!ar.disabled){Er(ar.key);return}}}function xr(Or){var Ur=Or.which;if(!$n){[s.a.DOWN,s.a.SPACE,s.a.ENTER].includes(Ur)&&(cr(!0),Or.preventDefault());return}switch(Ur){case s.a.UP:nr(-1),Or.preventDefault();break;case s.a.DOWN:nr(1),Or.preventDefault();break;case s.a.ESC:cr(!1);break;case s.a.SPACE:case s.a.ENTER:hr!==null&&xn(hr,Or);break}}Object(L.useEffect)(function(){var Or=document.getElementById(en);Or&&Or.scrollIntoView&&Or.scrollIntoView(!1)},[hr]),Object(L.useEffect)(function(){$n||Er(null)},[$n]);var Wn=Object(ne.a)({},Vt?"marginLeft":"marginRight",It);ue.length||(Wn.visibility="hidden",Wn.order=1);var Sr=K()(Object(ne.a)({},"".concat(Mt,"-rtl"),Vt)),Xr=fe?null:L.createElement(In.a,{prefixCls:Mt,overlay:At,trigger:["hover"],visible:$n,transitionName:$e,onVisibleChange:cr,overlayClassName:Sr,mouseEnterDelay:.1,mouseLeaveDelay:.1},L.createElement("button",{type:"button",className:"".concat(Ge,"-nav-more"),style:Wn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Xt,id:"".concat(Ae,"-more"),"aria-expanded":$n,onKeyDown:xr},Pe));return L.createElement("div",{className:K()("".concat(Ge,"-nav-operations"),nt),style:Me,ref:Ne},Xr,L.createElement(sn,{prefixCls:Ge,locale:ye,editable:xt}))}var $t=L.forwardRef(En),sr=Object(L.createContext)(null),un=.1,nn=.01,mt=20,Xe=Math.pow(.995,mt);function Et(){var Te=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(Te)||/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(Te.substr(0,4)))}function vt(Te,Ne){var Ge=Object(L.useState)(),Ae=Object(V.a)(Ge,2),ue=Ae[0],ye=Ae[1],fe=Object(L.useState)(0),De=Object(V.a)(fe,2),Pe=De[0],$e=De[1],Me=Object(L.useState)(0),nt=Object(V.a)(Me,2),xt=nt[0],It=nt[1],Vt=Object(L.useState)(),xn=Object(V.a)(Vt,2),An=xn[0],qn=xn[1],$n=Object(L.useRef)();function cr(Rt){var At=Rt.touches[0],nr=At.screenX,xr=At.screenY;ye({x:nr,y:xr}),window.clearInterval($n.current)}function gr(Rt){if(!ue)return;Rt.preventDefault();var At=Rt.touches[0],nr=At.screenX,xr=At.screenY;ye({x:nr,y:xr});var Wn=nr-ue.x,Sr=xr-ue.y;Ne(Wn,Sr);var Xr=Date.now();$e(Xr),It(Xr-Pe),qn({x:Wn,y:Sr})}function ir(){if(!ue)return;if(ye(null),qn(null),An){var Rt=An.x/xt,At=An.y/xt,nr=Math.abs(Rt),xr=Math.abs(At);if(Math.max(nr,xr)<un)return;var Wn=Rt,Sr=At;$n.current=window.setInterval(function(){if(Math.abs(Wn)<nn&&Math.abs(Sr)<nn){window.clearInterval($n.current);return}Wn*=Xe,Sr*=Xe,Ne(Wn*mt,Sr*mt)},mt)}}var hr=Object(L.useRef)(0),Er=Object(L.useRef)(!1),Xt=Object(L.useRef)();function Mt(Rt){var At=Rt.deltaX,nr=Rt.deltaY,xr=0,Wn=Math.abs(At),Sr=Math.abs(nr);Wn===Sr?xr=Xt.current==="x"?At:nr:Wn>Sr?(xr=At,Xt.current="x"):(xr=nr,Xt.current="y");var Xr=Date.now();Xr-hr.current>100&&(Er.current=!1),(Ne(-xr,-xr)||Er.current)&&(Rt.preventDefault(),Er.current=!0),hr.current=Xr}var en=Object(L.useRef)(null);en.current={onTouchStart:cr,onTouchMove:gr,onTouchEnd:ir,onWheel:Mt},L.useEffect(function(){function Rt(Wn){en.current.onTouchStart(Wn)}function At(Wn){en.current.onTouchMove(Wn)}function nr(Wn){en.current.onTouchEnd(Wn)}function xr(Wn){en.current.onWheel(Wn)}return document.addEventListener("touchmove",At,{passive:!1}),document.addEventListener("touchend",nr,{passive:!1}),Te.current.addEventListener("touchstart",Rt,{passive:!1}),Te.current.addEventListener("wheel",xr),function(){document.removeEventListener("touchmove",At),document.removeEventListener("touchend",nr)}},[])}function Ht(){var Te=Object(L.useRef)(new Map);function Ne(Ae){return Te.current.has(Ae)||Te.current.set(Ae,L.createRef()),Te.current.get(Ae)}function Ge(Ae){Te.current.delete(Ae)}return[Ne,Ge]}function Rn(Te,Ne){var Ge=L.useRef(Te),Ae=L.useState({}),ue=Object(V.a)(Ae,2),ye=ue[1];function fe(De){var Pe=typeof De=="function"?De(Ge.current):De;Pe!==Ge.current&&Ne(Pe,Ge.current),Ge.current=Pe,ye({})}return[Ge.current,fe]}var pn=function(Ne){var Ge=Ne.position,Ae=Ne.prefixCls,ue=Ne.extra;if(!ue)return null;var ye,fe=ue;return Ge==="right"&&(ye=fe.right||!fe.left&&fe||null),Ge==="left"&&(ye=fe.left||null),ye?L.createElement("div",{className:"".concat(Ae,"-extra-content")},ye):null};function Gn(Te,Ne){var Ge,Ae=L.useContext(sr),ue=Ae.prefixCls,ye=Ae.tabs,fe=Te.className,De=Te.style,Pe=Te.id,$e=Te.animated,Me=Te.activeKey,nt=Te.rtl,xt=Te.extra,It=Te.editable,Vt=Te.locale,xn=Te.tabPosition,An=Te.tabBarGutter,qn=Te.children,$n=Te.onTabClick,cr=Te.onTabScroll,gr=Object(L.useRef)(),ir=Object(L.useRef)(),hr=Object(L.useRef)(),Er=Object(L.useRef)(),Xt=Ht(),Mt=Object(V.a)(Xt,2),en=Mt[0],Rt=Mt[1],At=xn==="top"||xn==="bottom",nr=Rn(0,function(jr,Cr){At&&cr&&cr({direction:jr>Cr?"left":"right"})}),xr=Object(V.a)(nr,2),Wn=xr[0],Sr=xr[1],Xr=Rn(0,function(jr,Cr){!At&&cr&&cr({direction:jr>Cr?"top":"bottom"})}),Or=Object(V.a)(Xr,2),Ur=Or[0],Mr=Or[1],Pr=Object(L.useState)(0),Dr=Object(V.a)(Pr,2),ar=Dr[0],ui=Dr[1],Ji=Object(L.useState)(0),Ii=Object(V.a)(Ji,2),wi=Ii[0],Jr=Ii[1],Wr=Object(L.useState)(0),Vr=Object(V.a)(Wr,2),Qr=Vr[0],Ni=Vr[1],ha=Object(L.useState)(0),sa=Object(V.a)(ha,2),Kr=sa[0],Qi=sa[1],Zi=Object(L.useState)(null),$r=Object(V.a)(Zi,2),Br=$r[0],yi=$r[1],ka=Object(L.useState)(null),no=Object(V.a)(ka,2),la=no[0],Ta=no[1],Ca=Object(L.useState)(0),Sa=Object(V.a)(Ca,2),Ma=Sa[0],co=Sa[1],Ro=Object(L.useState)(0),za=Object(V.a)(Ro,2),Oa=za[0],Va=za[1],_a=a(new Map),Ra=Object(V.a)(_a,2),ho=Ra[0],Ya=Ra[1],Aa=n(ye,ho,ar),Da="".concat(ue,"-nav-operations-hidden"),ya=0,ki=0;At?nt?(ya=0,ki=Math.max(0,ar-Br)):(ya=Math.min(0,Br-ar),ki=0):(ya=Math.min(0,la-wi),ki=0);function fa(jr){return jr<ya?[ya,!1]:jr>ki?[ki,!1]:[jr,!0]}var pa=Object(L.useRef)(),ba=Object(L.useState)(),ma=Object(V.a)(ba,2),Xa=ma[0],$a=ma[1];function Ja(){$a(Date.now())}function Ia(){window.clearTimeout(pa.current)}vt(gr,function(jr,Cr){var ii=!1;function Ui(La,ca){La(function(ja){var da=fa(ja+ca),bi=Object(V.a)(da,2),Fa=bi[0],Ba=bi[1];return ii=Ba,Fa})}if(At){if(Br>=ar)return ii;Ui(Sr,jr)}else{if(la>=wi)return ii;Ui(Mr,Cr)}return Ia(),Ja(),ii}),Object(L.useEffect)(function(){return Ia(),Xa&&(pa.current=window.setTimeout(function(){$a(0)},100)),Ia},[Xa]);function ua(){var jr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Me,Cr=Aa.get(jr);if(!Cr)return;if(At){var ii=Wn;nt?Cr.right<Wn?ii=Cr.right:Cr.right+Cr.width>Wn+Br&&(ii=Cr.right+Cr.width-Br):Cr.left<-Wn?ii=-Cr.left:Cr.left+Cr.width>-Wn+Br&&(ii=-(Cr.left+Cr.width-Br)),Mr(0),Sr(fa(ii)[0])}else{var Ui=Ur;Cr.top<-Ur?Ui=-Cr.top:Cr.top+Cr.height>-Ur+la&&(Ui=-(Cr.top+Cr.height-la)),Sr(0),Mr(fa(Ui)[0])}}var Ea=C(Aa,{width:Br,height:la,left:Wn,top:Ur},{width:Qr,height:Kr},{width:Ma,height:Oa},Object(z.a)(Object(z.a)({},Te),{},{tabs:ye})),ro=Object(V.a)(Ea,2),Ao=ro[0],Do=ro[1],fo=ye.map(function(jr){var Cr=jr.key;return L.createElement(l,{id:Pe,prefixCls:ue,key:Cr,rtl:nt,tab:jr,closable:jr.closable,editable:It,active:Cr===Me,tabPosition:xn,tabBarGutter:An,renderWrapper:qn,removeAriaLabel:Vt==null?void 0:Vt.removeAriaLabel,ref:en(Cr),onClick:function(Ui){$n(Cr,Ui)},onRemove:function(){Rt(Cr)},onFocus:function(){ua(Cr),Ja(),nt||(gr.current.scrollLeft=0),gr.current.scrollTop=0}})}),io=c(function(){var jr,Cr,ii,Ui,La,ca,ja,da,bi,Fa=((jr=gr.current)===null||jr===void 0?void 0:jr.offsetWidth)||0,Ba=((Cr=gr.current)===null||Cr===void 0?void 0:Cr.offsetHeight)||0,Ha=((ii=Er.current)===null||ii===void 0?void 0:ii.offsetWidth)||0,Ki=((Ui=Er.current)===null||Ui===void 0?void 0:Ui.offsetHeight)||0,Ir=((La=hr.current)===null||La===void 0?void 0:La.offsetWidth)||0,pr=((ca=hr.current)===null||ca===void 0?void 0:ca.offsetHeight)||0;yi(Fa),Ta(Ba),co(Ha),Va(Ki);var Pn=(((ja=ir.current)===null||ja===void 0?void 0:ja.offsetWidth)||0)-Ha,Jn=(((da=ir.current)===null||da===void 0?void 0:da.offsetHeight)||0)-Ki;ui(Pn),Jr(Jn);var Tr=(bi=hr.current)===null||bi===void 0?void 0:bi.className.includes(Da);Ni(Pn-(Tr?0:Ir)),Qi(Jn-(Tr?0:pr)),Ya(function(){var ei=new Map;return ye.forEach(function(ga){var ia=ga.key,Ai=en(ia).current;Ai&&ei.set(ia,{width:Ai.offsetWidth,height:Ai.offsetHeight,left:Ai.offsetLeft,top:Ai.offsetTop})}),ei})}),po=ye.slice(0,Ao),Wi=ye.slice(Do+1),di=[].concat(Object(P.a)(po),Object(P.a)(Wi)),Ri=Object(L.useState)(),hi=Object(V.a)(Ri,2),Na=hi[0],mo=hi[1],qi=Aa.get(Me),ao=Object(L.useRef)();function oo(){p.a.cancel(ao.current)}Object(L.useEffect)(function(){var jr={};return qi&&(At?(nt?jr.right=qi.right:jr.left=qi.left,jr.width=qi.width):(jr.top=qi.top,jr.height=qi.height)),oo(),ao.current=p()(function(){mo(jr)}),oo},[qi,At,nt]),Object(L.useEffect)(function(){ua()},[Me,qi,Aa,At]),Object(L.useEffect)(function(){io()},[nt,An,Me,ye.map(function(jr){return jr.key}).join("_")]);var so=!!di.length,xa="".concat(ue,"-nav-wrap"),Qa,Ua,go,Za;return At?nt?(Ua=Wn>0,Qa=Wn+Br<ar):(Qa=Wn<0,Ua=-Wn+Br<ar):(go=Ur<0,Za=-Ur+la<wi),L.createElement("div",{ref:Ne,role:"tablist",className:K()("".concat(ue,"-nav"),fe),style:De,onKeyDown:function(){Ja()}},L.createElement(pn,{position:"left",extra:xt,prefixCls:ue}),L.createElement(m.a,{onResize:io},L.createElement("div",{className:K()(xa,(Ge={},Object(ne.a)(Ge,"".concat(xa,"-ping-left"),Qa),Object(ne.a)(Ge,"".concat(xa,"-ping-right"),Ua),Object(ne.a)(Ge,"".concat(xa,"-ping-top"),go),Object(ne.a)(Ge,"".concat(xa,"-ping-bottom"),Za),Ge)),ref:gr},L.createElement(m.a,{onResize:io},L.createElement("div",{ref:ir,className:"".concat(ue,"-nav-list"),style:{transform:"translate(".concat(Wn,"px, ").concat(Ur,"px)"),transition:Xa?"none":void 0}},fo,L.createElement(sn,{ref:Er,prefixCls:ue,locale:Vt,editable:It,style:{visibility:so?"hidden":null}}),L.createElement("div",{className:K()("".concat(ue,"-ink-bar"),Object(ne.a)({},"".concat(ue,"-ink-bar-animated"),$e.inkBar)),style:Na}))))),L.createElement($t,Object.assign({},Te,{ref:hr,prefixCls:ue,tabs:di,className:!so&&Da})),L.createElement(pn,{position:"right",extra:xt,prefixCls:ue}))}var jn=L.forwardRef(Gn);function mr(Te){var Ne=Te.id,Ge=Te.activeKey,Ae=Te.animated,ue=Te.tabPosition,ye=Te.rtl,fe=Te.destroyInactiveTabPane,De=L.useContext(sr),Pe=De.prefixCls,$e=De.tabs,Me=Ae.tabPane,nt=$e.findIndex(function(xt){return xt.key===Ge});return L.createElement("div",{className:K()("".concat(Pe,"-content-holder"))},L.createElement("div",{className:K()("".concat(Pe,"-content"),"".concat(Pe,"-content-").concat(ue),Object(ne.a)({},"".concat(Pe,"-content-animated"),Me)),style:nt&&Me?Object(ne.a)({},ye?"marginRight":"marginLeft","-".concat(nt,"00%")):null},$e.map(function(xt){return L.cloneElement(xt.node,{key:xt.key,prefixCls:Pe,tabKey:xt.key,id:Ne,animated:Me,active:xt.key===Ge,destroyInactiveTabPane:fe})})))}function rr(Te){var Ne=Te.prefixCls,Ge=Te.forceRender,Ae=Te.className,ue=Te.style,ye=Te.id,fe=Te.active,De=Te.animated,Pe=Te.destroyInactiveTabPane,$e=Te.tabKey,Me=Te.children,nt=L.useState(Ge),xt=Object(V.a)(nt,2),It=xt[0],Vt=xt[1];L.useEffect(function(){fe?Vt(!0):Pe&&Vt(!1)},[fe,Pe]);var xn={};return fe||(De?(xn.visibility="hidden",xn.height=0,xn.overflowY="hidden"):xn.display="none"),L.createElement("div",{id:ye&&"".concat(ye,"-panel-").concat($e),role:"tabpanel",tabIndex:fe?0:-1,"aria-labelledby":ye&&"".concat(ye,"-tab-").concat($e),"aria-hidden":!fe,style:Object(z.a)(Object(z.a)({},xn),ue),className:K()("".concat(Ne,"-tabpane"),fe&&"".concat(Ne,"-tabpane-active"),Ae)},(fe||It||Ge)&&Me)}var ur=0;function Hr(Te){return Object(M.a)(Te).map(function(Ne){if(L.isValidElement(Ne)){var Ge=Ne.key!==void 0?String(Ne.key):void 0;return Object(z.a)(Object(z.a)({key:Ge},Ne.props),{},{node:Ne})}return null}).filter(function(Ne){return Ne})}function Nr(Te,Ne){var Ge,Ae=Te.id,ue=Te.prefixCls,ye=ue===void 0?"rc-tabs":ue,fe=Te.className,De=Te.children,Pe=Te.direction,$e=Te.activeKey,Me=Te.defaultActiveKey,nt=Te.editable,xt=Te.animated,It=Te.tabPosition,Vt=It===void 0?"top":It,xn=Te.tabBarGutter,An=Te.tabBarStyle,qn=Te.tabBarExtraContent,$n=Te.locale,cr=Te.moreIcon,gr=Te.moreTransitionName,ir=Te.destroyInactiveTabPane,hr=Te.renderTabBar,Er=Te.onChange,Xt=Te.onTabClick,Mt=Te.onTabScroll,en=Object(I.a)(Te,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Rt=Hr(De),At=Pe==="rtl",nr;xt===!1?nr={inkBar:!1,tabPane:!1}:nr=Object(z.a)({inkBar:!0,tabPane:!1},xt!==!0?xt:null);var xr=Object(L.useState)(!1),Wn=Object(V.a)(xr,2),Sr=Wn[0],Xr=Wn[1];Object(L.useEffect)(function(){Xr(Et())},[]);var Or=Object(r.a)(function(){var Kr;return(Kr=Rt[0])===null||Kr===void 0?void 0:Kr.key},{value:$e,defaultValue:Me}),Ur=Object(V.a)(Or,2),Mr=Ur[0],Pr=Ur[1],Dr=Object(L.useState)(function(){return Rt.findIndex(function(Kr){return Kr.key===Mr})}),ar=Object(V.a)(Dr,2),ui=ar[0],Ji=ar[1];Object(L.useEffect)(function(){var Kr=Rt.findIndex(function(Zi){return Zi.key===Mr});if(Kr===-1){var Qi;Kr=Math.max(0,Math.min(ui,Rt.length-1)),Pr((Qi=Rt[Kr])===null||Qi===void 0?void 0:Qi.key)}Ji(Kr)},[Rt.map(function(Kr){return Kr.key}).join("_"),Mr,ui]);var Ii=Object(r.a)(null,{value:Ae}),wi=Object(V.a)(Ii,2),Jr=wi[0],Wr=wi[1],Vr=Vt;Sr&&!["left","right"].includes(Vt)&&(Vr="top"),Object(L.useEffect)(function(){Ae||(Wr("rc-tabs-".concat(ur)),ur+=1)},[]);function Qr(Kr,Qi){Xt==null||Xt(Kr,Qi),Pr(Kr),Er==null||Er(Kr)}var Ni={id:Jr,activeKey:Mr,animated:nr,tabPosition:Vr,rtl:At,mobile:Sr},ha,sa=Object(z.a)(Object(z.a)({},Ni),{},{editable:nt,locale:$n,moreIcon:cr,moreTransitionName:gr,tabBarGutter:xn,onTabClick:Qr,onTabScroll:Mt,extra:qn,style:An,panes:De});return hr?ha=hr(sa,jn):ha=L.createElement(jn,Object.assign({},sa)),L.createElement(sr.Provider,{value:{tabs:Rt,prefixCls:ye}},L.createElement("div",Object.assign({ref:Ne,id:Ae,className:K()(ye,"".concat(ye,"-").concat(Vr),(Ge={},Object(ne.a)(Ge,"".concat(ye,"-mobile"),Sr),Object(ne.a)(Ge,"".concat(ye,"-editable"),nt),Object(ne.a)(Ge,"".concat(ye,"-rtl"),At),Ge),fe)},en),ha,L.createElement(mr,Object.assign({destroyInactiveTabPane:ir},Ni,{animated:nr}))))}var Fr=L.forwardRef(Nr);Fr.TabPane=rr;var si=Fr,li=ve.b=si},kSUc:function(Lt,ve,k){},lZu9:function(Lt,ve,k){(function(ne){ne(k("VrN/"),k("1eCo"),k("8EBN"))})(function(ne){"use strict";ne.defineMode("markdown",function(V,I){var z=ne.getMode(V,"text/html"),L=z.name=="null";function D(U){if(ne.findModeByName){var w=ne.findModeByName(U);w&&(U=w.mime||w.mimes[0])}var Y=ne.getMode(V,U);return Y.name=="null"?null:Y}I.highlightFormatting===void 0&&(I.highlightFormatting=!1),I.maxBlockquoteDepth===void 0&&(I.maxBlockquoteDepth=0),I.taskLists===void 0&&(I.taskLists=!1),I.strikethrough===void 0&&(I.strikethrough=!1),I.emoji===void 0&&(I.emoji=!1),I.fencedCodeBlockHighlighting===void 0&&(I.fencedCodeBlockHighlighting=!0),I.fencedCodeBlockDefaultMode===void 0&&(I.fencedCodeBlockDefaultMode="text/plain"),I.xml===void 0&&(I.xml=!0),I.tokenTypeOverrides===void 0&&(I.tokenTypeOverrides={});var K={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var M in K)K.hasOwnProperty(M)&&I.tokenTypeOverrides[M]&&(K[M]=I.tokenTypeOverrides[M]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,P=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,x=/^\[(x| )\](?=\s)/i,p=I.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,s=/^\s*\[[^\]]+?\]:.*$/,d=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,l=" ";function i(U,w,Y){return w.f=w.inline=Y,Y(U,w)}function n(U,w,Y){return w.f=w.block=Y,Y(U,w)}function O(U){return!U||!/\S/.test(U.string)}function C(U){if(U.linkTitle=!1,U.linkHref=!1,U.linkText=!1,U.em=!1,U.strong=!1,U.strikethrough=!1,U.quote=0,U.indentedCode=!1,U.f==R){var w=L;if(!w){var Y=ne.innerMode(z,U.htmlState);w=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}w&&(U.f=f,U.block=T,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function T(U,w){var Y=U.column()===w.indentation,Z=O(w.prevLine.stream),ce=w.indentedCode,be=w.prevLine.hr,Ze=w.list!==!1,Ce=(w.listStack[w.listStack.length-1]||0)+3;w.indentedCode=!1;var We=w.indentation;if(w.indentationDiff===null&&(w.indentationDiff=w.indentation,Ze)){for(w.list=null;We<w.listStack[w.listStack.length-1];)w.listStack.pop(),w.listStack.length?w.indentation=w.listStack[w.listStack.length-1]:w.list=!1;w.list!==!1&&(w.indentationDiff=We-w.listStack[w.listStack.length-1])}var Ve=!Z&&!be&&!w.prevLine.header&&(!Ze||!ce)&&!w.prevLine.fencedCodeEnd,Ye=(w.list===!1||be||Z)&&w.indentation<=Ce&&U.match(r),we=null;if(w.indentationDiff>=4&&(ce||w.prevLine.fencedCodeEnd||w.prevLine.header||Z))return U.skipToEnd(),w.indentedCode=!0,K.code;if(U.eatSpace())return null;if(Y&&w.indentation<=Ce&&(we=U.match(p))&&we[1].length<=6)return w.quote=0,w.header=we[1].length,w.thisLine.header=!0,I.highlightFormatting&&(w.formatting="header"),w.f=w.inline,y(w);if(w.indentation<=Ce&&U.eat(">"))return w.quote=Y?1:w.quote+1,I.highlightFormatting&&(w.formatting="quote"),U.eatSpace(),y(w);if(!Ye&&!w.setext&&Y&&w.indentation<=Ce&&(we=U.match(P))){var X=we[1]?"ol":"ul";return w.indentation=We+U.current().length,w.list=!0,w.quote=0,w.listStack.push(w.indentation),w.em=!1,w.strong=!1,w.code=!1,w.strikethrough=!1,I.taskLists&&U.match(x,!1)&&(w.taskList=!0),w.f=w.inline,I.highlightFormatting&&(w.formatting=["list","list-"+X]),y(w)}else{if(Y&&w.indentation<=Ce&&(we=U.match(a,!0)))return w.quote=0,w.fencedEndRE=new RegExp(we[1]+"+ *$"),w.localMode=I.fencedCodeBlockHighlighting&&D(we[2]||I.fencedCodeBlockDefaultMode),w.localMode&&(w.localState=ne.startState(w.localMode)),w.f=w.block=S,I.highlightFormatting&&(w.formatting="code-block"),w.code=-1,y(w);if(w.setext||(!Ve||!Ze)&&!w.quote&&w.list===!1&&!w.code&&!Ye&&!s.test(U.string)&&(we=U.lookAhead(1))&&(we=we.match(m)))return w.setext?(w.header=w.setext,w.setext=0,U.skipToEnd(),I.highlightFormatting&&(w.formatting="header")):(w.header=we[0].charAt(0)=="="?1:2,w.setext=w.header),w.thisLine.header=!0,w.f=w.inline,y(w);if(Ye)return U.skipToEnd(),w.hr=!0,w.thisLine.hr=!0,K.hr;if(U.peek()==="[")return i(U,w,N)}return i(U,w,w.inline)}function R(U,w){var Y=z.token(U,w.htmlState);if(!L){var Z=ne.innerMode(z,w.htmlState);(Z.mode.name=="xml"&&Z.state.tagStart===null&&!Z.state.context&&Z.state.tokenize.isInText||w.md_inside&&U.current().indexOf(">")>-1)&&(w.f=f,w.block=T,w.htmlState=null)}return Y}function S(U,w){var Y=w.listStack[w.listStack.length-1]||0,Z=w.indentation<Y,ce=Y+3;if(w.fencedEndRE&&w.indentation<=ce&&(Z||U.match(w.fencedEndRE))){I.highlightFormatting&&(w.formatting="code-block");var be;return Z||(be=y(w)),w.localMode=w.localState=null,w.block=T,w.f=f,w.fencedEndRE=null,w.code=0,w.thisLine.fencedCodeEnd=!0,Z?n(U,w,w.block):be}else return w.localMode?w.localMode.token(U,w.localState):(U.skipToEnd(),K.code)}function y(U){var w=[];if(U.formatting){w.push(K.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var Y=0;Y<U.formatting.length;Y++)w.push(K.formatting+"-"+U.formatting[Y]),U.formatting[Y]==="header"&&w.push(K.formatting+"-"+U.formatting[Y]+"-"+U.header),U.formatting[Y]==="quote"&&(!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=U.quote?w.push(K.formatting+"-"+U.formatting[Y]+"-"+U.quote):w.push("error"))}if(U.taskOpen)return w.push("meta"),w.length?w.join(" "):null;if(U.taskClosed)return w.push("property"),w.length?w.join(" "):null;if(U.linkHref?w.push(K.linkHref,"url"):(U.strong&&w.push(K.strong),U.em&&w.push(K.em),U.strikethrough&&w.push(K.strikethrough),U.emoji&&w.push(K.emoji),U.linkText&&w.push(K.linkText),U.code&&w.push(K.code),U.image&&w.push(K.image),U.imageAltText&&w.push(K.imageAltText,"link"),U.imageMarker&&w.push(K.imageMarker)),U.header&&w.push(K.header,K.header+"-"+U.header),U.quote&&(w.push(K.quote),!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=U.quote?w.push(K.quote+"-"+U.quote):w.push(K.quote+"-"+I.maxBlockquoteDepth)),U.list!==!1){var Z=(U.listStack.length-1)%3;Z?Z===1?w.push(K.list2):w.push(K.list3):w.push(K.list1)}return U.trailingSpaceNewLine?w.push("trailing-space-new-line"):U.trailingSpace&&w.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),w.length?w.join(" "):null}function E(U,w){return U.match(c,!0)?y(w):void 0}function f(U,w){var Y=w.text(U,w);if(typeof Y!="undefined")return Y;if(w.list)return w.list=null,y(w);if(w.taskList){var Z=U.match(x,!0)[1]===" ";return Z?w.taskOpen=!0:w.taskClosed=!0,I.highlightFormatting&&(w.formatting="task"),w.taskList=!1,y(w)}if(w.taskOpen=!1,w.taskClosed=!1,w.header&&U.match(/^#+$/,!0))return I.highlightFormatting&&(w.formatting="header"),y(w);var ce=U.next();if(w.linkTitle){w.linkTitle=!1;var be=ce;ce==="("&&(be=")"),be=(be+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ze="^\\s*(?:[^"+be+"\\\\]+|\\\\\\\\|\\\\.)"+be;if(U.match(new RegExp(Ze),!0))return K.linkHref}if(ce==="`"){var Ce=w.formatting;I.highlightFormatting&&(w.formatting="code"),U.eatWhile("`");var We=U.current().length;if(w.code==0&&(!w.quote||We==1))return w.code=We,y(w);if(We==w.code){var Ve=y(w);return w.code=0,Ve}else return w.formatting=Ce,y(w)}else if(w.code)return y(w);if(ce==="\\"&&(U.next(),I.highlightFormatting)){var Ye=y(w),we=K.formatting+"-escape";return Ye?Ye+" "+we:we}if(ce==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return w.imageMarker=!0,w.image=!0,I.highlightFormatting&&(w.formatting="image"),y(w);if(ce==="["&&w.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return w.imageMarker=!1,w.imageAltText=!0,I.highlightFormatting&&(w.formatting="image"),y(w);if(ce==="]"&&w.imageAltText){I.highlightFormatting&&(w.formatting="image");var Ye=y(w);return w.imageAltText=!1,w.image=!1,w.inline=w.f=v,Ye}if(ce==="["&&!w.image)return w.linkText&&U.match(/^.*?\]/)||(w.linkText=!0,I.highlightFormatting&&(w.formatting="link")),y(w);if(ce==="]"&&w.linkText){I.highlightFormatting&&(w.formatting="link");var Ye=y(w);return w.linkText=!1,w.inline=w.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?v:f,Ye}if(ce==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){w.f=w.inline=h,I.highlightFormatting&&(w.formatting="link");var Ye=y(w);return Ye?Ye+=" ":Ye="",Ye+K.linkInline}if(ce==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){w.f=w.inline=h,I.highlightFormatting&&(w.formatting="link");var Ye=y(w);return Ye?Ye+=" ":Ye="",Ye+K.linkEmail}if(I.xml&&ce==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var X=U.string.indexOf(">",U.pos);if(X!=-1){var j=U.string.substring(U.start,X);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(j)&&(w.md_inside=!0)}return U.backUp(1),w.htmlState=ne.startState(z),n(U,w,R)}if(I.xml&&ce==="<"&&U.match(/^\/\w*?>/))return w.md_inside=!1,"tag";if(ce==="*"||ce==="_"){for(var W=1,Q=U.pos==1?" ":U.string.charAt(U.pos-2);W<3&&U.eat(ce);)W++;var re=U.peek()||" ",G=!/\s/.test(re)&&(!d.test(re)||/\s/.test(Q)||d.test(Q)),xe=!/\s/.test(Q)&&(!d.test(Q)||/\s/.test(re)||d.test(re)),Ie=null,tt=null;if(W%2&&(!w.em&&G&&(ce==="*"||!xe||d.test(Q))?Ie=!0:w.em==ce&&xe&&(ce==="*"||!G||d.test(re))&&(Ie=!1)),W>1&&(!w.strong&&G&&(ce==="*"||!xe||d.test(Q))?tt=!0:w.strong==ce&&xe&&(ce==="*"||!G||d.test(re))&&(tt=!1)),tt!=null||Ie!=null){I.highlightFormatting&&(w.formatting=Ie==null?"strong":tt==null?"em":"strong em"),Ie===!0&&(w.em=ce),tt===!0&&(w.strong=ce);var Ve=y(w);return Ie===!1&&(w.em=!1),tt===!1&&(w.strong=!1),Ve}}else if(ce===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return y(w);U.backUp(1)}if(I.strikethrough){if(ce==="~"&&U.eatWhile(ce)){if(w.strikethrough){I.highlightFormatting&&(w.formatting="strikethrough");var Ve=y(w);return w.strikethrough=!1,Ve}else if(U.match(/^[^\s]/,!1))return w.strikethrough=!0,I.highlightFormatting&&(w.formatting="strikethrough"),y(w)}else if(ce===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return y(w);U.backUp(2)}}if(I.emoji&&ce===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){w.emoji=!0,I.highlightFormatting&&(w.formatting="emoji");var le=y(w);return w.emoji=!1,le}return ce===" "&&(U.match(/^ +$/,!1)?w.trailingSpace++:w.trailingSpace&&(w.trailingSpaceNewLine=!0)),y(w)}function h(U,w){var Y=U.next();if(Y===">"){w.f=w.inline=f,I.highlightFormatting&&(w.formatting="link");var Z=y(w);return Z?Z+=" ":Z="",Z+K.linkInline}return U.match(/^[^>]+/,!0),K.linkInline}function v(U,w){if(U.eatSpace())return null;var Y=U.next();return Y==="("||Y==="["?(w.f=w.inline=b(Y==="("?")":"]"),I.highlightFormatting&&(w.formatting="link-string"),w.linkHref=!0,y(w)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(U){return function(w,Y){var Z=w.next();if(Z===U){Y.f=Y.inline=f,I.highlightFormatting&&(Y.formatting="link-string");var ce=y(Y);return Y.linkHref=!1,ce}return w.match(g[U]),Y.linkHref=!0,y(Y)}}function N(U,w){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(w.f=H,U.next(),I.highlightFormatting&&(w.formatting="link"),w.linkText=!0,y(w)):i(U,w,f)}function H(U,w){if(U.match(/^\]:/,!0)){w.f=w.inline=A,I.highlightFormatting&&(w.formatting="link");var Y=y(w);return w.linkText=!1,Y}return U.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function A(U,w){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?w.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),w.f=w.inline=f,K.linkHref+" url")}var F={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:f,text:E,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(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&ne.copyState(z,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?ne.copyState(U.localMode,U.localState):null,inline:U.inline,text:U.text,formatting:!1,linkText:U.linkText,linkTitle:U.linkTitle,linkHref:U.linkHref,code:U.code,em:U.em,strong:U.strong,strikethrough:U.strikethrough,emoji:U.emoji,header:U.header,setext:U.setext,hr:U.hr,taskList:U.taskList,list:U.list,listStack:U.listStack.slice(0),quote:U.quote,indentedCode:U.indentedCode,trailingSpace:U.trailingSpace,trailingSpaceNewLine:U.trailingSpaceNewLine,md_inside:U.md_inside,fencedEndRE:U.fencedEndRE}},token:function(U,w){if(w.formatting=!1,U!=w.thisLine.stream){if(w.header=0,w.hr=!1,U.match(/^\s*$/,!0))return C(w),null;if(w.prevLine=w.thisLine,w.thisLine={stream:U},w.taskList=!1,w.trailingSpace=0,w.trailingSpaceNewLine=!1,!w.localState&&(w.f=w.block,w.f!=R)){var Y=U.match(/^\s*/,!0)[0].replace(/\t/g,l).length;if(w.indentation=Y,w.indentationDiff=null,Y>0)return null}}return w.f(U,w)},innerMode:function(U){return U.block==R?{state:U.htmlState,mode:z}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:F}},indent:function(U,w,Y){return U.block==R&&z.indent?z.indent(U.htmlState,w,Y):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,w,Y):ne.Pass},blankLine:C,getType:y,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return F},"xml"),ne.defineMIME("text/markdown","markdown"),ne.defineMIME("text/x-markdown","markdown")})},mgmH:function(Lt,ve,k){"use strict";k.d(ve,"d",function(){return m}),k.d(ve,"b",function(){return c}),k.d(ve,"e",function(){return a}),k.d(ve,"c",function(){return s}),k.d(ve,"n",function(){return d}),k.d(ve,"g",function(){return l}),k.d(ve,"h",function(){return i}),k.d(ve,"j",function(){return O}),k.d(ve,"a",function(){return C}),k.d(ve,"l",function(){return T}),k.d(ve,"f",function(){return R}),k.d(ve,"k",function(){return S}),k.d(ve,"m",function(){return y}),k.d(ve,"i",function(){return E}),k.d(ve,"o",function(){return f}),k.d(ve,"t",function(){return h}),k.d(ve,"s",function(){return v}),k.d(ve,"p",function(){return g}),k.d(ve,"q",function(){return b}),k.d(ve,"r",function(){return N}),k.d(ve,"v",function(){return H}),k.d(ve,"u",function(){return A});var ne=k("miYZ"),V=k("tsqr"),I=k("k1fw"),z=k("9og8"),L=k("WmNS"),D=k.n(L),K=k("oUNq"),M=k("9kvl"),r=k("1vsH"),P=k("m3rI"),x=function(){Object(M.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},p=function(){Object(M.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},m=function(){var F=Object(z.a)(D.a.mark(function U(w){var Y;return D.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return x(),ce.next=3,Object(K.t)(Object(I.a)({},w));case 3:if(Y=ce.sent,!(Y.status===0)){ce.next=7;break}return ce.next=7,Object(r.w)("",Object(r.Y)({url:P.a.API_SERVER+"/api/courses/".concat(w.coursesId,"/export_couser_info.json"),query:w}));case 7:p();case 8:case"end":return ce.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),c=function(){var F=Object(z.a)(D.a.mark(function U(w){var Y;return D.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(K.r)(Object(I.a)({},w));case 2:if(Y=ce.sent,!(Y.status===0)){ce.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_member_act_score")),ce.next=13;break;case 8:if(!(Y.status===-2)){ce.next=12;break}return ce.abrupt("return",Y);case 12:Y.status===-3&&(Object(M.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return ce.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),a=function(){var F=Object(z.a)(D.a.mark(function U(w){var Y;return D.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(K.u)(Object(I.a)({},w));case 2:if(Y=ce.sent,!(Y.status===0)){ce.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_score")),ce.next=13;break;case 8:if(!(Y.status===-2)){ce.next=12;break}return ce.abrupt("return",Y);case 12:Y.status===-3&&(Object(M.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_score")));case 13:case"end":return ce.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),s=function(){var F=Object(z.a)(D.a.mark(function U(w){var Y;return D.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(K.s)(Object(I.a)({},w));case 2:if(Y=ce.sent,!(Y.status===0)){ce.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_exercise_and_other")),ce.next=13;break;case 8:if(!(Y.status===-2)){ce.next=12;break}return ce.abrupt("return",Y);case 12:Y.status===-3&&(Object(M.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ce.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),d=function(){var F=Object(z.a)(D.a.mark(function U(w){var Y;return D.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(K.z)(Object(I.a)({},w));case 2:if(Y=ce.sent,!(Y.status===0)){ce.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_exercise_and_other")),ce.next=13;break;case 8:if(!(Y.status===-2)){ce.next=12;break}return ce.abrupt("return",Y);case 12:Y.status===-3&&(Object(M.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ce.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),l=function(){var F=Object(z.a)(D.a.mark(function U(w){var Y;return D.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(K.v)(Object(I.a)({},w));case 2:if(Y=ce.sent,!(Y.status===0)){ce.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_homework")),ce.next=13;break;case 8:if(!(Y.status===-2)){ce.next=12;break}return ce.abrupt("return",Y);case 12:Y.status===-3&&(Object(M.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return ce.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),i=function(){var F=Object(z.a)(D.a.mark(function U(w,Y){var Z;return D.a.wrap(function(be){for(;;)switch(be.prev=be.next){case 0:return be.next=2,Object(K.x)(Object(I.a)({},w));case 2:Z=be.sent,Z.status===0?(V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/").concat(Y))):Z.status===-3&&(Object(M.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/").concat(Y)));case 4:case"end":return be.stop()}},U)}));return function(w,Y){return F.apply(this,arguments)}}(),n=function(){var F=Object(z.a)(D.a.mark(function U(w){var Y;return D.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return x(),ce.next=3,Object(K.w)(Object(I.a)({},w));case 3:if(Y=ce.sent,!(Y.status===0)){ce.next=7;break}return ce.next=7,Object(r.w)("",Object(r.Y)({url:P.a.API_SERVER+"/api/homework_commons/".concat(w.categoryId,"/works_list.zip"),query:w}));case 7:p();case 8:case"end":return ce.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),O=function(){var F=Object(z.a)(D.a.mark(function U(w){var Y;return D.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return x(),ce.next=3,Object(K.A)(Object(I.a)({},w));case 3:if(Y=ce.sent,!(Y.status===0)){ce.next=7;break}return ce.next=7,Object(r.w)("",Object(r.Y)({url:P.a.API_SERVER+"/api/polls/".concat(w.categoryId,"/commit_result.xlsx"),query:w}));case 7:p();case 8:case"end":return ce.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),C=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(r.v)("",Object(r.Y)({url:P.a.API_SERVER+"/api/courses/".concat(w.coursesId,"/attendances/export_xlsx_data.xlsx"),query:w}));case 2:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),T=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(r.v)("",Object(r.Y)({url:P.a.API_SERVER+"/api/courses/".concat(w.coursesId,"/video_study_statics.xlsx"),query:w}));case 2:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),R=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(r.v)("",Object(r.Y)({url:P.a.API_SERVER+"/api/courses/".concat(w.coursesId,"/export_course_students_info.xlsx"),query:w}));case 2:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),S=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(r.v)("",Object(r.Y)({url:P.a.API_SERVER+"/api/item_banks/export.xlsx",query:w}));case 2:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),y=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(r.v)("",Object(r.Y)({url:P.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:w}));case 2:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),E=function(){var F=Object(z.a)(D.a.mark(function U(w){var Y;return D.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(K.y)(Object(I.a)({},w));case 2:Y=ce.sent,Y.status===0?(V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/exercise_score"))):Y.status===-3&&(Object(M.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),M.d.push("/classrooms/".concat(w.coursesId,"/exportlist/exercise_score")));case 4:case"end":return ce.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),f=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),Z.next=3,Object(r.v)("",Object(r.Y)({url:P.a.API_SERVER+"/api/export_records/".concat(w.id,".xlsx"),query:w}));case 3:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),h=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(r.v)("",Object(r.Y)({url:P.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:w}));case 2:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),v=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(r.v)("",Object(r.Y)({url:P.a.API_SERVER+"/api/ec_years/".concat(w==null?void 0:w.ec_year_id,"/ec_training_objectives.xlsx"),query:w}));case 2:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),g=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(r.v)(w==null?void 0:w.name,Object(r.Y)({url:P.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:w}));case 2:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),b=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(r.v)("",Object(r.Y)({url:P.a.API_SERVER+"/api/ec_years/".concat(w==null?void 0:w.ec_year_id,"/ec_courses.xlsx"),query:w}));case 2:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),N=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(r.v)("",Object(r.Y)({url:P.a.API_SERVER+"/api/ec_years/".concat(w==null?void 0:w.ec_year_id,"/ec_graduation_requirements.xlsx"),query:w}));case 2:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),H=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(r.v)("",Object(r.Y)({url:P.a.API_SERVER+"/api/courses/rank_list.xlsx",query:w}));case 2:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}(),A=function(){var F=Object(z.a)(D.a.mark(function U(w){return D.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(r.v)("",Object(r.Y)({url:P.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:w}));case 2:case"end":return Z.stop()}},U)}));return function(w){return F.apply(this,arguments)}}()},n6Qo:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return M});var ne=k("q1tI"),V=k("biw7"),I=k("fyJ8");function z(r){var P=r.className,x=r.index,p=r.children,m=r.colSpan,c=r.rowSpan,a=ne.useContext(V.a),s=a.prefixCls,d=a.fixedInfoList,l=d[x];return ne.createElement(I.a,Object.assign({className:P,index:x,component:"td",prefixCls:s,record:null,dataIndex:null,render:function(){return{children:p,props:{colSpan:m,rowSpan:c}}}},l))}function L(r){return ne.createElement("tr",Object.assign({},r))}function D(r){var P=r.children,x=ne.useContext(V.a),p=x.prefixCls;return ne.createElement("tfoot",{className:"".concat(p,"-summary")},P)}var K=ve.b=D,M={Cell:z,Row:L}},nEHx:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return ne});var ne;(function(V){V.DARK="dark",V.LIGHT="light",V.HIGH_CONTRAST="hc"})(ne||(ne={}))},nPLb:function(Lt,ve,k){"use strict";var ne=k("2qtc"),V=k("kLXV"),I=k("g9YV"),z=k("wCAj"),L=k("5NDa"),D=k("5rEg"),K=k("14J3"),M=k("BMrR"),r=k("iQDF"),P=k("+eQT"),x=k("miYZ"),p=k("tsqr"),m=k("jrin"),c=k("oBTY"),a=k("k1fw"),s=k("9og8"),d=k("y8nQ"),l=k("Vl3Y"),i=k("tJVT"),n=k("PpiC"),O=k("WmNS"),C=k.n(O),T=k("q1tI"),R=k.n(T),S=k("wd/R"),y=k.n(S),E=k("ErOA"),f=k("1vsH"),h=k("Ty5D"),v=k("9kvl"),g=k("oUNq"),b=k("xKgJ"),N=k("eozf"),H=function(F){var U=F.classroomList,w=F.dispatch,Y=F.courseEndTime,Z=Object(n.a)(F,["classroomList","dispatch","courseEndTime"]),ce=Object(h.i)(),be=l.a.useForm(),Ze=Object(i.a)(be,1),Ce=Ze[0],We=Object(T.useState)(1),Ve=Object(i.a)(We,2),Ye=Ve[0],we=Ve[1],X=Object(T.useState)([]),j=Object(i.a)(X,2),W=j[0],Q=j[1],re=Object(T.useState)(0),G=Object(i.a)(re,2),xe=G[0],Ie=G[1],tt=Object(T.useState)(2e4),le=Object(i.a)(tt,2),Se=le[0],je=le[1],ze=Object(T.useState)(!0),yt=Object(i.a)(ze,2),Ot=yt[0],Ut=yt[1],Qe=Object(T.useState)(),Bt=Object(i.a)(Qe,2),ln=Bt[0],Ke=Bt[1],He=Object(T.useState)([]),ct=Object(i.a)(He,2),bt=ct[0],de=ct[1];ce.id=ce.coursesId,Object(T.useEffect)(function(){U.actionTabs.key==="\u7ACB\u5373\u622A\u6B62"?q():(de([]),Q([]))},[U.actionTabs.key]);var q=function(){var ae=Object(s.a)(C.a.mark(function ie(me){var _e,Ee,Le;return C.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return Ut(!0),Ct.next=3,Object(g.D)(Object(a.a)(Object(a.a)({},ce),{},{page:me||Ye,limit:Se,homework_id:U.actionTabs.type===1?"":U.actionTabs.selectArrs[0],end_homework_action:!0}));case 3:_e=Ct.sent,_e==null||_e.course_groups.map(function(Jt){Jt.key=Jt.id}),_e&&(Q([].concat(Object(c.a)(W),Object(c.a)(_e==null?void 0:_e.course_groups))),Ie(_e==null?void 0:_e.group_count),Ke(_e==null?void 0:_e.course_groups),Ut(!1),me||Ce.setFieldsValue((Le={},Object(m.a)(Le,"group_ids",_e==null||((Ee=_e.course_groups)===null||Ee===void 0)?void 0:Ee.map(function(Jt){return String(Jt.id)})),Object(m.a)(Le,"end_time",y()(y()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Le)));case 6:case"end":return Ct.stop()}},ie)}));return function(me){return ae.apply(this,arguments)}}(),te=function(){var ae=Object(s.a)(C.a.mark(function ie(){var me,_e,Ee,Le;return C.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:if(me=Object(a.a)({},Ce.getFieldsValue()),console.log("----",me.group_ids),!(ln!=null&&ln.length&&!(bt!=null&&bt.length))){Ct.next=5;break}return p.b.warning("\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u73ED\u7EA7"),Ct.abrupt("return");case 5:return Ct.next=7,Object(E.a)("/api/courses/".concat(ce.id,"/homework_commons/end_with_homework_list_position.json"),{method:"post",body:{homework_ids:Object(c.a)(U.actionTabs.selectArrs),group_ids:(bt==null?void 0:bt.length)>0?bt:[],unified_setting:!(W!=null&&W.length),end_time:y()(me.end_time).format("YYYY-MM-DD HH:mm")}});case 7:_e=Ct.sent,_e.status===0&&(se(),Object(f.db)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u622A\u6B62"]),p.b.success("\u64CD\u4F5C\u6210\u529F"),w({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Z.onCallback&&Z.onCallback(),Object(b.c)()?(w({type:"classroomList/setActionTabs",payload:{}}),(U==null||((Ee=U.actionTabs)===null||Ee===void 0||((Le=Ee.selectArrsAll)===null||Le===void 0))?void 0:Le.length)>0?w({type:"classroomList/getClassroomTeacherCommonList",payload:Object(a.a)(Object(a.a)({},U.actionTabs.params),{},{type:5})}):w({type:"shixunHomeworks/getWorkList",payload:Object(a.a)({},ce)})):w({type:"classroomList/getClassroomCommonList",payload:Object(a.a)({},U.actionTabs.params)}));case 9:case"end":return Ct.stop()}},ie)}));return function(){return ae.apply(this,arguments)}}(),se=function(){we(1),Q([])},pe=U.detailCommonHomeworksList;return R.a.createElement(V.a,{centered:!0,title:"\u622A\u6B62\u4F5C\u4E1A",visible:U.actionTabs.key==="\u7ACB\u5373\u622A\u6B62",okText:"\u622A\u6B62\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u622A\u6B62",onOk:te,onCancel:function(){se(),w({type:"classroomList/setActionTabs",payload:{}})}},R.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A",R.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u63D0\u4EA4\u4E2D" \u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548'),W&&R.a.createElement(l.a,{form:Ce},R.a.createElement(M.a,null,R.a.createElement("span",{className:"mr5"},"\u622A\u6B62\u65F6\u95F4:"),R.a.createElement(l.a.Item,{name:"end_time"},R.a.createElement(P.a,{style:{width:170},getPopupContainer:function(ie){return ie.parentNode},disabledDate:function(ie){return Object(N.b)(ie,Y)},disabledTime:function(ie){return Object(N.c)(ie)},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:y()(Object(f.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),(ln==null?void 0:ln.length)>0&&R.a.createElement(M.a,null,R.a.createElement("span",{className:"mr5"},"\u9009\u62E9\u73ED\u7EA7:"),R.a.createElement(D.a.Search,{style:{width:"300px"},onChange:function(ie){Q(ln.filter(function(me){return me.name.indexOf(ie.target.value)>-1}))}})),(W==null?void 0:W.length)>0&&U.actionTabs.type===1&&R.a.createElement(z.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(ie,me){de(ie)}},rowKey:"id",pagination:!1,dataSource:W,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"}]}),(W==null?void 0:W.length)>0&&U.actionTabs.type===2&&R.a.createElement(z.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(ie,me){de(ie)}},rowKey:"id",pagination:!1,dataSource:W,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"},{title:"\u53D1\u5E03\u65F6\u95F4",dataIndex:"publish_time",key:"publish_time"},{title:"\u622A\u6B62\u65F6\u95F4",dataIndex:"end_time",key:"end_time"}]})))};ve.a=Object(v.a)(function(A){var F=A.classroomList;return{classroomList:F}})(H)},nnTU:function(Lt,ve,k){"use strict";k.d(ve,"b",function(){return K}),k.d(ve,"a",function(){return M});var ne=k("MI8n"),V=k("JYp7"),I=k("pmY6"),z=k("24hK"),L=k("746U"),D=k("Cg/j");const K=Object(D.c)("commandService"),M=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ne.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,P){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!P)throw new Error("invalid command");return this.registerCommand({id:r,handler:P})}if(r.description){const a=[];for(let d of r.description.args)a.push(d.constraint);const s=r.handler;r.handler=function(d,...l){return Object(L.o)(l,a),s(d,...l)}}const{id:x}=r;let p=this._commands.get(x);p||(p=new z.a,this._commands.set(x,p));let m=p.unshift(r),c=Object(I.i)(()=>{m();const a=this._commands.get(x);(a==null?void 0:a.isEmpty())&&this._commands.delete(x)});return this._onDidRegisterCommand.fire(x),c}registerCommandAlias(r,P){return M.registerCommand(r,(x,...p)=>x.get(K).executeCommand(P,...p))}getCommand(r){const P=this._commands.get(r);return!P||P.isEmpty()?void 0:V.a.first(P)}getCommands(){const r=new Map;for(const P of this._commands.keys()){const x=this.getCommand(P);x&&r.set(P,x)}return r}};M.registerCommand("noop",()=>{})},oOBs:function(Lt,ve,k){Lt.exports={leftdiv:"leftdiv___1FhsT",listClass:"listClass___1Y2ac",spantitle:"spantitle___1pL39",rightdiv:"rightdiv___3ZICD"}},ogmK:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return Xn});var ne=k("1OyB"),V=k("vuIU"),I=k("Ji7U"),z=k("LK+K"),L=k("rePB"),D=k("VTBJ"),K=k("ODXe"),M=k("q1tI"),r=k("TSYQ"),P=k.n(r),x=k("Kwbf"),p=k("6cGi"),m=k("U8pU"),c=k("4IlW"),a=M.createContext({}),s=a,d={visibility:"hidden"};function l(J){var ge=J.prefixCls,Oe=J.prevIcon,Re=Oe===void 0?"\u2039":Oe,qe=J.nextIcon,Ue=qe===void 0?"\u203A":qe,Je=J.superPrevIcon,dt=Je===void 0?"\xAB":Je,wt=J.superNextIcon,Tt=wt===void 0?"\xBB":wt,Be=J.onSuperPrev,ft=J.onSuperNext,et=J.onPrev,rt=J.onNext,ht=J.children,_t=M.useContext(s),st=_t.hideNextBtn,Pt=_t.hidePrevBtn;return M.createElement("div",{className:ge},Be&&M.createElement("button",{type:"button",onClick:Be,tabIndex:-1,className:"".concat(ge,"-super-prev-btn"),style:Pt?d:{}},dt),et&&M.createElement("button",{type:"button",onClick:et,tabIndex:-1,className:"".concat(ge,"-prev-btn"),style:Pt?d:{}},Re),M.createElement("div",{className:"".concat(ge,"-view")},ht),rt&&M.createElement("button",{type:"button",onClick:rt,tabIndex:-1,className:"".concat(ge,"-next-btn"),style:st?d:{}},Ue),ft&&M.createElement("button",{type:"button",onClick:ft,tabIndex:-1,className:"".concat(ge,"-super-next-btn"),style:st?d:{}},Tt))}var i=l;function n(J){var ge=M.useContext(s),Oe=ge.hideHeader;if(Oe)return null;var Re=J.prefixCls,qe=J.generateConfig,Ue=J.locale,Je=J.value,dt=J.format,wt="".concat(Re,"-header");return M.createElement(i,{prefixCls:wt},Je?qe.locale.format(Ue.locale,Je,dt):"\xA0")}var O=n,C=k("YrtM"),T=k("KQm4"),R=new Map;function S(J,ge,Oe){if(R.get(J)&&cancelAnimationFrame(R.get(J)),Oe<=0){R.set(J,requestAnimationFrame(function(){J.scrollTop=ge}));return}var Re=ge-J.scrollTop,qe=Re/Oe*10;R.set(J,requestAnimationFrame(function(){J.scrollTop+=qe,J.scrollTop!==ge&&S(J,ge,Oe-10)}))}function y(J,ge){var Oe=ge.onLeftRight,Re=ge.onCtrlLeftRight,qe=ge.onUpDown,Ue=ge.onPageUpDown,Je=ge.onEnter,dt=J.which,wt=J.ctrlKey,Tt=J.metaKey;switch(dt){case c.a.LEFT:if(wt||Tt){if(Re)return Re(-1),!0}else if(Oe)return Oe(-1),!0;break;case c.a.RIGHT:if(wt||Tt){if(Re)return Re(1),!0}else if(Oe)return Oe(1),!0;break;case c.a.UP:if(qe)return qe(-1),!0;break;case c.a.DOWN:if(qe)return qe(1),!0;break;case c.a.PAGE_UP:if(Ue)return Ue(-1),!0;break;case c.a.PAGE_DOWN:if(Ue)return Ue(1),!0;break;case c.a.ENTER:if(Je)return Je(),!0;break}return!1}function E(J,ge,Oe,Re){var qe=J;if(!qe)switch(ge){case"time":qe=Re?"hh:mm:ss a":"HH:mm:ss";break;case"week":qe="gggg-wo";break;case"month":qe="YYYY-MM";break;case"quarter":qe="YYYY-[Q]Q";break;case"year":qe="YYYY";break;default:qe=Oe?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return qe}function f(J,ge){var Oe=J==="time"?8:10;return Math.max(Oe,ge.length)+2}var h=null,v=new Set;function g(J){return!h&&typeof window!="undefined"&&window.addEventListener&&(h=function(Oe){Object(T.a)(v).forEach(function(Re){Re(Oe)})},window.addEventListener("mousedown",h)),v.add(J),function(){v.delete(J),v.size===0&&(window.removeEventListener("mousedown",h),h=null)}}var b=function(ge){return ge==="month"||ge==="date"?"year":ge},N=function(ge){return ge==="date"?"month":ge},H=function(ge){return ge==="month"||ge==="date"?"quarter":ge},A=function(ge){return ge==="date"?"week":ge},F={year:b,month:N,quarter:H,week:A,time:null,date:null};function U(J,ge){return J.some(function(Oe){return Oe&&Oe.contains(ge)})}function w(J){var ge=J.prefixCls,Oe=J.units,Re=J.onSelect,qe=J.value,Ue=J.active,Je=J.hideDisabledOptions,dt="".concat(ge,"-cell"),wt=M.useContext(s),Tt=wt.open,Be=M.useRef(null),ft=M.useRef(new Map);return M.useLayoutEffect(function(){var et=ft.current.get(qe);et&&Tt!==!1&&S(Be.current,et.offsetTop,120)},[qe]),M.useLayoutEffect(function(){if(Tt){var et=ft.current.get(qe);et&&S(Be.current,et.offsetTop,0)}},[Tt]),M.createElement("ul",{className:P()("".concat(ge,"-column"),Object(L.a)({},"".concat(ge,"-column-active"),Ue)),ref:Be,style:{position:"relative"}},Oe.map(function(et){var rt;return Je&&et.disabled?null:M.createElement("li",{key:et.value,ref:function(_t){ft.current.set(et.value,_t)},className:P()(dt,(rt={},Object(L.a)(rt,"".concat(dt,"-disabled"),et.disabled),Object(L.a)(rt,"".concat(dt,"-selected"),qe===et.value),rt)),onClick:function(){if(et.disabled)return;Re(et.value)}},M.createElement("div",{className:"".concat(dt,"-inner")},et.label))}))}var Y=w;function Z(J,ge){for(var Oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",Re=String(J);Re.length<ge;)Re="".concat(Oe).concat(J);return Re}var ce=function(){for(var ge=arguments.length,Oe=new Array(ge),Re=0;Re<ge;Re++)Oe[Re]=arguments[Re];return Oe};function be(J){return J==null?[]:Array.isArray(J)?J:[J]}function Ze(J){var ge={};return Object.keys(J).forEach(function(Oe){(Oe.substr(0,5)==="data-"||Oe.substr(0,5)==="aria-"||Oe==="role"||Oe==="name")&&Oe.substr(0,7)!=="data-__"&&(ge[Oe]=J[Oe])}),ge}function Ce(J,ge){return J?J[ge]:null}function We(J,ge,Oe){var Re=[Ce(J,0),Ce(J,1)];return Re[Oe]=typeof ge=="function"?ge(Re[Oe]):ge,!Re[0]&&!Re[1]?null:Re}function Ve(J,ge,Oe,Re,qe){var Ue=J.setHour(ge,Oe);return Ue=J.setMinute(Ue,Re),Ue=J.setSecond(Ue,qe),Ue}function Ye(J,ge,Oe,Re,qe,Ue){var Je=Math.floor(J/Re)*Re;if(Je<J)return[Je,60-qe,60-Ue];var dt=Math.floor(ge/qe)*qe;if(dt<ge)return[Je,dt,60-Ue];var wt=Math.floor(Oe/Ue)*Ue;return[Je,dt,wt]}function we(J,ge){if(J.length!==ge.length)return!0;for(var Oe=0;Oe<J.length;Oe+=1)if(J[Oe].disabled!==ge[Oe].disabled)return!0;return!1}function X(J,ge,Oe,Re){for(var qe=[],Ue=J;Ue<=ge;Ue+=Oe)qe.push({label:Z(Ue,2),value:Ue,disabled:(Re||[]).includes(Ue)});return qe}function j(J){var ge=J.generateConfig,Oe=J.prefixCls,Re=J.operationRef,qe=J.activeColumnIndex,Ue=J.value,Je=J.showHour,dt=J.showMinute,wt=J.showSecond,Tt=J.use12Hours,Be=J.hourStep,ft=Be===void 0?1:Be,et=J.minuteStep,rt=et===void 0?1:et,ht=J.secondStep,_t=ht===void 0?1:ht,st=J.disabledHours,Pt=J.disabledMinutes,Wt=J.disabledSeconds,cn=J.hideDisabledOptions,On=J.onSelect,an=[],mn="".concat(Oe,"-content"),hn="".concat(Oe,"-time-panel"),gt,Kt=Ue?ge.getHour(Ue):-1,St=Ue?ge.getMinute(Ue):-1,pt=Ue?ge.getSecond(Ue):-1,gn=function(nn,mt,Xe,Et){var vt=Ue||ge.getNow(),Ht=Math.max(0,mt),Rn=Math.max(0,Xe),pn=Math.max(0,Et);return vt=Ve(ge,vt,!Tt||!nn?Ht:Ht+12,Rn,pn),vt},on=X(0,23,ft,st&&st()),Dt=Object(C.a)(function(){return on},on,we);Tt&&(gt=Kt>=12,Kt%=12);var it=M.useMemo(function(){if(!Tt)return[!1,!1];var un=[!0,!0];return Dt.forEach(function(nn){var mt=nn.disabled,Xe=nn.value;if(mt)return;Xe>=12?un[1]=!1:un[0]=!1}),un},[Tt,Dt]),_n=Object(K.a)(it,2),Gt=_n[0],In=_n[1],kt=M.useMemo(function(){return Tt?Dt.filter(gt?function(un){return un.value>=12}:function(un){return un.value<12}).map(function(un){var nn=un.value%12,mt=nn===0?"12":Z(nn,2);return Object(D.a)(Object(D.a)({},un),{},{label:mt,value:nn})}):Dt},[Tt,Dt]),sn=X(0,59,rt,Pt&&Pt(Kt)),En=X(0,59,_t,Wt&&Wt(Kt,St));Re.current={onUpDown:function(nn){var mt=an[qe];if(mt)for(var Xe=mt.units.findIndex(function(Rn){return Rn.value===mt.value}),Et=mt.units.length,vt=1;vt<Et;vt+=1){var Ht=mt.units[(Xe+nn*vt+Et)%Et];if(Ht.disabled!==!0){mt.onSelect(Ht.value);break}}}};function $t(un,nn,mt,Xe,Et){un!==!1&&an.push({node:M.cloneElement(nn,{prefixCls:hn,value:mt,active:qe===an.length,onSelect:Et,units:Xe,hideDisabledOptions:cn}),onSelect:Et,value:mt,units:Xe})}$t(Je,M.createElement(Y,{key:"hour"}),Kt,kt,function(un){On(gn(gt,un,St,pt),"mouse")}),$t(dt,M.createElement(Y,{key:"minute"}),St,sn,function(un){On(gn(gt,Kt,un,pt),"mouse")}),$t(wt,M.createElement(Y,{key:"second"}),pt,En,function(un){On(gn(gt,Kt,St,un),"mouse")});var sr=-1;return typeof gt=="boolean"&&(sr=gt?1:0),$t(Tt===!0,M.createElement(Y,{key:"12hours"}),sr,[{label:"AM",value:0,disabled:Gt},{label:"PM",value:1,disabled:In}],function(un){On(gn(!!un,Kt,St,pt),"mouse")}),M.createElement("div",{className:mn},an.map(function(un){var nn=un.node;return nn}))}var W=j,Q=function(ge){return ge.filter(function(Oe){return Oe!==!1}).length};function re(J){var ge=J.generateConfig,Oe=J.format,Re=Oe===void 0?"HH:mm:ss":Oe,qe=J.prefixCls,Ue=J.active,Je=J.operationRef,dt=J.showHour,wt=J.showMinute,Tt=J.showSecond,Be=J.use12Hours,ft=Be===void 0?!1:Be,et=J.onSelect,rt=J.value,ht="".concat(qe,"-time-panel"),_t=M.useRef(),st=M.useState(-1),Pt=Object(K.a)(st,2),Wt=Pt[0],cn=Pt[1],On=Q([dt,wt,Tt,ft]);return Je.current={onKeyDown:function(mn){return y(mn,{onLeftRight:function(gt){cn((Wt+gt+On)%On)},onUpDown:function(gt){Wt===-1?cn(0):_t.current&&_t.current.onUpDown(gt)},onEnter:function(){et(rt||ge.getNow(),"key"),cn(-1)}})},onBlur:function(){cn(-1)}},M.createElement("div",{className:P()(ht,Object(L.a)({},"".concat(ht,"-active"),Ue))},M.createElement(O,Object.assign({},J,{format:Re,prefixCls:qe})),M.createElement(W,Object.assign({},J,{prefixCls:qe,activeColumnIndex:Wt,operationRef:_t})))}var G=re,xe=7;function Ie(J,ge){return!J&&!ge?!0:!J||!ge?!1:void 0}function tt(J,ge,Oe){var Re=Ie(ge,Oe);if(typeof Re=="boolean")return Re;var qe=Math.floor(J.getYear(ge)/10),Ue=Math.floor(J.getYear(Oe)/10);return qe===Ue}function le(J,ge,Oe){var Re=Ie(ge,Oe);return typeof Re=="boolean"?Re:J.getYear(ge)===J.getYear(Oe)}function Se(J,ge){var Oe=Math.floor(J.getMonth(ge)/3);return Oe+1}function je(J,ge,Oe){var Re=Ie(ge,Oe);return typeof Re=="boolean"?Re:le(J,ge,Oe)&&Se(J,ge)===Se(J,Oe)}function ze(J,ge,Oe){var Re=Ie(ge,Oe);return typeof Re=="boolean"?Re:le(J,ge,Oe)&&J.getMonth(ge)===J.getMonth(Oe)}function yt(J,ge,Oe){var Re=Ie(ge,Oe);return typeof Re=="boolean"?Re:J.getYear(ge)===J.getYear(Oe)&&J.getMonth(ge)===J.getMonth(Oe)&&J.getDate(ge)===J.getDate(Oe)}function Ot(J,ge,Oe){var Re=Ie(ge,Oe);return typeof Re=="boolean"?Re:J.getHour(ge)===J.getHour(Oe)&&J.getMinute(ge)===J.getMinute(Oe)&&J.getSecond(ge)===J.getSecond(Oe)}function Ut(J,ge,Oe,Re){var qe=Ie(Oe,Re);return typeof qe=="boolean"?qe:J.locale.getWeek(ge,Oe)===J.locale.getWeek(ge,Re)}function Qe(J,ge,Oe){return yt(J,ge,Oe)&&Ot(J,ge,Oe)}function Bt(J,ge,Oe,Re){return!ge||!Oe||!Re?!1:!yt(J,ge,Re)&&!yt(J,Oe,Re)&&J.isAfter(Re,ge)&&J.isAfter(Oe,Re)}function ln(J,ge,Oe){var Re=ge.locale.getWeekFirstDay(J),qe=ge.setDate(Oe,1),Ue=ge.getWeekDay(qe),Je=ge.addDate(qe,Re-Ue);return ge.getMonth(Je)===ge.getMonth(Oe)&&ge.getDate(Je)>1&&(Je=ge.addDate(Je,-7)),Je}function Ke(J,ge,Oe){var Re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(ge){case"year":return Oe.addYear(J,Re*10);case"quarter":case"month":return Oe.addYear(J,Re);default:return Oe.addMonth(J,Re)}}var He=M.createContext({}),ct=He;function bt(J){var ge=J.cellPrefixCls,Oe=J.generateConfig,Re=J.rangedValue,qe=J.hoverRangedValue,Ue=J.isInView,Je=J.isSameCell,dt=J.offsetCell,wt=J.today,Tt=J.value;function Be(ft){var et,rt=dt(ft,-1),ht=dt(ft,1),_t=Ce(Re,0),st=Ce(Re,1),Pt=Ce(qe,0),Wt=Ce(qe,1),cn=Bt(Oe,Pt,Wt,ft);function On(St){return Je(_t,St)}function an(St){return Je(st,St)}var mn=Je(Pt,ft),hn=Je(Wt,ft),gt=(cn||hn)&&(!Ue(rt)||an(rt)),Kt=(cn||mn)&&(!Ue(ht)||On(ht));return et={},Object(L.a)(et,"".concat(ge,"-in-view"),Ue(ft)),Object(L.a)(et,"".concat(ge,"-in-range"),Bt(Oe,_t,st,ft)),Object(L.a)(et,"".concat(ge,"-range-start"),On(ft)),Object(L.a)(et,"".concat(ge,"-range-end"),an(ft)),Object(L.a)(et,"".concat(ge,"-range-start-single"),On(ft)&&!st),Object(L.a)(et,"".concat(ge,"-range-end-single"),an(ft)&&!_t),Object(L.a)(et,"".concat(ge,"-range-start-near-hover"),On(ft)&&(Je(rt,Pt)||Bt(Oe,Pt,Wt,rt))),Object(L.a)(et,"".concat(ge,"-range-end-near-hover"),an(ft)&&(Je(ht,Wt)||Bt(Oe,Pt,Wt,ht))),Object(L.a)(et,"".concat(ge,"-range-hover"),cn),Object(L.a)(et,"".concat(ge,"-range-hover-start"),mn),Object(L.a)(et,"".concat(ge,"-range-hover-end"),hn),Object(L.a)(et,"".concat(ge,"-range-hover-edge-start"),gt),Object(L.a)(et,"".concat(ge,"-range-hover-edge-end"),Kt),Object(L.a)(et,"".concat(ge,"-range-hover-edge-start-near-range"),gt&&Je(rt,st)),Object(L.a)(et,"".concat(ge,"-range-hover-edge-end-near-range"),Kt&&Je(ht,_t)),Object(L.a)(et,"".concat(ge,"-today"),Je(wt,ft)),Object(L.a)(et,"".concat(ge,"-selected"),Je(Tt,ft)),et}return Be}function de(J){for(var ge=J.prefixCls,Oe=J.disabledDate,Re=J.onSelect,qe=J.rowNum,Ue=J.colNum,Je=J.prefixColumn,dt=J.rowClassName,wt=J.baseDate,Tt=J.getCellClassName,Be=J.getCellText,ft=J.getCellNode,et=J.getCellDate,rt=J.titleCell,ht=J.headerCells,_t=M.useContext(s),st=_t.onDateMouseEnter,Pt=_t.onDateMouseLeave,Wt="".concat(ge,"-cell"),cn=[],On=0;On<qe;On+=1){for(var an=[],mn=void 0,hn=function(St){var pt=On*Ue+St,gn=et(wt,pt),on=Oe&&Oe(gn);St===0&&(mn=gn,Je&&an.push(Je(mn))),an.push(M.createElement("td",{key:St,title:rt&&rt(gn),className:P()(Wt,Object(D.a)(Object(L.a)({},"".concat(Wt,"-disabled"),on),Tt(gn))),onClick:function(){on||Re(gn)},onMouseEnter:function(){!on&&st&&st(gn)},onMouseLeave:function(){!on&&Pt&&Pt(gn)}},ft?ft(gn):M.createElement("div",{className:"".concat(Wt,"-inner")},Be(gn))))},gt=0;gt<Ue;gt+=1)hn(gt);cn.push(M.createElement("tr",{key:On,className:dt&&dt(mn)},an))}return M.createElement("div",{className:"".concat(ge,"-body")},M.createElement("table",{className:"".concat(ge,"-content")},ht&&M.createElement("thead",null,M.createElement("tr",null,ht)),M.createElement("tbody",null,cn)))}function q(J){var ge=J.prefixCls,Oe=J.generateConfig,Re=J.prefixColumn,qe=J.locale,Ue=J.rowCount,Je=J.viewDate,dt=J.value,wt=J.dateRender,Tt=M.useContext(ct),Be=Tt.rangedValue,ft=Tt.hoverRangedValue,et=ln(qe.locale,Oe,Je),rt="".concat(ge,"-cell"),ht=Oe.locale.getWeekFirstDay(qe.locale),_t=Oe.getNow(),st=[],Pt=qe.shortWeekDays||(Oe.locale.getShortWeekDays?Oe.locale.getShortWeekDays(qe.locale):[]);Re&&st.push(M.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var Wt=0;Wt<xe;Wt+=1)st.push(M.createElement("th",{key:Wt},Pt[(Wt+ht)%xe]));var cn=bt({cellPrefixCls:rt,today:_t,value:dt,generateConfig:Oe,rangedValue:Re?null:Be,hoverRangedValue:Re?null:ft,isSameCell:function(mn,hn){return yt(Oe,mn,hn)},isInView:function(mn){return ze(Oe,mn,Je)},offsetCell:function(mn,hn){return Oe.addDate(mn,hn)}}),On=wt?function(an){return wt(an,_t)}:void 0;return M.createElement(de,Object.assign({},J,{rowNum:Ue,colNum:xe,baseDate:et,getCellNode:On,getCellText:Oe.getDate,getCellClassName:cn,getCellDate:Oe.addDate,titleCell:function(mn){return Oe.locale.format(qe.locale,mn,"YYYY-MM-DD")},headerCells:st}))}var te=q;function se(J){var ge=J.prefixCls,Oe=J.generateConfig,Re=J.locale,qe=J.viewDate,Ue=J.onNextMonth,Je=J.onPrevMonth,dt=J.onNextYear,wt=J.onPrevYear,Tt=J.onYearClick,Be=J.onMonthClick,ft=M.useContext(s),et=ft.hideHeader;if(et)return null;var rt="".concat(ge,"-header"),ht=Re.shortMonths||(Oe.locale.getShortMonths?Oe.locale.getShortMonths(Re.locale):[]),_t=Oe.getMonth(qe),st=M.createElement("button",{type:"button",key:"year",onClick:Tt,tabIndex:-1,className:"".concat(ge,"-year-btn")},Oe.locale.format(Re.locale,qe,Re.yearFormat)),Pt=M.createElement("button",{type:"button",key:"month",onClick:Be,tabIndex:-1,className:"".concat(ge,"-month-btn")},Re.monthFormat?Oe.locale.format(Re.locale,qe,Re.monthFormat):ht[_t]),Wt=Re.monthBeforeYear?[Pt,st]:[st,Pt];return M.createElement(i,Object.assign({},J,{prefixCls:rt,onSuperPrev:wt,onPrev:Je,onNext:Ue,onSuperNext:dt}),Wt)}var pe=se,ae=6;function ie(J){var ge=J.prefixCls,Oe=J.panelName,Re=Oe===void 0?"date":Oe,qe=J.keyboardConfig,Ue=J.active,Je=J.operationRef,dt=J.generateConfig,wt=J.value,Tt=J.viewDate,Be=J.onViewDateChange,ft=J.onPanelChange,et=J.onSelect,rt="".concat(ge,"-").concat(Re,"-panel");Je.current={onKeyDown:function(Pt){return y(Pt,Object(D.a)({onLeftRight:function(cn){et(dt.addDate(wt||Tt,cn),"key")},onCtrlLeftRight:function(cn){et(dt.addYear(wt||Tt,cn),"key")},onUpDown:function(cn){et(dt.addDate(wt||Tt,cn*xe),"key")},onPageUpDown:function(cn){et(dt.addMonth(wt||Tt,cn),"key")}},qe))}};var ht=function(Pt){var Wt=dt.addYear(Tt,Pt);Be(Wt),ft(null,Wt)},_t=function(Pt){var Wt=dt.addMonth(Tt,Pt);Be(Wt),ft(null,Wt)};return M.createElement("div",{className:P()(rt,Object(L.a)({},"".concat(rt,"-active"),Ue))},M.createElement(pe,Object.assign({},J,{prefixCls:ge,value:wt,viewDate:Tt,onPrevYear:function(){ht(-1)},onNextYear:function(){ht(1)},onPrevMonth:function(){_t(-1)},onNextMonth:function(){_t(1)},onMonthClick:function(){ft("month",Tt)},onYearClick:function(){ft("year",Tt)}})),M.createElement(te,Object.assign({},J,{onSelect:function(Pt){return et(Pt,"mouse")},prefixCls:ge,value:wt,viewDate:Tt,rowCount:ae})))}var me=ie;function _e(J,ge,Oe){if(!Oe)return ge;var Re=ge;return Re=J.setHour(Re,J.getHour(Oe)),Re=J.setMinute(Re,J.getMinute(Oe)),Re=J.setSecond(Re,J.getSecond(Oe)),Re}var Ee=ce("date","time");function Le(J){var ge=J.prefixCls,Oe=J.operationRef,Re=J.generateConfig,qe=J.value,Ue=J.defaultValue,Je=J.disabledTime,dt=J.showTime,wt=J.onSelect,Tt="".concat(ge,"-datetime-panel"),Be=M.useState(null),ft=Object(K.a)(Be,2),et=ft[0],rt=ft[1],ht=M.useRef({}),_t=M.useRef({}),st=Object(m.a)(dt)==="object"?Object(D.a)({},dt):{};function Pt(an){var mn=Ee.indexOf(et)+an,hn=Ee[mn]||null;return hn}var Wt=function(mn){_t.current.onBlur&&_t.current.onBlur(mn),rt(null)};Oe.current={onKeyDown:function(mn){if(mn.which===c.a.TAB){var hn=Pt(mn.shiftKey?-1:1);return rt(hn),hn&&mn.preventDefault(),!0}if(et){var gt=et==="date"?ht:_t;return gt.current&>.current.onKeyDown&>.current.onKeyDown(mn),!0}return[c.a.LEFT,c.a.RIGHT,c.a.UP,c.a.DOWN].includes(mn.which)?(rt("date"),!0):!1},onBlur:Wt,onClose:Wt};var cn=function(mn,hn){var gt=mn;hn==="date"&&!qe&&st.defaultValue?(gt=Re.setHour(gt,Re.getHour(st.defaultValue)),gt=Re.setMinute(gt,Re.getMinute(st.defaultValue)),gt=Re.setSecond(gt,Re.getSecond(st.defaultValue))):hn==="time"&&!qe&&Ue&&(gt=Re.setYear(gt,Re.getYear(Ue)),gt=Re.setMonth(gt,Re.getMonth(Ue)),gt=Re.setDate(gt,Re.getDate(Ue))),wt&&wt(gt,"mouse")},On=Je?Je(qe||null):{};return M.createElement("div",{className:P()(Tt,Object(L.a)({},"".concat(Tt,"-active"),et))},M.createElement(me,Object.assign({},J,{operationRef:ht,active:et==="date",onSelect:function(mn){cn(_e(Re,mn,dt&&Object(m.a)(dt)==="object"?dt.defaultValue:null),"date")}})),M.createElement(G,Object.assign({},J,{format:void 0},st,On,{defaultValue:void 0,operationRef:_t,active:et==="time",onSelect:function(mn){cn(mn,"time")}})))}var at=Le;function Ct(J){var ge=J.prefixCls,Oe=J.generateConfig,Re=J.locale,qe=J.value,Ue="".concat(ge,"-cell"),Je=function(Be){return M.createElement("td",{key:"week",className:P()(Ue,"".concat(Ue,"-week"))},Oe.locale.getWeek(Re.locale,Be))},dt="".concat(ge,"-week-panel-row"),wt=function(Be){return P()(dt,Object(L.a)({},"".concat(dt,"-selected"),Ut(Oe,Re.locale,qe,Be)))};return M.createElement(me,Object.assign({},J,{panelName:"week",prefixColumn:Je,rowClassName:wt,keyboardConfig:{onLeftRight:null}}))}var Jt=Ct;function lt(J){var ge=J.prefixCls,Oe=J.generateConfig,Re=J.locale,qe=J.viewDate,Ue=J.onNextYear,Je=J.onPrevYear,dt=J.onYearClick,wt=M.useContext(s),Tt=wt.hideHeader;if(Tt)return null;var Be="".concat(ge,"-header");return M.createElement(i,Object.assign({},J,{prefixCls:Be,onSuperPrev:Je,onSuperNext:Ue}),M.createElement("button",{type:"button",onClick:dt,className:"".concat(ge,"-year-btn")},Oe.locale.format(Re.locale,qe,Re.yearFormat)))}var Un=lt,Cn=3,vn=4;function er(J){var ge=J.prefixCls,Oe=J.locale,Re=J.value,qe=J.viewDate,Ue=J.generateConfig,Je=J.monthCellRender,dt=M.useContext(ct),wt=dt.rangedValue,Tt=dt.hoverRangedValue,Be="".concat(ge,"-cell"),ft=bt({cellPrefixCls:Be,value:Re,generateConfig:Ue,rangedValue:wt,hoverRangedValue:Tt,isSameCell:function(st,Pt){return ze(Ue,st,Pt)},isInView:function(){return!0},offsetCell:function(st,Pt){return Ue.addMonth(st,Pt)}}),et=Oe.shortMonths||(Ue.locale.getShortMonths?Ue.locale.getShortMonths(Oe.locale):[]),rt=Ue.setMonth(qe,0),ht=Je?function(_t){return Je(_t,Oe)}:void 0;return M.createElement(de,Object.assign({},J,{rowNum:vn,colNum:Cn,baseDate:rt,getCellNode:ht,getCellText:function(st){return Oe.monthFormat?Ue.locale.format(Oe.locale,st,Oe.monthFormat):et[Ue.getMonth(st)]},getCellClassName:ft,getCellDate:Ue.addMonth,titleCell:function(st){return Ue.locale.format(Oe.locale,st,"YYYY-MM")}}))}var kn=er;function Yn(J){var ge=J.prefixCls,Oe=J.operationRef,Re=J.onViewDateChange,qe=J.generateConfig,Ue=J.value,Je=J.viewDate,dt=J.onPanelChange,wt=J.onSelect,Tt="".concat(ge,"-month-panel");Oe.current={onKeyDown:function(et){return y(et,{onLeftRight:function(ht){wt(qe.addMonth(Ue||Je,ht),"key")},onCtrlLeftRight:function(ht){wt(qe.addYear(Ue||Je,ht),"key")},onUpDown:function(ht){wt(qe.addMonth(Ue||Je,ht*Cn),"key")},onEnter:function(){dt("date",Ue||Je)}})}};var Be=function(et){var rt=qe.addYear(Je,et);Re(rt),dt(null,rt)};return M.createElement("div",{className:Tt},M.createElement(Un,Object.assign({},J,{prefixCls:ge,onPrevYear:function(){Be(-1)},onNextYear:function(){Be(1)},onYearClick:function(){dt("year",Je)}})),M.createElement(kn,Object.assign({},J,{prefixCls:ge,onSelect:function(et){wt(et,"mouse"),dt("date",et)}})))}var vr=Yn;function Mn(J){var ge=J.prefixCls,Oe=J.generateConfig,Re=J.locale,qe=J.viewDate,Ue=J.onNextYear,Je=J.onPrevYear,dt=J.onYearClick,wt=M.useContext(s),Tt=wt.hideHeader;if(Tt)return null;var Be="".concat(ge,"-header");return M.createElement(i,Object.assign({},J,{prefixCls:Be,onSuperPrev:Je,onSuperNext:Ue}),M.createElement("button",{type:"button",onClick:dt,className:"".concat(ge,"-year-btn")},Oe.locale.format(Re.locale,qe,Re.yearFormat)))}var Zn=Mn,dr=4,jt=1;function Ft(J){var ge=J.prefixCls,Oe=J.locale,Re=J.value,qe=J.viewDate,Ue=J.generateConfig,Je=M.useContext(ct),dt=Je.rangedValue,wt=Je.hoverRangedValue,Tt="".concat(ge,"-cell"),Be=bt({cellPrefixCls:Tt,value:Re,generateConfig:Ue,rangedValue:dt,hoverRangedValue:wt,isSameCell:function(rt,ht){return je(Ue,rt,ht)},isInView:function(){return!0},offsetCell:function(rt,ht){return Ue.addMonth(rt,ht*3)}}),ft=Ue.setDate(Ue.setMonth(qe,0),1);return M.createElement(de,Object.assign({},J,{rowNum:jt,colNum:dr,baseDate:ft,getCellText:function(rt){return Ue.locale.format(Oe.locale,rt,Oe.quarterFormat||"[Q]Q")},getCellClassName:Be,getCellDate:function(rt,ht){return Ue.addMonth(rt,ht*3)},titleCell:function(rt){return Ue.locale.format(Oe.locale,rt,"YYYY-[Q]Q")}}))}var zt=Ft;function dn(J){var ge=J.prefixCls,Oe=J.operationRef,Re=J.onViewDateChange,qe=J.generateConfig,Ue=J.value,Je=J.viewDate,dt=J.onPanelChange,wt=J.onSelect,Tt="".concat(ge,"-quarter-panel");Oe.current={onKeyDown:function(et){return y(et,{onLeftRight:function(ht){wt(qe.addMonth(Ue||Je,ht*3),"key")},onCtrlLeftRight:function(ht){wt(qe.addYear(Ue||Je,ht),"key")},onUpDown:function(ht){wt(qe.addYear(Ue||Je,ht),"key")}})}};var Be=function(et){var rt=qe.addYear(Je,et);Re(rt),dt(null,rt)};return M.createElement("div",{className:Tt},M.createElement(Zn,Object.assign({},J,{prefixCls:ge,onPrevYear:function(){Be(-1)},onNextYear:function(){Be(1)},onYearClick:function(){dt("year",Je)}})),M.createElement(zt,Object.assign({},J,{prefixCls:ge,onSelect:function(et){wt(et,"mouse")}})))}var yn=dn;function bn(J){var ge=J.prefixCls,Oe=J.generateConfig,Re=J.viewDate,qe=J.onPrevDecade,Ue=J.onNextDecade,Je=J.onDecadeClick,dt=M.useContext(s),wt=dt.hideHeader;if(wt)return null;var Tt="".concat(ge,"-header"),Be=Oe.getYear(Re),ft=Math.floor(Be/Sn)*Sn,et=ft+Sn-1;return M.createElement(i,Object.assign({},J,{prefixCls:Tt,onSuperPrev:qe,onSuperNext:Ue}),M.createElement("button",{type:"button",onClick:Je,className:"".concat(ge,"-decade-btn")},ft,"-",et))}var _r=bn,Bn=3,Qt=4;function Hn(J){var ge=J.prefixCls,Oe=J.value,Re=J.viewDate,qe=J.locale,Ue=J.generateConfig,Je=M.useContext(ct),dt=Je.rangedValue,wt=Je.hoverRangedValue,Tt="".concat(ge,"-cell"),Be=Ue.getYear(Re),ft=Math.floor(Be/Sn)*Sn,et=ft+Sn-1,rt=Ue.setYear(Re,ft-Math.ceil((Bn*Qt-Sn)/2)),ht=function(Pt){var Wt=Ue.getYear(Pt);return ft<=Wt&&Wt<=et},_t=bt({cellPrefixCls:Tt,value:Oe,generateConfig:Ue,rangedValue:dt,hoverRangedValue:wt,isSameCell:function(Pt,Wt){return le(Ue,Pt,Wt)},isInView:ht,offsetCell:function(Pt,Wt){return Ue.addYear(Pt,Wt)}});return M.createElement(de,Object.assign({},J,{rowNum:Qt,colNum:Bn,baseDate:rt,getCellText:Ue.getYear,getCellClassName:_t,getCellDate:Ue.addYear,titleCell:function(Pt){return Ue.locale.format(qe.locale,Pt,"YYYY")}}))}var lr=Hn,Sn=10;function zn(J){var ge=J.prefixCls,Oe=J.operationRef,Re=J.onViewDateChange,qe=J.generateConfig,Ue=J.value,Je=J.viewDate,dt=J.sourceMode,wt=J.onSelect,Tt=J.onPanelChange,Be="".concat(ge,"-year-panel");Oe.current={onKeyDown:function(rt){return y(rt,{onLeftRight:function(_t){wt(qe.addYear(Ue||Je,_t),"key")},onCtrlLeftRight:function(_t){wt(qe.addYear(Ue||Je,_t*Sn),"key")},onUpDown:function(_t){wt(qe.addYear(Ue||Je,_t*Bn),"key")},onEnter:function(){Tt(dt==="date"?"date":"month",Ue||Je)}})}};var ft=function(rt){var ht=qe.addYear(Je,rt*10);Re(ht),Tt(null,ht)};return M.createElement("div",{className:Be},M.createElement(_r,Object.assign({},J,{prefixCls:ge,onPrevDecade:function(){ft(-1)},onNextDecade:function(){ft(1)},onDecadeClick:function(){Tt("decade",Je)}})),M.createElement(lr,Object.assign({},J,{prefixCls:ge,onSelect:function(rt){Tt(dt==="date"?"date":"month",rt),wt(rt,"mouse")}})))}var tr=zn;function Gr(J){var ge=J.prefixCls,Oe=J.generateConfig,Re=J.viewDate,qe=J.onPrevDecades,Ue=J.onNextDecades,Je=M.useContext(s),dt=Je.hideHeader;if(dt)return null;var wt="".concat(ge,"-header"),Tt=Oe.getYear(Re),Be=Math.floor(Tt/Yr)*Yr,ft=Be+Yr-1;return M.createElement(i,Object.assign({},J,{prefixCls:wt,onSuperPrev:qe,onSuperNext:Ue}),Be,"-",ft)}var Ar=Gr,Yt=3,Vn=4;function vi(J){var ge=ai-1,Oe=J.prefixCls,Re=J.viewDate,qe=J.generateConfig,Ue=J.disabledDate,Je="".concat(Oe,"-cell"),dt=qe.getYear(Re),wt=Math.floor(dt/ai)*ai,Tt=Math.floor(dt/Yr)*Yr,Be=Tt+Yr-1,ft=qe.setYear(Re,Tt-Math.ceil((Yt*Vn*ai-Yr)/2)),et=function(ht){var _t,st=Ue&&Ue(ht),Pt=qe.getYear(ht),Wt=Pt+ge;return _t={},Object(L.a)(_t,"".concat(Je,"-disabled"),st),Object(L.a)(_t,"".concat(Je,"-in-view"),Tt<=Pt&&Wt<=Be),Object(L.a)(_t,"".concat(Je,"-selected"),Pt===wt),_t};return M.createElement(de,Object.assign({},J,{rowNum:Vn,colNum:Yt,baseDate:ft,getCellText:function(ht){var _t=qe.getYear(ht);return"".concat(_t,"-").concat(_t+ge)},getCellClassName:et,getCellDate:function(ht,_t){return qe.addYear(ht,_t*ai)}}))}var Pi=vi,ai=10,Yr=ai*10;function Lr(J){var ge=J.prefixCls,Oe=J.onViewDateChange,Re=J.generateConfig,qe=J.viewDate,Ue=J.operationRef,Je=J.onSelect,dt=J.onPanelChange,wt="".concat(ge,"-decade-panel");Ue.current={onKeyDown:function(et){return y(et,{onLeftRight:function(ht){Je(Re.addYear(qe,ht*ai),"key")},onCtrlLeftRight:function(ht){Je(Re.addYear(qe,ht*Yr),"key")},onUpDown:function(ht){Je(Re.addYear(qe,ht*ai*Yt),"key")},onEnter:function(){dt("year",qe)}})}};var Tt=function(et){var rt=Re.addYear(qe,et*Yr);Oe(rt),dt(null,rt)},Be=function(et){Je(et,"mouse"),dt("year",et)};return M.createElement("div",{className:wt},M.createElement(Ar,Object.assign({},J,{prefixCls:ge,onPrevDecades:function(){Tt(-1)},onNextDecades:function(){Tt(1)}})),M.createElement(Pi,Object.assign({},J,{prefixCls:ge,onSelect:Be})))}var Fn=Lr;function pi(J,ge,Oe){return Oe?M.createElement("div",{className:"".concat(J,"-footer-extra")},Oe(ge)):null}function Zt(J){var ge=J.prefixCls,Oe=J.rangeList,Re=Oe===void 0?[]:Oe,qe=J.components,Ue=qe===void 0?{}:qe,Je=J.needConfirmButton,dt=J.onNow,wt=J.onOk,Tt=J.okDisabled,Be=J.showNow,ft=J.locale,et,rt;if(Re.length){var ht=Ue.rangeItem||"span";et=M.createElement(M.Fragment,null,Re.map(function(st){var Pt=st.label,Wt=st.onClick,cn=st.onMouseEnter,On=st.onMouseLeave;return M.createElement("li",{key:Pt,className:"".concat(ge,"-preset")},M.createElement(ht,{onClick:Wt,onMouseEnter:cn,onMouseLeave:On},Pt))}))}if(Je){var _t=Ue.button||"button";dt&&!et&&Be!==!1&&(et=M.createElement("li",{className:"".concat(ge,"-now")},M.createElement("a",{className:"".concat(ge,"-now-btn"),onClick:dt},ft.now))),rt=Je&&M.createElement("li",{className:"".concat(ge,"-ok")},M.createElement(_t,{disabled:Tt,onClick:wt},ft.ok))}return!et&&!rt?null:M.createElement("ul",{className:"".concat(ge,"-ranges")},et,rt)}function qr(J){var ge,Oe=J.prefixCls,Re=Oe===void 0?"rc-picker":Oe,qe=J.className,Ue=J.style,Je=J.locale,dt=J.generateConfig,wt=J.value,Tt=J.defaultValue,Be=J.pickerValue,ft=J.defaultPickerValue,et=J.disabledDate,rt=J.mode,ht=J.picker,_t=ht===void 0?"date":ht,st=J.tabIndex,Pt=st===void 0?0:st,Wt=J.showNow,cn=J.showTime,On=J.showToday,an=J.renderExtraFooter,mn=J.hideHeader,hn=J.onSelect,gt=J.onChange,Kt=J.onPanelChange,St=J.onMouseDown,pt=J.onPickerValueChange,gn=J.onOk,on=J.components,Dt=J.direction,it=J.hourStep,_n=it===void 0?1:it,Gt=J.minuteStep,In=Gt===void 0?1:Gt,kt=J.secondStep,sn=kt===void 0?1:kt,En=_t==="date"&&!!cn||_t==="time",$t=24%_n===0,sr=60%In===0,un=60%sn===0,nn=M.useContext(s),mt=nn.operationRef,Xe=nn.panelRef,Et=nn.onSelect,vt=nn.hideRanges,Ht=nn.defaultOpenValue,Rn=M.useContext(ct),pn=Rn.inRange,Gn=Rn.panelPosition,jn=Rn.rangedValue,mr=Rn.hoverRangedValue,rr=M.useRef({}),ur=M.useRef(!0),Hr=Object(p.a)(null,{value:wt,defaultValue:Tt,postState:function(Rt){return!Rt&&Ht&&_t==="time"?Ht:Rt}}),Nr=Object(K.a)(Hr,2),Fr=Nr[0],si=Nr[1],li=Object(p.a)(null,{value:Be,defaultValue:ft||Fr,postState:function(Rt){return Rt||dt.getNow()}}),Te=Object(K.a)(li,2),Ne=Te[0],Ge=Te[1],Ae=function(Rt){Ge(Rt),pt&&pt(Rt)},ue=function(Rt){var At=F[_t];return At?At(Rt):Rt},ye=Object(p.a)(function(){return _t==="time"?"time":ue("date")},{value:rt}),fe=Object(K.a)(ye,2),De=fe[0],Pe=fe[1];M.useEffect(function(){Pe(_t)},[_t]);var $e=M.useState(function(){return De}),Me=Object(K.a)($e,2),nt=Me[0],xt=Me[1],It=function(Rt,At){var nr=ue(Rt||De);xt(De),Pe(nr),Kt&&(De!==nr||Qe(dt,Ne,Ne))&&Kt(At,nr)},Vt=function(Rt,At){var nr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(De===_t||nr)&&(si(Rt),hn&&hn(Rt),Et&&Et(Rt,At),gt&&!Qe(dt,Rt,Fr)&>(Rt))},xn=function(Rt){return rr.current&&rr.current.onKeyDown?([c.a.LEFT,c.a.RIGHT,c.a.UP,c.a.DOWN,c.a.PAGE_UP,c.a.PAGE_DOWN,c.a.ENTER].includes(Rt.which)&&Rt.preventDefault(),rr.current.onKeyDown(Rt)):(Object(x.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)},An=function(Rt){rr.current&&rr.current.onBlur&&rr.current.onBlur(Rt)};mt&&Gn!=="right"&&(mt.current={onKeyDown:xn,onClose:function(){rr.current&&rr.current.onClose&&rr.current.onClose()}}),M.useEffect(function(){wt&&!ur.current&&Ge(wt)},[wt]),M.useEffect(function(){ur.current=!1},[]);var qn,$n=Object(D.a)(Object(D.a)({},J),{},{operationRef:rr,prefixCls:Re,viewDate:Ne,value:Fr,onViewDateChange:Ae,sourceMode:nt,onPanelChange:It,disabledDate:De!=="decade"?et:void 0});delete $n.onChange,delete $n.onSelect;switch(De){case"decade":qn=M.createElement(Fn,Object.assign({},$n,{onSelect:function(Rt,At){Ae(Rt),Vt(Rt,At)}}));break;case"year":qn=M.createElement(tr,Object.assign({},$n,{onSelect:function(Rt,At){Ae(Rt),Vt(Rt,At)}}));break;case"month":qn=M.createElement(vr,Object.assign({},$n,{onSelect:function(Rt,At){Ae(Rt),Vt(Rt,At)}}));break;case"quarter":qn=M.createElement(yn,Object.assign({},$n,{onSelect:function(Rt,At){Ae(Rt),Vt(Rt,At)}}));break;case"week":qn=M.createElement(Jt,Object.assign({},$n,{onSelect:function(Rt,At){Ae(Rt),Vt(Rt,At)}}));break;case"time":delete $n.showTime,qn=M.createElement(G,Object.assign({},$n,Object(m.a)(cn)==="object"?cn:null,{onSelect:function(Rt,At){Ae(Rt),Vt(Rt,At)}}));break;default:cn?qn=M.createElement(at,Object.assign({},$n,{onSelect:function(Rt,At){Ae(Rt),Vt(Rt,At)}})):qn=M.createElement(me,Object.assign({},$n,{onSelect:function(Rt,At){Ae(Rt),Vt(Rt,At)}}))}var cr,gr,ir=function(){var Rt=dt.getNow(),At=Ye(dt.getHour(Rt),dt.getMinute(Rt),dt.getSecond(Rt),$t?_n:1,sr?In:1,un?sn:1),nr=Ve(dt,Rt,At[0],At[1],At[2]);Vt(nr,"submit")};vt||(cr=pi(Re,De,an),gr=Zt({prefixCls:Re,components:on,needConfirmButton:En,okDisabled:!Fr||et&&et(Fr),locale:Je,showNow:Wt,onNow:En&&ir,onOk:function(){Fr&&(Vt(Fr,"submit",!0),gn&&gn(Fr))}}));var hr;if(On&&De==="date"&&_t==="date"&&!cn){var Er=dt.getNow(),Xt="".concat(Re,"-today-btn"),Mt=et&&et(Er);hr=M.createElement("a",{className:P()(Xt,Mt&&"".concat(Xt,"-disabled")),"aria-disabled":Mt,onClick:function(){Mt||Vt(Er,"mouse",!0)}},Je.today)}return M.createElement(s.Provider,{value:Object(D.a)(Object(D.a)({},nn),{},{hideHeader:"hideHeader"in J?mn:nn.hideHeader,hidePrevBtn:pn&&Gn==="right",hideNextBtn:pn&&Gn==="left"})},M.createElement("div",{tabIndex:Pt,className:P()("".concat(Re,"-panel"),qe,(ge={},Object(L.a)(ge,"".concat(Re,"-panel-has-range"),jn&&jn[0]&&jn[1]),Object(L.a)(ge,"".concat(Re,"-panel-has-range-hover"),mr&&mr[0]&&mr[1]),Object(L.a)(ge,"".concat(Re,"-panel-rtl"),Dt==="rtl"),ge)),style:Ue,onKeyDown:xn,onBlur:An,onMouseDown:St,ref:Xe},qn,cr||gr||hr?M.createElement("div",{className:"".concat(Re,"-footer")},cr,gr,hr):null))}var zr=qr,xi=k("uciX"),mi={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}};function ni(J){var ge,Oe=J.prefixCls,Re=J.popupElement,qe=J.popupStyle,Ue=J.visible,Je=J.dropdownClassName,dt=J.dropdownAlign,wt=J.transitionName,Tt=J.getPopupContainer,Be=J.children,ft=J.range,et=J.popupPlacement,rt=J.direction,ht="".concat(Oe,"-dropdown"),_t=function(){return et!==void 0?et:rt==="rtl"?"bottomRight":"bottomLeft"};return M.createElement(xi.a,{showAction:[],hideAction:[],popupPlacement:_t(),builtinPlacements:mi,prefixCls:ht,popupTransitionName:wt,popup:Re,popupAlign:dt,popupVisible:Ue,popupClassName:P()(Je,(ge={},Object(L.a)(ge,"".concat(ht,"-range"),ft),Object(L.a)(ge,"".concat(ht,"-rtl"),rt==="rtl"),ge)),popupStyle:qe,getPopupContainer:Tt},Be)}var Bi=ni;function Hi(J){var ge=J.open,Oe=J.value,Re=J.isClickOutside,qe=J.triggerOpen,Ue=J.forwardKeyDown,Je=J.blurToCancel,dt=J.onSubmit,wt=J.onCancel,Tt=J.onFocus,Be=J.onBlur,ft=Object(M.useState)(!1),et=Object(K.a)(ft,2),rt=et[0],ht=et[1],_t=Object(M.useState)(!1),st=Object(K.a)(_t,2),Pt=st[0],Wt=st[1],cn=Object(M.useRef)(!1),On=Object(M.useRef)(!1),an={onMouseDown:function(){ht(!0),qe(!0)},onKeyDown:function(hn){switch(hn.which){case c.a.ENTER:{ge?dt()!==!1&&ht(!0):qe(!0),hn.preventDefault();return}case c.a.TAB:{rt&&ge&&!hn.shiftKey?(ht(!1),hn.preventDefault()):!rt&&ge&&(!Ue(hn)&&hn.shiftKey&&(ht(!0),hn.preventDefault()));return}case c.a.ESC:{ht(!0),wt();return}}!ge&&![c.a.SHIFT].includes(hn.which)?qe(!0):rt||Ue(hn)},onFocus:function(hn){ht(!0),Wt(!0),Tt&&Tt(hn)},onBlur:function(hn){if(cn.current||!Re(document.activeElement)){cn.current=!1;return}Je?setTimeout(function(){Re(document.activeElement)&&wt()},0):ge&&(qe(!1),On.current&&dt()),Wt(!1),Be&&Be(hn)}};return Object(M.useEffect)(function(){On.current=!1},[ge]),Object(M.useEffect)(function(){On.current=!0},[Oe]),Object(M.useEffect)(function(){return g(function(mn){var hn=mn.target;ge&&(Re(hn)?Pt||qe(!1):(cn.current=!0,requestAnimationFrame(function(){cn.current=!1})))})}),[an,{focused:Pt,typing:rt}]}function ri(J){var ge=J.valueTexts,Oe=J.onTextChange,Re=M.useState(""),qe=Object(K.a)(Re,2),Ue=qe[0],Je=qe[1],dt=M.useRef([]);dt.current=ge;function wt(Be){Je(Be),Oe(Be)}function Tt(){Je(dt.current[0])}return M.useEffect(function(){ge.every(function(Be){return Be!==Ue})&&Tt()},[ge.join("||")]),[Ue,wt,Tt]}var wr=k("Gytx"),Si=k.n(wr);function Oi(J,ge){var Oe=ge.formatList,Re=ge.generateConfig,qe=ge.locale;return Object(C.a)(function(){if(!J)return[[""],""];for(var Ue="",Je=[],dt=0;dt<Oe.length;dt+=1){var wt=Oe[dt],Tt=Re.locale.format(qe.locale,J,wt);Je.push(Tt),dt===0&&(Ue=Tt)}return[Je,Ue]},[J,Oe],function(Ue,Je){return Ue[0]!==Je[0]||!Si()(Ue[1],Je[1])})}function ci(J,ge){var Oe=ge.formatList,Re=ge.generateConfig,qe=ge.locale,Ue=Object(M.useState)(null),Je=Object(K.a)(Ue,2),dt=Je[0],wt=Je[1],Tt=Object(M.useRef)(null);function Be(st){var Pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(Tt.current),Pt){wt(st);return}Tt.current=requestAnimationFrame(function(){wt(st)})}var ft=Oi(dt,{formatList:Oe,generateConfig:Re,locale:qe}),et=Object(K.a)(ft,2),rt=et[1];function ht(st){Be(st)}function _t(){var st=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Be(null,st)}return Object(M.useEffect)(function(){_t(!0)},[J]),Object(M.useEffect)(function(){return function(){return cancelAnimationFrame(Tt.current)}},[]),[rt,ht,_t]}function _i(J){var ge,Oe=J.prefixCls,Re=Oe===void 0?"rc-picker":Oe,qe=J.id,Ue=J.tabIndex,Je=J.style,dt=J.className,wt=J.dropdownClassName,Tt=J.dropdownAlign,Be=J.popupStyle,ft=J.transitionName,et=J.generateConfig,rt=J.locale,ht=J.inputReadOnly,_t=J.allowClear,st=J.autoFocus,Pt=J.showTime,Wt=J.picker,cn=Wt===void 0?"date":Wt,On=J.format,an=J.use12Hours,mn=J.value,hn=J.defaultValue,gt=J.open,Kt=J.defaultOpen,St=J.defaultOpenValue,pt=J.suffixIcon,gn=J.clearIcon,on=J.disabled,Dt=J.disabledDate,it=J.placeholder,_n=J.getPopupContainer,Gt=J.pickerRef,In=J.panelRender,kt=J.onChange,sn=J.onOpenChange,En=J.onFocus,$t=J.onBlur,sr=J.onMouseDown,un=J.onMouseUp,nn=J.onMouseEnter,mt=J.onMouseLeave,Xe=J.onContextMenu,Et=J.onClick,vt=J.direction,Ht=J.autoComplete,Rn=Ht===void 0?"off":Ht,pn=M.useRef(null),Gn=cn==="date"&&!!Pt||cn==="time",jn=be(E(On,cn,Pt,an)),mr=M.useRef(null),rr=M.useRef(null),ur=Object(p.a)(null,{value:mn,defaultValue:hn}),Hr=Object(K.a)(ur,2),Nr=Hr[0],Fr=Hr[1],si=M.useState(Nr),li=Object(K.a)(si,2),Te=li[0],Ne=li[1],Ge=M.useRef(null),Ae=Object(p.a)(!1,{value:gt,defaultValue:Kt,postState:function(ar){return on?!1:ar},onChange:function(ar){sn&&sn(ar),!ar&&Ge.current&&Ge.current.onClose&&Ge.current.onClose()}}),ue=Object(K.a)(Ae,2),ye=ue[0],fe=ue[1],De=Oi(Te,{formatList:jn,generateConfig:et,locale:rt}),Pe=Object(K.a)(De,2),$e=Pe[0],Me=Pe[1],nt=ri({valueTexts:$e,onTextChange:function(ar){var ui=et.locale.parse(rt.locale,ar,jn);ui&&(!Dt||!Dt(ui))&&Ne(ui)}}),xt=Object(K.a)(nt,3),It=xt[0],Vt=xt[1],xn=xt[2],An=function(ar){Ne(ar),Fr(ar),kt&&!Qe(et,Nr,ar)&&kt(ar,ar?et.locale.format(rt.locale,ar,jn[0]):"")},qn=function(ar){if(on&&ar)return;fe(ar)},$n=function(ar){return ye&&Ge.current&&Ge.current.onKeyDown?Ge.current.onKeyDown(ar):(Object(x.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},cr=function(){un&&un.apply(void 0,arguments),pn.current&&(pn.current.focus(),qn(!0))},gr=Hi({blurToCancel:Gn,open:ye,value:It,triggerOpen:qn,forwardKeyDown:$n,isClickOutside:function(ar){return!U([mr.current,rr.current],ar)},onSubmit:function(){return Dt&&Dt(Te)?!1:(An(Te),qn(!1),xn(),!0)},onCancel:function(){qn(!1),Ne(Nr),xn()},onFocus:En,onBlur:$t}),ir=Object(K.a)(gr,2),hr=ir[0],Er=ir[1],Xt=Er.focused,Mt=Er.typing;M.useEffect(function(){ye||(Ne(Nr),!$e.length||$e[0]===""?Vt(""):Me!==It&&xn())},[ye,$e]),M.useEffect(function(){ye||xn()},[cn]),M.useEffect(function(){Ne(Nr)},[Nr]),Gt&&(Gt.current={focus:function(){pn.current&&pn.current.focus()},blur:function(){pn.current&&pn.current.blur()}});var en=Object(D.a)(Object(D.a)({},J),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0}),Rt=M.createElement(zr,Object.assign({},en,{generateConfig:et,className:P()(Object(L.a)({},"".concat(Re,"-panel-focused"),!Mt)),value:Te,locale:rt,tabIndex:-1,onChange:Ne,direction:vt}));In&&(Rt=In(Rt));var At=M.createElement("div",{className:"".concat(Re,"-panel-container"),onMouseDown:function(ar){ar.preventDefault()}},Rt),nr;pt&&(nr=M.createElement("span",{className:"".concat(Re,"-suffix")},pt));var xr;_t&&Nr&&!on&&(xr=M.createElement("span",{onMouseDown:function(ar){ar.preventDefault(),ar.stopPropagation()},onMouseUp:function(ar){ar.preventDefault(),ar.stopPropagation(),An(null),qn(!1)},className:"".concat(Re,"-clear")},gn||M.createElement("span",{className:"".concat(Re,"-clear-btn")})));var Wn=function(ar,ui){(ui==="submit"||ui!=="key"&&!Gn)&&(An(ar),qn(!1))},Sr=vt==="rtl"?"bottomRight":"bottomLeft",Xr=ci(It,{formatList:jn,generateConfig:et,locale:rt}),Or=Object(K.a)(Xr,3),Ur=Or[0],Mr=Or[1],Pr=Or[2];return M.createElement(s.Provider,{value:{operationRef:Ge,hideHeader:cn==="time",panelRef:mr,onSelect:Wn,open:ye,defaultOpenValue:St,onDateMouseEnter:Mr,onDateMouseLeave:Pr}},M.createElement(Bi,{visible:ye,popupElement:At,popupStyle:Be,prefixCls:Re,dropdownClassName:wt,dropdownAlign:Tt,getPopupContainer:_n,transitionName:ft,popupPlacement:Sr,direction:vt},M.createElement("div",{className:P()(Re,dt,(ge={},Object(L.a)(ge,"".concat(Re,"-disabled"),on),Object(L.a)(ge,"".concat(Re,"-focused"),Xt),Object(L.a)(ge,"".concat(Re,"-rtl"),vt==="rtl"),ge)),style:Je,onMouseDown:sr,onMouseUp:cr,onMouseEnter:nn,onMouseLeave:mt,onContextMenu:Xe,onClick:Et},M.createElement("div",{className:P()("".concat(Re,"-input"),Object(L.a)({},"".concat(Re,"-input-placeholder"),!!Ur)),ref:rr},M.createElement("input",Object.assign({id:qe,tabIndex:Ue,disabled:on,readOnly:ht||!Mt,value:Ur||It,onChange:function(ar){Vt(ar.target.value)},autoFocus:st,placeholder:it,ref:pn,title:It},hr,{size:f(cn,jn[0])},Ze(J),{autoComplete:Rn})),nr,xr))))}var oa=function(J){Object(I.a)(Oe,J);var ge=Object(z.a)(Oe);function Oe(){var Re;return Object(ne.a)(this,Oe),Re=ge.apply(this,arguments),Re.pickerRef=M.createRef(),Re.focus=function(){Re.pickerRef.current&&Re.pickerRef.current.focus()},Re.blur=function(){Re.pickerRef.current&&Re.pickerRef.current.blur()},Re}return Object(V.a)(Oe,[{key:"render",value:function(){return M.createElement(_i,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Oe}(M.Component),$i=oa;function yr(J,ge,Oe){var Re=J.picker,qe=J.locale,Ue=J.selectedValue,Je=J.disabledDate,dt=J.disabled,wt=J.generateConfig,Tt=Ce(Ue,0),Be=Ce(Ue,1);function ft(st){var Pt=wt.getYear(st),Wt=wt.locale.getWeek(qe.locale,st);return Pt*100+Wt}function et(st){var Pt=wt.getYear(st),Wt=wt.getMonth(st);return Pt*100+Wt}function rt(st){var Pt=wt.getYear(st),Wt=Se(wt,st);return Pt*10+Wt}var ht=M.useCallback(function(st){if(Je&&Je(st))return!0;if(dt[1]&&Be)return!yt(wt,st,Be)&&wt.isAfter(st,Be);if(ge&&Be)switch(Re){case"quarter":return rt(st)>rt(Be);case"month":return et(st)>et(Be);case"week":return ft(st)>ft(Be);default:return!yt(wt,st,Be)&&wt.isAfter(st,Be)}return!1},[Je,dt[1],Be,ge]),_t=M.useCallback(function(st){if(Je&&Je(st))return!0;if(dt[0]&&Tt)return!yt(wt,st,Be)&&wt.isAfter(Tt,st);if(Oe&&Tt)switch(Re){case"quarter":return rt(st)<rt(Tt);case"month":return et(st)<et(Tt);case"week":return ft(st)<ft(Tt);default:return!yt(wt,st,Tt)&&wt.isAfter(Tt,st)}return!1},[Je,dt[0],Tt,Oe]);return[ht,_t]}function br(J,ge,Oe,Re){var qe=Ke(J,Oe,Re,1);function Ue(Je){return Je(J,ge)?"same":Je(qe,ge)?"closing":"far"}switch(Oe){case"year":return Ue(function(Je,dt){return tt(Re,Je,dt)});case"quarter":case"month":return Ue(function(Je,dt){return le(Re,Je,dt)});default:return Ue(function(Je,dt){return ze(Re,Je,dt)})}}function oi(J,ge,Oe,Re){var qe=Ce(J,0),Ue=Ce(J,1);if(ge===0)return qe;if(qe&&Ue){var Je=br(qe,Ue,Oe,Re);switch(Je){case"same":return qe;case"closing":return qe;default:return Ke(Ue,Oe,Re,-1)}}return qe}function kr(J){var ge=J.values,Oe=J.picker,Re=J.defaultDates,qe=J.generateConfig,Ue=M.useState(function(){return[Ce(Re,0),Ce(Re,1)]}),Je=Object(K.a)(Ue,2),dt=Je[0],wt=Je[1],Tt=M.useState(null),Be=Object(K.a)(Tt,2),ft=Be[0],et=Be[1],rt=Ce(ge,0),ht=Ce(ge,1);function _t(Pt){return dt[Pt]?dt[Pt]:Ce(ft,Pt)||oi(ge,Pt,Oe,qe)||rt||ht||qe.getNow()}function st(Pt,Wt){if(Pt){var cn=We(ft,Pt,Wt);wt(We(dt,null,Wt)||[null,null]);var On=(Wt+1)%2;Ce(ge,On)||(cn=We(cn,Pt,On)),et(cn)}else(rt||ht)&&et(null)}return[_t,st]}function Tn(J,ge){return J&&J[0]&&J[1]&&ge.isAfter(J[0],J[1])?[J[1],J[0]]:J}function qt(J,ge,Oe,Re){return J||Re&&Re[ge]?!0:!!Oe[(ge+1)%2]}function fn(J){var ge,Oe,Re,qe=J.prefixCls,Ue=qe===void 0?"rc-picker":qe,Je=J.id,dt=J.style,wt=J.className,Tt=J.popupStyle,Be=J.dropdownClassName,ft=J.transitionName,et=J.dropdownAlign,rt=J.getPopupContainer,ht=J.generateConfig,_t=J.locale,st=J.placeholder,Pt=J.autoFocus,Wt=J.disabled,cn=J.format,On=J.picker,an=On===void 0?"date":On,mn=J.showTime,hn=J.use12Hours,gt=J.separator,Kt=gt===void 0?"~":gt,St=J.value,pt=J.defaultValue,gn=J.defaultPickerValue,on=J.open,Dt=J.defaultOpen,it=J.disabledDate,_n=J.disabledTime,Gt=J.dateRender,In=J.panelRender,kt=J.ranges,sn=J.allowEmpty,En=J.allowClear,$t=J.suffixIcon,sr=J.clearIcon,un=J.pickerRef,nn=J.inputReadOnly,mt=J.mode,Xe=J.renderExtraFooter,Et=J.onChange,vt=J.onOpenChange,Ht=J.onPanelChange,Rn=J.onCalendarChange,pn=J.onFocus,Gn=J.onBlur,jn=J.onOk,mr=J.components,rr=J.order,ur=J.direction,Hr=J.activePickerIndex,Nr=J.autoComplete,Fr=Nr===void 0?"off":Nr,si=an==="date"&&!!mn||an==="time",li=Object(M.useRef)({}),Te=Object(M.useRef)(null),Ne=Object(M.useRef)(null),Ge=Object(M.useRef)(null),Ae=Object(M.useRef)(null),ue=Object(M.useRef)(null),ye=Object(M.useRef)(null),fe=Object(M.useRef)(null),De=be(E(cn,an,mn,hn)),Pe=Object(p.a)(0,{value:Hr}),$e=Object(K.a)(Pe,2),Me=$e[0],nt=$e[1],xt=Object(M.useRef)(null),It=M.useMemo(function(){return Array.isArray(Wt)?Wt:[Wt||!1,Wt||!1]},[Wt]),Vt=Object(p.a)(null,{value:St,defaultValue:pt,postState:function(Pn){return an==="time"&&!rr?Pn:Tn(Pn,ht)}}),xn=Object(K.a)(Vt,2),An=xn[0],qn=xn[1],$n=kr({values:An,picker:an,defaultDates:gn,generateConfig:ht}),cr=Object(K.a)($n,2),gr=cr[0],ir=cr[1],hr=Object(p.a)(An,{postState:function(Pn){var Jn=Pn;if(It[0]&&It[1])return Jn;for(var Tr=0;Tr<2;Tr+=1)It[Tr]&&!Ce(Jn,Tr)&&!Ce(sn,Tr)&&(Jn=We(Jn,ht.getNow(),Tr));return Jn}}),Er=Object(K.a)(hr,2),Xt=Er[0],Mt=Er[1],en=Object(p.a)([an,an],{value:mt}),Rt=Object(K.a)(en,2),At=Rt[0],nr=Rt[1];Object(M.useEffect)(function(){nr([an,an])},[an]);var xr=function(Pn,Jn){nr(Pn),Ht&&Ht(Jn,Pn)},Wn=yr({picker:an,selectedValue:Xt,locale:_t,disabled:It,disabledDate:it,generateConfig:ht},li.current[1],li.current[0]),Sr=Object(K.a)(Wn,2),Xr=Sr[0],Or=Sr[1],Ur=Object(p.a)(!1,{value:on,defaultValue:Dt,postState:function(Pn){return It[Me]?!1:Pn},onChange:function(Pn){vt&&vt(Pn),!Pn&&xt.current&&xt.current.onClose&&xt.current.onClose()}}),Mr=Object(K.a)(Ur,2),Pr=Mr[0],Dr=Mr[1],ar=Pr&&Me===0,ui=Pr&&Me===1,Ji=Object(M.useState)(0),Ii=Object(K.a)(Ji,2),wi=Ii[0],Jr=Ii[1];Object(M.useEffect)(function(){!Pr&&Te.current&&Jr(Te.current.offsetWidth)},[Pr]);var Wr=M.useRef();function Vr(pr,Pn){if(pr)clearTimeout(Wr.current),li.current[Pn]=!0,nt(Pn),Dr(pr),Pr||ir(null,Pn);else if(Me===Pn){Dr(pr);var Jn=li.current;Wr.current=setTimeout(function(){Jn===li.current&&(li.current={})})}}function Qr(pr){Vr(!0,pr),setTimeout(function(){var Pn=[ye,fe][pr];Pn.current&&Pn.current.focus()},0)}function Ni(pr,Pn){var Jn=pr,Tr=Ce(Jn,0),ei=Ce(Jn,1);Tr&&ei&&ht.isAfter(Tr,ei)&&(an==="week"&&!Ut(ht,_t.locale,Tr,ei)||an==="quarter"&&!je(ht,Tr,ei)||an!=="week"&&an!=="quarter"&&an!=="time"&&!yt(ht,Tr,ei)?(Pn===0?(Jn=[Tr,null],ei=null):(Tr=null,Jn=[null,ei]),li.current=Object(L.a)({},Pn,!0)):(an!=="time"||rr!==!1)&&(Jn=Tn(Jn,ht))),Mt(Jn);var ga=Jn&&Jn[0]?ht.locale.format(_t.locale,Jn[0],De[0]):"",ia=Jn&&Jn[1]?ht.locale.format(_t.locale,Jn[1],De[0]):"";if(Rn){var Ai={range:Pn===0?"start":"end"};Rn(Jn,[ga,ia],Ai)}var Yi=qt(Tr,0,It,sn),va=qt(ei,1,It,sn),Wa=Jn===null||Yi&&va;Wa&&(qn(Jn),Et&&(!Qe(ht,Ce(An,0),Tr)||!Qe(ht,Ce(An,1),ei))&&Et(Jn,[ga,ia]));var Ti=null;Pn===0&&!It[1]?Ti=1:Pn===1&&!It[0]&&(Ti=0),Ti!==null&&Ti!==Me&&(!li.current[Ti]||!Ce(Jn,Ti))&&Ce(Jn,Pn)?Qr(Ti):Vr(!1,Pn)}var ha=function(Pn){return Pr&&xt.current&&xt.current.onKeyDown?xt.current.onKeyDown(Pn):(Object(x.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},sa={formatList:De,generateConfig:ht,locale:_t},Kr=Oi(Ce(Xt,0),sa),Qi=Object(K.a)(Kr,2),Zi=Qi[0],$r=Qi[1],Br=Oi(Ce(Xt,1),sa),yi=Object(K.a)(Br,2),ka=yi[0],no=yi[1],la=function(Pn,Jn){var Tr=ht.locale.parse(_t.locale,Pn,De),ei=Jn===0?Xr:Or;Tr&&!ei(Tr)&&(Mt(We(Xt,Tr,Jn)),ir(Tr,Jn))},Ta=ri({valueTexts:Zi,onTextChange:function(Pn){return la(Pn,0)}}),Ca=Object(K.a)(Ta,3),Sa=Ca[0],Ma=Ca[1],co=Ca[2],Ro=ri({valueTexts:ka,onTextChange:function(Pn){return la(Pn,1)}}),za=Object(K.a)(Ro,3),Oa=za[0],Va=za[1],_a=za[2],Ra=Object(M.useState)(null),ho=Object(K.a)(Ra,2),Ya=ho[0],Aa=ho[1],Da=Object(M.useState)(null),ya=Object(K.a)(Da,2),ki=ya[0],fa=ya[1],pa=ci(Sa,{formatList:De,generateConfig:ht,locale:_t}),ba=Object(K.a)(pa,3),ma=ba[0],Xa=ba[1],$a=ba[2],Ja=ci(Oa,{formatList:De,generateConfig:ht,locale:_t}),Ia=Object(K.a)(Ja,3),ua=Ia[0],Ea=Ia[1],ro=Ia[2],Ao=function(Pn){fa(We(Xt,Pn,Me)),Me===0?Xa(Pn):Ea(Pn)},Do=function(){fa(We(Xt,null,Me)),Me===0?$a():ro()},fo=function(Pn,Jn){return{blurToCancel:si,forwardKeyDown:ha,onBlur:Gn,isClickOutside:function(ei){return!U([Ne.current,Ge.current,Ae.current],ei)},onFocus:function(ei){nt(Pn),pn&&pn(ei)},triggerOpen:function(ei){Vr(ei,Pn)},onSubmit:function(){Ni(Xt,Pn),Jn()},onCancel:function(){Vr(!1,Pn),Mt(An),Jn()}}},io=Hi(Object(D.a)(Object(D.a)({},fo(0,co)),{},{open:ar,value:Sa})),po=Object(K.a)(io,2),Wi=po[0],di=po[1],Ri=di.focused,hi=di.typing,Na=Hi(Object(D.a)(Object(D.a)({},fo(1,_a)),{},{open:ui,value:Oa})),mo=Object(K.a)(Na,2),qi=mo[0],ao=mo[1],oo=ao.focused,so=ao.typing,xa=function(Pn){!Pr&&!ye.current.contains(Pn.target)&&!fe.current.contains(Pn.target)&&(It[0]?It[1]||Qr(1):Qr(0))},Qa=function(Pn){Pr&&(Ri||oo)&&!ye.current.contains(Pn.target)&&!fe.current.contains(Pn.target)&&Pn.preventDefault()},Ua=An&&An[0]?ht.locale.format(_t.locale,An[0],"YYYYMMDDHHmmss"):"",go=An&&An[1]?ht.locale.format(_t.locale,An[1],"YYYYMMDDHHmmss"):"";Object(M.useEffect)(function(){Pr||(Mt(An),!Zi.length||Zi[0]===""?Ma(""):$r!==Sa&&co(),!ka.length||ka[0]===""?Va(""):no!==Oa&&_a())},[Pr,Zi,ka]),Object(M.useEffect)(function(){Mt(An)},[Ua,go]),un&&(un.current={focus:function(){ye.current&&ye.current.focus()},blur:function(){ye.current&&ye.current.blur(),fe.current&&fe.current.blur()}});var Za=Object.keys(kt||{}),jr=Za.map(function(pr){var Pn=kt[pr],Jn=typeof Pn=="function"?Pn():Pn;return{label:pr,onClick:function(){Ni(Jn,null),Vr(!1,Me)},onMouseEnter:function(){Aa(Jn)},onMouseLeave:function(){Aa(null)}}});function Cr(){var pr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Pn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Jn=null;Pr&&ki&&ki[0]&&ki[1]&&ht.isAfter(ki[1],ki[0])&&(Jn=ki);var Tr=mn;if(mn&&Object(m.a)(mn)==="object"&&mn.defaultValue){var ei=mn.defaultValue;Tr=Object(D.a)(Object(D.a)({},mn),{},{defaultValue:Ce(ei,Me)||void 0})}var ga=null;return Gt&&(ga=function(Ai,Yi){return Gt(Ai,Yi,{range:Me?"end":"start"})}),M.createElement(ct.Provider,{value:{inRange:!0,panelPosition:pr,rangedValue:Ya||Xt,hoverRangedValue:Jn}},M.createElement(zr,Object.assign({},J,Pn,{dateRender:ga,showTime:Tr,mode:At[Me],generateConfig:ht,style:void 0,direction:ur,disabledDate:Me===0?Xr:Or,disabledTime:function(Ai){return _n?_n(Ai,Me===0?"start":"end"):!1},className:P()(Object(L.a)({},"".concat(Ue,"-panel-focused"),Me===0?!hi:!so)),value:Ce(Xt,Me),locale:_t,tabIndex:-1,onPanelChange:function(Ai,Yi){xr(We(At,Yi,Me),We(Xt,Ai,Me));var va=Ai;pr==="right"&&At[Me]===Yi&&(va=Ke(va,Yi,ht,-1)),ir(va,Me)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:void 0,defaultPickerValue:void 0})))}var ii=0,Ui=0;Me&&Ge.current&&ue.current&&Ne.current&&(ii=Ge.current.offsetWidth+ue.current.offsetWidth,Ne.current.offsetWidth&&ii>Ne.current.offsetWidth&&(Ui=ii));var La=ur==="rtl"?{right:ii}:{left:ii};function ca(){var pr,Pn=pi(Ue,At[Me],Xe),Jn=Zt({prefixCls:Ue,components:mr,needConfirmButton:si,okDisabled:!Ce(Xt,Me)||it&&it(Xt[Me]),locale:_t,rangeList:jr,onOk:function(){Ce(Xt,Me)&&(Ni(Xt,Me),jn&&jn(Xt))}});if(an!=="time"&&!mn){var Tr=gr(Me),ei=Ke(Tr,an,ht),ga=At[Me],ia=ga===an,Ai=Cr(ia?"left":!1,{pickerValue:Tr,onPickerValueChange:function(Ti){ir(Ti,Me)}}),Yi=Cr("right",{pickerValue:ei,onPickerValueChange:function(Ti){ir(Ke(Ti,an,ht,-1),Me)}});ur==="rtl"?pr=M.createElement(M.Fragment,null,Yi,ia&&Ai):pr=M.createElement(M.Fragment,null,Ai,ia&&Yi)}else pr=Cr();var va=M.createElement(M.Fragment,null,M.createElement("div",{className:"".concat(Ue,"-panels")},pr),(Pn||Jn)&&M.createElement("div",{className:"".concat(Ue,"-footer")},Pn,Jn));return In&&(va=In(va)),M.createElement("div",{className:"".concat(Ue,"-panel-container"),style:{marginLeft:Ui},ref:Ne,onMouseDown:function(Ti){Ti.preventDefault()}},va)}var ja=M.createElement("div",{className:P()("".concat(Ue,"-range-wrapper"),"".concat(Ue,"-").concat(an,"-range-wrapper")),style:{minWidth:wi}},M.createElement("div",{className:"".concat(Ue,"-range-arrow"),style:La}),ca()),da;$t&&(da=M.createElement("span",{className:"".concat(Ue,"-suffix")},$t));var bi;En&&(Ce(An,0)&&!It[0]||Ce(An,1)&&!It[1])&&(bi=M.createElement("span",{onMouseDown:function(Pn){Pn.preventDefault(),Pn.stopPropagation()},onMouseUp:function(Pn){Pn.preventDefault(),Pn.stopPropagation();var Jn=An;It[0]||(Jn=We(Jn,null,0)),It[1]||(Jn=We(Jn,null,1)),Ni(Jn,null),Vr(!1,Me)},className:"".concat(Ue,"-clear")},sr||M.createElement("span",{className:"".concat(Ue,"-clear-btn")})));var Fa={size:f(an,De[0])},Ba=0,Ha=0;Ge.current&&Ae.current&&ue.current&&(Me===0?Ha=Ge.current.offsetWidth:(Ba=ii,Ha=Ae.current.offsetWidth));var Ki=ur==="rtl"?{right:Ba}:{left:Ba},Ir=function(Pn,Jn){var Tr=We(Xt,Pn,Me);Jn==="submit"||Jn!=="key"&&!si?(Ni(Tr,Me),Me===0?$a():ro()):Mt(Tr)};return M.createElement(s.Provider,{value:{operationRef:xt,hideHeader:an==="time",onDateMouseEnter:Ao,onDateMouseLeave:Do,hideRanges:!0,onSelect:Ir,open:Pr}},M.createElement(Bi,{visible:Pr,popupElement:ja,popupStyle:Tt,prefixCls:Ue,dropdownClassName:Be,dropdownAlign:et,getPopupContainer:rt,transitionName:ft,range:!0,direction:ur},M.createElement("div",Object.assign({ref:Te,className:P()(Ue,"".concat(Ue,"-range"),wt,(ge={},Object(L.a)(ge,"".concat(Ue,"-disabled"),It[0]&&It[1]),Object(L.a)(ge,"".concat(Ue,"-focused"),Me===0?Ri:oo),Object(L.a)(ge,"".concat(Ue,"-rtl"),ur==="rtl"),ge)),style:dt,onClick:xa,onMouseDown:Qa},Ze(J)),M.createElement("div",{className:P()("".concat(Ue,"-input"),(Oe={},Object(L.a)(Oe,"".concat(Ue,"-input-active"),Me===0),Object(L.a)(Oe,"".concat(Ue,"-input-placeholder"),!!ma),Oe)),ref:Ge},M.createElement("input",Object.assign({id:Je,disabled:It[0],readOnly:nn||!hi,value:ma||Sa,onChange:function(Pn){Ma(Pn.target.value)},autoFocus:Pt,placeholder:Ce(st,0)||"",ref:ye},Wi,Fa,{autoComplete:Fr}))),M.createElement("div",{className:"".concat(Ue,"-range-separator"),ref:ue},Kt),M.createElement("div",{className:P()("".concat(Ue,"-input"),(Re={},Object(L.a)(Re,"".concat(Ue,"-input-active"),Me===1),Object(L.a)(Re,"".concat(Ue,"-input-placeholder"),!!ua),Re)),ref:Ae},M.createElement("input",Object.assign({disabled:It[1],readOnly:nn||!so,value:ua||Oa,onChange:function(Pn){Va(Pn.target.value)},placeholder:Ce(st,1)||"",ref:fe},qi,Fa,{autoComplete:Fr}))),M.createElement("div",{className:"".concat(Ue,"-active-bar"),style:Object(D.a)(Object(D.a)({},Ki),{},{width:Ha,position:"absolute"})}),da,bi)))}var tn=function(J){Object(I.a)(Oe,J);var ge=Object(z.a)(Oe);function Oe(){var Re;return Object(ne.a)(this,Oe),Re=ge.apply(this,arguments),Re.pickerRef=M.createRef(),Re.focus=function(){Re.pickerRef.current&&Re.pickerRef.current.focus()},Re.blur=function(){Re.pickerRef.current&&Re.pickerRef.current.blur()},Re}return Object(V.a)(Oe,[{key:"render",value:function(){return M.createElement(fn,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Oe}(M.Component),Xn=tn,Qn=ve.b=$i},osHv:function(Lt,ve,k){(function(ne){ne(k("VrN/"))})(function(ne){"use strict";var V=ne.Pos;function I(d,l){return d.line-l.line||d.ch-l.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",L=z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",D=new RegExp("<(/?)(["+z+"]["+L+"]*)","g");function K(d,l,i,n){this.line=l,this.ch=i,this.cm=d,this.text=d.getLine(l),this.min=n?Math.max(n.from,d.firstLine()):d.firstLine(),this.max=n?Math.min(n.to-1,d.lastLine()):d.lastLine()}function M(d,l){var i=d.cm.getTokenTypeAt(V(d.line,l));return i&&/\btag\b/.test(i)}function r(d){return d.line>=d.max?void 0:(d.ch=0,d.text=d.cm.getLine(++d.line),!0)}function P(d){return d.line<=d.min?void 0:(d.text=d.cm.getLine(--d.line),d.ch=d.text.length,!0)}function x(d){for(;;){var l=d.text.indexOf(">",d.ch);if(l==-1){if(r(d))continue;return}if(!M(d,l+1)){d.ch=l+1;continue}var i=d.text.lastIndexOf("/",l),n=i>-1&&!/\S/.test(d.text.slice(i+1,l));return d.ch=l+1,n?"selfClose":"regular"}}function p(d){for(;;){var l=d.ch?d.text.lastIndexOf("<",d.ch-1):-1;if(l==-1){if(P(d))continue;return}if(!M(d,l+1)){d.ch=l;continue}D.lastIndex=l,d.ch=l;var i=D.exec(d.text);if(i&&i.index==l)return i}}function m(d){for(;;){D.lastIndex=d.ch;var l=D.exec(d.text);if(!l){if(r(d))continue;return}if(!M(d,l.index+1)){d.ch=l.index+1;continue}return d.ch=l.index+l[0].length,l}}function c(d){for(;;){var l=d.ch?d.text.lastIndexOf(">",d.ch-1):-1;if(l==-1){if(P(d))continue;return}if(!M(d,l+1)){d.ch=l;continue}var i=d.text.lastIndexOf("/",l),n=i>-1&&!/\S/.test(d.text.slice(i+1,l));return d.ch=l+1,n?"selfClose":"regular"}}function a(d,l){for(var i=[];;){var n=m(d),O,C=d.line,T=d.ch-(n?n[0].length:0);if(!n||!(O=x(d)))return;if(O=="selfClose")continue;if(n[1]){for(var R=i.length-1;R>=0;--R)if(i[R]==n[2]){i.length=R;break}if(R<0&&(!l||l==n[2]))return{tag:n[2],from:V(C,T),to:V(d.line,d.ch)}}else i.push(n[2])}}function s(d,l){for(var i=[];;){var n=c(d);if(!n)return;if(n=="selfClose"){p(d);continue}var O=d.line,C=d.ch,T=p(d);if(!T)return;if(T[1])i.push(T[2]);else{for(var R=i.length-1;R>=0;--R)if(i[R]==T[2]){i.length=R;break}if(R<0&&(!l||l==T[2]))return{tag:T[2],from:V(d.line,d.ch),to:V(O,C)}}}}ne.registerHelper("fold","xml",function(d,l){for(var i=new K(d,l.line,0);;){var n=m(i);if(!n||i.line!=l.line)return;var O=x(i);if(!O)return;if(!n[1]&&O!="selfClose"){var C=V(i.line,i.ch),T=a(i,n[2]);return T&&I(T.from,C)>0?{from:C,to:T.from}:null}}}),ne.findMatchingTag=function(d,l,i){var n=new K(d,l.line,l.ch,i);if(n.text.indexOf(">")==-1&&n.text.indexOf("<")==-1)return;var O=x(n),C=O&&V(n.line,n.ch),T=O&&p(n);if(!O||!T||I(n,l)>0)return;var R={from:V(n.line,n.ch),to:C,tag:T[2]};return O=="selfClose"?{open:R,close:null,at:"open"}:T[1]?{open:s(n,T[2]),close:R,at:"close"}:(n=new K(d,C.line,C.ch,i),{open:R,close:a(n,T[2]),at:"open"})},ne.findEnclosingTag=function(d,l,i,n){for(var O=new K(d,l.line,l.ch,i);;){var C=s(O,n);if(!C)break;var T=new K(d,l.line,l.ch,i),R=a(T,C.tag);if(R)return{open:C,close:R}}},ne.scanForClosingTag=function(d,l,i,n){var O=new K(d,l.line,l.ch,n?{from:0,to:n}:null);return a(O,i)}})},p5ED:function(Lt,ve,k){"use strict";var ne=k("+L6B"),V=k("2/Rp"),I=k("5Dmo"),z=k("3S7+"),L=k("k1fw"),D=k("9og8"),K=k("tJVT"),M=k("WmNS"),r=k.n(M),P=k("q1tI"),x=k.n(P),p=k("vHTk"),m=k.n(p),c=k("yEEn"),a=k("ZW9T"),s=k("1vsH"),d=k("V0Rq"),l=k("m3rI");ve.a=function(i){var n,O,C,T,R,S,y,E=i.editOffice,f=E===void 0?"view":E,h=i.data,v=i.theme,g=i.type,b=i.filename,N=i.monacoEditor,H=i.className,A=i.style,F=i.close,U=i.onClose,w=i.hasMask,Y=i.disabledDownload,Z=Object(P.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ce=Object(K.a)(Z,2),be=ce[0],Ze=ce[1],Ce=Object(P.useState)(""),We=Object(K.a)(Ce,2),Ve=We[0],Ye=We[1],we=Object(P.useState)(),X=Object(K.a)(we,2),j=X[0],W=X[1],Q=window.ENV==="build"?"/react/build":"",re=l.a.PROXY_SERVER||location.origin,G,xe=1024*1024,Ie=10*xe,tt=Object(P.useRef)();(n=h)!==null&&n!==void 0&&n.startsWith("/api")&&g!=="txt"&&(h=(l.a.API_SERVER||location.origin)+h),g==="office"&&(G=Object(s.T)(h).filesize,G>Ie&&(g="other")),b&&N&&(N.filename=b),Object(P.useEffect)(function(){var ze,yt,Ot=(ze=document.cookie)===null||ze===void 0||((yt=ze.replace(/\s/g,""))===null||yt===void 0)?void 0:yt.split(";");Ot==null||Ot.map(function(Ut){var Qe=Ut.split("=");Qe[0]==="_educoder_session"&&Ye(Qe[1])})},[]),Object(P.useEffect)(function(){g==="office"&&le()},[g,h]);var le=function(){var ze=Object(D.a)(r.a.mark(function yt(){var Ot,Ut,Qe;return r.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return console.log("data:",h),Ot=h,h.startsWith("http")||(Ot=location.origin+Ot),Ut=new URL(Ot).pathname.split("/").pop(),ln.next=6,Object(d.V)({attachment_id:Ut});case 6:Qe=ln.sent,W(Qe);case 8:case"end":return ln.stop()}},yt)}));return function(){return ze.apply(this,arguments)}}(),Se=function(){if(h.startsWith("http")||h.startsWith("blob:")){je();return}Object(s.z)(b||"educoder",h,b)},je=function(){Object(s.x)(b||"educoder",decodeURIComponent(h))};return x.a.createElement("div",{style:Object(L.a)({},A||{}),className:"".concat(w&&m.a.bgBlack," ").concat(g?m.a.wrp:"hide")},F&&x.a.createElement("div",{className:m.a.close,ref:tt},!Y&&x.a.createElement(z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return tt.current}},x.a.createElement("span",{onClick:je},x.a.createElement("i",{className:"icon-quxiaozhiding"}))),x.a.createElement(z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return tt.current}},x.a.createElement("span",{className:"",onClick:U},x.a.createElement("i",{className:"icon-guanbi1"})))),x.a.createElement("div",{className:"".concat(m.a[H]," ").concat(H," ").concat(m.a.monaco," ").concat(g==="txt"?"show":"hide")},g==="txt"&&x.a.createElement(a.b,N)),g==="audio"&&x.a.createElement("audio",{src:"".concat(((O=h)===null||O===void 0?void 0:O.indexOf("http://"))>-1||((C=h)===null||C===void 0?void 0:C.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(h),autoPlay:!0}),g==="video"&&x.a.createElement(x.a.Fragment,null,((T=h)===null||T===void 0?void 0:T.indexOf("http"))>-1?x.a.createElement("video",{controls:!0,src:"".concat(h),autoPlay:!0}):x.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(h),autoPlay:!0})),g==="office"&&j&&x.a.createElement("iframe",{src:"".concat(Q,"/office.html?key=").concat(j.key,"&url=").concat(re+j.url,"&callbackUrl=").concat(re+j.callbackUrl,"&fileType=").concat(j.fileType,"&title=").concat(j.title,"&model=").concat(f,"&officeServer=").concat(l.a.OFFICE_SERVER,"&disabledDownload=").concat(!!Y)}),g==="html"&&x.a.createElement("iframe",{src:h+"&disposition=inline"}),g==="pdf"&&x.a.createElement("iframe",{src:"".concat(Q,"/js/pdfview/index.html?url=").concat(h,"&disabledDownload=").concat(!!Y)}),g==="image"&&x.a.createElement("img",{src:"".concat(((R=h)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((S=h)===null||S===void 0?void 0:S.indexOf("https://"))>-1||(y=h)!==null&&y!==void 0&&y.startsWith("/api")?"":"data:image/png;base64,").concat(h)}),g==="other"&&x.a.createElement("div",null,x.a.createElement(V.a,{type:"primary",size:"large",onClick:Se},x.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),g==="download"&&x.a.createElement(V.a,{type:"primary",size:"large",onClick:Se},x.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Lt,ve,k){},pmY6:function(Lt,ve,k){"use strict";k.d(ve,"h",function(){return P}),k.d(ve,"g",function(){return p}),k.d(ve,"f",function(){return m}),k.d(ve,"e",function(){return c}),k.d(ve,"i",function(){return a}),k.d(ve,"b",function(){return s}),k.d(ve,"a",function(){return d}),k.d(ve,"d",function(){return l}),k.d(ve,"c",function(){return i});var ne=k("C/vA"),V=k("JYp7");const I=!1;let z=null;function L(n){z=n}if(I){const n="__is_disposable_tracked__";L(new class{trackDisposable(O){const C=new Error("Potentially leaked disposable").stack;setTimeout(()=>{O[n]||console.log(C)},3e3)}setParent(O,C){if(O&&O!==d.None)try{O[n]=!0}catch(T){}}markAsDisposed(O){if(O&&O!==d.None)try{O[n]=!0}catch(C){}}markAsSingleton(O){}})}function D(n){return z==null||z.trackDisposable(n),n}function K(n){z==null||z.markAsDisposed(n)}function M(n,O){z==null||z.setParent(n,O)}function r(n,O){if(!z)return;for(const C of n)z.setParent(C,O)}function P(n){return z==null||z.markAsSingleton(n),n}class x extends Error{constructor(n){super(`Encountered errors while disposing of store. Errors: [${n.join(", ")}]`);this.errors=n}}function p(n){return typeof n.dispose=="function"&&n.dispose.length===0}function m(n){if(V.a.is(n)){let O=[];for(const C of n)if(C)try{C.dispose()}catch(T){O.push(T)}if(O.length===1)throw O[0];if(O.length>1)throw new x(O);return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function c(...n){const O=a(()=>m(n));return r(n,O),O}function a(n){const O=D({dispose:Object(ne.a)(()=>{K(O),n()})});return O}class s{constructor(){this._toDispose=new Set,this._isDisposed=!1,D(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(n){if(!n)return n;if(n===this)throw new Error("Cannot register a disposable on itself!");return M(n,this),this._isDisposed?s.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(n),n}}s.DISABLE_DISPOSED_WARNING=!1;class d{constructor(){this._store=new s,D(this),M(this._store,this)}dispose(){K(this),this._store.dispose()}_register(n){if(n===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(n)}}d.None=Object.freeze({dispose(){}});class l{constructor(){this._isDisposed=!1,D(this)}get value(){return this._isDisposed?void 0:this._value}set value(n){var O;if(this._isDisposed||n===this._value)return;(O=this._value)===null||O===void 0||O.dispose(),n&&M(n,this),this._value=n}clear(){this.value=void 0}dispose(){var n;this._isDisposed=!0,K(this),(n=this._value)===null||n===void 0||n.dispose(),this._value=void 0}clearAndLeak(){const n=this._value;return this._value=void 0,n&&M(n,null),n}}class i{constructor(n){this.object=n}dispose(){}}},psGv:function(Lt,ve,k){var ne,V;(function(){var I;(function(){"use strict";var K=[,,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 s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(a))return!0;return!1},p.prototype.set_indent=function(a,s){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=s||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 s=a.lastIndexOf(`
|
|
`);s!==-1?this.__character_count=a.length-s: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 m(a,s){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)),s=s||"",a.indent_level>0&&(s=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}m.prototype.get_indent_size=function(a,s){var d=this.__base_string_length;return s=s||0,a<0&&(d=0),d+=a*this.__indent_size,d+=s,d},m.prototype.get_indent_string=function(a,s){var d=this.__base_string;return s=s||0,a<0&&(a=0,d=""),s+=a*this.__indent_size,this.__ensure_cache(s),d+=this.__cache[s],d},m.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var a=this.__cache.length,s=0,d="";this.__indent_size&&a>=this.__indent_size&&(s=Math.floor(a/this.__indent_size),a-=s*this.__indent_size,d=new Array(s+1).join(this.__indent_string)),a&&(d+=new Array(a+1).join(" ")),this.__cache.push(d)};function c(a,s){this.__indent_cache=new m(a,s),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,s){return this.__indent_cache.get_indent_string(a,s)},c.prototype.get_indent_size=function(a,s){return this.__indent_cache.get_indent_size(a,s)},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 s=this.current_line.pop();s&&(s[s.length-1]===`
|
|
`&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var d=this.__lines.join(`
|
|
`);return a!==`
|
|
`&&(d=d.replace(/[\n]/g,a)),d},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(a,s){return a=a||0,s=s||0,this.next_line.set_indent(a,s),this.__lines.length>1?(this.current_line.set_indent(a,s),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(a){for(var s=0;s<a.newlines;s++)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 s=this.__lines.length;a<s;)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,s){for(var d=this.__lines.length-2;d>=0;){var l=this.__lines[d];if(l.is_empty())break;if(l.item(0).indexOf(a)!==0&&l.item(-1)!==s){this.__lines.splice(d+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}d--}},x.exports.Output=c},function(x){function p(m,c,a,s){this.type=m,this.text=c,this.comments_before=null,this.newlines=a||0,this.whitespace_before=s||"",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,s){this.raw_options=m(a,s),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,s){var d=this.raw_options[a],l=s||[];return typeof d=="object"?d!==null&&typeof d.concat=="function"&&(l=d.concat()):typeof d=="string"&&(l=d.split(/[^a-zA-Z0-9_\/\-]+/)),l},p.prototype._get_boolean=function(a,s){var d=this.raw_options[a],l=d===void 0?!!s:!!d;return l},p.prototype._get_characters=function(a,s){var d=this.raw_options[a],l=s||"";return typeof d=="string"&&(l=d.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),l},p.prototype._get_number=function(a,s){var d=this.raw_options[a];s=parseInt(s,10),isNaN(s)&&(s=0);var l=parseInt(d,10);return isNaN(l)&&(l=s),l},p.prototype._get_selection=function(a,s,d){var l=this._get_selection_list(a,s,d);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
|
|
`+s+`
|
|
You passed in: '`+this.raw_options[a]+"'");return l[0]},p.prototype._get_selection_list=function(a,s,d){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(d=d||[s[0]],!this._is_valid_selection(d,s))throw new Error("Invalid Default Value!");var l=this._get_array(a,d);if(!this._is_valid_selection(l,s))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
|
|
`+s+`
|
|
You passed in: '`+this.raw_options[a]+"'");return l},p.prototype._is_valid_selection=function(a,s){return a.length&&s.length&&!a.some(function(d){return s.indexOf(d)===-1})};function m(a,s){var d={};a=c(a);var l;for(l in a)l!==s&&(d[l]=a[l]);if(s&&a[s])for(l in a[s])d[l]=a[s][l];return d}function c(a){var s={},d;for(d in a){var l=d.replace(/-/g,"_");s[l]=a[d]}return s}x.exports.Options=p,x.exports.normalizeOpts=c,x.exports.mergeOpts=m},,function(x){var p=RegExp.prototype.hasOwnProperty("sticky");function m(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},m.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},m.prototype.__match=function(c,a){c.lastIndex=a;var s=c.exec(this.__input);return s&&!(p&&c.sticky)&&(s.index!==a&&(s=null)),s},m.prototype.test=function(c,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(c,a):!1},m.prototype.testChar=function(c,a){var s=this.peek(a);return c.lastIndex=0,s!==null&&c.test(s)},m.prototype.match=function(c){var a=this.__match(c,this.__position);return a?this.__position+=a[0].length:a=null,a},m.prototype.read=function(c,a,s){var d="",l;return c&&(l=this.match(c),l&&(d+=l[0])),a&&(l||!c)&&(d+=this.readUntil(a,s)),d},m.prototype.readUntil=function(c,a){var s="",d=this.__position;c.lastIndex=this.__position;var l=c.exec(this.__input);return l?(d=l.index,a&&(d+=l[0].length)):d=this.__input_length,s=this.__input.substring(this.__position,d),this.__position=d,s},m.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},m.prototype.get_regexp=function(c,a){var s=null,d="g";return a&&p&&(d="y"),typeof c=="string"&&c!==""?s=new RegExp(c,d):c&&(s=new RegExp(c.source,d)),s},m.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(c){var a=this.__position,s=this.readUntilAfter(c);return this.__position=a,s},m.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=m},function(x,p,m){var c=m(8).InputScanner,a=m(3).Token,s=m(10).TokenStream,d=m(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(n,O){this._input=new c(n),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new d(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var n,O=new a(l.START,""),C=null,T=[],R=new s;O.type!==l.EOF;){for(n=this._get_next_token(O,C);this._is_comment(n);)R.add(n),n=this._get_next_token(O,C);R.isEmpty()||(n.comments_before=R,R=new s),n.parent=C,this._is_opening(n)?(T.push(C),C=n):C&&this._is_closing(n,C)&&(n.opened=C,C.closed=n,C=T.pop(),n.parent=C),n.previous=O,O.next=n,this.__tokens.add(n),O=n}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(n,O){this._readWhitespace();var C=this._input.read(/.+/g);return C?this._create_token(l.RAW,C):this._create_token(l.EOF,"")},i.prototype._is_comment=function(n){return!1},i.prototype._is_opening=function(n){return!1},i.prototype._is_closing=function(n,O){return!1},i.prototype._create_token=function(n,O){var C=new a(n,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return C},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},x.exports.Tokenizer=i,x.exports.TOKEN=l},function(x){function p(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}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 m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},p.prototype.peek=function(m){var c=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(c=this.__tokens[m]),c},p.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},x.exports.TokenStream=p},function(x,p,m){var c=m(12).Pattern;function a(s,d){c.call(this,s,d),d?this._line_regexp=this._input.get_regexp(d._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new c,a.prototype.__set_whitespace_patterns=function(s,d){s+="\\t ",d+="\\n\\r",this._match_pattern=this._input.get_regexp("["+s+d+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+d+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var s=this._input.read(this._match_pattern);if(s===" ")this.whitespace_before_token=" ";else if(s){var d=this.__split(this._newline_regexp,s);this.newline_count=d.length-1,this.whitespace_before_token=d[this.newline_count]}return s},a.prototype.matching=function(s,d){var l=this._create();return l.__set_whitespace_patterns(s,d),l._update(),l},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(s,d){s.lastIndex=0;for(var l=0,i=[],n=s.exec(d);n;)i.push(d.substring(l,n.index)),l=n.index+n[0].length,n=s.exec(d);return l<d.length?i.push(d.substring(l,d.length)):i.push(""),i},x.exports.WhitespacePattern=a},function(x){function p(m,c){this._input=m,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 m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(m){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(m),c._update(),c},p.prototype.until=function(m){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(m),c._update(),c},p.prototype.starting_with=function(m){var c=this._create();return c._starting_pattern=this._input.get_regexp(m,!0),c._update(),c},p.prototype.matching=function(m){var c=this._create();return c._match_pattern=this._input.get_regexp(m,!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(m,c){m=typeof m=="string"?m:m.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+c,"g")}p.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(m);a;)c[a[1]]=a[2],a=this.__directive_pattern.exec(m);return c},p.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},x.exports.Directives=p},function(x,p,m){var c=m(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function s(d,l){c.call(this,d,l),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var i=new c(d);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new c,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(d){var l=this._create();return l._disabled[d]=!0,l._update(),l},s.prototype.read_options=function(d){var l=this._create();for(var i in a)l._disabled[i]=d.templating.indexOf(i)===-1;return l._update(),l},s.prototype.exclude=function(d){var l=this._create();return l._excluded[d]=!0,l._update(),l},s.prototype.read=function(){var d="";this._match_pattern?d=this._input.read(this._starting_pattern):d=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),d+=l,l=this._read_template();return this._until_after&&(d+=this._input.readUntilAfter(this._until_pattern)),d},s.prototype.__set_templated_pattern=function(){var d=[];this._disabled.php||d.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||d.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||d.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(d.push(this.__patterns.django._starting_pattern.source),d.push(this.__patterns.django_value._starting_pattern.source),d.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||d.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&d.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+d.join("|")+")")},s.prototype._read_template=function(){var d="",l=this._input.peek();if(l==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(d=d||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(d=d||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(d=d||this.__patterns.handlebars_comment.read(),d=d||this.__patterns.handlebars_unescaped.read(),d=d||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(d=d||this.__patterns.django_value.read()),this._excluded.django||(d=d||this.__patterns.django_comment.read(),d=d||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(d=d||this.__patterns.smarty_comment.read(),d=d||this.__patterns.smarty_literal.read(),d=d||this.__patterns.smarty.read()));return d},x.exports.TemplatablePattern=s},,,,function(x,p,m){var c=m(19).Beautifier,a=m(20).Options;function s(d,l,i,n){var O=new c(d,l,i,n);return O.beautify()}x.exports=s,x.exports.defaultOptions=function(){return new a}},function(x,p,m){var c=m(20).Options,a=m(2).Output,s=m(21).Tokenizer,d=m(21).TOKEN,l=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,n=function(v,g){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=v.max_preserve_newlines,this.preserve_newlines=v.preserve_newlines,this._output=new a(v,g)};n.prototype.current_line_has_match=function(v){return this._output.current_line.has_match(v)},n.prototype.set_space_before_token=function(v,g){this._output.space_before_token=v,this._output.non_breaking_space=g},n.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},n.prototype.add_raw_token=function(v){this._output.add_raw_token(v)},n.prototype.print_preserved_newlines=function(v){var g=0;v.type!==d.TEXT&&v.previous.type!==d.TEXT&&(g=v.newlines?1:0),this.preserve_newlines&&(g=v.newlines<this.max_preserve_newlines+1?v.newlines:this.max_preserve_newlines+1);for(var b=0;b<g;b++)this.print_newline(b>0);return g!==0},n.prototype.traverse_whitespace=function(v){return v.whitespace_before||v.newlines?(this.print_preserved_newlines(v)||(this._output.space_before_token=!0),!0):!1},n.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},n.prototype.print_newline=function(v){this._output.add_new_line(v)},n.prototype.print_token=function(v){v.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(v.text))},n.prototype.indent=function(){this.indent_level++},n.prototype.get_full_indent=function(v){return v=this.indent_level+(v||0),v<1?"":this._output.get_indent_string(v)};var O=function(v){for(var g=null,b=v.next;b.type!==d.EOF&&v.closed!==b;){if(b.type===d.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===d.EQUALS&&b.next.next&&b.next.next.type===d.VALUE&&(g=b.next.next.text);break}b=b.next}return g},C=function(v,g){var b=null,N=null;return g.closed?(v==="script"?b="text/javascript":v==="style"&&(b="text/css"),b=O(g)||b,b.search("text/css")>-1?N="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":b.search(/test\/null/)>-1&&(N="null"),N):null};function T(v,g){return g.indexOf(v)!==-1}function R(v,g,b){this.parent=v||null,this.tag=g?g.tag_name:"",this.indent_level=b||0,this.parser_token=g||null}function S(v){this._printer=v,this._current_frame=null}S.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},S.prototype.record_tag=function(v){var g=new R(this._current_frame,v,this._printer.indent_level);this._current_frame=g},S.prototype._try_pop_frame=function(v){var g=null;return v&&(g=v.parser_token,this._printer.indent_level=v.indent_level,this._current_frame=v.parent),g},S.prototype._get_frame=function(v,g){for(var b=this._current_frame;b&&!(v.indexOf(b.tag)!==-1);){if(g&&g.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},S.prototype.try_pop=function(v,g){var b=this._get_frame([v],g);return this._try_pop_frame(b)},S.prototype.indent_to_tag=function(v){var g=this._get_frame(v);g&&(this._printer.indent_level=g.indent_level)};function y(v,g,b,N){this._source_text=v||"",g=g||{},this._js_beautify=b,this._css_beautify=N,this._tag_stack=null;var H=new c(g,"html");this._options=H,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"}y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v=this._source_text,g=this._options.eol;this._options.eol==="auto"&&(g=`
|
|
`,v&&l.test(v)&&(g=v.match(l)[0])),v=v.replace(i,`
|
|
`);var b=v.match(/^[\t ]*/)[0],N={text:"",type:""},H=new E,A=new n(this._options,b),F=new s(v,this._options).tokenize();this._tag_stack=new S(A);for(var U=null,w=F.next();w.type!==d.EOF;)w.type===d.TAG_OPEN||w.type===d.COMMENT?(U=this._handle_tag_open(A,w,H,N),H=U):w.type===d.ATTRIBUTE||w.type===d.EQUALS||w.type===d.VALUE||w.type===d.TEXT&&!H.tag_complete?U=this._handle_inside_tag(A,w,H,F):w.type===d.TAG_CLOSE?U=this._handle_tag_close(A,w,H):w.type===d.TEXT?U=this._handle_text(A,w,H):A.add_raw_token(w),N=U,w=F.next();var Y=A._output.get_code(g);return Y},y.prototype._handle_tag_close=function(v,g,b){var N={text:g.text,type:g.type};return v.alignment_size=0,b.tag_complete=!0,v.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),b.is_unformatted?v.add_raw_token(g):(b.tag_start_char==="<"&&(v.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&v.print_newline(!1)),v.print_token(g)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(v.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&v.set_wrap_point(),N},y.prototype._handle_inside_tag=function(v,g,b,N){var H=b.has_wrapped_attrs,A={text:g.text,type:g.type};if(v.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),b.is_unformatted)v.add_raw_token(g);else if(b.tag_start_char==="{"&&g.type===d.TEXT)v.print_preserved_newlines(g)?(g.newlines=0,v.add_raw_token(g)):v.print_token(g);else{if(g.type===d.ATTRIBUTE?(v.set_space_before_token(!0),b.attr_count+=1):(g.type===d.EQUALS||g.type===d.VALUE&&g.previous.type===d.EQUALS)&&v.set_space_before_token(!1),g.type===d.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(v.traverse_whitespace(g),H=H||g.newlines!==0),this._is_wrap_attributes_force)){var F=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var U=!0,w=0,Y;do{if(Y=N.peek(w),Y.type===d.ATTRIBUTE){U=!1;break}w+=1}while(w<4&&Y.type!==d.EOF&&Y.type!==d.TAG_CLOSE);F=!U}F&&(v.print_newline(!1),H=!0)}v.print_token(g),H=H||v.previous_token_wrapped(),b.has_wrapped_attrs=H}return A},y.prototype._handle_text=function(v,g,b){var N={text:g.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(v,g,b):b.is_unformatted||b.is_content_unformatted?v.add_raw_token(g):(v.traverse_whitespace(g),v.print_token(g)),N},y.prototype._print_custom_beatifier_text=function(v,g,b){var N=this;if(g.text!==""){var H=g.text,A,F=1,U="",w="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:b.custom_beautifier_name==="html"&&(A=function(Ce,We){var Ve=new y(Ce,We,N._js_beautify,N._css_beautify);return Ve.beautify()}),this._options.indent_scripts==="keep"?F=0:this._options.indent_scripts==="separate"&&(F=-v.indent_level);var Y=v.get_full_indent(F);if(H=H.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&H[0]==="<"&&H.match(/^(<!--|<!\[CDATA\[)/)){var Z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(H);if(!Z){v.add_raw_token(g);return}U=Y+Z[1]+`
|
|
`,H=Z[4],Z[5]&&(w=Y+Z[5]),H=H.replace(/\n[ \t]*$/,""),(Z[2]||Z[3].indexOf(`
|
|
`)!==-1)&&(Z=Z[3].match(/[ \t]+$/),Z&&(g.whitespace_before=Z[0]))}if(H)if(A){var ce=function(){this.eol=`
|
|
`};ce.prototype=this._options.raw_options;var be=new ce;H=A(Y+H,be)}else{var Ze=g.whitespace_before;Ze&&(H=H.replace(new RegExp(`
|
|
(`+Ze+")?","g"),`
|
|
`)),H=Y+H.replace(/\n/g,`
|
|
`+Y)}U&&(H?H=U+H+`
|
|
`+w:H=U+w),v.print_newline(!1),H&&(g.text=H,g.whitespace_before="",g.newlines=0,v.add_raw_token(g),v.print_newline(!0))}},y.prototype._handle_tag_open=function(v,g,b,N){var H=this._get_tag_open_token(g);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&g.type===d.TAG_OPEN&&g.text.indexOf("</")===0?(v.add_raw_token(g),H.start_tag_token=this._tag_stack.try_pop(H.tag_name)):(v.traverse_whitespace(g),this._set_tag_position(v,g,H,b,N),H.is_inline_element||v.set_wrap_point(),v.print_token(g)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(H.alignment_size=g.text.length+1),!H.tag_complete&&!H.is_unformatted&&(v.alignment_size=H.alignment_size),H};var E=function(v,g){if(this.parent=v||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="",!g)this.tag_complete=!0;else{var b;this.tag_start_char=g.text[0],this.text=g.text,this.tag_start_char==="<"?(b=g.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(g.text.startsWith("{{#>")||g.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&g.next!==null?this.tag_check=g.next.text.split(" ")[0]:this.tag_check=g.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),g.type===d.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||g.closed&&g.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};y.prototype._get_tag_open_token=function(v){var g=new E(this._tag_stack.get_parser_token(),v);return g.alignment_size=this._options.wrap_attributes_indent_size,g.is_end_tag=g.is_end_tag||T(g.tag_check,this._options.void_elements),g.is_empty_element=g.tag_complete||g.is_start_tag&&g.is_end_tag,g.is_unformatted=!g.tag_complete&&T(g.tag_check,this._options.unformatted),g.is_content_unformatted=!g.is_empty_element&&T(g.tag_check,this._options.content_unformatted),g.is_inline_element=T(g.tag_name,this._options.inline)||g.tag_name.includes("-")||g.tag_start_char==="{",g},y.prototype._set_tag_position=function(v,g,b,N,H){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||v.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=C(b.tag_check,g)))),T(b.tag_check,this._options.extra_liners)&&(v.print_newline(!1),v._output.just_added_blankline()||v.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var A=v.current_line_has_match(/{{#if/);A||v.print_newline(!1)}b.tag_name==="!--"&&H.type===d.TAG_CLOSE&&N.is_end_tag&&b.text.indexOf(`
|
|
`)===-1||(b.is_inline_element||b.is_unformatted||v.print_newline(!1),this._calcluate_parent_multiline(v,b))}else if(b.is_end_tag){var F=!1;F=b.start_tag_token&&b.start_tag_token.multiline_content,F=F||!b.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(H.type===d.TAG_CLOSE&&b.start_tag_token===N)&&H.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(F=!1),F&&v.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(H.type!=="TK_CONTENT"||b.is_content_unformatted)&&v.print_newline(!1),this._calcluate_parent_multiline(v,b)},y.prototype._calcluate_parent_multiline=function(v,g){g.parent&&v._output.just_added_newline()&&!((g.is_inline_element||g.is_unformatted)&&g.parent.is_inline_element)&&(g.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"],h=["a","audio","del","ins","map","noscript","video"];y.prototype._do_optional_end_element=function(v){var g=null;if(v.is_empty_element||!v.is_start_tag||!v.parent)return;if(v.tag_name==="body")g=g||this._tag_stack.try_pop("head");else if(v.tag_name==="li")g=g||this._tag_stack.try_pop("li",["ol","ul"]);else if(v.tag_name==="dd"||v.tag_name==="dt")g=g||this._tag_stack.try_pop("dt",["dl"]),g=g||this._tag_stack.try_pop("dd",["dl"]);else if(v.parent.tag_name==="p"&&f.indexOf(v.tag_name)!==-1){var b=v.parent.parent;(!b||h.indexOf(b.tag_name)===-1)&&(g=g||this._tag_stack.try_pop("p"))}else v.tag_name==="rp"||v.tag_name==="rt"?(g=g||this._tag_stack.try_pop("rt",["ruby","rtc"]),g=g||this._tag_stack.try_pop("rp",["ruby","rtc"])):v.tag_name==="optgroup"?g=g||this._tag_stack.try_pop("optgroup",["select"]):v.tag_name==="option"?g=g||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):v.tag_name==="colgroup"?g=g||this._tag_stack.try_pop("caption",["table"]):v.tag_name==="thead"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"])):v.tag_name==="tbody"||v.tag_name==="tfoot"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("thead",["table"]),g=g||this._tag_stack.try_pop("tbody",["table"])):v.tag_name==="tr"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(v.tag_name==="th"||v.tag_name==="td")&&(g=g||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),g=g||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return v.parent=this._tag_stack.get_parser_token(),g},x.exports.Beautifier=y},function(x,p,m){var c=m(6).Options;function a(s){c.call(this,s,"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,m){var c=m(9).Tokenizer,a=m(9).TOKEN,s=m(13).Directives,d=m(14).TemplatablePattern,l=m(12).Pattern,i={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},n=new s(/<\!--/,/-->/),O=function(C,T){c.call(this,C,T),this._current_tag_name="";var R=new d(this._input).read_options(this._options),S=new l(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.until(/[\n\r\t >\/]/),handlebars_comment:S.starting_with(/{{!--/).until_after(/--}}/),handlebars:S.starting_with(/{{/).until_after(/}}/),handlebars_open:S.until(/[\n\r\t }]/),handlebars_raw_close:S.until(/}}/),comment:S.starting_with(/<!--/).until_after(/-->/),cdata:S.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:S.starting_with(/<!\[/).until_after(/]>/),processing:S.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 y=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=S.matching(y).until_after(y)}};O.prototype=new c,O.prototype._is_comment=function(C){return!1},O.prototype._is_opening=function(C){return C.type===i.TAG_OPEN},O.prototype._is_closing=function(C,T){return C.type===i.TAG_CLOSE&&T&&((C.text===">"||C.text==="/>")&&T.text[0]==="<"||C.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(C,T){var R=null;this._readWhitespace();var S=this._input.peek();return S===null?this._create_token(i.EOF,""):(R=R||this._read_open_handlebars(S,T),R=R||this._read_attribute(S,C,T),R=R||this._read_close(S,T),R=R||this._read_raw_content(S,C,T),R=R||this._read_content_word(S),R=R||this._read_comment_or_cdata(S),R=R||this._read_processing(S),R=R||this._read_open(S,T),R=R||this._create_token(i.UNKNOWN,this._input.next()),R)},O.prototype._read_comment_or_cdata=function(C){var T=null,R=null,S=null;if(C==="<"){var y=this._input.peek(1);y==="!"&&(R=this.__patterns.comment.read(),R?(S=n.get_directives(R),S&&S.ignore==="start"&&(R+=n.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(T=this._create_token(i.COMMENT,R),T.directives=S)}return T},O.prototype._read_processing=function(C){var T=null,R=null,S=null;if(C==="<"){var y=this._input.peek(1);(y==="!"||y==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(T=this._create_token(i.COMMENT,R),T.directives=S)}return T},O.prototype._read_open=function(C,T){var R=null,S=null;return T||C==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),S=this._create_token(i.TAG_OPEN,R)),S},O.prototype._read_open_handlebars=function(C,T){var R=null,S=null;return T||this._options.indent_handlebars&&C==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),S=this._create_token(i.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),S=this._create_token(i.TAG_OPEN,R))),S},O.prototype._read_close=function(C,T){var R=null,S=null;return T&&(T.text[0]==="<"&&(C===">"||C==="/"&&this._input.peek(1)===">")?(R=this._input.next(),C==="/"&&(R+=this._input.next()),S=this._create_token(i.TAG_CLOSE,R)):T.text[0]==="{"&&C==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),S=this._create_token(i.TAG_CLOSE,"}}"))),S},O.prototype._read_attribute=function(C,T,R){var S=null,y="";if(R&&R.text[0]==="<")if(C==="=")S=this._create_token(i.EQUALS,this._input.next());else if(C==='"'||C==="'"){var E=this._input.next();C==='"'?E+=this.__patterns.double_quote.read():E+=this.__patterns.single_quote.read(),S=this._create_token(i.VALUE,E)}else y=this.__patterns.attribute.read(),y&&(T.type===i.EQUALS?S=this._create_token(i.VALUE,y):S=this._create_token(i.ATTRIBUTE,y));return S},O.prototype._is_content_unformatted=function(C){return this._options.void_elements.indexOf(C)===-1&&(this._options.content_unformatted.indexOf(C)!==-1||this._options.unformatted.indexOf(C)!==-1)},O.prototype._read_raw_content=function(C,T,R){var S="";if(R&&R.text[0]==="{")S=this.__patterns.handlebars_raw_close.read();else if(T.type===i.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var y=T.opened.text.substr(1).toLowerCase();if(y==="script"||y==="style"){var E=this._read_comment_or_cdata(C);if(E)return E.type=i.TEXT,E;S=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(y)&&(S=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig")))}return S?this._create_token(i.TEXT,S):null},O.prototype._read_content_word=function(C){var T="";if(this._options.unformatted_content_delimiter&&(C===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(i.TEXT,T)},x.exports.Tokenizer=O,x.exports.TOKEN=i}],M={};function r(x){var p=M[x];if(p!==void 0)return p.exports;var m=M[x]={exports:{}};return K[x](m,m.exports,r),m.exports}var P=r(18);I=P})();var z=I;if(!0)!(ne=[k,k("6UM0"),k("TXwP")],V=function(K){var M=k("6UM0"),r=k("TXwP");return{html_beautify:function(P,x){return z(P,x,M.js_beautify,r.css_beautify)}}}.apply(ve,ne),V!==void 0&&(Lt.exports=V));else var L,D})()},"rAM+":function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return V});var ne=k("Qw5x");function V(I,z){var L;if(typeof Symbol=="undefined"||I[Symbol.iterator]==null){if(Array.isArray(I)||(L=Object(ne.a)(I))||z&&I&&typeof I.length=="number"){L&&(I=L);var D=0,K=function(){};return{s:K,n:function(){return D>=I.length?{done:!0}:{done:!1,value:I[D++]}},e:function(p){throw p},f:K}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var M=!0,r=!1,P;return{s:function(){L=I[Symbol.iterator]()},n:function(){var p=L.next();return M=p.done,p},e:function(p){r=!0,P=p},f:function(){try{!M&&L.return!=null&&L.return()}finally{if(r)throw P}}}}},rUJ1:function(Lt,ve){const k=/[&<>"']/,ne=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,z={"&":"&","<":"<",">":">",'"':""","'":"'"},L=S=>z[S];function D(S,y){if(y){if(k.test(S))return S.replace(ne,L)}else if(V.test(S))return S.replace(I,L);return S}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function M(S){return S.replace(K,(y,E)=>(E=E.toLowerCase(),E==="colon"?":":E.charAt(0)==="#"?E.charAt(1)==="x"?String.fromCharCode(parseInt(E.substring(2),16)):String.fromCharCode(+E.substring(1)):""))}const r=/(^|[^\[])\^/g;function P(S,y){S=S.source||S,y=y||"";const E={replace:(f,h)=>(h=h.source||h,h=h.replace(r,"$1"),S=S.replace(f,h),E),getRegex:()=>new RegExp(S,y)};return E}const x=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(S,y,E){if(S){let f;try{f=decodeURIComponent(M(E)).replace(x,"").toLowerCase()}catch(h){return null}if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}y&&!p.test(E)&&(E=l(y,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(f){return null}return E}const c={},a=/^[^:]+:\/*[^/]*$/,s=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(S,y){c[" "+S]||(a.test(S)?c[" "+S]=S+"/":c[" "+S]=C(S,"/",!0)),S=c[" "+S];const E=S.indexOf(":")===-1;return y.substring(0,2)==="//"?E?y:S.replace(s,"$1")+y:y.charAt(0)==="/"?E?y:S.replace(d,"$1")+y:S+y}const i={exec:function(){}};function n(S){let y=1,E,f;for(;y<arguments.length;y++){E=arguments[y];for(f in E)Object.prototype.hasOwnProperty.call(E,f)&&(S[f]=E[f])}return S}function O(S,y){const E=S.replace(/\|/g,(v,g,b)=>{let N=!1,H=g;for(;--H>=0&&b[H]==="\\";)N=!N;return N?"|":" |"}),f=E.split(/ \|/);let h=0;if(f.length>y)f.splice(y);else for(;f.length<y;)f.push("");for(;h<f.length;h++)f[h]=f[h].trim().replace(/\\\|/g,"|");return f}function C(S,y,E){const f=S.length;if(f===0)return"";let h=0;for(;h<f;){const v=S.charAt(f-h-1);if(v===y&&!E)h++;else if(v!==y&&E)h++;else break}return S.substr(0,f-h)}function T(S,y){if(S.indexOf(y[1])===-1)return-1;const E=S.length;let f=0,h=0;for(;h<E;h++)if(S[h]==="\\")h++;else if(S[h]===y[0])f++;else if(S[h]===y[1]&&(f--,f<0))return h;return-1}function R(S){S&&S.sanitize&&!S.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")}Lt.exports={escape:D,unescape:M,edit:P,cleanUrl:m,resolveUrl:l,noopTest:i,merge:n,splitCells:O,rtrim:C,findClosingBracket:T,checkSanitizeDeprecation:R}},sR1s:function(Lt,ve,k){"use strict";k.d(ve,"b",function(){return z}),k.d(ve,"a",function(){return L}),k.d(ve,"c",function(){return D}),k.d(ve,"d",function(){return K});var ne=k("U8pU"),V="RC_TABLE_KEY";function I(M){return M==null?[]:Array.isArray(M)?M:[M]}function z(M,r){if(!r&&typeof r!="number")return M;for(var P=I(r),x=M,p=0;p<P.length;p+=1){if(!x)return null;var m=P[p];x=x[m]}return x}function L(M){var r=[],P={};return M.forEach(function(x){for(var p=x||{},m=p.key,c=p.dataIndex,a=m||I(c).join("-")||V;P[a];)a="".concat(a,"_next");P[a]=!0,r.push(a)}),r}function D(){var M={};function r(m,c){c&&Object.keys(c).forEach(function(a){var s=c[a];s&&Object(ne.a)(s)==="object"?(m[a]=m[a]||{},r(m[a],s)):m[a]=s})}for(var P=arguments.length,x=new Array(P),p=0;p<P;p++)x[p]=arguments[p];return x.forEach(function(m){r(M,m)}),M}function K(M){return M!=null}},sboe:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return I});var ne=k("q1tI"),V=k.n(ne),I=ne.createContext(null)},t23M:function(Lt,ve,k){"use strict";var ne=k("VTBJ"),V=k("1OyB"),I=k("vuIU"),z=k("Ji7U"),L=k("LK+K"),D=k("q1tI"),K=k.n(D),M=k("m+aA"),r=k("Zm9Q"),P=k("Kwbf"),x=k("c+Xe"),p=k("bdgK"),m="rc-observer-key",c=function(a){Object(z.a)(d,a);var s=Object(L.a)(d);function d(){var l;return Object(V.a)(this,d),l=s.apply(this,arguments),l.resizeObserver=null,l.childNode=null,l.currentElement=null,l.state={width:0,height:0,offsetHeight:0,offsetWidth:0},l.onResize=function(i){var n=l.props.onResize,O=i[0].target,C=O.getBoundingClientRect(),T=C.width,R=C.height,S=O.offsetWidth,y=O.offsetHeight,E=Math.floor(T),f=Math.floor(R);if(l.state.width!==E||l.state.height!==f||l.state.offsetWidth!==S||l.state.offsetHeight!==y){var h={width:E,height:f,offsetWidth:S,offsetHeight:y};l.setState(h),n&&Promise.resolve().then(function(){n(Object(ne.a)(Object(ne.a)({},h),{},{offsetWidth:S,offsetHeight:y}))})}},l.setChildNode=function(i){l.childNode=i},l}return Object(I.a)(d,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var i=this.props.disabled;if(i){this.destroyObserver();return}var n=Object(M.a)(this.childNode||this),O=n!==this.currentElement;O&&(this.destroyObserver(),this.currentElement=n),!this.resizeObserver&&n&&(this.resizeObserver=new p.default(this.onResize),this.resizeObserver.observe(n))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var i=this.props.children,n=Object(r.a)(i);if(n.length>1)Object(P.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(n.length===0)return Object(P.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var O=n[0];if(D.isValidElement(O)&&Object(x.c)(O)){var C=O.ref;n[0]=D.cloneElement(O,{ref:Object(x.a)(C,this.setChildNode)})}return n.length===1?n[0]:n.map(function(T,R){return!D.isValidElement(T)||"key"in T&&T.key!==null?T:D.cloneElement(T,{key:"".concat(m,"-").concat(R)})})}}]),d}(D.Component);c.displayName="ResizeObserver",ve.a=c},t9D7:function(Lt,ve,k){"use strict";k.d(ve,"b",function(){return K}),k.d(ve,"g",function(){return r}),k.d(ve,"d",function(){return P}),k.d(ve,"e",function(){return x}),k.d(ve,"a",function(){return p}),k.d(ve,"f",function(){return a}),k.d(ve,"c",function(){return s});var ne=k("Vhoy"),V=k("MI8n"),I=k("pmY6"),z=k("Cg/j"),L=k("ic2d"),D=k("nEHx");const K=Object(z.c)("themeService");var M;(function(d){function l(i){return i&&typeof i=="object"&&typeof i.id=="string"}d.isThemeColor=l})(M||(M={}));function r(d){return{id:d}}var P;(function(d){function l(R){return R&&typeof R=="object"&&typeof R.id=="string"&&(typeof R.color=="undefined"||M.isThemeColor(R.color))}d.isThemeIcon=l;const i=new RegExp(`^\\$\\((${ne.a.iconNameExpression}(?:${ne.a.iconModifierExpression})?)\\)$`);function n(R){const S=i.exec(R);if(!S)return;let[,y]=S;return{id:y}}d.fromString=n;function O(R,S){let y=R.id;const E=y.lastIndexOf("~");return E!==-1&&(y=y.substring(0,E)),S&&(y=`${y}~${S}`),{id:y}}d.modify=O;function C(R,S){var y,E;return R.id===S.id&&((y=R.color)===null||y===void 0?void 0:y.id)===((E=S.color)===null||E===void 0?void 0:E.id)}d.isEqual=C;function T(R,S){return{id:R.id,color:S?r(S):void 0}}d.asThemeIcon=T,d.asClassNameArray=ne.a.asClassNameArray,d.asClassName=ne.a.asClassName,d.asCSSSelector=ne.a.asCSSSelector})(P||(P={}));function x(d){switch(d){case D.a.DARK:return"vs-dark";case D.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const p={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new V.b}onColorThemeChange(d){return this.themingParticipants.push(d),this.onThemingParticipantAddedEmitter.fire(d),Object(I.i)(()=>{const l=this.themingParticipants.indexOf(d);this.themingParticipants.splice(l,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new m;L.a.add(p.ThemingContribution,c);function a(d){return c.onColorThemeChange(d)}class s extends I.a{constructor(d){super();this.themeService=d,this.theme=d.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(l=>this.onThemeChange(l)))}onThemeChange(d){this.theme=d,this.updateStyles()}updateStyles(){}}},ulZh:function(Lt,ve,k){typeof window!="undefined"&&function(V,I){Lt.exports=I()}(this,function(){return function(ne){var V={};function I(z){if(V[z])return V[z].exports;var L=V[z]={i:z,l:!1,exports:{}};return ne[z].call(L.exports,L,L.exports,I),L.l=!0,L.exports}return I.m=ne,I.c=V,I.d=function(z,L,D){I.o(z,L)||Object.defineProperty(z,L,{enumerable:!0,get:D})},I.r=function(z){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(z,"__esModule",{value:!0})},I.t=function(z,L){if(L&1&&(z=I(z)),L&8)return z;if(L&4&&typeof z=="object"&&z&&z.__esModule)return z;var D=Object.create(null);if(I.r(D),Object.defineProperty(D,"default",{enumerable:!0,value:z}),L&2&&typeof z!="string")for(var K in z)I.d(D,K,function(M){return z[M]}.bind(null,K));return D},I.n=function(z){var L=z&&z.__esModule?function(){return z.default}:function(){return z};return I.d(L,"a",L),L},I.o=function(z,L){return Object.prototype.hasOwnProperty.call(z,L)},I.p="/dist/",I(I.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ne,V,I){"use strict";var z=Object.prototype.hasOwnProperty,L="~";function D(){}Object.create&&(D.prototype=Object.create(null),new D().__proto__||(L=!1));function K(x,p,m){this.fn=x,this.context=p,this.once=m||!1}function M(x,p,m,c,a){if(typeof m!="function")throw new TypeError("The listener must be a function");var s=new K(m,c||x,a),d=L?L+p:p;return x._events[d]?x._events[d].fn?x._events[d]=[x._events[d],s]:x._events[d].push(s):(x._events[d]=s,x._eventsCount++),x}function r(x,p){--x._eventsCount===0?x._events=new D:delete x._events[p]}function P(){this._events=new D,this._eventsCount=0}P.prototype.eventNames=function(){var p=[],m,c;if(this._eventsCount===0)return p;for(c in m=this._events)z.call(m,c)&&p.push(L?c.slice(1):c);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},P.prototype.listeners=function(p){var m=L?L+p:p,c=this._events[m];if(!c)return[];if(c.fn)return[c.fn];for(var a=0,s=c.length,d=new Array(s);a<s;a++)d[a]=c[a].fn;return d},P.prototype.listenerCount=function(p){var m=L?L+p:p,c=this._events[m];return c?c.fn?1:c.length:0},P.prototype.emit=function(p,m,c,a,s,d){var l=L?L+p:p;if(!this._events[l])return!1;var i=this._events[l],n=arguments.length,O,C;if(i.fn){i.once&&this.removeListener(p,i.fn,void 0,!0);switch(n){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,m),!0;case 3:return i.fn.call(i.context,m,c),!0;case 4:return i.fn.call(i.context,m,c,a),!0;case 5:return i.fn.call(i.context,m,c,a,s),!0;case 6:return i.fn.call(i.context,m,c,a,s,d),!0}for(C=1,O=new Array(n-1);C<n;C++)O[C-1]=arguments[C];i.fn.apply(i.context,O)}else{var T=i.length,R;for(C=0;C<T;C++){i[C].once&&this.removeListener(p,i[C].fn,void 0,!0);switch(n){case 1:i[C].fn.call(i[C].context);break;case 2:i[C].fn.call(i[C].context,m);break;case 3:i[C].fn.call(i[C].context,m,c);break;case 4:i[C].fn.call(i[C].context,m,c,a);break;default:if(!O)for(R=1,O=new Array(n-1);R<n;R++)O[R-1]=arguments[R];i[C].fn.apply(i[C].context,O)}}}return!0},P.prototype.on=function(p,m,c){return M(this,p,m,c,!1)},P.prototype.once=function(p,m,c){return M(this,p,m,c,!0)},P.prototype.removeListener=function(p,m,c,a){var s=L?L+p:p;if(!this._events[s])return this;if(!m)return r(this,s),this;var d=this._events[s];if(d.fn)d.fn===m&&(!a||d.once)&&(!c||d.context===c)&&r(this,s);else{for(var l=0,i=[],n=d.length;l<n;l++)(d[l].fn!==m||a&&!d[l].once||c&&d[l].context!==c)&&i.push(d[l]);i.length?this._events[s]=i.length===1?i[0]:i:r(this,s)}return this},P.prototype.removeAllListeners=function(p){var m;return p?(m=L?L+p:p,this._events[m]&&r(this,m)):(this._events=new D,this._eventsCount=0),this},P.prototype.off=P.prototype.removeListener,P.prototype.addListener=P.prototype.on,P.prefixed=L,P.EventEmitter=P,ne.exports=P},"./node_modules/url-toolkit/src/url-toolkit.js":function(ne,V,I){(function(z){var L=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,D=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,M=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(P,x,p){if(p=p||{},P=P.trim(),x=x.trim(),!x){if(!p.alwaysNormalize)return P;var m=r.parseURL(P);if(!m)throw new Error("Error trying to parse base URL.");return m.path=r.normalizePath(m.path),r.buildURLFromParts(m)}var c=r.parseURL(x);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return p.alwaysNormalize?(c.path=r.normalizePath(c.path),r.buildURLFromParts(c)):x;var a=r.parseURL(P);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var s=D.exec(a.path);a.netLoc=s[1],a.path=s[2]}a.netLoc&&!a.path&&(a.path="/");var d={scheme:a.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(d.netLoc=a.netLoc,c.path[0]!=="/"))if(!c.path)d.path=a.path,c.params||(d.params=a.params,c.query||(d.query=a.query));else{var l=a.path,i=l.substring(0,l.lastIndexOf("/")+1)+c.path;d.path=r.normalizePath(i)}return d.path===null&&(d.path=p.alwaysNormalize?r.normalizePath(c.path):c.path),r.buildURLFromParts(d)},parseURL:function(P){var x=L.exec(P);return x?{scheme:x[1]||"",netLoc:x[2]||"",path:x[3]||"",params:x[4]||"",query:x[5]||"",fragment:x[6]||""}:null},normalizePath:function(P){for(P=P.split("").reverse().join("").replace(K,"");P.length!==(P=P.replace(M,"")).length;);return P.split("").reverse().join("")},buildURLFromParts:function(P){return P.scheme+P.netLoc+P.path+P.params+P.query+P.fragment}};ne.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(ne,V,I){function z(p){var m={};function c(s){if(m[s])return m[s].exports;var d=m[s]={i:s,l:!1,exports:{}};return p[s].call(d.exports,d,d.exports,c),d.l=!0,d.exports}c.m=p,c.c=m,c.i=function(s){return s},c.d=function(s,d,l){c.o(s,d)||Object.defineProperty(s,d,{configurable:!1,enumerable:!0,get:l})},c.r=function(s){Object.defineProperty(s,"__esModule",{value:!0})},c.n=function(s){var d=s&&s.__esModule?function(){return s.default}:function(){return s};return c.d(d,"a",d),d},c.o=function(s,d){return Object.prototype.hasOwnProperty.call(s,d)},c.p="/",c.oe=function(s){throw console.error(s),s};var a=c(c.s=ENTRY_MODULE);return a.default||a}var L="[\\.|\\-|\\+|\\w|/|@]+",D="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+L+").*?\\)";function K(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function M(p){return!isNaN(1*p)}function r(p,m,c){var a={};a[c]=[];var s=m.toString(),d=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!d)return a;for(var l=d[1],i=new RegExp("(\\\\n|\\W)"+K(l)+D,"g"),n;n=i.exec(s);){if(n[3]==="dll-reference")continue;a[c].push(n[3])}for(i=new RegExp("\\("+K(l)+'\\("(dll-reference\\s('+L+'))"\\)\\)'+D,"g");n=i.exec(s);)p[n[2]]||(a[c].push(n[1]),p[n[2]]=I(n[1]).m),a[n[2]]=a[n[2]]||[],a[n[2]].push(n[4]);for(var O=Object.keys(a),C=0;C<O.length;C++)for(var T=0;T<a[O[C]].length;T++)M(a[O[C]][T])&&(a[O[C]][T]=1*a[O[C]][T]);return a}function P(p){var m=Object.keys(p);return m.reduce(function(c,a){return c||p[a].length>0},!1)}function x(p,m){for(var c={main:[m]},a={main:[]},s={main:{}};P(c);)for(var d=Object.keys(c),l=0;l<d.length;l++){var i=d[l],n=c[i],O=n.pop();if(s[i]=s[i]||{},s[i][O]||!p[i][O])continue;s[i][O]=!0,a[i]=a[i]||[],a[i].push(O);for(var C=r(p,p[i][O],i),T=Object.keys(C),R=0;R<T.length;R++)c[T[R]]=c[T[R]]||[],c[T[R]]=c[T[R]].concat(C[T[R]])}return a}ne.exports=function(p,m){m=m||{};var c={main:I.m},a=m.all?{main:Object.keys(c.main)}:x(c,p),s="";Object.keys(a).filter(function(O){return O!=="main"}).forEach(function(O){for(var C=0;a[O][C];)C++;a[O].push(C),c[O][C]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",s=s+"var "+O+" = ("+z.toString().replace("ENTRY_MODULE",JSON.stringify(C))+")({"+a[O].map(function(T){return""+JSON.stringify(T)+": "+c[O][T].toString()}).join(",")+`});
|
|
`}),s=s+"new (("+z.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+a.main.map(function(O){return""+JSON.stringify(O)+": "+c.main[O].toString()}).join(",")+"}))(self);";var d=new window.Blob([s],{type:"text/javascript"});if(m.bare)return d;var l=window.URL||window.webkitURL||window.mozURL||window.msURL,i=l.createObjectURL(d),n=new window.Worker(i);return n.objectURL=i,n}},"./src/config.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"hlsDefaultConfig",function(){return R}),I.d(V,"mergeConfig",function(){return y}),I.d(V,"enableStreamingMode",function(){return E});var z=I("./src/controller/abr-controller.ts"),L=I("./src/controller/audio-stream-controller.ts"),D=I("./src/controller/audio-track-controller.ts"),K=I("./src/controller/subtitle-stream-controller.ts"),M=I("./src/controller/subtitle-track-controller.ts"),r=I("./src/controller/buffer-controller.ts"),P=I("./src/controller/timeline-controller.ts"),x=I("./src/controller/cap-level-controller.ts"),p=I("./src/controller/fps-controller.ts"),m=I("./src/controller/eme-controller.ts"),c=I("./src/controller/cmcd-controller.ts"),a=I("./src/utils/xhr-loader.ts"),s=I("./src/utils/fetch-loader.ts"),d=I("./src/utils/cues.ts"),l=I("./src/utils/mediakeys-helper.ts"),i=I("./src/utils/logger.ts");function n(){return n=Object.assign||function(f){for(var h=1;h<arguments.length;h++){var v=arguments[h];for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(f[g]=v[g])}return f},n.apply(this,arguments)}function O(f,h){var v=Object.keys(f);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(f);h&&(g=g.filter(function(b){return Object.getOwnPropertyDescriptor(f,b).enumerable})),v.push.apply(v,g)}return v}function C(f){for(var h=1;h<arguments.length;h++){var v=arguments[h]!=null?arguments[h]:{};h%2?O(Object(v),!0).forEach(function(g){T(f,g,v[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(v)):O(Object(v)).forEach(function(g){Object.defineProperty(f,g,Object.getOwnPropertyDescriptor(v,g))})}return f}function T(f,h,v){return h in f?Object.defineProperty(f,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):f[h]=v,f}var R=C(C({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:r.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:l.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},S()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:M.default,timelineController:P.TimelineController,audioStreamController:L.default,audioTrackController:D.default,emeController:m.default,cmcdController:c.default});function S(){return{cueHandler:d.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 y(f,h){if((h.liveSyncDurationCount||h.liveMaxLatencyDurationCount)&&(h.liveSyncDuration||h.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(h.liveMaxLatencyDurationCount!==void 0&&(h.liveSyncDurationCount===void 0||h.liveMaxLatencyDurationCount<=h.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(h.liveMaxLatencyDuration!==void 0&&(h.liveSyncDuration===void 0||h.liveMaxLatencyDuration<=h.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return n({},f,h)}function E(f){var h=f.loader;if(h!==s.default&&h!==a.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),f.progressive=!1;else{var v=Object(s.fetchSupported)();v&&(f.loader=s.default,f.progressive=!0,f.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/polyfills/number.ts"),L=I("./src/utils/ewma-bandwidth-estimator.ts"),D=I("./src/events.ts"),K=I("./src/utils/buffer-helper.ts"),M=I("./src/errors.ts"),r=I("./src/types/loader.ts"),P=I("./src/utils/logger.ts");function x(c,a){for(var s=0;s<a.length;s++){var d=a[s];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(c,d.key,d)}}function p(c,a,s){return a&&x(c.prototype,a),s&&x(c,s),c}var m=function(){function c(s){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=s;var d=s.config;this.bwEstimator=new L.default(d.abrEwmaSlowVoD,d.abrEwmaFastVoD,d.abrEwmaDefaultEstimate),this.registerListeners()}var a=c.prototype;return a.registerListeners=function(){var d=this.hls;d.on(D.Events.FRAG_LOADING,this.onFragLoading,this),d.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),d.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(D.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var d=this.hls;d.off(D.Events.FRAG_LOADING,this.onFragLoading,this),d.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(D.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(d,l){var i=l.frag;if(i.type===r.PlaylistLevelType.MAIN&&!this.timer){var n;this.fragCurrent=i,this.partCurrent=(n=l.part)!=null?n:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(d,l){var i=this.hls.config;l.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var d=this.fragCurrent,l=this.partCurrent,i=this.hls,n=i.autoLevelEnabled,O=i.config,C=i.media;if(!d||!C)return;var T=l?l.stats:d.stats,R=l?l.duration:d.duration;if(T.aborted){P.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!n||C.paused||!C.playbackRate||!C.readyState)return;var S=performance.now()-T.loading.start,y=Math.abs(C.playbackRate);if(S<=500*R/y)return;var E=i.levels,f=i.minAutoLevel,h=E[d.level],v=T.total||Math.max(T.loaded,Math.round(R*h.maxBitrate/8)),g=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/S),b=(v-T.loaded)/g,N=C.currentTime,H=(K.BufferHelper.bufferInfo(C,N,O.maxBufferHole).end-N)/y;if(H>=2*R/y||b<=H)return;var A=Number.POSITIVE_INFINITY,F;for(F=d.level-1;F>f;F--){var U=E[F].maxBitrate;if(A=R*U/(8*.8*g),A<H)break}if(A>=b)return;var w=this.bwEstimator.getEstimate();P.logger.warn("Fragment "+d.sn+(l?" part "+l.index:"")+" of level "+d.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+F+`
|
|
Current BW estimate: `+(Object(z.isFiniteNumber)(w)?(w/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+b.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+A.toFixed(3)+` s
|
|
Time to underbuffer: `+H.toFixed(3)+" s"),i.nextLoadLevel=F,this.bwEstimator.sample(S,T.loaded),this.clearTimer(),d.loader&&(this.fragCurrent=this.partCurrent=null,d.loader.abort()),i.trigger(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:d,part:l,stats:T})},a.onFragLoaded=function(d,l){var i=l.frag,n=l.part;if(i.type===r.PlaylistLevelType.MAIN&&Object(z.isFiniteNumber)(i.sn)){var O=n?n.stats:i.stats,C=n?n.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[i.level],R=(T.loaded?T.loaded.bytes:0)+O.loaded,S=(T.loaded?T.loaded.duration:0)+C;T.loaded={bytes:R,duration:S},T.realBitrate=Math.round(8*R/S)}if(i.bitrateTest){var y={stats:O,frag:i,part:n,id:i.type};this.onFragBuffered(D.Events.FRAG_BUFFERED,y),i.bitrateTest=!1}}},a.onFragBuffered=function(d,l){var i=l.frag,n=l.part,O=n?n.stats:i.stats;if(O.aborted)return;if(i.type!==r.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var C=O.parsing.end-O.loading.start;this.bwEstimator.sample(C,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=C/1e3:this.bitrateTestDelay=0},a.onError=function(d,l){switch(l.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var d=this.fragCurrent,l=this.partCurrent,i=this.hls,n=i.maxAutoLevel,O=i.config,C=i.minAutoLevel,T=i.media,R=l?l.duration:d?d.duration:0,S=T?T.currentTime:0,y=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,f=(K.BufferHelper.bufferInfo(T,S,O.maxBufferHole).end-S)/y,h=this.findBestLevel(E,C,n,f,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(h>=0)return h;P.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var v=R?Math.min(R,O.maxStarvationDelay):O.maxStarvationDelay,g=O.abrBandWidthFactor,b=O.abrBandWidthUpFactor;if(!f){var N=this.bitrateTestDelay;if(N){var H=R?Math.min(R,O.maxLoadingDelay):O.maxLoadingDelay;v=H-N,P.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),g=b=1}}return h=this.findBestLevel(E,C,n,f+v,g,b),Math.max(h,0)},a.findBestLevel=function(d,l,i,n,O,C){for(var T,R=this.fragCurrent,S=this.partCurrent,y=this.lastLoadedFragLevel,E=this.hls.levels,f=E[y],h=!!(f!=null&&(T=f.details)!==null&&T!==void 0&&T.live),v=f==null?void 0:f.codecSet,g=S?S.duration:R?R.duration:0,b=i;b>=l;b--){var N=E[b];if(!N||v&&N.codecSet!==v)continue;var H=N.details,A=(S?H==null?void 0:H.partTarget:H==null?void 0:H.averagetargetduration)||g,F=void 0;b<=y?F=O*d:F=C*d;var U=E[b].maxBitrate,w=U*A/F;if(P.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(F)+"/"+U+"/"+A+"/"+n+"/"+w),F>U&&(!w||h&&!this.bitrateTestDelay||w<n))return b}return-1},p(c,[{key:"nextAutoLevel",get:function(){var d=this._nextAutoLevel,l=this.bwEstimator;if(d!==-1&&(!l||!l.canEstimate()))return d;var i=this.getNextABRAutoLevel();return d!==-1&&(i=Math.min(d,i)),i},set:function(d){this._nextAutoLevel=d}}]),c}();V.default=m},"./src/controller/audio-stream-controller.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/polyfills/number.ts"),L=I("./src/controller/base-stream-controller.ts"),D=I("./src/events.ts"),K=I("./src/utils/buffer-helper.ts"),M=I("./src/controller/fragment-tracker.ts"),r=I("./src/types/level.ts"),P=I("./src/types/loader.ts"),x=I("./src/loader/fragment.ts"),p=I("./src/demux/chunk-cache.ts"),m=I("./src/demux/transmuxer-interface.ts"),c=I("./src/types/transmuxer.ts"),a=I("./src/controller/fragment-finders.ts"),s=I("./src/utils/discontinuities.ts"),d=I("./src/errors.ts"),l=I("./src/utils/logger.ts");function i(){return i=Object.assign||function(R){for(var S=1;S<arguments.length;S++){var y=arguments[S];for(var E in y)Object.prototype.hasOwnProperty.call(y,E)&&(R[E]=y[E])}return R},i.apply(this,arguments)}function n(R,S){R.prototype=Object.create(S.prototype),R.prototype.constructor=R,O(R,S)}function O(R,S){return O=Object.setPrototypeOf||function(E,f){return E.__proto__=f,E},O(R,S)}var C=100,T=function(R){n(S,R);function S(E,f){var h;return h=R.call(this,E,f,"[audio-stream-controller]")||this,h.videoBuffer=null,h.videoTrackCC=-1,h.waitingVideoCC=-1,h.audioSwitch=!1,h.trackId=-1,h.waitingData=null,h.mainDetails=null,h.bufferFlushed=!1,h._registerListeners(),h}var y=S.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var f=this.hls;f.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(D.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.on(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(D.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.on(D.Events.ERROR,this.onError,this),f.on(D.Events.BUFFER_RESET,this.onBufferReset,this),f.on(D.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._unregisterListeners=function(){var f=this.hls;f.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(D.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.off(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(D.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.off(D.Events.ERROR,this.onError,this),f.off(D.Events.BUFFER_RESET,this.onBufferReset,this),f.off(D.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onInitPtsFound=function(f,h){var v=h.frag,g=h.id,b=h.initPTS;if(g==="main"){var N=v.cc;this.initPTS[v.cc]=b,this.log("InitPTS for cc: "+N+" found from main: "+b),this.videoTrackCC=N,this.state===L.State.WAITING_INIT_PTS&&this.tick()}},y.startLoad=function(f){if(!this.levels){this.startPosition=f,this.state=L.State.STOPPED;return}var h=this.lastCurrentTime;this.stopLoad(),this.setInterval(C),this.fragLoadError=0,h>0&&f===-1?(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),this.state=L.State.IDLE):(this.loadedmetadata=!1,this.state=L.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()},y.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_TRACK:{var f,h=this.levels,v=this.trackId,g=h==null||((f=h[v])===null||f===void 0)?void 0:f.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=L.State.WAITING_INIT_PTS}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var b,N=performance.now(),H=this.retryDate;(!H||N>=H||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=L.State.IDLE);break}case L.State.WAITING_INIT_PTS:{var A=this.waitingData;if(A){var F=A.frag,U=A.part,w=A.cache,Y=A.complete;if(this.initPTS[F.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.FRAG_LOADING;var Z=w.flush(),ce={frag:F,part:U,payload:Z,networkDetails:null};this._handleFragmentLoadProgress(ce),Y&&R.prototype._handleFragmentLoadComplete.call(this,ce)}else if(this.videoTrackCC!==this.waitingVideoCC)l.logger.log("Waiting fragment cc ("+F.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var be=this.getLoadPosition(),Ze=K.BufferHelper.bufferInfo(this.mediaBuffer,be,this.config.maxBufferHole),Ce=Object(a.fragmentWithinToleranceTest)(Ze.end,this.config.maxFragLookUpTolerance,F);Ce<0&&(l.logger.log("Waiting fragment cc ("+F.cc+") @ "+F.start+" cancelled because another fragment at "+Ze.end+" is needed"),this.clearWaitingFragment())}}else this.state=L.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var f=this.waitingData;f&&(this.fragmentTracker.removeFragment(f.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.IDLE)},y.onTickEnd=function(){var f=this.media;if(!f||!f.readyState)return;var h=this.mediaBuffer?this.mediaBuffer:f,v=h.buffered;!this.loadedmetadata&&v.length&&(this.loadedmetadata=!0),this.lastCurrentTime=f.currentTime},y.doTickIdle=function(){var f,h,v=this.hls,g=this.levels,b=this.media,N=this.trackId,H=v.config;if(!g||!g[N])return;if(!b&&(this.startFragRequested||!H.startFragPrefetch))return;var A=g[N],F=A.details;if(!F||F.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(F)){this.state=L.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,x.ElementaryStreamTypes.AUDIO,P.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,P.PlaylistLevelType.AUDIO);if(U===null)return;var w=U.len,Y=this.getMaxBufferLength(),Z=this.audioSwitch;if(w>=Y&&!Z)return;if(!Z&&this._streamEnded(U,F)){v.trigger(D.Events.BUFFER_EOS,{type:"audio"}),this.state=L.State.ENDED;return}var ce=F.fragments,be=ce[0].start,Ze=U.end;if(Z){var Ce=this.getLoadPosition();Ze=Ce,F.PTSKnown&&Ce<be&&((U.end>be||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=be+.05))}var We=this.getNextFragment(Ze,F);if(!We){this.bufferFlushed=!0;return}((f=We.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((h=We.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(We,F):this.loadFragment(We,F,Ze)},y.getMaxBufferLength=function(){var f=R.prototype.getMaxBufferLength.call(this),h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,P.PlaylistLevelType.MAIN);return h===null?f:Math.max(f,h.len)},y.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(f,h){var v=h.audioTracks;this.resetTransmuxer(),this.levels=v.map(function(g){return new r.Level(g)})},y.onAudioTrackSwitching=function(f,h){var v=!!h.url;this.trackId=h.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),v?this.setInterval(C):this.resetTransmuxer(),v?(this.audioSwitch=!0,this.state=L.State.IDLE):this.state=L.State.STOPPED,this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},y.onLevelLoaded=function(f,h){this.mainDetails=h.details},y.onAudioTrackLoaded=function(f,h){var v,g=this.levels,b=h.details,N=h.id;if(!g){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var H=g[N],A=0;if(b.live||(v=H.details)!==null&&v!==void 0&&v.live){var F=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!F)return;!H.details&&b.hasProgramDateTime&&F.hasProgramDateTime?(Object(s.alignMediaPlaylistByPDT)(b,F),A=b.fragments[0].start):A=this.alignPlaylists(b,H.details)}H.details=b,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(H.details,A),this.state===L.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=L.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(f){var h,v=f.frag,g=f.part,b=f.payload,N=this.config,H=this.trackId,A=this.levels;if(!A){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+v.sn+" of level "+v.level+" will not be buffered");return}var F=A[H];console.assert(F,"Audio track is defined on fragment load progress");var U=F.details;console.assert(U,"Audio track details are defined on fragment load progress");var w=N.defaultAudioCodec||F.audioCodec||"mp4a.40.2",Y=this.transmuxer;Y||(Y=this.transmuxer=new m.default(this.hls,P.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Z=this.initPTS[v.cc],ce=(h=v.initSegment)===null||h===void 0?void 0:h.data;if(Z!==void 0){var be=!1,Ze=g?g.index:-1,Ce=Ze!==-1,We=new c.ChunkMetadata(v.level,v.sn,v.stats.chunkCount,b.byteLength,Ze,Ce);Y.push(b,ce,w,"",v,g,U.totalduration,be,We,Z)}else{l.logger.log("Unknown video PTS for cc "+v.cc+", waiting for video PTS before demuxing audio frag "+v.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+H);var Ve=this.waitingData=this.waitingData||{frag:v,part:g,cache:new p.default,complete:!1},Ye=Ve.cache;Ye.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=L.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(f){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,f)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(f,h){var v=h.tracks.audio;v&&(this.mediaBuffer=v.buffer),h.tracks.video&&(this.videoBuffer=h.tracks.video.buffer)},y.onFragBuffered=function(f,h){var v=h.frag,g=h.part;if(v.type!==P.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(v)){this.warn("Fragment "+v.sn+(g?" p: "+g.index:"")+" of level "+v.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}v.sn!=="initSegment"&&(this.fragPrevious=v,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(v,g)},y.onError=function(f,h){switch(h.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.AUDIO,h);break;case d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case d.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==L.State.ERROR&&this.state!==L.State.STOPPED&&(this.state=h.fatal?L.State.ERROR:L.State.IDLE,this.warn(h.details+" while loading frag, switching to "+this.state+" state"));break;case d.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="audio"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var v=!0,g=this.getFwdBufferInfo(this.mediaBuffer,P.PlaylistLevelType.AUDIO);g&&g.len>.5&&(v=!this.reduceMaxBufferLength(g.len)),v&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},y.onBufferFlushed=function(f,h){var v=h.type;v===x.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(f){var h,v="audio",g=this.hls,b=f.remuxResult,N=f.chunkMeta,H=this.getCurrentContext(N);if(!H){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var A=H.frag,F=H.part,U=b.audio,w=b.text,Y=b.id3,Z=b.initSegment;if(this.fragContextChanged(A))return;if(this.state=L.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),Z!=null&&Z.tracks&&(this._bufferInitSegment(Z.tracks,A,N),g.trigger(D.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:v,tracks:Z.tracks})),U){var ce=U.startPTS,be=U.endPTS,Ze=U.startDTS,Ce=U.endDTS;F&&(F.elementaryStreams[x.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:be,startDTS:Ze,endDTS:Ce}),A.setElementaryStreamInfo(x.ElementaryStreamTypes.AUDIO,ce,be,Ze,Ce),this.bufferFragmentData(U,A,F,N)}if(Y!=null&&(h=Y.samples)!==null&&h!==void 0&&h.length){var We=i({frag:A,id:v},Y);g.trigger(D.Events.FRAG_PARSING_METADATA,We)}if(w){var Ve=i({frag:A,id:v},w);g.trigger(D.Events.FRAG_PARSING_USERDATA,Ve)}},y._bufferInitSegment=function(f,h,v){if(this.state!==L.State.PARSING)return;f.video&&delete f.video;var g=f.audio;if(!g)return;g.levelCodec=g.codec,g.id="audio",this.log("Init audio buffer, container:"+g.container+", codecs[parsed]=["+g.codec+"]"),this.hls.trigger(D.Events.BUFFER_CODECS,f);var b=g.initSegment;if(b!=null&&b.byteLength){var N={type:"audio",frag:h,part:null,chunkMeta:v,parent:h.type,data:b};this.hls.trigger(D.Events.BUFFER_APPENDING,N)}this.tick()},y.loadFragment=function(f,h,v){var g=this.fragmentTracker.getState(f);this.fragCurrent=f,(this.audioSwitch||g===M.FragmentState.NOT_LOADED||g===M.FragmentState.PARTIAL)&&(f.sn==="initSegment"?this._loadInitSegment(f):h.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=L.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,f,h,v)))},y.completeAudioSwitch=function(){var f=this.hls,h=this.media,v=this.trackId;h&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,f.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:v})},S}(L.default);V.default=T},"./src/controller/audio-track-controller.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/events.ts"),L=I("./src/errors.ts"),D=I("./src/controller/base-playlist-controller.ts"),K=I("./src/types/loader.ts");function M(m,c){for(var a=0;a<c.length;a++){var s=c[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(m,s.key,s)}}function r(m,c,a){return c&&M(m.prototype,c),a&&M(m,a),m}function P(m,c){m.prototype=Object.create(c.prototype),m.prototype.constructor=m,x(m,c)}function x(m,c){return x=Object.setPrototypeOf||function(s,d){return s.__proto__=d,s},x(m,c)}var p=function(m){P(c,m);function c(s){var d;return d=m.call(this,s,"[audio-track-controller]")||this,d.tracks=[],d.groupId=null,d.tracksInGroup=[],d.trackId=-1,d.trackName="",d.selectDefaultTrack=!0,d.registerListeners(),d}var a=c.prototype;return a.registerListeners=function(){var d=this.hls;d.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.on(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.on(z.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var d=this.hls;d.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.off(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.off(z.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.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(d,l){this.tracks=l.audioTracks||[]},a.onAudioTrackLoaded=function(d,l){var i=l.id,n=l.details,O=this.tracksInGroup[i];if(!O){this.warn("Invalid audio track id "+i);return}var C=O.details;O.details=l.details,this.log("audioTrack "+i+" loaded ["+n.startSN+"-"+n.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,l,C))},a.onLevelLoading=function(d,l){this.switchLevel(l.level)},a.onLevelSwitching=function(d,l){this.switchLevel(l.level)},a.switchLevel=function(d){var l=this.hls.levels[d];if(!(l!=null&&l.audioGroupIds))return;var i=l.audioGroupIds[l.urlId];if(this.groupId!==i){this.groupId=i;var n=this.tracks.filter(function(C){return!i||C.groupId===i});this.selectDefaultTrack&&!n.some(function(C){return C.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=n;var O={audioTracks:n};this.log("Updating audio tracks, "+n.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(z.Events.AUDIO_TRACKS_UPDATED,O),this.selectInitialTrack()}},a.onError=function(d,l){if(m.prototype.onError.call(this,d,l),l.fatal||!l.context)return;l.context.type===K.PlaylistContextType.AUDIO_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},a.setAudioTrack=function(d){var l=this.tracksInGroup;if(d<0||d>=l.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=l[this.trackId];this.log("Now switching to audio-track index "+d);var n=l[d],O=n.id,C=n.groupId,T=C===void 0?"":C,R=n.name,S=n.type,y=n.url;if(this.trackId=d,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(z.Events.AUDIO_TRACK_SWITCHING,{id:O,groupId:T,name:R,type:S,url:y}),n.details&&!n.details.live)return;var E=this.switchParams(n.url,i==null?void 0:i.details);this.loadPlaylist(E)},a.selectInitialTrack=function(){var d=this.tracksInGroup;console.assert(d.length,"Initial audio track should be selected when tracks are known");var l=this.trackName,i=this.findTrackId(l)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(z.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(d){for(var l=this.tracksInGroup,i=0;i<l.length;i++){var n=l[i];if((!this.selectDefaultTrack||n.default)&&(!d||d===n.name))return n.id}return-1},a.loadPlaylist=function(d){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var i=l.id,n=l.groupId,O=l.url;if(d)try{O=d.addDirectives(O)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(z.Events.AUDIO_TRACK_LOADING,{url:O,id:i,groupId:n,deliveryDirectives:d||null})}},r(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(d){this.selectDefaultTrack=!1,this.setAudioTrack(d)}}]),c}(D.default);V.default=p},"./src/controller/base-playlist-controller.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return r});var z=I("./src/polyfills/number.ts"),L=I("./src/types/level.ts"),D=I("./src/controller/level-helper.ts"),K=I("./src/utils/logger.ts"),M=I("./src/errors.ts"),r=function(){function P(p,m){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=K.logger.log.bind(K.logger,m+":"),this.warn=K.logger.warn.bind(K.logger,m+":"),this.hls=p}var x=P.prototype;return x.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},x.onError=function(m,c){c.fatal&&c.type===M.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(m,c){var a=c==null?void 0:c.renditionReports;if(a)for(var s=0;s<a.length;s++){var d=a[s],l=""+d.URI;if(l===m.substr(-l.length)){var i=parseInt(d["LAST-MSN"]),n=parseInt(d["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var O=Math.min(c.age-c.partTarget,c.targetduration);n!==void 0&&O>c.partTarget&&(n+=1)}if(Object(z.isFiniteNumber)(i))return new L.HlsUrlParameters(i,Object(z.isFiniteNumber)(n)?n:void 0,L.HlsSkip.No)}}},x.loadPlaylist=function(m){},x.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},x.playlistLoaded=function(m,c,a){var s=this,d=c.details,l=c.stats,i=l.loading.end?Math.max(0,self.performance.now()-l.loading.end):0;if(d.advancedDateTime=Date.now()-i,d.live||a!=null&&a.live){if(d.reloaded(a),a&&this.log("live playlist "+m+" "+(d.advanced?"REFRESHED "+d.lastPartSn+"-"+d.lastPartIndex:"MISSED")),a&&d.fragments.length>0&&Object(D.mergeDetails)(a,d),!this.canLoad||!d.live)return;var n,O=void 0,C=void 0;if(d.canBlockReload&&d.endSN&&d.advanced){var T=this.hls.config.lowLatencyMode,R=d.lastPartSn,S=d.endSN,y=d.lastPartIndex,E=y!==-1,f=R===S,h=T?0:y;E?(O=f?S+1:R,C=f?h:y+1):O=S+1;var v=d.age,g=v+d.ageHeader,b=Math.min(g-d.partTarget,d.targetduration*1.5);if(b>0){if(a&&b>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+b+" with playlist age: "+d.age),b=0;else{var N=Math.floor(b/d.targetduration);if(O+=N,C!==void 0){var H=Math.round(b%d.targetduration/d.partTarget);C+=H}this.log("CDN Tune-in age: "+d.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+b+" skip sn "+N+" to part "+C)}d.tuneInGoal=b}if(n=this.getDeliveryDirectives(d,c.deliveryDirectives,O,C),T||!f){this.loadPlaylist(n);return}}else n=this.getDeliveryDirectives(d,c.deliveryDirectives,O,C);var A=Object(D.computeReloadInterval)(d,l);O!==void 0&&d.canBlockReload&&(A-=d.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return s.loadPlaylist(n)},A)}else this.clearTimer()},x.getDeliveryDirectives=function(m,c,a,s){var d=Object(L.getSkipValue)(m,a);return c!=null&&c.skip&&m.deltaUpdateFailed&&(a=c.msn,s=c.part,d=L.HlsSkip.No),new L.HlsUrlParameters(a,s,d)},x.retryLoadingOrFail=function(m){var c=this,a=this.hls.config,s=this.retryCount<a.levelLoadingMaxRetry;if(s){var d;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-1&&(d=m.context)!==null&&d!==void 0&&d.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var l=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},l),this.warn("retry playlist loading #"+this.retryCount+" in "+l+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return s},P}()},"./src/controller/base-stream-controller.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"State",function(){return S}),I.d(V,"default",function(){return y});var z=I("./src/polyfills/number.ts"),L=I("./src/task-loop.ts"),D=I("./src/controller/fragment-tracker.ts"),K=I("./src/utils/buffer-helper.ts"),M=I("./src/utils/logger.ts"),r=I("./src/events.ts"),P=I("./src/errors.ts"),x=I("./src/types/transmuxer.ts"),p=I("./src/utils/mp4-tools.ts"),m=I("./src/utils/discontinuities.ts"),c=I("./src/controller/fragment-finders.ts"),a=I("./src/controller/level-helper.ts"),s=I("./src/loader/fragment-loader.ts"),d=I("./src/crypt/decrypter.ts"),l=I("./src/utils/time-ranges.ts"),i=I("./src/types/loader.ts");function n(E,f){for(var h=0;h<f.length;h++){var v=f[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(E,v.key,v)}}function O(E,f,h){return f&&n(E.prototype,f),h&&n(E,h),E}function C(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function T(E,f){E.prototype=Object.create(f.prototype),E.prototype.constructor=E,R(E,f)}function R(E,f){return R=Object.setPrototypeOf||function(v,g){return v.__proto__=g,v},R(E,f)}var S={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"},y=function(E){T(f,E);function f(v,g,b){var N;return N=E.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=S.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=b,N.log=M.logger.log.bind(M.logger,b+":"),N.warn=M.logger.warn.bind(M.logger,b+":"),N.hls=v,N.fragmentLoader=new s.default(v.config),N.fragmentTracker=g,N.config=v.config,N.decrypter=new d.default(v,v.config),v.on(r.Events.KEY_LOADED,N.onKeyLoaded,C(N)),N}var h=f.prototype;return h.doTick=function(){this.onTickEnd()},h.onTickEnd=function(){},h.startLoad=function(g){},h.stopLoad=function(){this.fragmentLoader.abort();var g=this.fragCurrent;g&&this.fragmentTracker.removeFragment(g),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=S.STOPPED},h._streamEnded=function(g,b){var N=this.fragCurrent,H=this.fragmentTracker;if(!b.live&&N&&N.sn===b.endSN&&!g.nextStart){var A=H.getState(N);return A===D.FragmentState.PARTIAL||A===D.FragmentState.OK}return!1},h.onMediaAttached=function(g,b){var N=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var H=this.config;this.levels&&H.autoStartLoad&&this.state===S.STOPPED&&this.startLoad(H.startPosition)},h.onMediaDetaching=function(){var g=this.media;g!=null&&g.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),g&&(g.removeEventListener("seeking",this.onvseeking),g.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},h.onMediaSeeking=function(){var g=this.config,b=this.fragCurrent,N=this.media,H=this.mediaBuffer,A=this.state,F=N?N.currentTime:0,U=K.BufferHelper.bufferInfo(H||N,F,g.maxBufferHole);if(this.log("media seeking to "+(Object(z.isFiniteNumber)(F)?F.toFixed(3):F)+", state: "+A),A===S.ENDED)this.resetLoadingState();else if(b&&!U.len){var w=g.maxFragLookUpTolerance,Y=b.start-w,Z=b.start+b.duration+w,ce=F>Z;(F<Y||ce)&&(ce&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=F),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=F),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onKeyLoaded=function(g,b){if(this.state!==S.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=S.IDLE;var N=this.levels[b.frag.level].details;N&&this.loadFragment(b.frag,N,b.frag.start)},h.onHandlerDestroying=function(){this.stopLoad(),E.prototype.onHandlerDestroying.call(this)},h.onHandlerDestroyed=function(){this.state=S.STOPPED,this.hls.off(r.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,E.prototype.onHandlerDestroyed.call(this)},h.loadKey=function(g,b){this.log("Loading key for "+g.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=S.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(r.Events.KEY_LOADING,{frag:g})},h.loadFragment=function(g,b,N){this._loadFragForPlayback(g,b,N)},h._loadFragForPlayback=function(g,b,N){var H=this,A=function(U){if(H.fragContextChanged(g)){H.warn("Fragment "+g.sn+(U.part?" p: "+U.part.index:"")+" of level "+g.level+" was dropped during download."),H.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,H._handleFragmentLoadProgress(U)};this._doFragLoad(g,b,N,A).then(function(F){if(!F)return;H.fragLoadError=0;var U=H.state;if(H.fragContextChanged(g)){(U===S.FRAG_LOADING||U===S.BACKTRACKING||!H.fragCurrent&&U===S.PARSING)&&(H.fragmentTracker.removeFragment(g),H.state=S.IDLE);return}if("payload"in F&&(H.log("Loaded fragment "+g.sn+" of level "+g.level),H.hls.trigger(r.Events.FRAG_LOADED,F),H.state===S.BACKTRACKING)){H.fragmentTracker.backtrack(g,F),H.resetFragmentLoading(g);return}H._handleFragmentLoadComplete(F)}).catch(function(F){H.warn(F),H.resetFragmentLoading(g)})},h.flushMainBuffer=function(g,b,N){if(N===void 0&&(N=null),!(g-b))return;var H={startOffset:g,endOffset:b,type:N};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,H)},h._loadInitSegment=function(g){var b=this;this._doFragLoad(g).then(function(N){if(!N||b.fragContextChanged(g)||!b.levels)throw new Error("init load aborted");return N}).then(function(N){var H=b.hls,A=N.payload,F=g.decryptdata;if(A&&A.byteLength>0&&F&&F.key&&F.iv&&F.method==="AES-128"){var U=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(A),F.key.buffer,F.iv.buffer).then(function(w){var Y=self.performance.now();return H.trigger(r.Events.FRAG_DECRYPTED,{frag:g,payload:w,stats:{tstart:U,tdecrypt:Y}}),N.payload=w,N})}return N}).then(function(N){var H=b.fragCurrent,A=b.hls,F=b.levels;if(!F)throw new Error("init load aborted, missing levels");var U=F[g.level].details;console.assert(U,"Level details are defined when init segment is loaded");var w=g.stats;b.state=S.IDLE,b.fragLoadError=0,g.data=new Uint8Array(N.payload),w.parsing.start=w.buffering.start=self.performance.now(),w.parsing.end=w.buffering.end=self.performance.now(),N.frag===H&&A.trigger(r.Events.FRAG_BUFFERED,{stats:w,frag:H,part:null,id:g.type}),b.tick()}).catch(function(N){b.warn(N),b.resetFragmentLoading(g)})},h.fragContextChanged=function(g){var b=this.fragCurrent;return!g||!b||g.level!==b.level||g.sn!==b.sn||g.urlId!==b.urlId},h.fragBufferedComplete=function(g,b){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+l.default.toString(K.BufferHelper.getBuffered(N))),this.state=S.IDLE,this.tick()},h._handleFragmentLoadComplete=function(g){var b=this.transmuxer;if(!b)return;var N=g.frag,H=g.part,A=g.partsLoaded,F=!A||A.length===0||A.some(function(w){return!w}),U=new x.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,H?H.index:-1,!F);b.flush(U)},h._handleFragmentLoadProgress=function(g){},h._doFragLoad=function(g,b,N,H){var A=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(g.start,N||0),this.config.lowLatencyMode&&b){var F=b.partList;if(F&&H){N>g.end&&b.fragmentHint&&(g=b.fragmentHint);var U=this.getNextPart(F,g,N);if(U>-1){var w=F[U];return this.log("Loading part sn: "+g.sn+" p: "+w.index+" cc: "+g.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+U+"-"+(F.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=w.start+w.duration,this.state=S.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:g,part:F[U],targetBufferTime:N}),this.doFragPartsLoad(g,F,U,H).catch(function(Y){return A.handleFragLoadError(Y)})}else if(!g.url||this.loadedEndOfParts(F,N))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(N.toFixed(3))),Object(z.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=S.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:g,targetBufferTime:N}),this.fragmentLoader.load(g,H).catch(function(Y){return A.handleFragLoadError(Y)})},h.doFragPartsLoad=function(g,b,N,H){var A=this;return new Promise(function(F,U){var w=[],Y=function Z(ce){var be=b[ce];A.fragmentLoader.loadPart(g,be,H).then(function(Ze){w[be.index]=Ze;var Ce=Ze.part;A.hls.trigger(r.Events.FRAG_LOADED,Ze);var We=b[ce+1];if(We&&We.fragment===g)Z(ce+1);else return F({frag:g,part:Ce,partsLoaded:w})}).catch(U)};Y(N)})},h.handleFragLoadError=function(g){var b=g.data;return b&&b.details===P.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(r.Events.ERROR,b),null},h._handleTransmuxerFlush=function(g){var b=this.getCurrentContext(g);if(!b||this.state!==S.PARSING){this.fragCurrent||(this.state=S.IDLE);return}var N=b.frag,H=b.part,A=b.level,F=self.performance.now();N.stats.parsing.end=F,H&&(H.stats.parsing.end=F),this.updateLevelTiming(N,H,A,g.partial)},h.getCurrentContext=function(g){var b=this.levels,N=g.level,H=g.sn,A=g.part;if(!b||!b[N])return this.warn("Levels object was unset while buffering fragment "+H+" of level "+N+". The current chunk will not be buffered."),null;var F=b[N],U=A>-1?Object(a.getPartWith)(F,H,A):null,w=U?U.fragment:Object(a.getFragmentWithSN)(F,H,this.fragCurrent);return w?{frag:w,part:U,level:F}:null},h.bufferFragmentData=function(g,b,N,H){if(!g||this.state!==S.PARSING)return;var A=g.data1,F=g.data2,U=A;if(A&&F&&(U=Object(p.appendUint8Array)(A,F)),!U||!U.length)return;var w={type:g.type,frag:b,part:N,chunkMeta:H,parent:b.type,data:U};this.hls.trigger(r.Events.BUFFER_APPENDING,w),g.dropped&&g.independent&&!N&&this.flushBufferGap(b)},h.flushBufferGap=function(g){var b=this.media;if(!b)return;if(!K.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,g.start);return}var N=b.currentTime,H=K.BufferHelper.bufferInfo(b,N,0),A=g.duration,F=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),U=Math.max(Math.min(g.start-F,H.end-F),N+F);g.start-U>F&&this.flushMainBuffer(U,g.start)},h.getFwdBufferInfo=function(g,b){var N=this.config,H=this.getLoadPosition();if(!Object(z.isFiniteNumber)(H))return null;var A=K.BufferHelper.bufferInfo(g,H,N.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var F=this.fragmentTracker.getBufferedFrag(H,b);if(F&&A.nextStart<F.end)return K.BufferHelper.bufferInfo(g,H,Math.max(A.nextStart,N.maxBufferHole))}return A},h.getMaxBufferLength=function(g){var b=this.config,N;return g?N=Math.max(8*b.maxBufferSize/g,b.maxBufferLength):N=b.maxBufferLength,Math.min(N,b.maxMaxBufferLength)},h.reduceMaxBufferLength=function(g){var b=this.config,N=g||b.maxBufferLength;return b.maxMaxBufferLength>=N?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(g,b){var N,H,A=b.fragments,F=A.length;if(!F)return null;var U=this.config,w=A[0].start,Y;if(b.live){var Z=U.initialLiveManifestSize;if(F<Z)return this.warn("Not enough fragments to start playback (have: "+F+", need: "+Z+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(Y=this.getInitialLiveFragment(b,A),this.startPosition=Y?this.hls.liveSyncPosition||Y.start:g)}else g<=w&&(Y=A[0]);if(!Y){var ce=U.lowLatencyMode?b.partEnd:b.fragmentEnd;Y=this.getFragmentAtPosition(g,ce,b)}return(N=Y)!==null&&N!==void 0&&N.initSegment&&!((H=Y)!==null&&H!==void 0&&H.initSegment.data)&&!this.bitrateTest&&(Y=Y.initSegment),Y},h.getNextPart=function(g,b,N){for(var H=-1,A=!1,F=!0,U=0,w=g.length;U<w;U++){var Y=g[U];if(F=F&&!Y.independent,H>-1&&N<Y.start)break;var Z=Y.loaded;!Z&&(A||Y.independent||F)&&Y.fragment===b&&(H=U),A=Z}return H},h.loadedEndOfParts=function(g,b){var N=g[g.length-1];return N&&b>N.start&&N.loaded},h.getInitialLiveFragment=function(g,b){var N=this.fragPrevious,H=null;if(N){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),H=Object(c.findFragmentByPDT)(b,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!H){var A=N.sn+1;if(A>=g.startSN&&A<=g.endSN){var F=b[A-g.startSN];N.cc===F.cc&&(H=F,this.log("Live playlist, switching playlist, load frag with next SN: "+H.sn))}H||(H=Object(c.findFragWithCC)(b,N.cc),H&&this.log("Live playlist, switching playlist, load frag with same CC: "+H.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(H=this.getFragmentAtPosition(U,this.bitrateTest?g.fragmentEnd:g.edge,g))}return H},h.getFragmentAtPosition=function(g,b,N){var H=this.config,A=this.fragPrevious,F=N.fragments,U=N.endSN,w=N.fragmentHint,Y=H.maxFragLookUpTolerance,Z=!!(H.lowLatencyMode&&N.partList&&w);Z&&w&&!this.bitrateTest&&(F=F.concat(w),U=w.sn);var ce;if(g<b){var be=g>b-Y?0:Y;ce=Object(c.findFragmentByPTS)(A,F,g,be)}else ce=F[F.length-1];if(ce){var Ze=ce.sn-N.startSN,Ce=A&&ce.level===A.level,We=F[Ze+1],Ve=this.fragmentTracker.getState(ce);if(Ve===D.FragmentState.BACKTRACKED){ce=null;for(var Ye=Ze;F[Ye]&&this.fragmentTracker.getState(F[Ye])===D.FragmentState.BACKTRACKED;)A?ce=F[Ye--]:ce=F[--Ye];ce||(ce=We)}else A&&ce.sn===A.sn&&!Z&&(Ce&&(ce.sn<U&&this.fragmentTracker.getState(We)!==D.FragmentState.OK?(this.log("SN "+ce.sn+" just loaded, load next one: "+We.sn),ce=We):ce=null))}return ce},h.synchronizeToLiveEdge=function(g){var b=this.config,N=this.media;if(!N)return;var H=this.hls.liveSyncPosition,A=N.currentTime,F=g.fragments[0].start,U=g.edge,w=A>=F-b.maxFragLookUpTolerance&&A<=U;if(H!==null&&N.duration>H&&(A<H||!w)){var Y=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*g.targetduration;(!w&&N.readyState<4||A<U-Y)&&(this.loadedmetadata||(this.nextLoadPosition=H),N.readyState&&(this.warn("Playback: "+A.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+H.toFixed(3)),N.currentTime=H))}},h.alignPlaylists=function(g,b){var N=this.levels,H=this.levelLastLoaded,A=this.fragPrevious,F=H!==null?N[H]:null,U=g.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var w=g.fragments[0].start,Y=!b,Z=g.alignedSliding&&Object(z.isFiniteNumber)(w);if(Y||!Z&&!w){Object(m.alignStream)(A,F,g);var ce=g.fragments[0].start;return this.log("Live playlist sliding: "+ce.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+g.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+U),ce}return w},h.waitForCdnTuneIn=function(g){var b=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*b)},h.setStartPosition=function(g,b){var N=this.startPosition;if(N<b&&(N=-1),N===-1||this.lastCurrentTime===-1){var H=g.startTimeOffset;Object(z.isFiniteNumber)(H)?(N=b+H,H<0&&(N+=g.totalduration),N=Math.min(Math.max(b,N),b+g.totalduration),this.log("Start time offset "+H+" found in playlist, adjust startPosition to "+N),this.startPosition=N):g.live?N=this.hls.liveSyncPosition||b:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},h.getLoadPosition=function(){var g=this.media,b=0;return this.loadedmetadata&&g?b=g.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},h.handleFragLoadAborted=function(g,b){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(b?" part"+b.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},h.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=S.IDLE)},h.onFragmentOrKeyLoadError=function(g,b){if(b.fatal)return;var N=b.frag;if(!N||N.type!==g)return;var H=this.fragCurrent;console.assert(H&&N.sn===H.sn&&N.level===H.level&&N.urlId===H.urlId,"Frag load error must match current frag to retry");var A=this.config;if(this.fragLoadError+1<=A.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(N.level))return;var F=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+g+" "+N.level+" failed to load, retrying in "+F+"ms"),this.retryDate=self.performance.now()+F,this.fragLoadError++,this.state=S.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(g===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=S.IDLE):(M.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=S.ERROR)},h.afterBufferFlushed=function(g,b,N){if(!g)return;var H=K.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(b,H,N),this.state===S.ENDED&&this.resetLoadingState()},h.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=S.IDLE},h.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[g].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},h.updateLevelTiming=function(g,b,N,H){var A=this,F=N.details;console.assert(!!F,"level.details must be defined");var U=Object.keys(g.elementaryStreams).reduce(function(w,Y){var Z=g.elementaryStreams[Y];if(Z){var ce=Z.endPTS-Z.startPTS;if(ce<=0)return A.warn("Could not parse fragment "+g.sn+" "+Y+" duration reliably ("+ce+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),w||!1;var be=H?0:Object(a.updateFragPTSDTS)(F,g,Z.startPTS,Z.endPTS,Z.startDTS,Z.endDTS);return A.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:F,level:N,drift:be,type:Y,frag:g,start:Z.startPTS,end:Z.endPTS}),!0}return w},!1);U?(this.state=S.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:g,part:b})):this.resetLoadingState()},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},O(f,[{key:"state",get:function(){return this._state},set:function(g){var b=this._state;b!==g&&(this._state=g,this.log(b+"->"+g))}}]),f}(L.default)},"./src/controller/buffer-controller.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return c});var z=I("./src/polyfills/number.ts"),L=I("./src/events.ts"),D=I("./src/utils/logger.ts"),K=I("./src/errors.ts"),M=I("./src/utils/buffer-helper.ts"),r=I("./src/utils/mediasource-helper.ts"),P=I("./src/loader/fragment.ts"),x=I("./src/controller/buffer-operation-queue.ts"),p=Object(r.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function a(d){var l=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var i=l.hls,n=l.media,O=l.mediaSource;D.logger.log("[buffer-controller]: Media source opened"),n&&(l.updateMediaElementDuration(),i.trigger(L.Events.MEDIA_ATTACHED,{media:n})),O&&O.removeEventListener("sourceopen",l._onMediaSourceOpen),l.checkPendingTracks()},this._onMediaSourceClose=function(){D.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){D.logger.log("[buffer-controller]: Media source ended")},this.hls=d,this._initSourceBuffer(),this.registerListeners()}var s=a.prototype;return s.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},s.destroy=function(){this.unregisterListeners(),this.details=null},s.registerListeners=function(){var l=this.hls;l.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(L.Events.BUFFER_RESET,this.onBufferReset,this),l.on(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.on(L.Events.BUFFER_EOS,this.onBufferEos,this),l.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.on(L.Events.FRAG_PARSED,this.onFragParsed,this),l.on(L.Events.FRAG_CHANGED,this.onFragChanged,this)},s.unregisterListeners=function(){var l=this.hls;l.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(L.Events.BUFFER_RESET,this.onBufferReset,this),l.off(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.off(L.Events.BUFFER_EOS,this.onBufferEos,this),l.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.off(L.Events.FRAG_PARSED,this.onFragParsed,this),l.off(L.Events.FRAG_CHANGED,this.onFragChanged,this)},s._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new x.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},s.onManifestParsed=function(l,i){var n=2;(i.audio&&!i.video||!i.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,D.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},s.onMediaAttaching=function(l,i){var n=this.media=i.media;if(n&&p){var O=this.mediaSource=new p;O.addEventListener("sourceopen",this._onMediaSourceOpen),O.addEventListener("sourceended",this._onMediaSourceEnded),O.addEventListener("sourceclose",this._onMediaSourceClose),n.src=self.URL.createObjectURL(O),this._objectUrl=n.src}},s.onMediaDetaching=function(){var l=this.media,i=this.mediaSource,n=this._objectUrl;if(i){if(D.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(O){D.logger.warn("[buffer-controller]: onMediaDetaching: "+O.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),l&&(n&&self.URL.revokeObjectURL(n),l.src===n?(l.removeAttribute("src"),l.load()):D.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(L.Events.MEDIA_DETACHED,void 0)},s.onBufferReset=function(){var l=this;this.getSourceBufferTypes().forEach(function(i){var n=l.sourceBuffer[i];try{n&&(l.removeBufferListeners(i),l.mediaSource&&l.mediaSource.removeSourceBuffer(n),l.sourceBuffer[i]=void 0)}catch(O){D.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",O)}}),this._initSourceBuffer()},s.onBufferCodecs=function(l,i){var n=this,O=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(C){if(O){var T=n.tracks[C];if(T&&typeof T.buffer.changeType=="function"){var R=i[C],S=R.codec,y=R.levelCodec,E=R.container,f=(T.levelCodec||T.codec).replace(m,"$1"),h=(y||S).replace(m,"$1");if(f!==h){var v=E+";codecs="+(y||S);n.appendChangeType(C,v)}}}else n.pendingTracks[C]=i[C]}),O)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},s.appendChangeType=function(l,i){var n=this,O=this.operationQueue,C={execute:function(){var R=n.sourceBuffer[l];R&&(D.logger.log("[buffer-controller]: changing "+l+" sourceBuffer type to "+i),R.changeType(i)),O.shiftAndExecuteNext(l)},onStart:function(){},onComplete:function(){},onError:function(R){D.logger.warn("[buffer-controller]: Failed to change "+l+" SourceBuffer type",R)}};O.append(C,l)},s.onBufferAppending=function(l,i){var n=this,O=this.hls,C=this.operationQueue,T=this.tracks,R=i.data,S=i.type,y=i.frag,E=i.part,f=i.chunkMeta,h=f.buffering[S],v=self.performance.now();h.start=v;var g=y.stats.buffering,b=E?E.stats.buffering:null;g.start===0&&(g.start=v),b&&b.start===0&&(b.start=v);var N=T.audio,H=S==="audio"&&f.id===1&&(N==null?void 0:N.container)==="audio/mpeg",A={execute:function(){if(h.executeStart=self.performance.now(),H){var U=n.sourceBuffer[S];if(U){var w=y.start-U.timestampOffset;Math.abs(w)>=.1&&(D.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+w+") sn: "+y.sn+")"),U.timestampOffset=y.start)}}n.appendExecutor(R,S)},onStart:function(){},onComplete:function(){var U=self.performance.now();h.executeEnd=h.end=U,g.first===0&&(g.first=U),b&&b.first===0&&(b.first=U);var w=n.sourceBuffer,Y={};for(var Z in w)Y[Z]=M.BufferHelper.getBuffered(w[Z]);n.appendError=0,n.hls.trigger(L.Events.BUFFER_APPENDED,{type:S,frag:y,part:E,chunkMeta:f,parent:y.type,timeRanges:Y})},onError:function(U){D.logger.error("[buffer-controller]: Error encountered while trying to append to the "+S+" SourceBuffer",U);var w={type:K.ErrorTypes.MEDIA_ERROR,parent:y.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?w.details=K.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,w.details=K.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>O.config.appendErrorMaxRetry&&(D.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),w.fatal=!0)),O.trigger(L.Events.ERROR,w)}};C.append(A,S)},s.onBufferFlushing=function(l,i){var n=this,O=this.operationQueue,C=function(R){return{execute:n.removeExecutor.bind(n,R,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){n.hls.trigger(L.Events.BUFFER_FLUSHED,{type:R})},onError:function(y){D.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",y)}}};i.type?O.append(C(i.type),i.type):this.getSourceBufferTypes().forEach(function(T){O.append(C(T),T)})},s.onFragParsed=function(l,i){var n=this,O=i.frag,C=i.part,T=[],R=C?C.elementaryStreams:O.elementaryStreams;R[P.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(R[P.ElementaryStreamTypes.AUDIO]&&T.push("audio"),R[P.ElementaryStreamTypes.VIDEO]&&T.push("video"));var S=function(){var E=self.performance.now();O.stats.buffering.end=E,C&&(C.stats.buffering.end=E);var f=C?C.stats:O.stats;n.hls.trigger(L.Events.FRAG_BUFFERED,{frag:O,part:C,stats:f,id:O.type})};T.length===0&&D.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(S,T)},s.onFragChanged=function(l,i){this.flushBackBuffer()},s.onBufferEos=function(l,i){var n=this,O=this.getSourceBufferTypes().reduce(function(C,T){var R=n.sourceBuffer[T];return(!i.type||i.type===T)&&(R&&!R.ended&&(R.ended=!0,D.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),C&&!!(!R||R.ended)},!0);O&&this.blockBuffers(function(){var C=n.mediaSource;if(!C||C.readyState!=="open")return;C.endOfStream()})},s.onLevelUpdated=function(l,i){var n=i.details;if(!n.fragments.length)return;this.details=n,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},s.flushBackBuffer=function(){var l=this.hls,i=this.details,n=this.media,O=this.sourceBuffer;if(!n||i===null)return;var C=this.getSourceBufferTypes();if(!C.length)return;var T=i.live&&l.config.liveBackBufferLength!==null?l.config.liveBackBufferLength:l.config.backBufferLength;if(!Object(z.isFiniteNumber)(T)||T<0)return;var R=n.currentTime,S=i.levelTargetDuration,y=Math.max(T,S),E=Math.floor(R/S)*S-y;C.forEach(function(f){var h=O[f];if(h){var v=M.BufferHelper.getBuffered(h);v.length>0&&E>v.start(0)&&(l.trigger(L.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),i.live&&l.trigger(L.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),l.trigger(L.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:f}))}})},s.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var l=this.details,i=this.hls,n=this.media,O=this.mediaSource,C=l.fragments[0].start+l.totalduration,T=n.duration,R=Object(z.isFiniteNumber)(O.duration)?O.duration:0;l.live&&i.config.liveDurationInfinity?(D.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(l)):(C>R&&C>T||!Object(z.isFiniteNumber)(T))&&(D.logger.log("[buffer-controller]: Updating Media Source duration to "+C.toFixed(3)),O.duration=C)},s.updateSeekableRange=function(l){var i=this.mediaSource,n=l.fragments,O=n.length;if(O&&l.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var C=Math.max(0,n[0].start),T=Math.max(C,C+l.totalduration);i.setLiveSeekableRange(C,T)}},s.checkPendingTracks=function(){var l=this.bufferCodecEventsExpected,i=this.operationQueue,n=this.pendingTracks,O=Object.keys(n).length;if(O&&!l||O===2){this.createSourceBuffers(n),this.pendingTracks={};var C=this.getSourceBufferTypes();if(C.length===0){this.hls.trigger(L.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}C.forEach(function(T){i.executeNext(T)})}},s.createSourceBuffers=function(l){var i=this.sourceBuffer,n=this.mediaSource;if(!n)throw Error("createSourceBuffers called when mediaSource was null");var O=0;for(var C in l)if(!i[C]){var T=l[C];if(!T)throw Error("source buffer exists for track "+C+", however track does not");var R=T.levelCodec||T.codec,S=T.container+";codecs="+R;D.logger.log("[buffer-controller]: creating sourceBuffer("+S+")");try{var y=i[C]=n.addSourceBuffer(S),E=C;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[C]={buffer:y,codec:R,container:T.container,levelCodec:T.levelCodec,id:T.id},O++}catch(f){D.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+f.message),this.hls.trigger(L.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,mimeType:S})}}O&&this.hls.trigger(L.Events.BUFFER_CREATED,{tracks:this.tracks})},s._onSBUpdateStart=function(l){var i=this.operationQueue,n=i.current(l);n.onStart()},s._onSBUpdateEnd=function(l){var i=this.operationQueue,n=i.current(l);n.onComplete(),i.shiftAndExecuteNext(l)},s._onSBUpdateError=function(l,i){D.logger.error("[buffer-controller]: "+l+" SourceBuffer error",i),this.hls.trigger(L.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(l);n&&n.onError(i)},s.removeExecutor=function(l,i,n){var O=this.media,C=this.mediaSource,T=this.operationQueue,R=this.sourceBuffer,S=R[l];if(!O||!C||!S){D.logger.warn("[buffer-controller]: Attempting to remove from the "+l+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(l);return}var y=Object(z.isFiniteNumber)(O.duration)?O.duration:Infinity,E=Object(z.isFiniteNumber)(C.duration)?C.duration:Infinity,f=Math.max(0,i),h=Math.min(n,y,E);h>f?(D.logger.log("[buffer-controller]: Removing ["+f+","+h+"] from the "+l+" SourceBuffer"),console.assert(!S.updating,l+" sourceBuffer must not be updating"),S.remove(f,h)):T.shiftAndExecuteNext(l)},s.appendExecutor=function(l,i){var n=this.operationQueue,O=this.sourceBuffer,C=O[i];if(!C){D.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),n.shiftAndExecuteNext(i);return}C.ended=!1,console.assert(!C.updating,i+" sourceBuffer must not be updating"),C.appendBuffer(l)},s.blockBuffers=function(l,i){var n=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){D.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(l);return}var O=this.operationQueue,C=i.map(function(T){return O.appendBlocker(T)});Promise.all(C).then(function(){l(),i.forEach(function(T){var R=n.sourceBuffer[T];(!R||!R.updating)&&O.shiftAndExecuteNext(T)})})},s.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},s.addBufferListener=function(l,i,n){var O=this.sourceBuffer[l];if(!O)return;var C=n.bind(this,l);this.listeners[l].push({event:i,listener:C}),O.addEventListener(i,C)},s.removeBufferListeners=function(l){var i=this.sourceBuffer[l];if(!i)return;this.listeners[l].forEach(function(n){i.removeEventListener(n.event,n.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return L});var z=I("./src/utils/logger.ts"),L=function(){function D(M){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=M}var K=D.prototype;return K.append=function(r,P){var x=this.queues[P];x.push(r),x.length===1&&this.buffers[P]&&this.executeNext(P)},K.insertAbort=function(r,P){var x=this.queues[P];x.unshift(r),this.executeNext(P)},K.appendBlocker=function(r){var P,x=new Promise(function(m){P=m}),p={execute:P,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,r),x},K.executeNext=function(r){var P=this.buffers,x=this.queues,p=P[r],m=x[r];if(m.length){var c=m[0];try{c.execute()}catch(a){z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(a),(!p||!p.updating)&&(m.shift(),this.executeNext(r))}}},K.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},K.current=function(r){return this.queues[r][0]},D}()},"./src/controller/cap-level-controller.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/events.ts");function L(M,r){for(var P=0;P<r.length;P++){var x=r[P];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(M,x.key,x)}}function D(M,r,P){return r&&L(M.prototype,r),P&&L(M,P),M}var K=function(){function M(P){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=P,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var r=M.prototype;return r.setStreamController=function(x){this.streamController=x},r.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},r.registerListeners=function(){var 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)},r.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)},r.onFpsDropLevelCapping=function(x,p){M.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},r.onMediaAttaching=function(x,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},r.onManifestParsed=function(x,p){var m=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,m.config.capLevelToPlayerSize&&p.video&&this.startCapping()},r.onBufferCodecs=function(x,p){var m=this.hls;m.config.capLevelToPlayerSize&&p.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.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}}},r.getMaxLevel=function(x){var p=this,m=this.hls.levels;if(!m.length)return-1;var c=m.filter(function(a,s){return M.isLevelAllowed(s,p.restrictedLevels)&&s<=x});return this.clientRect=null,M.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},r.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var x=this.media,p={width:0,height:0};if(x){var m=x.getBoundingClientRect();p.width=m.width,p.height=m.height,!p.width&&!p.height&&(p.width=m.right-m.left||x.width||0,p.height=m.bottom-m.top||x.height||0)}return this.clientRect=p,p},M.isLevelAllowed=function(x,p){return p===void 0&&(p=[]),p.indexOf(x)===-1},M.getMaxLevelByMediaSize=function(x,p,m){if(!x||!x.length)return-1;for(var c=function(i,n){return n?i.width!==n.width||i.height!==n.height:!0},a=x.length-1,s=0;s<x.length;s+=1){var d=x[s];if((d.width>=p||d.height>=m)&&c(d,x[s+1])){a=s;break}}return a},D(M,[{key:"mediaWidth",get:function(){return this.getDimensions().width*M.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*M.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var x=1;try{x=self.devicePixelRatio}catch(p){}return x}}]),M}();V.default=K},"./src/controller/cmcd-controller.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return c});var z=I("./src/events.ts"),L=I("./src/types/cmcd.ts"),D=I("./src/utils/buffer-helper.ts"),K=I("./src/utils/logger.ts");function M(a,s){for(var d=0;d<s.length;d++){var l=s[d];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(a,l.key,l)}}function r(a,s,d){return s&&M(a.prototype,s),d&&M(a,d),a}function P(a,s){var d=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(d)return(d=d.call(a)).next.bind(d);if(Array.isArray(a)||(d=x(a))||s&&a&&typeof a.length=="number"){d&&(a=d);var l=0;return function(){return l>=a.length?{done:!0}:{done:!1,value:a[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x(a,s){if(!a)return;if(typeof a=="string")return p(a,s);var d=Object.prototype.toString.call(a).slice(8,-1);if(d==="Object"&&a.constructor&&(d=a.constructor.name),d==="Map"||d==="Set")return Array.from(a);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return p(a,s)}function p(a,s){(s==null||s>a.length)&&(s=a.length);for(var d=0,l=new Array(s);d<s;d++)l[d]=a[d];return l}function m(){return m=Object.assign||function(a){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var l in d)Object.prototype.hasOwnProperty.call(d,l)&&(a[l]=d[l])}return a},m.apply(this,arguments)}var c=function(){function a(d){var l=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){l.initialized&&(l.starved=!0),l.buffering=!0},this.onPlaying=function(){l.initialized||(l.initialized=!0),l.buffering=!1},this.applyPlaylistData=function(O){try{l.apply(O,{ot:L.CMCDObjectType.MANIFEST,su:!l.initialized})}catch(C){K.logger.warn("Could not generate manifest CMCD data.",C)}},this.applyFragmentData=function(O){try{var C=O.frag,T=l.hls.levels[C.level],R=l.getObjectType(C),S={d:C.duration*1e3,ot:R};(R===L.CMCDObjectType.VIDEO||R===L.CMCDObjectType.AUDIO||R==L.CMCDObjectType.MUXED)&&(S.br=T.bitrate/1e3,S.tb=l.getTopBandwidth(R),S.bl=l.getBufferLength(R)),l.apply(O,S)}catch(y){K.logger.warn("Could not generate segment CMCD data.",y)}},this.hls=d;var i=this.config=d.config,n=i.cmcd;n!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||a.uuid(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.registerListeners())}var s=a.prototype;return s.registerListeners=function(){var l=this.hls;l.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),l.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this)},s.unregisterListeners=function(){var l=this.hls;l.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),l.off(z.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},s.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},s.onMediaAttached=function(l,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},s.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},s.onBufferCreated=function(l,i){var n,O;this.audioBuffer=(n=i.tracks.audio)===null||n===void 0?void 0:n.buffer,this.videoBuffer=(O=i.tracks.video)===null||O===void 0?void 0:O.buffer},s.createData=function(){var l;return{v:L.CMCDVersion,sf:L.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(l=this.media)===null||l===void 0?void 0:l.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},s.apply=function(l,i){i===void 0&&(i={}),m(i,this.createData());var n=i.ot===L.CMCDObjectType.INIT||i.ot===L.CMCDObjectType.VIDEO||i.ot===L.CMCDObjectType.MUXED;if(this.starved&&n&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var O=a.toHeaders(i);if(!Object.keys(O).length)return;l.headers||(l.headers={}),m(l.headers,O)}else{var C=a.toQuery(i);if(!C)return;l.url=a.appendQueryToUri(l.url,C)}},s.getObjectType=function(l){var i=l.type;return i==="subtitle"?L.CMCDObjectType.TIMED_TEXT:l.sn==="initSegment"?L.CMCDObjectType.INIT:i==="audio"?L.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?L.CMCDObjectType.VIDEO:L.CMCDObjectType.MUXED:void 0},s.getTopBandwidth=function(l){for(var i=0,n=l===L.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,O=P(n),C;!(C=O()).done;){var T=C.value;T.bitrate>i&&(i=T.bitrate)}return i>0?i:NaN},s.getBufferLength=function(l){var i=this.hls.media,n=l===L.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!i)return NaN;var O=D.BufferHelper.bufferInfo(n,i.currentTime,this.config.maxBufferHole);return O.len*1e3},s.createPlaylistLoader=function(){var l=this.config.pLoader,i=this.applyPlaylistData,n=l||this.config.loader;return function(){function O(T){this.loader=void 0,this.loader=new n(T)}var C=O.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(R,S,y){i(R),this.loader.load(R,S,y)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},s.createFragmentLoader=function(){var l=this.config.fLoader,i=this.applyFragmentData,n=l||this.config.loader;return function(){function O(T){this.loader=void 0,this.loader=new n(T)}var C=O.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(R,S,y){i(R),this.loader.load(R,S,y)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},a.uuid=function(){var l=URL.createObjectURL(new Blob),i=l.toString();return URL.revokeObjectURL(l),i.substr(i.lastIndexOf("/")+1)},a.serialize=function(l){for(var i=[],n=function(H){return!Number.isNaN(H)&&H!=null&&H!==""&&H!==!1},O=function(H){return Math.round(H)},C=function(H){return O(H/100)*100},T=function(H){return encodeURIComponent(H)},R={br:O,d:O,bl:C,dl:C,mtp:C,nor:T,rtp:C,tb:O},S=Object.keys(l||{}).sort(),y=P(S),E;!(E=y()).done;){var f=E.value,h=l[f];if(!n(h))continue;if(f==="v"&&h===1)continue;if(f=="pr"&&h===1)continue;var v=R[f];v&&(h=v(h));var g=typeof h,b=void 0;f==="ot"||f==="sf"||f==="st"?b=f+"="+h:g==="boolean"?b=f:g==="number"?b=f+"="+h:b=f+"="+JSON.stringify(h),i.push(b)}return i.join(",")},a.toHeaders=function(l){for(var i=Object.keys(l),n={},O=["Object","Request","Session","Status"],C=[{},{},{},{}],T={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},R=0,S=i;R<S.length;R++){var y=S[R],E=T[y]!=null?T[y]:1;C[E][y]=l[y]}for(var f=0;f<C.length;f++){var h=a.serialize(C[f]);h&&(n["CMCD-"+O[f]]=h)}return n},a.toQuery=function(l){return"CMCD="+encodeURIComponent(a.serialize(l))},a.appendQueryToUri=function(l,i){if(!i)return l;var n=l.includes("?")?"&":"?";return""+l+n+i},a}()},"./src/controller/eme-controller.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/events.ts"),L=I("./src/errors.ts"),D=I("./src/utils/logger.ts"),K=I("./src/utils/mediakeys-helper.ts");function M(c,a){for(var s=0;s<a.length;s++){var d=a[s];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(c,d.key,d)}}function r(c,a,s){return a&&M(c.prototype,a),s&&M(c,s),c}var P=3,x=function(a,s,d){var l={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(i){l.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:d.audioRobustness||""})}),s.forEach(function(i){l.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:d.videoRobustness||""})}),[l]},p=function(a,s,d,l){switch(a){case K.KeySystems.WIDEVINE:return x(s,d,l);default:throw new Error("Unknown key-system: "+a)}},m=function(){function c(s){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=s,this._config=s.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(d){switch(d){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+d+'"')},a._attemptKeySystemAccess=function(d,l,i){var n=this,O=p(d,l,i,this._drmSystemOptions);D.logger.log("Requesting encrypted media key-system access");var C=this.requestMediaKeySystemAccess(d,O);this.mediaKeysPromise=C.then(function(T){return n._onMediaKeySystemAccessObtained(d,T)}),C.catch(function(T){D.logger.error('Failed to obtain key-system "'+d+'" access:',T)})},a._onMediaKeySystemAccessObtained=function(d,l){var i=this;D.logger.log('Access for key-system "'+d+'" obtained');var n={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:l,mediaKeySystemDomain:d};this._mediaKeysList.push(n);var O=Promise.resolve().then(function(){return l.createMediaKeys()}).then(function(C){return n.mediaKeys=C,D.logger.log('Media-keys created for key-system "'+d+'"'),i._onMediaKeysCreated(),C});return O.catch(function(C){D.logger.error("Failed to create media-keys:",C)}),O},a._onMediaKeysCreated=function(){var d=this;this._mediaKeysList.forEach(function(l){l.mediaKeysSession||(l.mediaKeysSession=l.mediaKeys.createSession(),d._onNewMediaKeySession(l.mediaKeysSession))})},a._onNewMediaKeySession=function(d){var l=this;D.logger.log("New key-system session "+d.sessionId),d.addEventListener("message",function(i){l._onKeySessionMessage(d,i.message)},!1)},a._onKeySessionMessage=function(d,l){D.logger.log("Got EME message event, creating license request"),this._requestLicense(l,function(i){D.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),d.update(i)})},a.onMediaEncrypted=function(d){var l=this;if(D.logger.log('Media is encrypted using "'+d.initDataType+'" init data type'),!this.mediaKeysPromise){D.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(z.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(O){if(!l._media)return;l._attemptSetMediaKeys(O),l._generateRequestWithPreferredKeySession(d.initDataType,d.initData)};this.mediaKeysPromise.then(i).catch(i)},a._attemptSetMediaKeys=function(d){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var l=this._mediaKeysList[0];if(!l||!l.mediaKeys){D.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}D.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(l.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(d,l){var i=this,n=this._mediaKeysList[0];if(!n){D.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(n.mediaKeysSessionInitialized){D.logger.warn("Key-Session already initialized but requested again");return}var O=n.mediaKeysSession;if(!O){D.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(z.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!l){D.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(z.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}D.logger.log('Generating key-session request for "'+d+'" init data type'),n.mediaKeysSessionInitialized=!0,O.generateRequest(d,l).then(function(){D.logger.debug("Key-session generation succeeded")}).catch(function(C){D.logger.error("Error generating key-session request:",C),i.hls.trigger(z.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(d,l,i){var n=new XMLHttpRequest;n.responseType="arraybuffer",n.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,n,d,l,i);var O=this._licenseXhrSetup;if(O)try{O.call(this.hls,n,d),O=void 0}catch(C){D.logger.error(C)}try{n.readyState||n.open("POST",d,!0),O&&O.call(this.hls,n,d)}catch(C){throw new Error("issue setting up KeySystem license XHR "+C)}return n},a._onLicenseRequestReadyStageChange=function(d,l,i,n){switch(d.readyState){case 4:if(d.status===200){this._requestLicenseFailureCount=0,D.logger.log("License request succeeded");var O=d.response,C=this._licenseResponseCallback;if(C)try{O=C.call(this.hls,d,l)}catch(R){D.logger.error(R)}n(O)}else{if(D.logger.error("License Request XHR failed ("+l+"). Status: "+d.status+" ("+d.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>P){this.hls.trigger(z.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=P-this._requestLicenseFailureCount+1;D.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(i,n)}break}},a._generateLicenseRequestChallenge=function(d,l){switch(d.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return l}throw new Error("unsupported key-system: "+d.mediaKeySystemDomain)},a._requestLicense=function(d,l){D.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){D.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var n=this.getLicenseServerUrl(i.mediaKeySystemDomain),O=this._createLicenseXhr(n,d,l);D.logger.log("Sending license request to URL: "+n);var C=this._generateLicenseRequestChallenge(i,d);O.send(C)}catch(T){D.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(z.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(d,l){if(!this._emeEnabled)return;var i=l.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var d=this._media,l=this._mediaKeysList;if(!d)return;d.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(l.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return d.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(d,l){if(!this._emeEnabled)return;var i=l.levels.map(function(O){return O.audioCodec}).filter(function(O){return!!O}),n=l.levels.map(function(O){return O.videoCodec}).filter(function(O){return!!O});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,i,n)},r(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();V.default=m},"./src/controller/fps-controller.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/events.ts"),L=I("./src/utils/logger.ts"),D=function(){function K(r){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=r,this.registerListeners()}var M=K.prototype;return M.setStreamController=function(P){this.streamController=P},M.registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},M.unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching)},M.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},M.onMediaAttaching=function(P,x){var p=this.hls.config;if(p.capLevelOnFPSDrop){var m=x.media instanceof self.HTMLVideoElement?x.media:null;this.media=m,m&&typeof m.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},M.checkFPS=function(P,x,p){var m=performance.now();if(x){if(this.lastTime){var c=m-this.lastTime,a=p-this.lastDroppedFrames,s=x-this.lastDecodedFrames,d=1e3*a/c,l=this.hls;if(l.trigger(z.Events.FPS_DROP,{currentDropped:a,currentDecoded:s,totalDroppedFrames:p}),d>0&&a>l.config.fpsDroppedMonitoringThreshold*s){var i=l.currentLevel;L.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=i)&&(i=i-1,l.trigger(z.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:l.currentLevel}),l.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=p,this.lastDecodedFrames=x}},M.checkFPSInterval=function(){var P=this.media;if(P)if(this.isVideoPlaybackQualityAvailable){var x=P.getVideoPlaybackQuality();this.checkFPS(P,x.totalVideoFrames,x.droppedVideoFrames)}else this.checkFPS(P,P.webkitDecodedFrameCount,P.webkitDroppedFrameCount)},K}();V.default=D},"./src/controller/fragment-finders.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"findFragmentByPDT",function(){return D}),I.d(V,"findFragmentByPTS",function(){return K}),I.d(V,"fragmentWithinToleranceTest",function(){return M}),I.d(V,"pdtWithinToleranceTest",function(){return r}),I.d(V,"findFragWithCC",function(){return P});var z=I("./src/polyfills/number.ts"),L=I("./src/utils/binary-search.ts");function D(x,p,m){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;m=m||0;for(var s=0;s<x.length;++s){var d=x[s];if(r(p,m,d))return d}return null}function K(x,p,m,c){m===void 0&&(m=0),c===void 0&&(c=0);var a=null;if(x?a=p[x.sn-p[0].sn+1]||null:m===0&&p[0].start===0&&(a=p[0]),a&&M(m,c,a)===0)return a;var s=L.default.search(p,M.bind(null,m,c));return s||a}function M(x,p,m){x===void 0&&(x=0),p===void 0&&(p=0);var c=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-c<=x?1:m.start-c>x&&m.start?-1:0}function r(x,p,m){var c=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,a=m.endProgramDateTime||0;return a-c>x}function P(x,p){return L.default.search(x,function(m){return m.cc<p?1:m.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"FragmentState",function(){return D}),I.d(V,"FragmentTracker",function(){return K});var z=I("./src/events.ts"),L=I("./src/types/loader.ts"),D;(function(P){P.NOT_LOADED="NOT_LOADED",P.BACKTRACKED="BACKTRACKED",P.APPENDING="APPENDING",P.PARTIAL="PARTIAL",P.OK="OK"})(D||(D={}));var K=function(){function P(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=P.prototype;return x._registerListeners=function(){var m=this.hls;m.on(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(z.Events.FRAG_LOADED,this.onFragLoaded,this)},x._unregisterListeners=function(){var m=this.hls;m.off(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(z.Events.FRAG_LOADED,this.onFragLoaded,this)},x.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},x.getAppendedFrag=function(m,c){if(c===L.PlaylistLevelType.MAIN){var a=this.activeFragment,s=this.activeParts;if(!a)return null;if(s)for(var d=s.length;d--;){var l=s[d],i=l?l.end:a.appendedPTS;if(l.start<=m&&i!==void 0&&m<=i)return d>9&&(this.activeParts=s.slice(d-9)),l}else if(a.start<=m&&a.appendedPTS!==void 0&&m<=a.appendedPTS)return a}return this.getBufferedFrag(m,c)},x.getBufferedFrag=function(m,c){for(var a=this.fragments,s=Object.keys(a),d=s.length;d--;){var l=a[s[d]];if((l==null?void 0:l.body.type)===c&&l.buffered){var i=l.body;if(i.start<=m&&m<=i.end)return i}}return null},x.detectEvictedFragments=function(m,c,a){var s=this;Object.keys(this.fragments).forEach(function(d){var l=s.fragments[d];if(!l)return;if(!l.buffered){l.body.type===a&&s.removeFragment(l.body);return}var i=l.range[m];if(!i)return;i.time.some(function(n){var O=!s.isTimeBuffered(n.startPTS,n.endPTS,c);return O&&s.removeFragment(l.body),O})})},x.detectPartialFragments=function(m){var c=this,a=this.timeRanges,s=m.frag,d=m.part;if(!a||s.sn==="initSegment")return;var l=r(s),i=this.fragments[l];if(!i)return;Object.keys(a).forEach(function(n){var O=s.elementaryStreams[n];if(!O)return;var C=a[n],T=d!==null||O.partial===!0;i.range[n]=c.getBufferedTimes(s,d,T,C)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},x.fragBuffered=function(m){var c=r(m),a=this.fragments[c];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},x.getBufferedTimes=function(m,c,a,s){for(var d={time:[],partial:a},l=c?c.start:m.start,i=c?c.end:m.end,n=m.minEndPTS||i,O=m.maxStartPTS||l,C=0;C<s.length;C++){var T=s.start(C)-this.bufferPadding,R=s.end(C)+this.bufferPadding;if(O>=T&&n<=R){d.time.push({startPTS:Math.max(l,s.start(C)),endPTS:Math.min(i,s.end(C))});break}else if(l<R&&i>T)d.partial=!0,d.time.push({startPTS:Math.max(l,s.start(C)),endPTS:Math.min(i,s.end(C))});else if(i<=T)break}return d},x.getPartialFragment=function(m){var c=null,a,s,d,l=0,i=this.bufferPadding,n=this.fragments;return Object.keys(n).forEach(function(O){var C=n[O];if(!C)return;M(C)&&(s=C.body.start-i,d=C.body.end+i,m>=s&&m<=d&&(a=Math.min(m-s,d-m),l<=a&&(c=C.body,l=a)))}),c},x.getState=function(m){var c=r(m),a=this.fragments[c];return a?a.buffered?M(a)?D.PARTIAL:D.OK:a.backtrack?D.BACKTRACKED:D.APPENDING:D.NOT_LOADED},x.backtrack=function(m,c){var a=r(m),s=this.fragments[a];if(!s||s.backtrack)return null;var d=s.backtrack=c||s.loaded;return s.loaded=null,d},x.getBacktrackData=function(m){var c=r(m),a=this.fragments[c];if(a){var s,d=a.backtrack;if(d!=null&&(s=d.payload)!==null&&s!==void 0&&s.byteLength)return d;this.removeFragment(m)}return null},x.isTimeBuffered=function(m,c,a){for(var s,d,l=0;l<a.length;l++){if(s=a.start(l)-this.bufferPadding,d=a.end(l)+this.bufferPadding,m>=s&&c<=d)return!0;if(c<=s)return!1}return!1},x.onFragLoaded=function(m,c){var a=c.frag,s=c.part;if(a.sn==="initSegment"||a.bitrateTest||s)return;var d=r(a);this.fragments[d]={body:a,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},x.onBufferAppended=function(m,c){var a=this,s=c.frag,d=c.part,l=c.timeRanges;if(s.type===L.PlaylistLevelType.MAIN)if(this.activeFragment=s,d){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(d)}else this.activeParts=null;this.timeRanges=l,Object.keys(l).forEach(function(n){var O=l[n];if(a.detectEvictedFragments(n,O),!d)for(var C=0;C<O.length;C++)s.appendedPTS=Math.max(O.end(C),s.appendedPTS||0)})},x.onFragBuffered=function(m,c){this.detectPartialFragments(c)},x.hasFragment=function(m){var c=r(m);return!!this.fragments[c]},x.removeFragmentsInRange=function(m,c,a){var s=this;Object.keys(this.fragments).forEach(function(d){var l=s.fragments[d];if(!l)return;if(l.buffered){var i=l.body;i.type===a&&i.start<c&&i.end>m&&s.removeFragment(i)}})},x.removeFragment=function(m){var c=r(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[c]},x.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},P}();function M(P){var x,p;return P.buffered&&(((x=P.range.video)===null||x===void 0?void 0:x.partial)||((p=P.range.audio)===null||p===void 0?void 0:p.partial))}function r(P){return P.type+"_"+P.level+"_"+P.urlId+"_"+P.sn}},"./src/controller/gap-controller.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"STALL_MINIMUM_DURATION_MS",function(){return M}),I.d(V,"MAX_START_GAP_JUMP",function(){return r}),I.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return P}),I.d(V,"SKIP_BUFFER_RANGE_START",function(){return x}),I.d(V,"default",function(){return p});var z=I("./src/utils/buffer-helper.ts"),L=I("./src/errors.ts"),D=I("./src/events.ts"),K=I("./src/utils/logger.ts"),M=250,r=2,P=.1,x=.05,p=function(){function m(a,s,d,l){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=a,this.media=s,this.fragmentTracker=d,this.hls=l}var c=m.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(s){var d=this.config,l=this.media,i=this.stalled,n=l.currentTime,O=l.seeking,C=this.seeking&&!O,T=!this.seeking&&O;if(this.seeking=O,n!==s){if(this.moved=!0,i!==null){if(this.stallReported){var R=self.performance.now()-i;K.logger.warn("playback not stuck anymore @"+n+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||C)&&(this.stalled=null),l.paused||l.ended||l.playbackRate===0||!z.BufferHelper.getBuffered(l).length)return;var S=z.BufferHelper.bufferInfo(l,n,0),y=S.len>0,E=S.nextStart||0;if(!y&&!E)return;if(O){var f=S.len>r,h=!E||E-n>r&&!this.fragmentTracker.getPartialFragment(n);if(f||h)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var v,g=Math.max(E,S.start||0)-n,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=b==null||((v=b.details)===null||v===void 0)?void 0:v.live,H=N?b.details.targetduration*2:r;if(g>0&&g<=H){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(i===null){this.stalled=A;return}var F=A-i;!O&&F>=M&&this._reportStall(S.len);var U=z.BufferHelper.bufferInfo(l,n,d.maxBufferHole);this._tryFixBufferStall(U,F)},c._tryFixBufferStall=function(s,d){var l=this.config,i=this.fragmentTracker,n=this.media,O=n.currentTime,C=i.getPartialFragment(O);if(C){var T=this._trySkipBufferHole(C);if(T)return}s.len>l.maxBufferHole&&d>l.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(s){var d=this.hls,l=this.media,i=this.stallReported;i||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+l.currentTime+" due to low buffer (buffer="+s+")"),d.trigger(D.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:s}))},c._trySkipBufferHole=function(s){for(var d=this.config,l=this.hls,i=this.media,n=i.currentTime,O=0,C=z.BufferHelper.getBuffered(i),T=0;T<C.length;T++){var R=C.start(T);if(n+d.maxBufferHole>=O&&n<R){var S=Math.max(R+x,i.currentTime+P);return K.logger.warn("skipping hole, adjusting currentTime from "+n+" to "+S),this.moved=!0,this.stalled=null,i.currentTime=S,s&&l.trigger(D.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+n+" to "+S,frag:s}),S}O=C.end(T)}return 0},c._tryNudgeBuffer=function(){var s=this.config,d=this.hls,l=this.media,i=l.currentTime,n=(this.nudgeRetry||0)+1;if(this.nudgeRetry=n,n<s.nudgeMaxRetry){var O=i+n*s.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+i+" to "+O),l.currentTime=O,d.trigger(D.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+s.nudgeMaxRetry+" nudges"),d.trigger(D.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/events.ts"),L=I("./src/utils/texttrack-utils.ts"),D=I("./src/demux/id3.ts"),K=.25,M=function(){function r(x){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=x,this._registerListeners()}var P=r.prototype;return P.destroy=function(){this._unregisterListeners()},P._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)},P._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)},P.onMediaAttached=function(p,m){this.media=m.media},P.onMediaDetaching=function(){if(!this.id3Track)return;Object(L.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},P.getID3Track=function(p){if(!this.media)return;for(var m=0;m<p.length;m++){var c=p[m];if(c.kind==="metadata"&&c.label==="id3")return Object(L.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},P.onFragParsingMetadata=function(p,m){if(!this.media)return;var c=m.frag,a=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var s=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,d=0;d<a.length;d++){var l=D.getID3Frames(a[d].data);if(l){var i=a[d].pts,n=d<a.length-1?a[d+1].pts:c.end,O=n-i;O<=0&&(n=i+K);for(var C=0;C<l.length;C++){var T=l[C];if(!D.isTimeStampFrame(T)){var R=new s(i,n,"");R.value=T,this.id3Track.addCue(R)}}}}},P.onBufferFlushing=function(p,m){var c=m.startOffset,a=m.endOffset,s=m.type;if(!s||s==="audio"){var d=this.id3Track;d&&Object(L.removeCuesInRange)(d,c,a)}},r}();V.default=M},"./src/controller/latency-controller.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return r});var z=I("./src/errors.ts"),L=I("./src/events.ts"),D=I("./src/utils/logger.ts");function K(P,x){for(var p=0;p<x.length;p++){var m=x[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(P,m.key,m)}}function M(P,x,p){return x&&K(P.prototype,x),p&&K(P,p),P}var r=function(){function P(p){var m=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 m.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var x=P.prototype;return x.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},x.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(L.Events.ERROR,this.onError,this)},x.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(L.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(L.Events.ERROR,this.onError)},x.onMediaAttached=function(m,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(m,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(m,c){if(c.details!==z.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,D.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},x.timeupdate=function(){var m=this.media,c=this.levelDetails;if(!m||!c)return;this.currentTime=m.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var s=this.config,d=s.lowLatencyMode,l=s.maxLiveSyncPlaybackRate;if(!d||l===1)return;var i=this.targetLatency;if(i===null)return;var n=a-i,O=Math.min(this.maxLatency,i+c.targetduration),C=n<O;if(c.live&&C&&n>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,l)),R=Math.round(2/(1+Math.exp(-.75*n-this.edgeStalled))*20)/20;m.playbackRate=Math.min(T,Math.max(1,R))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},x.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},x.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},M(P,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,c=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:c?m.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var c=m.holdBack,a=m.partHoldBack,s=m.targetduration,d=this.config,l=d.liveSyncDuration,i=d.liveSyncDurationCount,n=d.lowLatencyMode,O=this.hls.userConfig,C=n&&a||c;(O.liveSyncDuration||O.liveSyncDurationCount||C===0)&&(C=l!==void 0?l:i*s);var T=s,R=1;return C+Math.min(this.stallCount*R,T)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),c=this.targetLatency,a=this.levelDetails;if(m===null||c===null||a===null)return null;var s=a.edge,d=m-c-this.edgeStalled,l=s-a.totalduration,i=s-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(l,d),i)}},{key:"drift",get:function(){var m=this.levelDetails;return m===null?1:m.drift}},{key:"edgeStalled",get:function(){var m=this.levelDetails;if(m===null)return 0;var c=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-c,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,c=this.levelDetails;if(!m||!c)return 0;var a=m.buffered.length;return a?m.buffered.end(a-1):c.edge-this.currentTime}}]),P}()},"./src/controller/level-controller.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return d});var z=I("./src/types/level.ts"),L=I("./src/events.ts"),D=I("./src/errors.ts"),K=I("./src/utils/codecs.ts"),M=I("./src/controller/level-helper.ts"),r=I("./src/controller/base-playlist-controller.ts"),P=I("./src/types/loader.ts");function x(){return x=Object.assign||function(l){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var O in n)Object.prototype.hasOwnProperty.call(n,O)&&(l[O]=n[O])}return l},x.apply(this,arguments)}function p(l,i){for(var n=0;n<i.length;n++){var O=i[n];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(l,O.key,O)}}function m(l,i,n){return i&&p(l.prototype,i),n&&p(l,n),l}function c(l,i){l.prototype=Object.create(i.prototype),l.prototype.constructor=l,a(l,i)}function a(l,i){return a=Object.setPrototypeOf||function(O,C){return O.__proto__=C,O},a(l,i)}var s=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),d=function(l){c(i,l);function i(O){var C;return C=l.call(this,O,"[level-controller]")||this,C._levels=[],C._firstLevel=-1,C._startLevel=void 0,C.currentLevelIndex=-1,C.manualLevelIndex=-1,C.onParsedComplete=void 0,C._registerListeners(),C}var n=i.prototype;return n._registerListeners=function(){var C=this.hls;C.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),C.on(L.Events.ERROR,this.onError,this)},n._unregisterListeners=function(){var C=this.hls;C.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),C.off(L.Events.ERROR,this.onError,this)},n.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,l.prototype.destroy.call(this)},n.startLoad=function(){var C=this._levels;C.forEach(function(T){T.loadError=0}),l.prototype.startLoad.call(this)},n.onManifestLoaded=function(C,T){var R=[],S=[],y=[],E,f={},h,v=!1,g=!1,b=!1;if(T.levels.forEach(function(F){var U=F.attrs;v=v||!!(F.width&&F.height),g=g||!!F.videoCodec,b=b||!!F.audioCodec,s&&F.audioCodec&&F.audioCodec.indexOf("mp4a.40.34")!==-1&&(F.audioCodec=void 0);var w=F.bitrate+"-"+F.attrs.RESOLUTION+"-"+F.attrs.CODECS;h=f[w],h?h.url.push(F.url):(h=new z.Level(F),f[w]=h,R.push(h)),U&&(U.AUDIO&&Object(M.addGroupId)(h,"audio",U.AUDIO),U.SUBTITLES&&Object(M.addGroupId)(h,"text",U.SUBTITLES))}),(v||g)&&b&&(R=R.filter(function(F){var U=F.videoCodec,w=F.width,Y=F.height;return!!U||!!(w&&Y)})),R=R.filter(function(F){var U=F.audioCodec,w=F.videoCodec;return(!U||Object(K.isCodecSupportedInMp4)(U,"audio"))&&(!w||Object(K.isCodecSupportedInMp4)(w,"video"))}),T.audioTracks&&(S=T.audioTracks.filter(function(F){return!F.audioCodec||Object(K.isCodecSupportedInMp4)(F.audioCodec,"audio")}),Object(M.assignTrackIdsByGroup)(S)),T.subtitles&&(y=T.subtitles,Object(M.assignTrackIdsByGroup)(y)),R.length>0){E=R[0].bitrate,R.sort(function(F,U){return F.bitrate-U.bitrate}),this._levels=R;for(var N=0;N<R.length;N++)if(R[N].bitrate===E){this._firstLevel=N,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+E);break}var H=b&&!g,A={levels:R,audioTracks:S,subtitleTracks:y,firstLevel:this._firstLevel,stats:T.stats,audio:b,video:g,altAudio:!H&&S.some(function(F){return!!F.url})};this.hls.trigger(L.Events.MANIFEST_PARSED,A),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(L.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},n.onError=function(C,T){if(l.prototype.onError.call(this,C,T),T.fatal)return;var R=T.context,S=this._levels[this.currentLevelIndex];if(R&&(R.type===P.PlaylistContextType.AUDIO_TRACK&&S.audioGroupIds&&R.groupId===S.audioGroupIds[S.urlId]||R.type===P.PlaylistContextType.SUBTITLE_TRACK&&S.textGroupIds&&R.groupId===S.textGroupIds[S.urlId])){this.redundantFailover(this.currentLevelIndex);return}var y=!1,E=!0,f;switch(T.details){case D.ErrorDetails.FRAG_LOAD_ERROR:case D.ErrorDetails.FRAG_LOAD_TIMEOUT:case D.ErrorDetails.KEY_LOAD_ERROR:case D.ErrorDetails.KEY_LOAD_TIMEOUT:if(T.frag){var h=this._levels[T.frag.level];h?(h.fragmentError++,h.fragmentError>this.hls.config.fragLoadingMaxRetry&&(f=T.frag.level)):f=T.frag.level}break;case D.ErrorDetails.LEVEL_LOAD_ERROR:case D.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(E=!1),f=R.level),y=!0;break;case D.ErrorDetails.REMUX_ALLOC_ERROR:f=T.level,y=!0;break}f!==void 0&&this.recoverLevel(T,f,y,E)},n.recoverLevel=function(C,T,R,S){var y=C.details,E=this._levels[T];if(E.loadError++,R){var f=this.retryLoadingOrFail(C);if(f)C.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(S){var h=E.url.length;if(h>1&&E.loadError<h)C.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var v=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==v&&this._levels[v].loadError===0&&(this.warn(y+": switch to "+v),C.levelRetry=!0,this.hls.nextAutoLevel=v)}}},n.redundantFailover=function(C){var T=this._levels[C],R=T.url.length;if(R>1){var S=(T.urlId+1)%R;this.warn("Switching to redundant URL-id "+S),this._levels.forEach(function(y){y.urlId=S}),this.level=C}},n.onFragLoaded=function(C,T){var R=T.frag;if(R!==void 0&&R.type===P.PlaylistLevelType.MAIN){var S=this._levels[R.level];S!==void 0&&(S.fragmentError=0,S.loadError=0)}},n.onLevelLoaded=function(C,T){var R,S=T.level,y=T.details,E=this._levels[S];if(!E){var f;this.warn("Invalid level index "+S),(f=T.deliveryDirectives)!==null&&f!==void 0&&f.skip&&(y.deltaUpdateFailed=!0);return}S===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(S,T,E.details)):(R=T.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(y.deltaUpdateFailed=!0)},n.onAudioTrackSwitched=function(C,T){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var S=-1,y=this.hls.audioTracks[T.id].groupId,E=0;E<R.audioGroupIds.length;E++)if(R.audioGroupIds[E]===y){S=E;break}S!==R.urlId&&(R.urlId=S,this.startLoad())}},n.loadPlaylist=function(C){var T=this.currentLevelIndex,R=this._levels[T];if(this.canLoad&&R&&R.url.length>0){var S=R.urlId,y=R.url[S];if(C)try{y=C.addDirectives(y)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+T+(C?" at sn "+C.msn+" part "+C.part:"")+" with URL-id "+S+" "+y),this.clearTimer(),this.hls.trigger(L.Events.LEVEL_LOADING,{url:y,level:T,id:S,deliveryDirectives:C||null})}},n.removeLevel=function(C,T){var R=function(E,f){return f!==T},S=this._levels.filter(function(y,E){return E!==C?!0:y.url.length>1&&T!==void 0?(y.url=y.url.filter(R),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(R)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(R)),y.urlId=0,!0):!1}).map(function(y,E){var f=y.details;return f!=null&&f.fragments&&f.fragments.forEach(function(h){h.level=E}),y});this._levels=S,this.hls.trigger(L.Events.LEVELS_UPDATED,{levels:S})},m(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(C){var T,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===C&&(T=R[C])!==null&&T!==void 0&&T.details)return;if(C<0||C>=R.length){var S=C<0;if(this.hls.trigger(L.Events.ERROR,{type:D.ErrorTypes.OTHER_ERROR,details:D.ErrorDetails.LEVEL_SWITCH_ERROR,level:C,fatal:S,reason:"invalid level idx"}),S)return;C=Math.min(C,R.length-1)}this.clearTimer();var y=this.currentLevelIndex,E=R[y],f=R[C];this.log("switching to level "+C+" from "+y),this.currentLevelIndex=C;var h=x({},f,{level:C,maxBitrate:f.maxBitrate,uri:f.uri,urlId:f.urlId});delete h._urlId,this.hls.trigger(L.Events.LEVEL_SWITCHING,h);var v=f.details;if(!v||v.live){var g=this.switchParams(f.uri,E==null?void 0:E.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(C){this.manualLevelIndex=C,this._startLevel===void 0&&(this._startLevel=C),C!==-1&&(this.level=C)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(C){this._firstLevel=C}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var C=this.hls.config.startLevel;return C!==void 0?C:this._firstLevel}else return this._startLevel},set:function(C){this._startLevel=C}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(C){this.level=C,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=C)}}]),i}(r.default)},"./src/controller/level-helper.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"addGroupId",function(){return D}),I.d(V,"assignTrackIdsByGroup",function(){return K}),I.d(V,"updatePTS",function(){return M}),I.d(V,"updateFragPTSDTS",function(){return P}),I.d(V,"mergeDetails",function(){return x}),I.d(V,"mapPartIntersection",function(){return p}),I.d(V,"mapFragmentIntersection",function(){return m}),I.d(V,"adjustSliding",function(){return c}),I.d(V,"addSliding",function(){return a}),I.d(V,"computeReloadInterval",function(){return s}),I.d(V,"getFragmentWithSN",function(){return d}),I.d(V,"getPartWith",function(){return l});var z=I("./src/polyfills/number.ts"),L=I("./src/utils/logger.ts");function D(i,n,O){switch(n){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(O);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(O);break}}function K(i){var n={};i.forEach(function(O){var C=O.groupId||"";O.id=n[C]=n[C]||0,n[C]++})}function M(i,n,O){var C=i[n],T=i[O];r(C,T)}function r(i,n){var O=n.startPTS;if(Object(z.isFiniteNumber)(O)){var C=0,T;n.sn>i.sn?(C=O-i.start,T=i):(C=i.start-O,T=n),T.duration!==C&&(T.duration=C)}else if(n.sn>i.sn){var R=i.cc===n.cc;R&&i.minEndPTS?n.start=i.start+(i.minEndPTS-i.start):n.start=i.start+i.duration}else n.start=Math.max(i.start-n.duration,0)}function P(i,n,O,C,T,R){var S=C-O;S<=0&&(L.logger.warn("Fragment should have a positive duration",n),C=O+n.duration,R=T+n.duration);var y=O,E=C,f=n.startPTS,h=n.endPTS;if(Object(z.isFiniteNumber)(f)){var v=Math.abs(f-O);Object(z.isFiniteNumber)(n.deltaPTS)?n.deltaPTS=Math.max(v,n.deltaPTS):n.deltaPTS=v,y=Math.max(O,f),O=Math.min(O,f),T=Math.min(T,n.startDTS),E=Math.min(C,h),C=Math.max(C,h),R=Math.max(R,n.endDTS)}n.duration=C-O;var g=O-n.start;n.appendedPTS=C,n.start=n.startPTS=O,n.maxStartPTS=y,n.startDTS=T,n.endPTS=C,n.minEndPTS=E,n.endDTS=R;var b=n.sn;if(!i||b<i.startSN||b>i.endSN)return 0;var N,H=b-i.startSN,A=i.fragments;for(A[H]=n,N=H;N>0;N--)r(A[N],A[N-1]);for(N=H;N<A.length-1;N++)r(A[N],A[N+1]);return i.fragmentHint&&r(A[A.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,g}function x(i,n){for(var O=null,C=i.fragments,T=C.length-1;T>=0;T--){var R=C[T].initSegment;if(R){O=R;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var S=0,y;if(m(i,n,function(N,H){N.relurl&&(S=N.cc-H.cc),Object(z.isFiniteNumber)(N.startPTS)&&Object(z.isFiniteNumber)(N.endPTS)&&(H.start=H.startPTS=N.startPTS,H.startDTS=N.startDTS,H.appendedPTS=N.appendedPTS,H.maxStartPTS=N.maxStartPTS,H.endPTS=N.endPTS,H.endDTS=N.endDTS,H.minEndPTS=N.minEndPTS,H.duration=N.endPTS-N.startPTS,H.duration&&(y=H),n.PTSKnown=n.alignedSliding=!0),H.elementaryStreams=N.elementaryStreams,H.loader=N.loader,H.stats=N.stats,H.urlId=N.urlId,N.initSegment&&(H.initSegment=N.initSegment,O=N.initSegment)}),O){var E=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments;E.forEach(function(N){var H;(!N.initSegment||N.initSegment.relurl===((H=O)===null||H===void 0?void 0:H.relurl))&&(N.initSegment=O)})}if(n.skippedSegments&&(n.deltaUpdateFailed=n.fragments.some(function(N){return!N}),n.deltaUpdateFailed)){L.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var f=n.skippedSegments;f--;)n.fragments.shift();n.startSN=n.fragments[0].sn,n.startCC=n.fragments[0].cc}var h=n.fragments;if(S){L.logger.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v<h.length;v++)h[v].cc+=S}n.skippedSegments&&(n.startCC=n.fragments[0].cc),p(i.partList,n.partList,function(N,H){H.elementaryStreams=N.elementaryStreams,H.stats=N.stats}),y?P(n,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):c(i,n),h.length&&(n.totalduration=n.edge-h[0].start),n.driftStartTime=i.driftStartTime,n.driftStart=i.driftStart;var g=n.advancedDateTime;if(n.advanced&&g){var b=n.edge;n.driftStart||(n.driftStartTime=g,n.driftStart=b),n.driftEndTime=g,n.driftEnd=b}else n.driftEndTime=i.driftEndTime,n.driftEnd=i.driftEnd,n.advancedDateTime=i.advancedDateTime}function p(i,n,O){if(i&&n)for(var C=0,T=0,R=i.length;T<=R;T++){var S=i[T],y=n[T+C];S&&y&&S.index===y.index&&S.fragment.sn===y.fragment.sn?O(S,y):C--}}function m(i,n,O){for(var C=n.skippedSegments,T=Math.max(i.startSN,n.startSN)-n.startSN,R=(i.fragmentHint?1:0)+(C?n.endSN:Math.min(i.endSN,n.endSN))-n.startSN,S=n.startSN-i.startSN,y=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,E=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,f=T;f<=R;f++){var h=E[S+f],v=y[f];C&&!v&&f<C&&(v=n.fragments[f]=h),h&&v&&O(h,v)}}function c(i,n){var O=n.startSN+n.skippedSegments-i.startSN,C=i.fragments;if(O<0||O>=C.length)return;a(n,C[O].start)}function a(i,n){if(n){for(var O=i.fragments,C=i.skippedSegments;C<O.length;C++)O[C].start+=n;i.fragmentHint&&(i.fragmentHint.start+=n)}}function s(i,n){var O=1e3*i.levelTargetDuration,C=O/2,T=i.age,R=T>0&&T<O*3,S=n.loading.end-n.loading.start,y,E=i.availabilityDelay;if(i.updated===!1)if(R){var f=333*i.misses;y=Math.max(Math.min(C,S*2),f),i.availabilityDelay=(i.availabilityDelay||0)+y}else y=C;else R?(E=Math.min(E||O/2,T),i.availabilityDelay=E,y=E+O-T):y=O-S;return Math.round(y)}function d(i,n,O){if(!i||!i.details)return null;var C=i.details,T=C.fragments[n-C.startSN];return T||(T=C.fragmentHint,T&&T.sn===n?T:n<C.startSN&&O&&O.sn===n?O:null)}function l(i,n,O){if(!i||!i.details)return null;var C=i.details.partList;if(C)for(var T=C.length;T--;){var R=C[T];if(R.index===O&&R.fragment.sn===n)return R}return null}},"./src/controller/stream-controller.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return C});var z=I("./src/polyfills/number.ts"),L=I("./src/controller/base-stream-controller.ts"),D=I("./src/is-supported.ts"),K=I("./src/events.ts"),M=I("./src/utils/buffer-helper.ts"),r=I("./src/controller/fragment-tracker.ts"),P=I("./src/types/loader.ts"),x=I("./src/loader/fragment.ts"),p=I("./src/demux/transmuxer-interface.ts"),m=I("./src/types/transmuxer.ts"),c=I("./src/controller/gap-controller.ts"),a=I("./src/errors.ts"),s=I("./src/utils/logger.ts");function d(T,R){for(var S=0;S<R.length;S++){var y=R[S];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(T,y.key,y)}}function l(T,R,S){return R&&d(T.prototype,R),S&&d(T,S),T}function i(T,R){T.prototype=Object.create(R.prototype),T.prototype.constructor=T,n(T,R)}function n(T,R){return n=Object.setPrototypeOf||function(y,E){return y.__proto__=E,y},n(T,R)}var O=100,C=function(T){i(R,T);function R(y,E){var f;return f=T.call(this,y,E,"[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 S=R.prototype;return S._registerListeners=function(){var E=this.hls;E.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.on(K.Events.ERROR,this.onError,this),E.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var E=this.hls;E.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.off(K.Events.ERROR,this.onError,this),E.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},S.startLoad=function(E){if(this.levels){var f=this.lastCurrentTime,h=this.hls;if(this.stopLoad(),this.setInterval(O),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var v=h.startLevel;v===-1&&(h.config.testBandwidth?(v=0,this.bitrateTest=!0):v=h.nextAutoLevel),this.level=h.nextLoadLevel=v,this.loadedmetadata=!1}f>0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),E=f),this.state=L.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=L.State.STOPPED},S.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},S.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_LEVEL:{var E,f=this.levels,h=this.level,v=f==null||((E=f[h])===null||E===void 0)?void 0:E.details;if(v&&(!v.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(v))break;this.state=L.State.IDLE;break}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var g,b=self.performance.now(),N=this.retryDate;(!N||b>=N||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=L.State.IDLE)}break;default:break}this.onTickEnd()},S.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},S.doTickIdle=function(){var E,f,h=this.hls,v=this.levelLastLoaded,g=this.levels,b=this.media,N=h.config,H=h.nextLoadLevel;if(v===null||!b&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[H])return;var A=g[H];this.level=h.nextLoadLevel=H;var F=A.details;if(!F||this.state===L.State.WAITING_LEVEL||F.live&&this.levelLastLoaded!==H){this.state=L.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,P.PlaylistLevelType.MAIN);if(U===null)return;var w=U.len,Y=this.getMaxBufferLength(A.maxBitrate);if(w>=Y)return;if(this._streamEnded(U,F)){var Z={};this.altAudio&&(Z.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,Z),this.state=L.State.ENDED;return}var ce=U.end,be=this.getNextFragment(ce,F);if(this.couldBacktrack&&!this.fragPrevious&&be&&be.sn!=="initSegment"){var Ze=be.sn-F.startSN;Ze>1&&(be=F.fragments[Ze-1],this.fragmentTracker.removeFragment(be))}if(be&&this.fragmentTracker.getState(be)===r.FragmentState.OK&&this.nextLoadPosition>ce){var Ce=this.audioOnly&&!this.altAudio?x.ElementaryStreamTypes.AUDIO:x.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,Ce,P.PlaylistLevelType.MAIN),be=this.getNextFragment(this.nextLoadPosition,F)}if(!be)return;be.initSegment&&!be.initSegment.data&&!this.bitrateTest&&(be=be.initSegment),((E=be.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((f=be.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(be,F):this.loadFragment(be,F,ce)},S.loadFragment=function(E,f,h){var v,g=this.fragmentTracker.getState(E);if(this.fragCurrent=E,g===r.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(E);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else g=r.FragmentState.NOT_LOADED}g===r.FragmentState.NOT_LOADED||g===r.FragmentState.PARTIAL?E.sn==="initSegment"?this._loadInitSegment(E):this.bitrateTest?(E.bitrateTest=!0,this.log("Fragment "+E.sn+" of level "+E.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(E)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,E,f,h)):g===r.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((v=this.media)===null||v===void 0?void 0:v.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},S.getAppendedFrag=function(E){var f=this.fragmentTracker.getAppendedFrag(E,P.PlaylistLevelType.MAIN);return f&&"fragment"in f?f.fragment:f},S.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,P.PlaylistLevelType.MAIN)},S.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},S.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},S.nextLevelSwitch=function(){var E=this.levels,f=this.media;if(f!=null&&f.readyState){var h,v=this.getAppendedFrag(f.currentTime);if(v&&v.start>1&&this.flushMainBuffer(0,v.start-1),!f.paused&&E){var g=this.hls.nextLoadLevel,b=E[g],N=this.fragLastKbps;N&&this.fragCurrent?h=this.fragCurrent.duration*b.maxBitrate/(1e3*N)+1:h=0}else h=0;var H=this.getBufferedFrag(f.currentTime+h);if(H){var A=this.followingBufferedFrag(H);if(A){this.abortCurrentFrag();var F=A.maxStartPTS?A.maxStartPTS:A.start,U=A.duration,w=Math.max(H.end,F+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(w,Number.POSITIVE_INFINITY)}}}},S.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===L.State.KEY_LOADING&&(this.state=L.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},S.flushMainBuffer=function(E,f){T.prototype.flushMainBuffer.call(this,E,f,this.altAudio?"video":null)},S.onMediaAttached=function(E,f){T.prototype.onMediaAttached.call(this,E,f);var h=f.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),h.addEventListener("playing",this.onvplaying),h.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,h,this.fragmentTracker,this.hls)},S.onMediaDetaching=function(){var E=this.media;E&&(E.removeEventListener("playing",this.onvplaying),E.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},S.onMediaPlaying=function(){this.tick()},S.onMediaSeeked=function(){var E=this.media,f=E?E.currentTime:null;Object(z.isFiniteNumber)(f)&&this.log("Media seeked to "+f.toFixed(3)),this.tick()},S.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},S.onManifestParsed=function(E,f){var h=!1,v=!1,g;f.levels.forEach(function(b){g=b.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(h=!0),g.indexOf("mp4a.40.5")!==-1&&(v=!0))}),this.audioCodecSwitch=h&&v&&!Object(D.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},S.onLevelLoading=function(E,f){var h=this.levels;if(!h||this.state!==L.State.IDLE)return;var v=h[f.level];(!v.details||v.details.live&&this.levelLastLoaded!==f.level||this.waitForCdnTuneIn(v.details))&&(this.state=L.State.WAITING_LEVEL)},S.onLevelLoaded=function(E,f){var h,v=this.levels,g=f.level,b=f.details,N=b.totalduration;if(!v){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+N);var H=this.fragCurrent;H&&(this.state===L.State.FRAG_LOADING||this.state===L.State.FRAG_LOADING_WAITING_RETRY)&&(H.level!==f.level&&H.loader&&(this.state=L.State.IDLE,H.loader.abort()));var A=v[g],F=0;if(b.live||(h=A.details)!==null&&h!==void 0&&h.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;F=this.alignPlaylists(b,A.details)}if(A.details=b,this.levelLastLoaded=g,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:b,level:g}),this.state===L.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=L.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,F),this.tick()},S._handleFragmentLoadProgress=function(E){var f,h=E.frag,v=E.part,g=E.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+h.sn+" of level "+h.level+" will not be buffered");return}var N=b[h.level],H=N.details;if(!H){this.warn("Dropping fragment "+h.sn+" of level "+h.level+" after level details were reset");return}var A=N.videoCodec,F=H.PTSKnown||!H.live,U=(f=h.initSegment)===null||f===void 0?void 0:f.data,w=this._getAudioCodec(N),Y=this.transmuxer=this.transmuxer||new p.default(this.hls,P.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Z=v?v.index:-1,ce=Z!==-1,be=new m.ChunkMetadata(h.level,h.sn,h.stats.chunkCount,g.byteLength,Z,ce),Ze=this.initPTS[h.cc];Y.push(g,U,w,A,h,v,H.totalduration,F,be,Ze)},S.onAudioTrackSwitching=function(E,f){var h=this.altAudio,v=!!f.url,g=f.id;if(!v){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;h&&N.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:g})}},S.onAudioTrackSwitched=function(E,f){var h=f.id,v=!!this.hls.audioTracks[h].url;if(v){var g=this.videoBuffer;g&&this.mediaBuffer!==g&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=g)}this.altAudio=v,this.tick()},S.onBufferCreated=function(E,f){var h=f.tracks,v,g,b=!1;for(var N in h){var H=h[N];if(H.id==="main"){if(g=N,v=H,N==="video"){var A=h[N];A&&(this.videoBuffer=A.buffer)}}else b=!0}b&&v?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=v.buffer):this.mediaBuffer=this.media},S.onFragBuffered=function(E,f){var h=f.frag,v=f.part;if(h&&h.type!==P.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(h)){this.warn("Fragment "+h.sn+(v?" p: "+v.index:"")+" of level "+h.level+" finished buffering, but was aborted. state: "+this.state),this.state===L.State.PARSED&&(this.state=L.State.IDLE);return}var g=v?v.stats:h.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),h.sn!=="initSegment"&&(this.fragPrevious=h),this.fragBufferedComplete(h,v)},S.onError=function(E,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(P.PlaylistLevelType.MAIN,f);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==L.State.ERROR&&(f.fatal?(this.warn(""+f.details),this.state=L.State.ERROR):!f.levelRetry&&this.state===L.State.WAITING_LEVEL&&(this.state=L.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="main"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var h=!0,v=this.getFwdBufferInfo(this.media,P.PlaylistLevelType.MAIN);v&&v.len>.5&&(h=!this.reduceMaxBufferLength(v.len)),h&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},S.checkBuffer=function(){var E=this.media,f=this.gapController;if(!E||!f||!E.readyState)return;var h=M.BufferHelper.getBuffered(E);!this.loadedmetadata&&h.length?(this.loadedmetadata=!0,this.seekToStartPos()):f.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},S.onFragLoadEmergencyAborted=function(){this.state=L.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},S.onBufferFlushed=function(E,f){var h=f.type;if(h!==x.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var v=(h===x.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(v,h,P.PlaylistLevelType.MAIN)}},S.onLevelsUpdated=function(E,f){this.levels=f.levels},S.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},S.seekToStartPos=function(){var E=this.media,f=E.currentTime,h=this.startPosition;if(h>=0&&f<h){if(E.seeking){s.logger.log("could not seek to "+h+", already seeking at "+f);return}var v=M.BufferHelper.getBuffered(E),g=v.length?v.start(0):0,b=g-h;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(s.logger.log("adjusting start position by "+b+" to match buffer start"),h+=b,this.startPosition=h),this.log("seek to target start position "+h+" from current time "+f),E.currentTime=h}},S._getAudioCodec=function(E){var f=this.config.defaultAudioCodec||E.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},S._loadBitrateTestFrag=function(E){var f=this;this._doFragLoad(E).then(function(h){var v=f.hls;if(!h||v.nextLoadLevel||f.fragContextChanged(E))return;f.fragLoadError=0,f.state=L.State.IDLE,f.startFragRequested=!1,f.bitrateTest=!1;var g=E.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),v.trigger(K.Events.FRAG_LOADED,h)})},S._handleTransmuxComplete=function(E){var f,h="main",v=this.hls,g=E.remuxResult,b=E.chunkMeta,N=this.getCurrentContext(b);if(!N){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var H=N.frag,A=N.part,F=N.level,U=g.video,w=g.text,Y=g.id3,Z=g.initSegment,ce=this.altAudio?void 0:g.audio;if(this.fragContextChanged(H))return;if(this.state=L.State.PARSING,Z){Z.tracks&&(this._bufferInitSegment(F,Z.tracks,H,b),v.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:h,tracks:Z.tracks}));var be=Z.initPTS,Ze=Z.timescale;Object(z.isFiniteNumber)(be)&&(this.initPTS[H.cc]=be,v.trigger(K.Events.INIT_PTS_FOUND,{frag:H,id:h,initPTS:be,timescale:Ze}))}if(U&&g.independent!==!1){if(F.details){var Ce=U.startPTS,We=U.endPTS,Ve=U.startDTS,Ye=U.endDTS;if(A)A.elementaryStreams[U.type]={startPTS:Ce,endPTS:We,startDTS:Ve,endDTS:Ye};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var we=this.getLoadPosition()+this.config.maxBufferHole;if(we<Ce){this.backtrack(H);return}H.setElementaryStreamInfo(U.type,H.start,We,H.start,Ye,!0)}H.setElementaryStreamInfo(U.type,Ce,We,Ve,Ye),this.bufferFragmentData(U,H,A,b)}}else if(g.independent===!1){this.backtrack(H);return}if(ce){var X=ce.startPTS,j=ce.endPTS,W=ce.startDTS,Q=ce.endDTS;A&&(A.elementaryStreams[x.ElementaryStreamTypes.AUDIO]={startPTS:X,endPTS:j,startDTS:W,endDTS:Q}),H.setElementaryStreamInfo(x.ElementaryStreamTypes.AUDIO,X,j,W,Q),this.bufferFragmentData(ce,H,A,b)}if(Y!=null&&(f=Y.samples)!==null&&f!==void 0&&f.length){var re={frag:H,id:h,samples:Y.samples};v.trigger(K.Events.FRAG_PARSING_METADATA,re)}if(w){var G={frag:H,id:h,samples:w.samples};v.trigger(K.Events.FRAG_PARSING_USERDATA,G)}},S._bufferInitSegment=function(E,f,h,v){var g=this;if(this.state!==L.State.PARSING)return;this.audioOnly=!!f.audio&&!f.video,this.altAudio&&!this.audioOnly&&delete f.audio;var b=f.audio,N=f.video,H=f.audiovideo;if(b){var A=E.audioCodec,F=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),b.metadata.channelCount!==1&&F.indexOf("firefox")===-1&&(A="mp4a.40.5")),F.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log("Android: force audio codec to "+A)),E.audioCodec&&E.audioCodec!==A&&this.log('Swapping manifest audio codec "'+E.audioCodec+'" for "'+A+'"'),b.levelCodec=A,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(A||"")+"/"+(E.audioCodec||"")+"/"+b.codec+"]")}N&&(N.levelCodec=E.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(E.videoCodec||"")+"/"+N.codec+"]")),H&&this.log("Init audiovideo buffer, container:"+H.container+", codecs[level/parsed]=["+(E.attrs.CODECS||"")+"/"+H.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,f),Object.keys(f).forEach(function(U){var w=f[U],Y=w.initSegment;Y!=null&&Y.byteLength&&g.hls.trigger(K.Events.BUFFER_APPENDING,{type:U,data:Y,frag:h,part:null,chunkMeta:v,parent:h.type})}),this.tick()},S.backtrack=function(E){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(E);var f=this.fragmentTracker.backtrack(E);this.fragPrevious=null,this.nextLoadPosition=E.start,f?this.resetFragmentLoading(E):this.state=L.State.BACKTRACKING},S.checkFragmentChanged=function(){var E=this.media,f=null;if(E&&E.readyState>1&&E.seeking===!1){var h=E.currentTime;if(M.BufferHelper.isBuffered(E,h)?f=this.getAppendedFrag(h):M.BufferHelper.isBuffered(E,h+.1)&&(f=this.getAppendedFrag(h+.1)),f){var v=this.fragPlaying,g=f.level;(!v||f.sn!==v.sn||v.level!==g||f.urlId!==v.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:f}),(!v||v.level!==g)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=f)}}},l(R,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var f=this.getAppendedFrag(E.currentTime);if(f)return f.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var f=this.getAppendedFrag(E.currentTime);return this.followingBufferedFrag(f)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(L.default)},"./src/controller/subtitle-stream-controller.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"SubtitleStreamController",function(){return i});var z=I("./src/events.ts"),L=I("./src/utils/logger.ts"),D=I("./src/utils/buffer-helper.ts"),K=I("./src/controller/fragment-finders.ts"),M=I("./src/utils/discontinuities.ts"),r=I("./src/controller/level-helper.ts"),P=I("./src/controller/fragment-tracker.ts"),x=I("./src/controller/base-stream-controller.ts"),p=I("./src/types/loader.ts"),m=I("./src/types/level.ts");function c(n,O){for(var C=0;C<O.length;C++){var T=O[C];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(n,T.key,T)}}function a(n,O,C){return O&&c(n.prototype,O),C&&c(n,C),n}function s(n,O){n.prototype=Object.create(O.prototype),n.prototype.constructor=n,d(n,O)}function d(n,O){return d=Object.setPrototypeOf||function(T,R){return T.__proto__=R,T},d(n,O)}var l=500,i=function(n){s(O,n);function O(T,R){var S;return S=n.call(this,T,R,"[subtitle-stream-controller]")||this,S.levels=[],S.currentTrackId=-1,S.tracksBuffered=[],S.mainDetails=null,S._registerListeners(),S}var C=O.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var R=this.hls;R.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(z.Events.ERROR,this.onError,this),R.on(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C._unregisterListeners=function(){var R=this.hls;R.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(z.Events.ERROR,this.onError,this),R.off(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C.startLoad=function(){this.stopLoad(),this.state=x.State.IDLE,this.setInterval(l),this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},C.onLevelLoaded=function(R,S){this.mainDetails=S.details},C.onSubtitleFragProcessed=function(R,S){var y=S.frag,E=S.success;if(this.fragPrevious=y,this.state=x.State.IDLE,!E)return;var f=this.tracksBuffered[this.currentTrackId];if(!f)return;for(var h,v=y.start,g=0;g<f.length;g++)if(v>=f[g].start&&v<=f[g].end){h=f[g];break}var b=y.start+y.duration;h?h.end=b:(h={start:v,end:b},f.push(h)),this.fragmentTracker.fragBuffered(y)},C.onBufferFlushing=function(R,S){var y=S.startOffset,E=S.endOffset;if(y===0&&E!==Number.POSITIVE_INFINITY){var f=this.currentTrackId,h=this.levels;if(!h.length||!h[f]||!h[f].details)return;var v=h[f].details,g=v.targetduration,b=E-g;if(b<=0)return;S.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(N){for(var H=0;H<N.length;){if(N[H].end<=b){N.shift();continue}else if(N[H].start<b)N[H].start=b;else break;H++}}),this.fragmentTracker.removeFragmentsInRange(y,b,p.PlaylistLevelType.SUBTITLE)}},C.onError=function(R,S){var y,E=S.frag;if(!E||E.type!==p.PlaylistLevelType.SUBTITLE)return;(y=this.fragCurrent)!==null&&y!==void 0&&y.loader&&this.fragCurrent.loader.abort(),this.state=x.State.IDLE},C.onSubtitleTracksUpdated=function(R,S){var y=this,E=S.subtitleTracks;this.tracksBuffered=[],this.levels=E.map(function(f){return new m.Level(f)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(f){y.tracksBuffered[f.id]=[]}),this.mediaBuffer=null},C.onSubtitleTrackSwitch=function(R,S){if(this.currentTrackId=S.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var y=this.levels[this.currentTrackId];y!=null&&y.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,y&&this.setInterval(l)},C.onSubtitleTrackLoaded=function(R,S){var y,E=S.details,f=S.id,h=this.currentTrackId,v=this.levels;if(!v.length)return;var g=v[h];if(f>=v.length||f!==h||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(y=g.details)!==null&&y!==void 0&&y.live){var b=this.mainDetails;if(E.deltaUpdateFailed||!b)return;var N=b.fragments[0];if(!g.details)E.hasProgramDateTime&&b.hasProgramDateTime?Object(M.alignMediaPlaylistByPDT)(E,b):N&&Object(r.addSliding)(E,N.start);else{var H=this.alignPlaylists(E,g.details);H===0&&N&&Object(r.addSliding)(E,N.start)}}if(g.details=E,this.levelLastLoaded=f,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===x.State.IDLE){var A=Object(K.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},C._handleFragmentLoadComplete=function(R){var S=R.frag,y=R.payload,E=S.decryptdata,f=this.hls;if(this.fragContextChanged(S))return;if(y&&y.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var h=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(y),E.key.buffer,E.iv.buffer).then(function(v){var g=performance.now();f.trigger(z.Events.FRAG_DECRYPTED,{frag:S,payload:v,stats:{tstart:h,tdecrypt:g}})})}},C.doTick=function(){if(!this.media){this.state=x.State.IDLE;return}if(this.state===x.State.IDLE){var R,S=this.currentTrackId,y=this.levels;if(!y.length||!y[S]||!y[S].details)return;var E=y[S].details,f=E.targetduration,h=this.config,v=this.media,g=D.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,v.currentTime-f,h.maxBufferHole),b=g.end,N=g.len,H=this.getMaxBufferLength()+f;if(N>H)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var A=E.fragments,F=A.length,U=E.edge,w,Y=this.fragPrevious;if(b<U){var Z=h.maxFragLookUpTolerance;Y&&E.hasProgramDateTime&&(w=Object(K.findFragmentByPDT)(A,Y.endProgramDateTime,Z)),w||(w=Object(K.findFragmentByPTS)(Y,A,b,Z),!w&&Y&&Y.start<A[0].start&&(w=A[0]))}else w=A[F-1];(R=w)!==null&&R!==void 0&&R.encrypted?(L.logger.log("Loading key for "+w.sn),this.state=x.State.KEY_LOADING,this.hls.trigger(z.Events.KEY_LOADING,{frag:w})):w&&this.fragmentTracker.getState(w)===P.FragmentState.NOT_LOADED&&this.loadFragment(w,E,b)}},C.loadFragment=function(R,S,y){this.fragCurrent=R,n.prototype.loadFragment.call(this,R,S,y)},a(O,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),O}(x.default)},"./src/controller/subtitle-track-controller.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/events.ts"),L=I("./src/utils/texttrack-utils.ts"),D=I("./src/controller/base-playlist-controller.ts"),K=I("./src/types/loader.ts");function M(c,a){for(var s=0;s<a.length;s++){var d=a[s];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(c,d.key,d)}}function r(c,a,s){return a&&M(c.prototype,a),s&&M(c,s),c}function P(c,a){c.prototype=Object.create(a.prototype),c.prototype.constructor=c,x(c,a)}function x(c,a){return x=Object.setPrototypeOf||function(d,l){return d.__proto__=l,d},x(c,a)}var p=function(c){P(a,c);function a(d){var l;return l=c.call(this,d,"[subtitle-track-controller]")||this,l.media=null,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.selectDefaultTrack=!0,l.queuedDefaultTrack=-1,l.trackChangeListener=function(){return l.onTextTracksChanged()},l.asyncPollTrackChange=function(){return l.pollTrackChange(0)},l.useTextTrackPolling=!1,l.subtitlePollingInterval=-1,l.subtitleDisplay=!0,l.registerListeners(),l}var s=a.prototype;return s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},s.registerListeners=function(){var l=this.hls;l.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),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.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),l.on(z.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var l=this.hls;l.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),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.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),l.off(z.Events.ERROR,this.onError,this)},s.onMediaAttached=function(l,i){if(this.media=i.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},s.pollTrackChange=function(l){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,l)},s.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var l=m(this.media.textTracks);l.forEach(function(i){Object(L.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},s.onManifestParsed=function(l,i){this.tracks=i.subtitleTracks},s.onSubtitleTrackLoaded=function(l,i){var n=i.id,O=i.details,C=this.trackId,T=this.tracksInGroup[C];if(!T){this.warn("Invalid subtitle track id "+n);return}var R=T.details;T.details=i.details,this.log("subtitle track "+n+" loaded ["+O.startSN+"-"+O.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,i,R))},s.onLevelLoading=function(l,i){this.switchLevel(i.level)},s.onLevelSwitching=function(l,i){this.switchLevel(i.level)},s.switchLevel=function(l){var i=this.hls.levels[l];if(!(i!=null&&i.textGroupIds))return;var n=i.textGroupIds[i.urlId];if(this.groupId!==n){var O=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,C=this.tracks.filter(function(S){return!n||S.groupId===n});this.tracksInGroup=C;var T=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=n;var R={subtitleTracks:C};this.log("Updating subtitle tracks, "+C.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(z.Events.SUBTITLE_TRACKS_UPDATED,R),T!==-1&&this.setSubtitleTrack(T,O)}},s.findTrackId=function(l){for(var i=this.tracksInGroup,n=0;n<i.length;n++){var O=i[n];if((!this.selectDefaultTrack||O.default)&&(!l||l===O.name))return O.id}return-1},s.onError=function(l,i){if(c.prototype.onError.call(this,l,i),i.fatal||!i.context)return;i.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},s.loadPlaylist=function(l){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var n=i.id,O=i.groupId,C=i.url;if(l)try{C=l.addDirectives(C)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+n),this.hls.trigger(z.Events.SUBTITLE_TRACK_LOADING,{url:C,id:n,groupId:O,deliveryDirectives:l||null})}},s.toggleTrackModes=function(l){var i=this,n=this.media,O=this.subtitleDisplay,C=this.trackId;if(!n)return;var T=m(n.textTracks),R=T.filter(function(E){return E.groupId===i.groupId});if(l===-1)[].slice.call(T).forEach(function(E){E.mode="disabled"});else{var S=R[C];S&&(S.mode="disabled")}var y=R[l];y&&(y.mode=O?"showing":"hidden")},s.setSubtitleTrack=function(l,i){var n,O=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=l;return}if(this.trackId!==l&&this.toggleTrackModes(l),this.trackId===l&&(l===-1||(n=O[l])!==null&&n!==void 0&&n.details)||l<-1||l>=O.length)return;this.clearTimer();var C=O[l];if(this.log("Switching to subtitle track "+l),this.trackId=l,C){var T=C.id,R=C.groupId,S=R===void 0?"":R,y=C.name,E=C.type,f=C.url;this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:S,name:y,type:E,url:f});var h=this.switchParams(C.url,i==null?void 0:i.details);this.loadPlaylist(h)}else this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:l})},s.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var l=-1,i=m(this.media.textTracks),n=0;n<i.length;n++)if(i[n].mode==="hidden")l=n;else if(i[n].mode==="showing"){l=n;break}this.subtitleTrack!==l&&(this.subtitleTrack=l)},r(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(l,i)}}]),a}(D.default);function m(c){for(var a=[],s=0;s<c.length;s++){var d=c[s];d.kind==="subtitles"&&d.label&&a.push(c[s])}return a}V.default=p},"./src/controller/timeline-controller.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"TimelineController",function(){return m});var z=I("./src/polyfills/number.ts"),L=I("./src/events.ts"),D=I("./src/utils/cea-608-parser.ts"),K=I("./src/utils/output-filter.ts"),M=I("./src/utils/webvtt-parser.ts"),r=I("./src/utils/texttrack-utils.ts"),P=I("./src/utils/imsc1-ttml-parser.ts"),x=I("./src/types/loader.ts"),p=I("./src/utils/logger.ts"),m=function(){function d(i){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),this.captionsProperties=void 0,this.hls=i,this.config=i.config,this.Cues=i.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var n=new K.default(this,"textTrack1"),O=new K.default(this,"textTrack2"),C=new K.default(this,"textTrack3"),T=new K.default(this,"textTrack4");this.cea608Parser1=new D.default(1,n,O),this.cea608Parser2=new D.default(3,C,T)}i.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(L.Events.FRAG_LOADING,this.onFragLoading,this),i.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var l=d.prototype;return l.destroy=function(){var n=this.hls;n.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.off(L.Events.FRAG_LOADING,this.onFragLoading,this),n.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),n.off(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.off(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.off(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},l.addCues=function(n,O,C,T,R){for(var S=!1,y=R.length;y--;){var E=R[y],f=a(E[0],E[1],O,C);if(f>=0&&(E[0]=Math.min(E[0],O),E[1]=Math.max(E[1],C),S=!0,f/(C-O)>.5))return}if(S||R.push([O,C]),this.config.renderTextTracksNatively){var h=this.captionsTracks[n];this.Cues.newCue(h,O,C,T)}else{var v=this.Cues.newCue(null,O,C,T);this.hls.trigger(L.Events.CUES_PARSED,{type:"captions",cues:v,track:n})}},l.onInitPtsFound=function(n,O){var C=this,T=O.frag,R=O.id,S=O.initPTS,y=O.timescale,E=this.unparsedVttFrags;R==="main"&&(this.initPTS[T.cc]=S,this.timescale[T.cc]=y),E.length&&(this.unparsedVttFrags=[],E.forEach(function(f){C.onFragLoaded(L.Events.FRAG_LOADED,f)}))},l.getExistingTrack=function(n){var O=this.media;if(O)for(var C=0;C<O.textTracks.length;C++){var T=O.textTracks[C];if(T[n])return T}return null},l.createCaptionsTrack=function(n){this.config.renderTextTracksNatively?this.createNativeTrack(n):this.createNonNativeTrack(n)},l.createNativeTrack=function(n){if(this.captionsTracks[n])return;var O=this.captionsProperties,C=this.captionsTracks,T=this.media,R=O[n],S=R.label,y=R.languageCode,E=this.getExistingTrack(n);if(E)C[n]=E,Object(r.clearCurrentCues)(C[n]),Object(r.sendAddTrackEvent)(C[n],T);else{var f=this.createTextTrack("captions",S,y);f&&(f[n]=!0,C[n]=f)}},l.createNonNativeTrack=function(n){if(this.nonNativeCaptionsTracks[n])return;var O=this.captionsProperties[n];if(!O)return;var C=O.label,T={_id:n,label:C,kind:"captions",default:O.media?!!O.media.default:!1,closedCaptions:O.media};this.nonNativeCaptionsTracks[n]=T,this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},l.createTextTrack=function(n,O,C){var T=this.media;return T?T.addTextTrack(n,O,C):void 0},l.onMediaAttaching=function(n,O){this.media=O.media,this._cleanTracks()},l.onMediaDetaching=function(){var n=this.captionsTracks;Object.keys(n).forEach(function(O){Object(r.clearCurrentCues)(n[O]),delete n[O]}),this.nonNativeCaptionsTracks={}},l.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},l._cleanTracks=function(){var n=this.media;if(!n)return;var O=n.textTracks;if(O)for(var C=0;C<O.length;C++)Object(r.clearCurrentCues)(O[C])},l.onSubtitleTracksUpdated=function(n,O){var C=this;this.textTracks=[];var T=O.subtitleTracks||[],R=T.some(function(f){return f.textCodec===P.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var S=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var y=this.media?this.media.textTracks:[];this.tracks.forEach(function(f,h){var v;if(h<y.length){for(var g=null,b=0;b<y.length;b++)if(c(y[b],f)){g=y[b];break}g&&(v=g)}v?Object(r.clearCurrentCues)(v):(v=C.createTextTrack("subtitles",f.name,f.lang),v&&(v.mode="disabled")),v&&(v.groupId=f.groupId,C.textTracks.push(v))})}else if(!S&&this.tracks&&this.tracks.length){var E=this.tracks.map(function(f){return{label:f.name,kind:f.type.toLowerCase(),default:f.default,subtitleTrack:f}});this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:E})}}},l.onManifestLoaded=function(n,O){var C=this;this.config.enableCEA708Captions&&O.captions&&O.captions.forEach(function(T){var R=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!R)return;var S="textTrack"+R[1],y=C.captionsProperties[S];if(!y)return;y.label=T.name,T.lang&&(y.languageCode=T.lang),y.media=T})},l.onFragLoading=function(n,O){var C=this.cea608Parser1,T=this.cea608Parser2,R=this.lastSn,S=this.lastPartIndex;if(!this.enabled||!(C&&T))return;if(O.frag.type===x.PlaylistLevelType.MAIN){var y,E,f=O.frag.sn,h=(y=O==null||((E=O.part)===null||E===void 0)?void 0:E.index)!=null?y:-1;f===R+1||f===R&&h===S+1||(C.reset(),T.reset()),this.lastSn=f,this.lastPartIndex=h}},l.onFragLoaded=function(n,O){var C=O.frag,T=O.payload,R=this.initPTS,S=this.unparsedVttFrags;if(C.type===x.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(z.isFiniteNumber)(R[C.cc])){S.push(O),R.length&&this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:C,error:new Error("Missing initial subtitle PTS")});return}var y=C.decryptdata;if(y==null||y.key==null||y.method!=="AES-128"){var E=this.tracks[C.level],f=this.vttCCs;f[C.cc]||(f[C.cc]={start:C.start,prevCC:this.prevCC,new:!0},this.prevCC=C.cc),E&&E.textCodec===P.IMSC1_CODEC?this._parseIMSC1(C,T):this._parseVTTs(C,T,f)}}else this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:C,error:new Error("Empty subtitle payload")})},l._parseIMSC1=function(n,O){var C=this,T=this.hls;Object(P.parseIMSC1)(O,this.initPTS[n.cc],this.timescale[n.cc],function(R){C._appendCues(R,n.level),T.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(R){p.logger.log("Failed to parse IMSC1: "+R),T.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:R})})},l._parseVTTs=function(n,O,C){var T=this,R=this.hls;Object(M.parseWebVTT)(O,this.initPTS[n.cc],this.timescale[n.cc],C,n.cc,n.start,function(S){T._appendCues(S,n.level),R.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(S){T._fallbackToIMSC1(n,O),p.logger.log("Failed to parse VTT cue: "+S),R.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:S})})},l._fallbackToIMSC1=function(n,O){var C=this,T=this.tracks[n.level];T.textCodec||Object(P.parseIMSC1)(O,this.initPTS[n.cc],this.timescale[n.cc],function(){T.textCodec=P.IMSC1_CODEC,C._parseIMSC1(n,O)},function(){T.textCodec="wvtt"})},l._appendCues=function(n,O){var C=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[O];if(T.mode==="disabled")return;n.forEach(function(y){return Object(r.addCueToTrack)(T,y)})}else{var R=this.tracks[O],S=R.default?"default":"subtitles"+O;C.trigger(L.Events.CUES_PARSED,{type:"subtitles",cues:n,track:S})}},l.onFragDecrypted=function(n,O){var C=O.frag;if(C.type===x.PlaylistLevelType.SUBTITLE){if(!Object(z.isFiniteNumber)(this.initPTS[C.cc])){this.unparsedVttFrags.push(O);return}this.onFragLoaded(L.Events.FRAG_LOADED,O)}},l.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},l.onFragParsingUserdata=function(n,O){var C=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(C&&T))return;for(var R=0;R<O.samples.length;R++){var S=O.samples[R].bytes;if(S){var y=this.extractCea608Data(S);C.addData(O.samples[R].pts,y[0]),T.addData(O.samples[R].pts,y[1])}}},l.onBufferFlushing=function(n,O){var C=O.startOffset,T=O.endOffset,R=O.endOffsetSubtitles,S=O.type,y=this.media;if(!y||y.currentTime<T)return;if(!S||S==="video"){var E=this.captionsTracks;Object.keys(E).forEach(function(h){return Object(r.removeCuesInRange)(E[h],C,T)})}if(this.config.renderTextTracksNatively&&(C===0&&R!==void 0)){var f=this.textTracks;Object.keys(f).forEach(function(h){return Object(r.removeCuesInRange)(f[h],C,R)})}},l.extractCea608Data=function(n){for(var O=n[0]&31,C=2,T=[[],[]],R=0;R<O;R++){var S=n[C++],y=127&n[C++],E=127&n[C++],f=(4&S)!==0,h=3&S;if(y===0&&E===0)continue;f&&((h===0||h===1)&&(T[h].push(y),T[h].push(E)))}return T},d}();function c(d,l){return d&&d.label===l.name&&!(d.textTrack1||d.textTrack2)}function a(d,l,i,n){return Math.min(l,n)-Math.max(d,i)}function s(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return z});var z=function(){function L(K,M){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=M}var D=L.prototype;return D.decrypt=function(M,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,M)},L}()},"./src/crypt/aes-decryptor.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"removePadding",function(){return L}),I.d(V,"default",function(){return D});var z=I("./src/utils/typed-array.ts");function L(K){var M=K.byteLength,r=M&&new DataView(K.buffer).getUint8(M-1);return r?Object(z.sliceUint8)(K,0,M-r):K}var D=function(){function K(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var M=K.prototype;return M.uint8ArrayToUint32Array_=function(P){for(var x=new DataView(P),p=new Uint32Array(4),m=0;m<4;m++)p[m]=x.getUint32(m*4);return p},M.initTable=function(){var P=this.sBox,x=this.invSBox,p=this.subMix,m=p[0],c=p[1],a=p[2],s=p[3],d=this.invSubMix,l=d[0],i=d[1],n=d[2],O=d[3],C=new Uint32Array(256),T=0,R=0,S=0;for(S=0;S<256;S++)S<128?C[S]=S<<1:C[S]=S<<1^283;for(S=0;S<256;S++){var y=R^R<<1^R<<2^R<<3^R<<4;y=y>>>8^y&255^99,P[T]=y,x[y]=T;var E=C[T],f=C[E],h=C[f],v=C[y]*257^y*16843008;m[T]=v<<24|v>>>8,c[T]=v<<16|v>>>16,a[T]=v<<8|v>>>24,s[T]=v,v=h*16843009^f*65537^E*257^T*16843008,l[y]=v<<24|v>>>8,i[y]=v<<16|v>>>16,n[y]=v<<8|v>>>24,O[y]=v,T?(T=E^C[C[C[h^E]]],R^=C[C[R]]):T=R=1}},M.expandKey=function(P){for(var x=this.uint8ArrayToUint32Array_(P),p=!0,m=0;m<x.length&&p;)p=x[m]===this.key[m],m++;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,s,d,l=this.keySchedule=new Uint32Array(a),i=this.invKeySchedule=new Uint32Array(a),n=this.sBox,O=this.rcon,C=this.invSubMix,T=C[0],R=C[1],S=C[2],y=C[3],E,f;for(s=0;s<a;s++){if(s<c){E=l[s]=x[s];continue}f=E,s%c===0?(f=f<<8|f>>>24,f=n[f>>>24]<<24|n[f>>>16&255]<<16|n[f>>>8&255]<<8|n[f&255],f^=O[s/c|0]<<24):c>6&&s%c===4&&(f=n[f>>>24]<<24|n[f>>>16&255]<<16|n[f>>>8&255]<<8|n[f&255]),l[s]=E=(l[s-c]^f)>>>0}for(d=0;d<a;d++)s=a-d,d&3?f=l[s]:f=l[s-4],d<4||s<=4?i[d]=f:i[d]=T[n[f>>>24]]^R[n[f>>>16&255]]^S[n[f>>>8&255]]^y[n[f&255]],i[d]=i[d]>>>0},M.networkToHostOrderSwap=function(P){return P<<24|(P&65280)<<8|(P&16711680)>>8|P>>>24},M.decrypt=function(P,x,p){for(var m=this.keySize+6,c=this.invKeySchedule,a=this.invSBox,s=this.invSubMix,d=s[0],l=s[1],i=s[2],n=s[3],O=this.uint8ArrayToUint32Array_(p),C=O[0],T=O[1],R=O[2],S=O[3],y=new Int32Array(P),E=new Int32Array(y.length),f,h,v,g,b,N,H,A,F,U,w,Y,Z,ce,be=this.networkToHostOrderSwap;x<y.length;){for(F=be(y[x]),U=be(y[x+1]),w=be(y[x+2]),Y=be(y[x+3]),b=F^c[0],N=Y^c[1],H=w^c[2],A=U^c[3],Z=4,ce=1;ce<m;ce++)f=d[b>>>24]^l[N>>16&255]^i[H>>8&255]^n[A&255]^c[Z],h=d[N>>>24]^l[H>>16&255]^i[A>>8&255]^n[b&255]^c[Z+1],v=d[H>>>24]^l[A>>16&255]^i[b>>8&255]^n[N&255]^c[Z+2],g=d[A>>>24]^l[b>>16&255]^i[N>>8&255]^n[H&255]^c[Z+3],b=f,N=h,H=v,A=g,Z=Z+4;f=a[b>>>24]<<24^a[N>>16&255]<<16^a[H>>8&255]<<8^a[A&255]^c[Z],h=a[N>>>24]<<24^a[H>>16&255]<<16^a[A>>8&255]<<8^a[b&255]^c[Z+1],v=a[H>>>24]<<24^a[A>>16&255]<<16^a[b>>8&255]<<8^a[N&255]^c[Z+2],g=a[A>>>24]<<24^a[b>>16&255]<<16^a[N>>8&255]<<8^a[H&255]^c[Z+3],E[x]=be(f^C),E[x+1]=be(g^T),E[x+2]=be(v^R),E[x+3]=be(h^S),C=F,T=U,R=w,S=Y,x=x+4}return E.buffer},K}()},"./src/crypt/decrypter.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return x});var z=I("./src/crypt/aes-crypto.ts"),L=I("./src/crypt/fast-aes-key.ts"),D=I("./src/crypt/aes-decryptor.ts"),K=I("./src/utils/logger.ts"),M=I("./src/utils/mp4-tools.ts"),r=I("./src/utils/typed-array.ts"),P=16,x=function(){function p(c,a,s){var d=s===void 0?{}:s,l=d.removePKCS7Padding,i=l===void 0?!0:l;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=c,this.config=a,this.removePKCS7Padding=i,i)try{var n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(O){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var m=p.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var s=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(D.removePadding)(s):s},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(a,s,d,l){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),s,d);var i=this.flush();i&&l(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),s,d).then(l)},m.softwareDecrypt=function(a,s,d){var l=this.currentIV,i=this.currentResult,n=this.remainderData;this.logOnce("JS AES decrypt"),n&&(a=Object(M.appendUint8Array)(n,a),this.remainderData=null);var O=this.getValidChunk(a);if(!O.length)return null;l&&(d=l);var C=this.softwareDecrypter;C||(C=this.softwareDecrypter=new D.default),C.expandKey(s);var T=i;return this.currentResult=C.decrypt(O.buffer,0,d),this.currentIV=Object(r.sliceUint8)(O,-16).buffer,T||null},m.webCryptoDecrypt=function(a,s,d){var l=this,i=this.subtle;return(this.key!==s||!this.fastAesKey)&&(this.key=s,this.fastAesKey=new L.default(i,s)),this.fastAesKey.expandKey().then(function(n){if(!i)return Promise.reject(new Error("web crypto not initialized"));var O=new z.default(i,d);return O.decrypt(a.buffer,n)}).catch(function(n){return l.onWebCryptoError(n,a,s,d)})},m.onWebCryptoError=function(a,s,d,l){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(s,d,l)},m.getValidChunk=function(a){var s=a,d=a.length-a.length%P;return d!==a.length&&(s=Object(r.sliceUint8)(a,0,d),this.remainderData=Object(r.sliceUint8)(a,d)),s},m.logOnce=function(a){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return z});var z=function(){function L(K,M){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=M}var D=L.prototype;return D.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},L}()},"./src/demux/aacdemuxer.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/demux/base-audio-demuxer.ts"),L=I("./src/demux/adts.ts"),D=I("./src/utils/logger.ts"),K=I("./src/demux/id3.ts");function M(x,p){x.prototype=Object.create(p.prototype),x.prototype.constructor=x,r(x,p)}function r(x,p){return r=Object.setPrototypeOf||function(c,a){return c.__proto__=a,c},r(x,p)}var P=function(x){M(p,x);function p(c,a){var s;return s=x.call(this)||this,s.observer=void 0,s.config=void 0,s.observer=c,s.config=a,s}var m=p.prototype;return m.resetInitSegment=function(a,s,d){x.prototype.resetInitSegment.call(this,a,s,d),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:d,inputTimeScale:9e4,dropped:0}},p.probe=function(a){if(!a)return!1;for(var s=K.getID3Data(a,0)||[],d=s.length,l=a.length;d<l;d++)if(L.probe(a,d))return D.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(a,s){return L.canParse(a,s)},m.appendFrame=function(a,s,d){L.initTrackConfig(a,this.observer,s,d,a.manifestCodec);var l=L.appendFrame(a,s,d,this.initPTS,this.frameIndex);if(l&&l.missing===0)return l},p}(z.default);P.minProbeByteLength=9,V.default=P},"./src/demux/adts.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"getAudioConfig",function(){return K}),I.d(V,"isHeaderPattern",function(){return M}),I.d(V,"getHeaderLength",function(){return r}),I.d(V,"getFullFrameLength",function(){return P}),I.d(V,"canGetFrameLength",function(){return x}),I.d(V,"isHeader",function(){return p}),I.d(V,"canParse",function(){return m}),I.d(V,"probe",function(){return c}),I.d(V,"initTrackConfig",function(){return a}),I.d(V,"getFrameDuration",function(){return s}),I.d(V,"parseFrameHeader",function(){return d}),I.d(V,"appendFrame",function(){return l});var z=I("./src/utils/logger.ts"),L=I("./src/errors.ts"),D=I("./src/events.ts");function K(i,n,O,C){var T,R,S,y,E=navigator.userAgent.toLowerCase(),f=C,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((n[O+2]&192)>>>6)+1;var v=(n[O+2]&60)>>>2;if(v>h.length-1){i.trigger(D.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+v});return}return S=(n[O+2]&1)<<2,S|=(n[O+3]&192)>>>6,z.logger.log("manifest codec:"+C+", ADTS type:"+T+", samplingIndex:"+v),/firefox/i.test(E)?v>=6?(T=5,y=new Array(4),R=v-3):(T=2,y=new Array(2),R=v):E.indexOf("android")!==-1?(T=2,y=new Array(2),R=v):(T=5,y=new Array(4),C&&(C.indexOf("mp4a.40.29")!==-1||C.indexOf("mp4a.40.5")!==-1)||!C&&v>=6?R=v-3:((C&&C.indexOf("mp4a.40.2")!==-1&&(v>=6&&S===1||/vivaldi/i.test(E))||!C&&S===1)&&(T=2,y=new Array(2)),R=v)),y[0]=T<<3,y[0]|=(v&14)>>1,y[1]|=(v&1)<<7,y[1]|=S<<3,T===5&&(y[1]|=(R&14)>>1,y[2]=(R&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:h[v],channelCount:S,codec:"mp4a.40."+T,manifestCodec:f}}function M(i,n){return i[n]===255&&(i[n+1]&246)===240}function r(i,n){return i[n+1]&1?7:9}function P(i,n){return(i[n+3]&3)<<11|i[n+4]<<3|(i[n+5]&224)>>>5}function x(i,n){return n+5<i.length}function p(i,n){return n+1<i.length&&M(i,n)}function m(i,n){return x(i,n)&&M(i,n)&&P(i,n)<=i.length-n}function c(i,n){if(p(i,n)){var O=r(i,n);if(n+O>=i.length)return!1;var C=P(i,n);if(C<=O)return!1;var T=n+C;return T===i.length||p(i,T)}return!1}function a(i,n,O,C,T){if(!i.samplerate){var R=K(n,O,C,T);if(!R)return;i.config=R.config,i.samplerate=R.samplerate,i.channelCount=R.channelCount,i.codec=R.codec,i.manifestCodec=R.manifestCodec,z.logger.log("parsed codec:"+i.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function s(i){return 1024*9e4/i}function d(i,n,O,C,T){var R=r(i,n),S=P(i,n);if(S-=R,S>0){var y=O+C*T;return{headerLength:R,frameLength:S,stamp:y}}}function l(i,n,O,C,T){var R=s(i.samplerate),S=d(n,O,C,T,R);if(S){var y=S.frameLength,E=S.headerLength,f=S.stamp,h=E+y,v=Math.max(0,O+h-n.length),g;v?(g=new Uint8Array(h-E),g.set(n.subarray(O+E,n.length),0)):g=n.subarray(O+E,O+h);var b={unit:g,pts:f};return v||i.samples.push(b),{sample:b,length:h,missing:v}}}},"./src/demux/base-audio-demuxer.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"initPTSFn",function(){return P});var z=I("./src/polyfills/number.ts"),L=I("./src/demux/id3.ts"),D=I("./src/demux/dummy-demuxed-track.ts"),K=I("./src/utils/mp4-tools.ts"),M=I("./src/utils/typed-array.ts"),r=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,s){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,s){},p.demux=function(c,a){this.cachedData&&(c=Object(K.appendUint8Array)(this.cachedData,c),this.cachedData=null);var s=L.getID3Data(c,0),d=s?s.length:0,l,i,n=this._audioTrack,O=this._id3Track,C=s?L.getTimeStamp(s):void 0,T=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=P(C,a)),s&&s.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:s}),i=this.initPTS;d<T;){if(this.canParse(c,d)){var R=this.appendFrame(n,c,d);R?(this.frameIndex++,i=R.sample.pts,d+=R.length,l=d):d=T}else L.canParse(c,d)?(s=L.getID3Data(c,d),O.samples.push({pts:i,dts:i,data:s}),d+=s.length,l=d):d++;if(d===T&&l!==T){var S=Object(M.sliceUint8)(c,l);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,S):this.cachedData=S}}return{audioTrack:n,avcTrack:Object(D.dummyTrack)(),id3Track:O,textTrack:Object(D.dummyTrack)()}},p.demuxSampleAes=function(c,a,s){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(D.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(D.dummyTrack)()}},p.destroy=function(){},x}(),P=function(p,m){return Object(z.isFiniteNumber)(p)?p*90:m*9e4};V.default=r},"./src/demux/chunk-cache.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return z});var z=function(){function D(){this.chunks=[],this.dataLength=0}var K=D.prototype;return K.push=function(r){this.chunks.push(r),this.dataLength+=r.length},K.flush=function(){var r=this.chunks,P=this.dataLength,x;if(r.length)r.length===1?x=r[0]:x=L(r,P);else return new Uint8Array(0);return this.reset(),x},K.reset=function(){this.chunks.length=0,this.dataLength=0},D}();function L(D,K){for(var M=new Uint8Array(K),r=0,P=0;P<D.length;P++){var x=D[P];M.set(x,r),r+=x.length}return M}},"./src/demux/dummy-demuxed-track.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"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(ne,V,I){"use strict";I.r(V);var z=I("./src/utils/logger.ts"),L=function(){function D(M){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=M,this.bytesAvailable=M.byteLength,this.word=0,this.bitsAvailable=0}var K=D.prototype;return K.loadWord=function(){var r=this.data,P=this.bytesAvailable,x=r.byteLength-P,p=new Uint8Array(4),m=Math.min(4,P);if(m===0)throw new Error("no bytes available");p.set(r.subarray(x,x+m)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},K.skipBits=function(r){var P;this.bitsAvailable>r?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,P=r>>3,r-=P>>3,this.bytesAvailable-=P,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)},K.readBits=function(r){var P=Math.min(this.bitsAvailable,r),x=this.word>>>32-P;return r>32&&z.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=P,this.bitsAvailable>0?this.word<<=P:this.bytesAvailable>0&&this.loadWord(),P=r-P,P>0&&this.bitsAvailable?x<<P|this.readBits(P):x},K.skipLZ=function(){var r;for(r=0;r<this.bitsAvailable;++r)if((this.word&2147483648>>>r)!==0)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},K.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(r){for(var P=8,x=8,p,m=0;m<r;m++)x!==0&&(p=this.readEG(),x=(P+p+256)%256),P=x===0?P:x},K.readSPS=function(){var r=0,P=0,x=0,p=0,m,c,a,s=this.readUByte.bind(this),d=this.readBits.bind(this),l=this.readUEG.bind(this),i=this.readBoolean.bind(this),n=this.skipBits.bind(this),O=this.skipEG.bind(this),C=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);s();var R=s();if(d(5),n(3),s(),C(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var S=l();if(S===3&&n(1),C(),C(),n(1),i())for(c=S!==3?8:12,a=0;a<c;a++)i()&&(a<6?T(16):T(64))}C();var y=l();if(y===0)l();else if(y===1)for(n(1),O(),O(),m=l(),a=0;a<m;a++)O();C(),n(1);var E=l(),f=l(),h=d(1);h===0&&n(1),n(1),i()&&(r=l(),P=l(),x=l(),p=l());var v=[1,1];if(i()&&i()){var g=s();switch(g){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:{v=[s()<<8|s(),s()<<8|s()];break}}}return{width:Math.ceil((E+1)*16-r*2-P*2),height:(2-h)*(f+1)*16-(h?2:4)*(x+p),pixelRatio:v}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},D}();V.default=L},"./src/demux/id3.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"isHeader",function(){return z}),I.d(V,"isFooter",function(){return L}),I.d(V,"getID3Data",function(){return D}),I.d(V,"canParse",function(){return M}),I.d(V,"getTimeStamp",function(){return r}),I.d(V,"isTimeStampFrame",function(){return P}),I.d(V,"getID3Frames",function(){return p}),I.d(V,"decodeFrame",function(){return m}),I.d(V,"utf8ArrayToStr",function(){return l}),I.d(V,"testables",function(){return i});var z=function(T,R){return R+10<=T.length&&(T[R]===73&&T[R+1]===68&&T[R+2]===51&&(T[R+3]<255&&T[R+4]<255&&(T[R+6]<128&&T[R+7]<128&&T[R+8]<128&&T[R+9]<128)))},L=function(T,R){return R+10<=T.length&&(T[R]===51&&T[R+1]===68&&T[R+2]===73&&(T[R+3]<255&&T[R+4]<255&&(T[R+6]<128&&T[R+7]<128&&T[R+8]<128&&T[R+9]<128)))},D=function(T,R){for(var S=R,y=0;z(T,R);){y+=10;var E=K(T,R+6);y+=E,L(T,R+10)&&(y+=10),R+=y}return y>0?T.subarray(S,S+y):void 0},K=function(T,R){var S=0;return S=(T[R]&127)<<21,S|=(T[R+1]&127)<<14,S|=(T[R+2]&127)<<7,S|=T[R+3]&127,S},M=function(T,R){return z(T,R)&&K(T,R+6)+10<=T.length-R},r=function(T){for(var R=p(T),S=0;S<R.length;S++){var y=R[S];if(P(y))return d(y)}return},P=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},x=function(T){var R=String.fromCharCode(T[0],T[1],T[2],T[3]),S=K(T,4),y=10;return{type:R,size:S,data:T.subarray(y,y+S)}},p=function(T){for(var R=0,S=[];z(T,R);){var y=K(T,R+6);R+=10;for(var E=R+y;R+8<E;){var f=x(T.subarray(R)),h=m(f);h&&S.push(h),R+=f.size+10}L(T,R)&&(R+=10)}return S},m=function(T){return T.type==="PRIV"?c(T):T.type[0]==="W"?s(T):a(T)},c=function(T){if(T.size<2)return;var R=l(T.data,!0),S=new Uint8Array(T.data.subarray(R.length+1));return{key:T.type,info:R,data:S.buffer}},a=function(T){if(T.size<2)return;if(T.type==="TXXX"){var R=1,S=l(T.data.subarray(R),!0);R+=S.length+1;var y=l(T.data.subarray(R));return{key:T.type,info:S,data:y}}var E=l(T.data.subarray(1));return{key:T.type,data:E}},s=function(T){if(T.type==="WXXX"){if(T.size<2)return;var R=1,S=l(T.data.subarray(R),!0);R+=S.length+1;var y=l(T.data.subarray(R));return{key:T.type,info:S,data:y}}var E=l(T.data);return{key:T.type,data:E}},d=function(T){if(T.data.byteLength===8){var R=new Uint8Array(T.data),S=R[3]&1,y=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return y/=45,S&&(y+=4772185884e-2),Math.round(y)}return},l=function(T,R){R===void 0&&(R=!1);var S=O();if(S){var y=S.decode(T);if(R){var E=y.indexOf("\0");return E!==-1?y.substring(0,E):y}return y.replace(/\0/g,"")}for(var f=T.length,h,v,g,b="",N=0;N<f;){if(h=T[N++],h===0&&R)return b;if(h===0||h===3)continue;switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(h);break;case 12:case 13:v=T[N++],b+=String.fromCharCode((h&31)<<6|v&63);break;case 14:v=T[N++],g=T[N++],b+=String.fromCharCode((h&15)<<12|(v&63)<<6|(g&63)<<0);break;default:}}return b},i={decodeTextFrame:a},n;function O(){return!n&&typeof self.TextDecoder!="undefined"&&(n=new self.TextDecoder("utf-8")),n}},"./src/demux/mp3demuxer.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/demux/base-audio-demuxer.ts"),L=I("./src/demux/id3.ts"),D=I("./src/utils/logger.ts"),K=I("./src/demux/mpegaudio.ts");function M(x,p){x.prototype=Object.create(p.prototype),x.prototype.constructor=x,r(x,p)}function r(x,p){return r=Object.setPrototypeOf||function(c,a){return c.__proto__=a,c},r(x,p)}var P=function(x){M(p,x);function p(){return x.apply(this,arguments)||this}var m=p.prototype;return m.resetInitSegment=function(a,s,d){x.prototype.resetInitSegment.call(this,a,s,d),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:d,inputTimeScale:9e4,dropped:0}},p.probe=function(a){if(!a)return!1;for(var s=L.getID3Data(a,0)||[],d=s.length,l=a.length;d<l;d++)if(K.probe(a,d))return D.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(a,s){return K.canParse(a,s)},m.appendFrame=function(a,s,d){return this.initPTS===null?void 0:K.appendFrame(a,s,d,this.initPTS,this.frameIndex)},p}(z.default);P.minProbeByteLength=4,V.default=P},"./src/demux/mp4demuxer.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/utils/mp4-tools.ts"),L=I("./src/demux/dummy-demuxed-track.ts"),D=function(){function K(r,P){this.remainderData=null,this.config=void 0,this.config=P}var M=K.prototype;return M.resetTimeStamp=function(){},M.resetInitSegment=function(){},M.resetContiguity=function(){},K.probe=function(P){return Object(z.findBox)({data:P,start:0,end:Math.min(P.length,16384)},["moof"]).length>0},M.demux=function(P){var x=P,p=Object(L.dummyTrack)();if(this.config.progressive){this.remainderData&&(x=Object(z.appendUint8Array)(this.remainderData,P));var m=Object(z.segmentValidRange)(x);this.remainderData=m.remainder,p.samples=m.valid||new Uint8Array}else p.samples=x;return{audioTrack:Object(L.dummyTrack)(),avcTrack:p,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},M.flush=function(){var P=Object(L.dummyTrack)();return P.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(L.dummyTrack)(),avcTrack:P,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},M.demuxSampleAes=function(P,x,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},M.destroy=function(){},K}();D.minProbeByteLength=1024,V.default=D},"./src/demux/mpegaudio.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"appendFrame",function(){return r}),I.d(V,"parseHeader",function(){return P}),I.d(V,"isHeaderPattern",function(){return x}),I.d(V,"isHeader",function(){return p}),I.d(V,"canParse",function(){return m}),I.d(V,"probe",function(){return c});var z=null,L=[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],D=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],M=[0,1,1,4];function r(a,s,d,l,i){if(d+24>s.length)return;var n=P(s,d);if(n&&d+n.frameLength<=s.length){var O=n.samplesPerFrame*9e4/n.sampleRate,C=l+i*O,T={unit:s.subarray(d,d+n.frameLength),pts:C,dts:C};return a.config=[],a.channelCount=n.channelCount,a.samplerate=n.sampleRate,a.samples.push(T),{sample:T,length:n.frameLength,missing:0}}}function P(a,s){var d=a[s+1]>>3&3,l=a[s+1]>>1&3,i=a[s+2]>>4&15,n=a[s+2]>>2&3;if(d!==1&&i!==0&&i!==15&&n!==3){var O=a[s+2]>>1&1,C=a[s+3]>>6,T=d===3?3-l:l===3?3:4,R=L[T*14+i-1]*1e3,S=d===3?0:d===2?1:2,y=D[S*3+n],E=C===3?1:2,f=K[d][l],h=M[l],v=f*8*h,g=Math.floor(f*R/y+O)*h;if(z===null){var b=navigator.userAgent||"",N=b.match(/Chrome\/(\d+)/i);z=N?parseInt(N[1]):0}var H=!!z&&z<=87;return H&&l===2&&R>=224e3&&C===0&&(a[s+3]=a[s+3]|128),{sampleRate:y,channelCount:E,frameLength:g,samplesPerFrame:v}}}function x(a,s){return a[s]===255&&(a[s+1]&224)===224&&(a[s+1]&6)!==0}function p(a,s){return s+1<a.length&&x(a,s)}function m(a,s){var d=4;return x(a,s)&&d<=a.length-s}function c(a,s){if(s+1<a.length&&x(a,s)){var d=4,l=P(a,s),i=d;l!=null&&l.frameLength&&(i=l.frameLength);var n=s+i;return n===a.length||p(a,n)}return!1}},"./src/demux/sample-aes.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/crypt/decrypter.ts"),L=I("./src/demux/tsdemuxer.ts"),D=function(){function K(r,P,x){this.keyData=void 0,this.decrypter=void 0,this.keyData=x,this.decrypter=new z.default(r,P,{removePKCS7Padding:!1})}var M=K.prototype;return M.decryptBuffer=function(P,x){this.decrypter.decrypt(P,this.keyData.key.buffer,this.keyData.iv.buffer,x)},M.decryptAacSample=function(P,x,p,m){var c=P[x].unit,a=c.subarray(16,c.length-c.length%16),s=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),d=this;this.decryptBuffer(s,function(l){var i=new Uint8Array(l);c.set(i,16),m||d.decryptAacSamples(P,x+1,p)})},M.decryptAacSamples=function(P,x,p){for(;;x++){if(x>=P.length){p();return}if(P[x].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(P,x,p,m),!m)return}},M.getAvcEncryptedData=function(P){for(var x=Math.floor((P.length-48)/160)*16+16,p=new Int8Array(x),m=0,c=32;c<=P.length-16;c+=160,m+=16)p.set(P.subarray(c,c+16),m);return p},M.getAvcDecryptedUnit=function(P,x){for(var p=new Uint8Array(x),m=0,c=32;c<=P.length-16;c+=160,m+=16)P.set(p.subarray(m,m+16),c);return P},M.decryptAvcSample=function(P,x,p,m,c,a){var s=Object(L.discardEPB)(c.data),d=this.getAvcEncryptedData(s),l=this;this.decryptBuffer(d.buffer,function(i){c.data=l.getAvcDecryptedUnit(s,i),a||l.decryptAvcSamples(P,x,p+1,m)})},M.decryptAvcSamples=function(P,x,p,m){if(P instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;x++,p=0){if(x>=P.length){m();return}for(var c=P[x].units;!(p>=c.length);p++){var a=c[p];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var s=this.decrypter.isSync();if(this.decryptAvcSample(P,x,p,m,a,s),!s)return}}},K}();V.default=D},"./src/demux/transmuxer-interface.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return c});var z=I("./node_modules/webworkify-webpack/index.js"),L=I.n(z),D=I("./src/events.ts"),K=I("./src/demux/transmuxer.ts"),M=I("./src/utils/logger.ts"),r=I("./src/errors.ts"),P=I("./src/utils/mediasource-helper.ts"),x=I("./node_modules/eventemitter3/index.js"),p=I.n(x),m=Object(P.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function a(d,l,i,n){var O=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=d,this.id=l,this.onTransmuxComplete=i,this.onFlush=n;var C=d.config,T=function(f,h){h=h||{},h.frag=O.frag,h.id=O.id,d.trigger(f,h)};this.observer=new x.EventEmitter,this.observer.on(D.Events.FRAG_DECRYPTED,T),this.observer.on(D.Events.ERROR,T);var R={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},S=navigator.vendor;if(C.enableWorker&&typeof Worker!="undefined"){M.logger.log("demuxing in webworker");var y;try{y=this.worker=z("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(E){d.trigger(D.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},y.postMessage({cmd:"init",typeSupported:R,vendor:S,id:l,config:JSON.stringify(C)})}catch(E){M.logger.warn("Error in worker:",E),M.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new K.default(this.observer,R,C,S,l),this.worker=null}}else this.transmuxer=new K.default(this.observer,R,C,S,l)}var s=a.prototype;return s.destroy=function(){var l=this.worker;if(l)l.removeEventListener("message",this.onwmsg),l.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var n=this.observer;n&&n.removeAllListeners(),this.observer=null},s.push=function(l,i,n,O,C,T,R,S,y,E){var f=this;y.transmuxing.start=self.performance.now();var h=this.transmuxer,v=this.worker,g=T?T.start:C.start,b=C.decryptdata,N=this.frag,H=!(N&&C.cc===N.cc),A=!(N&&y.level===N.level),F=N?y.sn-N.sn:-1,U=this.part?y.part-this.part.index:1,w=!A&&(F===1||F===0&&U===1),Y=self.performance.now();(A||F||C.stats.parsing.start===0)&&(C.stats.parsing.start=Y),T&&(U||!w)&&(T.stats.parsing.start=Y);var Z=new K.TransmuxState(H,w,S,A,g);if(!w||H){M.logger.log("[transmuxer-interface, "+C.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+`
|
|
discontinuity: `+H+`
|
|
trackSwitch: `+A+`
|
|
contiguous: `+w+`
|
|
accurateTimeOffset: `+S+`
|
|
timeOffset: `+g);var ce=new K.TransmuxConfig(n,O,i,R,E);this.configureTransmuxer(ce)}if(this.frag=C,this.part=T,v)v.postMessage({cmd:"demux",data:l,decryptdata:b,chunkMeta:y,state:Z},l instanceof ArrayBuffer?[l]:[]);else if(h){var be=h.push(l,b,y,Z);Object(K.isPromise)(be)?be.then(function(Ze){f.handleTransmuxComplete(Ze)}):this.handleTransmuxComplete(be)}},s.flush=function(l){var i=this;l.transmuxing.start=self.performance.now();var n=this.transmuxer,O=this.worker;if(O)O.postMessage({cmd:"flush",chunkMeta:l});else if(n){var C=n.flush(l);Object(K.isPromise)(C)?C.then(function(T){i.handleFlushResult(T,l)}):this.handleFlushResult(C,l)}},s.handleFlushResult=function(l,i){var n=this;l.forEach(function(O){n.handleTransmuxComplete(O)}),this.onFlush(i)},s.onWorkerMessage=function(l){var i=l.data,n=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,n.trigger(i.event,i.data);break}}},s.configureTransmuxer=function(l){var i=this.worker,n=this.transmuxer;i?i.postMessage({cmd:"configure",config:l}):n&&n.configure(l)},s.handleTransmuxComplete=function(l){l.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(l)},a}()},"./src/demux/transmuxer-worker.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return r});var z=I("./src/demux/transmuxer.ts"),L=I("./src/events.ts"),D=I("./src/utils/logger.ts"),K=I("./node_modules/eventemitter3/index.js"),M=I.n(K);function r(c){var a=new K.EventEmitter,s=function(l,i){c.postMessage({event:l,data:i})};a.on(L.Events.FRAG_DECRYPTED,s),a.on(L.Events.ERROR,s),c.addEventListener("message",function(d){var l=d.data;switch(l.cmd){case"init":{var i=JSON.parse(l.config);c.transmuxer=new z.default(a,l.typeSupported,i,l.vendor,l.id),Object(D.enableLogs)(i.debug),s("init",null);break}case"configure":{c.transmuxer.configure(l.config);break}case"demux":{var n=c.transmuxer.push(l.data,l.decryptdata,l.chunkMeta,l.state);Object(z.isPromise)(n)?n.then(function(T){P(c,T)}):P(c,n);break}case"flush":{var O=l.chunkMeta,C=c.transmuxer.flush(O);Object(z.isPromise)(C)?C.then(function(T){p(c,T,O)}):p(c,C,O);break}default:break}})}function P(c,a){if(m(a.remuxResult))return;var s=[],d=a.remuxResult,l=d.audio,i=d.video;l&&x(s,l),i&&x(s,i),c.postMessage({event:"transmuxComplete",data:a},s)}function x(c,a){a.data1&&c.push(a.data1.buffer),a.data2&&c.push(a.data2.buffer)}function p(c,a,s){a.forEach(function(d){P(c,d)}),c.postMessage({event:"flush",data:s})}function m(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return i}),I.d(V,"isPromise",function(){return C}),I.d(V,"TransmuxConfig",function(){return T}),I.d(V,"TransmuxState",function(){return R});var z=I("./src/events.ts"),L=I("./src/errors.ts"),D=I("./src/crypt/decrypter.ts"),K=I("./src/demux/aacdemuxer.ts"),M=I("./src/demux/mp4demuxer.ts"),r=I("./src/demux/tsdemuxer.ts"),P=I("./src/demux/mp3demuxer.ts"),x=I("./src/remux/mp4-remuxer.ts"),p=I("./src/remux/passthrough-remuxer.ts"),m=I("./src/demux/chunk-cache.ts"),c=I("./src/utils/mp4-tools.ts"),a=I("./src/utils/logger.ts"),s;try{s=self.performance.now.bind(self.performance)}catch(S){a.logger.debug("Unable to use Performance API on this environment"),s=self.Date.now}var d=[{demux:r.default,remux:x.default},{demux:M.default,remux:p.default},{demux:K.default,remux:x.default},{demux:P.default,remux:x.default}],l=1024;d.forEach(function(S){var y=S.demux;l=Math.max(l,y.minProbeByteLength)});var i=function(){function S(E,f,h,v,g){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 m.default,this.observer=E,this.typeSupported=f,this.config=h,this.vendor=v,this.id=g}var y=S.prototype;return y.configure=function(f){this.transmuxConfig=f,this.decrypter&&this.decrypter.reset()},y.push=function(f,h,v,g){var b=this,N=v.transmuxing;N.executeStart=s();var H=new Uint8Array(f),A=this.cache,F=this.config,U=this.currentTransmuxState,w=this.transmuxConfig;g&&(this.currentTransmuxState=g);var Y=n(H,h);if(Y&&Y.method==="AES-128"){var Z=this.getDecrypter();if(F.enableSoftwareAES){var ce=Z.softwareDecrypt(H,Y.key.buffer,Y.iv.buffer);if(!ce)return N.executeEnd=s(),O(v);H=new Uint8Array(ce)}else return this.decryptionPromise=Z.webCryptoDecrypt(H,Y.key.buffer,Y.iv.buffer).then(function(Ie){var tt=b.push(Ie,null,v);return b.decryptionPromise=null,tt}),this.decryptionPromise}var be=g||U,Ze=be.contiguous,Ce=be.discontinuity,We=be.trackSwitch,Ve=be.accurateTimeOffset,Ye=be.timeOffset,we=w.audioCodec,X=w.videoCodec,j=w.defaultInitPts,W=w.duration,Q=w.initSegmentData;if((Ce||We)&&this.resetInitSegment(Q,we,X,W),Ce&&this.resetInitialTimestamp(j),Ze||this.resetContiguity(),this.needsProbing(H,Ce,We)){if(A.dataLength){var re=A.flush();H=Object(c.appendUint8Array)(re,H)}this.configureTransmuxer(H,w)}var G=this.transmux(H,Y,Ye,Ve,v),xe=this.currentTransmuxState;return xe.contiguous=!0,xe.discontinuity=!1,xe.trackSwitch=!1,N.executeEnd=s(),G},y.flush=function(f){var h=this,v=f.transmuxing;v.executeStart=s();var g=this.decrypter,b=this.cache,N=this.currentTransmuxState,H=this.decryptionPromise;if(H)return H.then(function(){return h.flush(f)});var A=[],F=N.timeOffset;if(g){var U=g.flush();U&&A.push(this.push(U,null,f))}var w=b.dataLength;b.reset();var Y=this.demuxer,Z=this.remuxer;if(!Y||!Z)return w>=l&&this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),v.executeEnd=s(),[O(f)];var ce=Y.flush(F);return C(ce)?ce.then(function(be){return h.flushRemux(A,be,f),A}):(this.flushRemux(A,ce,f),A)},y.flushRemux=function(f,h,v){var g=h.audioTrack,b=h.avcTrack,N=h.id3Track,H=h.textTrack,A=this.currentTransmuxState,F=A.accurateTimeOffset,U=A.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+v.sn+(v.part>-1?" p: "+v.part:"")+" of level "+v.level);var w=this.remuxer.remux(g,b,N,H,U,F,!0,this.id);f.push({remuxResult:w,chunkMeta:v}),v.transmuxing.executeEnd=s()},y.resetInitialTimestamp=function(f){var h=this.demuxer,v=this.remuxer;if(!h||!v)return;h.resetTimeStamp(f),v.resetTimeStamp(f)},y.resetContiguity=function(){var f=this.demuxer,h=this.remuxer;if(!f||!h)return;f.resetContiguity(),h.resetNextTimestamp()},y.resetInitSegment=function(f,h,v,g){var b=this.demuxer,N=this.remuxer;if(!b||!N)return;b.resetInitSegment(h,v,g),N.resetInitSegment(f,h,v)},y.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},y.transmux=function(f,h,v,g,b){var N;return h&&h.method==="SAMPLE-AES"?N=this.transmuxSampleAes(f,h,v,g,b):N=this.transmuxUnencrypted(f,v,g,b),N},y.transmuxUnencrypted=function(f,h,v,g){var b=this.demuxer.demux(f,h,!1,!this.config.progressive),N=b.audioTrack,H=b.avcTrack,A=b.id3Track,F=b.textTrack,U=this.remuxer.remux(N,H,A,F,h,v,!1,this.id);return{remuxResult:U,chunkMeta:g}},y.transmuxSampleAes=function(f,h,v,g,b){var N=this;return this.demuxer.demuxSampleAes(f,h,v).then(function(H){var A=N.remuxer.remux(H.audioTrack,H.avcTrack,H.id3Track,H.textTrack,v,g,!1,N.id);return{remuxResult:A,chunkMeta:b}})},y.configureTransmuxer=function(f,h){for(var v=this.config,g=this.observer,b=this.typeSupported,N=this.vendor,H=h.audioCodec,A=h.defaultInitPts,F=h.duration,U=h.initSegmentData,w=h.videoCodec,Y,Z=0,ce=d.length;Z<ce;Z++)if(d[Z].demux.probe(f)){Y=d[Z];break}Y||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),Y={demux:M.default,remux:p.default});var be=this.demuxer,Ze=this.remuxer,Ce=Y.remux,We=Y.demux;(!Ze||!(Ze instanceof Ce))&&(this.remuxer=new Ce(g,v,b,N)),(!be||!(be instanceof We))&&(this.demuxer=new We(g,v,b),this.probe=We.probe),this.resetInitSegment(U,H,w,F),this.resetInitialTimestamp(A)},y.needsProbing=function(f,h,v){return!this.demuxer||!this.remuxer||h||v},y.getDecrypter=function(){var f=this.decrypter;return f||(f=this.decrypter=new D.default(this.observer,this.config)),f},S}();function n(S,y){var E=null;return S.byteLength>0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(E=y),E}var O=function(y){return{remuxResult:{},chunkMeta:y}};function C(S){return"then"in S&&S.then instanceof Function}var T=function(y,E,f,h,v){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=y,this.videoCodec=E,this.initSegmentData=f,this.duration=h,this.defaultInitPts=v},R=function(y,E,f,h,v){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=y,this.contiguous=E,this.accurateTimeOffset=f,this.trackSwitch=h,this.timeOffset=v}},"./src/demux/tsdemuxer.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"discardEPB",function(){return O});var z=I("./src/demux/adts.ts"),L=I("./src/demux/mpegaudio.ts"),D=I("./src/demux/exp-golomb.ts"),K=I("./src/demux/id3.ts"),M=I("./src/demux/sample-aes.ts"),r=I("./src/events.ts"),P=I("./src/utils/mp4-tools.ts"),x=I("./src/utils/logger.ts"),p=I("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},c=function(){function C(R,S,y){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=R,this.config=S,this.typeSupported=y}C.probe=function(S){var y=C.syncOffset(S);return y<0?!1:(y&&x.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},C.syncOffset=function(S){for(var y=Math.min(1e3,S.length-3*188),E=0;E<y;){if(S[E]===71&&S[E+188]===71&&S[E+2*188]===71)return E;E++}return-1},C.createTrack=function(S,y){return{container:S==="video"||S==="audio"?"video/mp2t":void 0,type:S,id:m[S],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:S==="audio"?y:void 0}};var T=C.prototype;return T.resetInitSegment=function(S,y,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=C.createTrack("video",E),this._audioTrack=C.createTrack("audio",E),this._id3Track=C.createTrack("id3",E),this._txtTrack=C.createTrack("text",E),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=S,this.videoCodec=y,this._duration=E},T.resetTimeStamp=function(){},T.resetContiguity=function(){var S=this._audioTrack,y=this._avcTrack,E=this._id3Track;S&&(S.pesData=null),y&&(y.pesData=null),E&&(E.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(S,y,E,f){E===void 0&&(E=!1),f===void 0&&(f=!1),E||(this.sampleAes=null);var h,v=this._avcTrack,g=this._audioTrack,b=this._id3Track,N=v.pid,H=v.pesData,A=g.pid,F=b.pid,U=g.pesData,w=b.pesData,Y=!1,Z=this.pmtParsed,ce=this._pmtId,be=S.length;if(this.remainderData&&(S=Object(P.appendUint8Array)(this.remainderData,S),be=S.length,this.remainderData=null),be<188&&!f)return this.remainderData=S,{audioTrack:g,avcTrack:v,id3Track:b,textTrack:this._txtTrack};var Ze=Math.max(0,C.syncOffset(S));be-=(be+Ze)%188,be<S.byteLength&&!f&&(this.remainderData=new Uint8Array(S.buffer,be,S.buffer.byteLength-be));for(var Ce=Ze;Ce<be;Ce+=188)if(S[Ce]===71){var We=!!(S[Ce+1]&64),Ve=((S[Ce+1]&31)<<8)+S[Ce+2],Ye=(S[Ce+3]&48)>>4,we=void 0;if(Ye>1){if(we=Ce+5+S[Ce+4],we===Ce+188)continue}else we=Ce+4;switch(Ve){case N:We&&(H&&(h=l(H))&&this.parseAVCPES(h,!1),H={data:[],size:0}),H&&(H.data.push(S.subarray(we,Ce+188)),H.size+=Ce+188-we);break;case A:We&&(U&&(h=l(U))&&(g.isAAC?this.parseAACPES(h):this.parseMPEGPES(h)),U={data:[],size:0}),U&&(U.data.push(S.subarray(we,Ce+188)),U.size+=Ce+188-we);break;case F:We&&(w&&(h=l(w))&&this.parseID3PES(h),w={data:[],size:0}),w&&(w.data.push(S.subarray(we,Ce+188)),w.size+=Ce+188-we);break;case 0:We&&(we+=S[we]+1),ce=this._pmtId=s(S,we);break;case ce:{We&&(we+=S[we]+1);var X=d(S,we,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);N=X.avc,N>0&&(v.pid=N),A=X.audio,A>0&&(g.pid=A,g.isAAC=X.isAAC),F=X.id3,F>0&&(b.pid=F),Y&&!Z&&(x.logger.log("reparse from beginning"),Y=!1,Ce=Ze-188),Z=this.pmtParsed=!0;break}case 17:case 8191:break;default:Y=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});v.pesData=H,g.pesData=U,b.pesData=w;var j={audioTrack:g,avcTrack:v,id3Track:b,textTrack:this._txtTrack};return f&&this.extractRemainingSamples(j),j},T.flush=function(){var S=this.remainderData;this.remainderData=null;var y;return S?y=this.demux(S,-1,!1,!0):y={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(y),this.sampleAes?this.decrypt(y,this.sampleAes):y},T.extractRemainingSamples=function(S){var y=S.audioTrack,E=S.avcTrack,f=S.id3Track,h=E.pesData,v=y.pesData,g=f.pesData,b;h&&(b=l(h))?(this.parseAVCPES(b,!0),E.pesData=null):E.pesData=h,v&&(b=l(v))?(y.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),y.pesData=null):(v!=null&&v.size&&x.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=v),g&&(b=l(g))?(this.parseID3PES(b),f.pesData=null):f.pesData=g},T.demuxSampleAes=function(S,y,E){var f=this.demux(S,E,!0,!this.config.progressive),h=this.sampleAes=new M.default(this.observer,this.config,y);return this.decrypt(f,h)},T.decrypt=function(S,y){return new Promise(function(E){var f=S.audioTrack,h=S.avcTrack;f.samples&&f.isAAC?y.decryptAacSamples(f.samples,0,function(){h.samples?y.decryptAvcSamples(h.samples,0,0,function(){E(S)}):E(S)}):h.samples&&y.decryptAvcSamples(h.samples,0,0,function(){E(S)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(S,y){var E=this,f=this._avcTrack,h=this.parseAVCNALu(S.data),v=!1,g=this.avcSample,b,N=!1;S.data=null,g&&h.length&&!f.audFound&&(i(g,f),g=this.avcSample=a(!1,S.pts,S.dts,"")),h.forEach(function(H){switch(H.type){case 1:{b=!0,g||(g=E.avcSample=a(!0,S.pts,S.dts,"")),v&&(g.debug+="NDR "),g.frame=!0;var A=H.data;if(N&&A.length>4){var F=new D.default(A).readSliceType();(F===2||F===4||F===7||F===9)&&(g.key=!0)}break}case 5:b=!0,g||(g=E.avcSample=a(!0,S.pts,S.dts,"")),v&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{b=!0,v&&g&&(g.debug+="SEI ");var U=new D.default(O(H.data));U.readUByte();for(var w=0,Y=0,Z=!1,ce=0;!Z&&U.bytesAvailable>1;){w=0;do ce=U.readUByte(),w+=ce;while(ce===255);Y=0;do ce=U.readUByte(),Y+=ce;while(ce===255);if(w===4&&U.bytesAvailable!==0){Z=!0;var be=U.readUByte();if(be===181){var Ze=U.readUShort();if(Ze===49){var Ce=U.readUInt();if(Ce===1195456820){var We=U.readUByte();if(We===3){for(var Ve=U.readUByte(),Ye=U.readUByte(),we=31&Ve,X=[Ve,Ye],j=0;j<we;j++)X.push(U.readUByte()),X.push(U.readUByte()),X.push(U.readUByte());n(E._txtTrack.samples,{type:3,pts:S.pts,bytes:X})}}}}}else if(w===5&&U.bytesAvailable!==0){if(Z=!0,Y>16){for(var W=[],Q=0;Q<16;Q++)W.push(U.readUByte().toString(16)),(Q===3||Q===5||Q===7||Q===9)&&W.push("-");for(var re=Y-16,G=new Uint8Array(re),xe=0;xe<re;xe++)G[xe]=U.readUByte();n(E._txtTrack.samples,{pts:S.pts,payloadType:w,uuid:W.join(""),userData:Object(K.utf8ArrayToStr)(G),userDataBytes:G})}}else if(Y<U.bytesAvailable)for(var Ie=0;Ie<Y;Ie++)U.readUByte()}break}case 7:if(b=!0,N=!0,v&&g&&(g.debug+="SPS "),!f.sps){var tt=new D.default(H.data),le=tt.readSPS();f.width=le.width,f.height=le.height,f.pixelRatio=le.pixelRatio,f.sps=[H.data],f.duration=E._duration;for(var Se=H.data.subarray(1,4),je="avc1.",ze=0;ze<3;ze++){var yt=Se[ze].toString(16);yt.length<2&&(yt="0"+yt),je+=yt}f.codec=je}break;case 8:b=!0,v&&g&&(g.debug+="PPS "),f.pps||(f.pps=[H.data]);break;case 9:b=!1,f.audFound=!0,g&&i(g,f),g=E.avcSample=a(!1,S.pts,S.dts,v?"AUD ":"");break;case 12:b=!1;break;default:b=!1,g&&(g.debug+="unknown NAL "+H.type+" ");break}if(g&&b){var Ot=g.units;Ot.push(H)}}),y&&g&&(i(g,f),this.avcSample=null)},T.getLastNalUnit=function(){var S,y=this.avcSample,E;if(!y||y.units.length===0){var f=this._avcTrack.samples;y=f[f.length-1]}if((S=y)!==null&&S!==void 0&&S.units){var h=y.units;E=h[h.length-1]}return E},T.parseAVCNALu=function(S){var y=S.byteLength,E=this._avcTrack,f=E.naluState||0,h=f,v=[],g=0,b,N,H,A=-1,F=0;for(f===-1&&(A=0,F=S[0]&31,f=0,g=1);g<y;){if(b=S[g++],!f){f=b?0:1;continue}if(f===1){f=b?0:2;continue}if(!b)f=3;else if(b===1){if(A>=0){var U={data:S.subarray(A,g-f-1),type:F};v.push(U)}else{var w=this.getLastNalUnit();if(w&&(h&&g<=4-h&&(w.state&&(w.data=w.data.subarray(0,w.data.byteLength-h))),N=g-f-1,N>0)){var Y=new Uint8Array(w.data.byteLength+N);Y.set(w.data,0),Y.set(S.subarray(0,N),w.data.byteLength),w.data=Y,w.state=0}}g<y?(H=S[g]&31,A=g,F=H,f=0):f=-1}else f=0}if(A>=0&&f>=0){var Z={data:S.subarray(A,y),type:F,state:f};v.push(Z)}if(v.length===0){var ce=this.getLastNalUnit();if(ce){var be=new Uint8Array(ce.data.byteLength+S.byteLength);be.set(ce.data,0),be.set(S,ce.data.byteLength),ce.data=be}}return E.naluState=f,v},T.parseAACPES=function(S){var y=0,E=this._audioTrack,f=this.aacOverFlow,h=S.data;if(f){this.aacOverFlow=null;var v=f.sample.unit.byteLength,g=Math.min(f.missing,v),b=v-g;f.sample.unit.set(h.subarray(0,g),b),E.samples.push(f.sample),y=f.missing}var N,H;for(N=y,H=h.length;N<H-1&&!z.isHeader(h,N);N++);if(N!==y){var A,F;if(N<H-1?(A="AAC PES did not start with ADTS header,offset:"+N,F=!1):(A="no ADTS header found in AAC PES",F=!0),x.logger.warn("parsing error:"+A),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:F,reason:A}),F)return}z.initTrackConfig(E,this.observer,h,N,this.audioCodec);var U;if(S.pts!==void 0)U=S.pts;else if(f){var w=z.getFrameDuration(E.samplerate);U=f.sample.pts+w}else{x.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var Y=0;N<H;)if(z.isHeader(h,N)){if(N+5<H){var Z=z.appendFrame(E,h,N,U,Y);if(Z)if(Z.missing)this.aacOverFlow=Z;else{N+=Z.length,Y++;continue}}break}else N++},T.parseMPEGPES=function(S){var y=S.data,E=y.length,f=0,h=0,v=S.pts;if(v===void 0){x.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<E;)if(L.isHeader(y,h)){var g=L.appendFrame(this._audioTrack,y,h,v,f);if(g)h+=g.length,f++;else break}else h++},T.parseID3PES=function(S){if(S.pts===void 0){x.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(S)},C}();c.minProbeByteLength=188;function a(C,T,R,S){return{key:C,frame:!1,pts:T,dts:R,units:[],debug:S,length:0}}function s(C,T){return(C[T+10]&31)<<8|C[T+11]}function d(C,T,R,S){var y={audio:-1,avc:-1,id3:-1,isAAC:!0},E=(C[T+1]&15)<<8|C[T+2],f=T+3+E-4,h=(C[T+10]&15)<<8|C[T+11];for(T+=12+h;T<f;){var v=(C[T+1]&31)<<8|C[T+2];switch(C[T]){case 207:if(!S){x.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:y.audio===-1&&(y.audio=v);break;case 21:y.id3===-1&&(y.id3=v);break;case 219:if(!S){x.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:y.avc===-1&&(y.avc=v);break;case 3:case 4:R?y.audio===-1&&(y.audio=v,y.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}T+=((C[T+3]&15)<<8|C[T+4])+5}return y}function l(C){var T=0,R,S,y,E,f,h=C.data;if(!C||C.size===0)return null;for(;h[0].length<19&&h.length>1;){var v=new Uint8Array(h[0].length+h[1].length);v.set(h[0]),v.set(h[1],h[0].length),h[0]=v,h.splice(1,1)}R=h[0];var g=(R[0]<<16)+(R[1]<<8)+R[2];if(g===1){if(S=(R[4]<<8)+R[5],S&&S>C.size-6)return null;var b=R[7];b&192&&(E=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,b&64?(f=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,E-f>60*9e4&&(x.logger.warn(Math.round((E-f)/9e4)+"s delta between PTS and DTS, align them"),E=f)):f=E),y=R[8];var N=y+9;if(C.size<=N)return null;C.size-=N;for(var H=new Uint8Array(C.size),A=0,F=h.length;A<F;A++){R=h[A];var U=R.byteLength;if(N)if(N>U){N-=U;continue}else R=R.subarray(N),U-=N,N=0;H.set(R,T),T+=U}return S&&(S-=y+3),{data:H,pts:E,dts:f,len:S}}return null}function i(C,T){if(C.units.length&&C.frame){if(C.pts===void 0){var R=T.samples,S=R.length;if(S){var y=R[S-1];C.pts=y.pts,C.dts=y.dts}else{T.dropped++;return}}T.samples.push(C)}C.debug.length&&x.logger.log(C.pts+"/"+C.dts+":"+C.debug)}function n(C,T){var R=C.length;if(R>0){if(T.pts>=C[R-1].pts)C.push(T);else for(var S=R-1;S>=0;S--)if(T.pts<C[S].pts){C.splice(S,0,T);break}}else C.push(T)}function O(C){for(var T=C.byteLength,R=[],S=1;S<T-2;)C[S]===0&&C[S+1]===0&&C[S+2]===3?(R.push(S+2),S+=2):S++;if(R.length===0)return C;var y=T-R.length,E=new Uint8Array(y),f=0;for(S=0;S<y;f++,S++)f===R[0]&&(f++,R.shift()),E[S]=C[f];return E}V.default=c},"./src/errors.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"ErrorTypes",function(){return z}),I.d(V,"ErrorDetails",function(){return L});var z;(function(D){D.NETWORK_ERROR="networkError",D.MEDIA_ERROR="mediaError",D.KEY_SYSTEM_ERROR="keySystemError",D.MUX_ERROR="muxError",D.OTHER_ERROR="otherError"})(z||(z={}));var L;(function(D){D.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",D.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",D.KEY_SYSTEM_NO_SESSION="keySystemNoSession",D.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",D.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",D.MANIFEST_LOAD_ERROR="manifestLoadError",D.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",D.MANIFEST_PARSING_ERROR="manifestParsingError",D.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",D.LEVEL_EMPTY_ERROR="levelEmptyError",D.LEVEL_LOAD_ERROR="levelLoadError",D.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",D.LEVEL_SWITCH_ERROR="levelSwitchError",D.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",D.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",D.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",D.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",D.FRAG_LOAD_ERROR="fragLoadError",D.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",D.FRAG_DECRYPT_ERROR="fragDecryptError",D.FRAG_PARSING_ERROR="fragParsingError",D.REMUX_ALLOC_ERROR="remuxAllocError",D.KEY_LOAD_ERROR="keyLoadError",D.KEY_LOAD_TIMEOUT="keyLoadTimeOut",D.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",D.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",D.BUFFER_APPEND_ERROR="bufferAppendError",D.BUFFER_APPENDING_ERROR="bufferAppendingError",D.BUFFER_STALLED_ERROR="bufferStalledError",D.BUFFER_FULL_ERROR="bufferFullError",D.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",D.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",D.INTERNAL_EXCEPTION="internalException",D.INTERNAL_ABORTED="aborted",D.UNKNOWN="unknown"})(L||(L={}))},"./src/events.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"Events",function(){return z});var z;(function(L){L.MEDIA_ATTACHING="hlsMediaAttaching",L.MEDIA_ATTACHED="hlsMediaAttached",L.MEDIA_DETACHING="hlsMediaDetaching",L.MEDIA_DETACHED="hlsMediaDetached",L.BUFFER_RESET="hlsBufferReset",L.BUFFER_CODECS="hlsBufferCodecs",L.BUFFER_CREATED="hlsBufferCreated",L.BUFFER_APPENDING="hlsBufferAppending",L.BUFFER_APPENDED="hlsBufferAppended",L.BUFFER_EOS="hlsBufferEos",L.BUFFER_FLUSHING="hlsBufferFlushing",L.BUFFER_FLUSHED="hlsBufferFlushed",L.MANIFEST_LOADING="hlsManifestLoading",L.MANIFEST_LOADED="hlsManifestLoaded",L.MANIFEST_PARSED="hlsManifestParsed",L.LEVEL_SWITCHING="hlsLevelSwitching",L.LEVEL_SWITCHED="hlsLevelSwitched",L.LEVEL_LOADING="hlsLevelLoading",L.LEVEL_LOADED="hlsLevelLoaded",L.LEVEL_UPDATED="hlsLevelUpdated",L.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",L.LEVELS_UPDATED="hlsLevelsUpdated",L.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",L.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",L.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",L.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",L.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",L.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",L.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",L.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",L.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",L.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",L.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",L.CUES_PARSED="hlsCuesParsed",L.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",L.INIT_PTS_FOUND="hlsInitPtsFound",L.FRAG_LOADING="hlsFragLoading",L.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",L.FRAG_LOADED="hlsFragLoaded",L.FRAG_DECRYPTED="hlsFragDecrypted",L.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",L.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",L.FRAG_PARSING_METADATA="hlsFragParsingMetadata",L.FRAG_PARSED="hlsFragParsed",L.FRAG_BUFFERED="hlsFragBuffered",L.FRAG_CHANGED="hlsFragChanged",L.FPS_DROP="hlsFpsDrop",L.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",L.ERROR="hlsError",L.DESTROYING="hlsDestroying",L.KEY_LOADING="hlsKeyLoading",L.KEY_LOADED="hlsKeyLoaded",L.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",L.BACK_BUFFER_REACHED="hlsBackBufferReached"})(z||(z={}))},"./src/hls.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return C});var z=I("./node_modules/url-toolkit/src/url-toolkit.js"),L=I.n(z),D=I("./src/loader/playlist-loader.ts"),K=I("./src/loader/key-loader.ts"),M=I("./src/controller/id3-track-controller.ts"),r=I("./src/controller/latency-controller.ts"),P=I("./src/controller/level-controller.ts"),x=I("./src/controller/fragment-tracker.ts"),p=I("./src/controller/stream-controller.ts"),m=I("./src/is-supported.ts"),c=I("./src/utils/logger.ts"),a=I("./src/config.ts"),s=I("./node_modules/eventemitter3/index.js"),d=I.n(s),l=I("./src/events.ts"),i=I("./src/errors.ts");function n(T,R){for(var S=0;S<R.length;S++){var y=R[S];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(T,y.key,y)}}function O(T,R,S){return R&&n(T.prototype,R),S&&n(T,S),T}var C=function(){T.isSupported=function(){return Object(m.isSupported)()};function T(S){S===void 0&&(S={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new s.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 y=this.config=Object(a.mergeConfig)(T.DefaultConfig,S);this.userConfig=S,Object(c.enableLogs)(y.debug),this._autoLevelCapping=-1,y.progressive&&Object(a.enableStreamingMode)(y);var E=y.abrController,f=y.bufferController,h=y.capLevelController,v=y.fpsController,g=this.abrController=new E(this),b=this.bufferController=new f(this),N=this.capLevelController=new h(this),H=new v(this),A=new D.default(this),F=new K.default(this),U=new M.default(this),w=this.levelController=new P.default(this),Y=new x.FragmentTracker(this),Z=this.streamController=new p.default(this,Y);N.setStreamController(Z),H.setStreamController(Z);var ce=[w,Z];this.networkControllers=ce;var be=[A,F,g,b,N,H,U,Y];this.audioTrackController=this.createController(y.audioTrackController,null,ce),this.createController(y.audioStreamController,Y,ce),this.subtitleTrackController=this.createController(y.subtitleTrackController,null,ce),this.createController(y.subtitleStreamController,Y,ce),this.createController(y.timelineController,null,be),this.emeController=this.createController(y.emeController,null,be),this.cmcdController=this.createController(y.cmcdController,null,be),this.latencyController=this.createController(r.default,null,be),this.coreComponents=be}var R=T.prototype;return R.createController=function(y,E,f){if(y){var h=E?new y(this,E):new y(this);return f&&f.push(h),h}return null},R.on=function(y,E,f){f===void 0&&(f=this),this._emitter.on(y,E,f)},R.once=function(y,E,f){f===void 0&&(f=this),this._emitter.once(y,E,f)},R.removeAllListeners=function(y){this._emitter.removeAllListeners(y)},R.off=function(y,E,f,h){f===void 0&&(f=this),this._emitter.off(y,E,f,h)},R.listeners=function(y){return this._emitter.listeners(y)},R.emit=function(y,E,f){return this._emitter.emit(y,E,f)},R.trigger=function(y,E){if(this.config.debug)return this.emit(y,y,E);try{return this.emit(y,y,E)}catch(f){c.logger.error("An internal error happened while handling event "+y+'. Error message: "'+f.message+'". Here is a stacktrace:',f),this.trigger(l.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:y,error:f})}return!1},R.listenerCount=function(y){return this._emitter.listenerCount(y)},R.destroy=function(){c.logger.log("destroy"),this.trigger(l.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(y){return y.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(y){return y.destroy()}),this.coreComponents.length=0},R.attachMedia=function(y){c.logger.log("attachMedia"),this._media=y,this.trigger(l.Events.MEDIA_ATTACHING,{media:y})},R.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(l.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(y){this.stopLoad();var E=this.media,f=this.url,h=this.url=z.buildAbsoluteURL(self.location.href,y,{alwaysNormalize:!0});c.logger.log("loadSource:"+h),E&&f&&f!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(l.Events.MANIFEST_LOADING,{url:y})},R.startLoad=function(y){y===void 0&&(y=-1),c.logger.log("startLoad("+y+")"),this.networkControllers.forEach(function(E){E.startLoad(y)})},R.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(y){y.stopLoad()})},R.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){c.logger.log("recoverMediaError");var y=this._media;this.detachMedia(),y&&this.attachMedia(y)},R.removeLevel=function(y,E){E===void 0&&(E=0),this.levelController.removeLevel(y,E)},O(T,[{key:"levels",get:function(){var y=this.levelController.levels;return y||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(y){c.logger.log("set currentLevel:"+y),this.loadLevel=y,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(y){c.logger.log("set nextLevel:"+y),this.levelController.manualLevel=y,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(y){c.logger.log("set loadLevel:"+y),this.levelController.manualLevel=y}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(y){this.levelController.nextLoadLevel=y}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(y){c.logger.log("set firstLevel:"+y),this.levelController.firstLevel=y}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(y){c.logger.log("set startLevel:"+y),y!==-1&&(y=Math.max(y,this.minAutoLevel)),this.levelController.startLevel=y}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(y){var E=!!y;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(y){this._autoLevelCapping!==y&&(c.logger.log("set autoLevelCapping:"+y),this._autoLevelCapping=y)}},{key:"bandwidthEstimate",get:function(){var y=this.abrController.bwEstimator;return y?y.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var y=this.levels,E=this.config.minAutoBitrate;if(!y)return 0;for(var f=y.length,h=0;h<f;h++)if(y[h].maxBitrate>E)return h;return 0}},{key:"maxAutoLevel",get:function(){var y=this.levels,E=this.autoLevelCapping,f;return E===-1&&y&&y.length?f=y.length-1:f=E,f}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(y){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,y)}},{key:"audioTracks",get:function(){var y=this.audioTrackController;return y?y.audioTracks:[]}},{key:"audioTrack",get:function(){var y=this.audioTrackController;return y?y.audioTrack:-1},set:function(y){var E=this.audioTrackController;E&&(E.audioTrack=y)}},{key:"subtitleTracks",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTrack:-1},set:function(y){var E=this.subtitleTrackController;E&&(E.subtitleTrack=y)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var y=this.subtitleTrackController;return y?y.subtitleDisplay:!1},set:function(y){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=y)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(y){this.config.lowLatencyMode=y}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return l.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:a.hlsDefaultConfig},set:function(y){T.defaultConfig=y}}]),T}();C.defaultConfig=void 0},"./src/is-supported.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"isSupported",function(){return D}),I.d(V,"changeTypeSupported",function(){return K});var z=I("./src/utils/mediasource-helper.ts");function L(){return self.SourceBuffer||self.WebKitSourceBuffer}function D(){var M=Object(z.getMediaSource)();if(!M)return!1;var r=L(),P=M&&typeof M.isTypeSupported=="function"&&M.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),x=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!P&&!!x}function K(){var M,r=L();return typeof(r==null||((M=r.prototype)===null||M===void 0)?void 0:M.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return c}),I.d(V,"LoadError",function(){return s});var z=I("./src/polyfills/number.ts"),L=I("./src/errors.ts");function D(d,l){d.prototype=Object.create(l.prototype),d.prototype.constructor=d,x(d,l)}function K(d){var l=typeof Map=="function"?new Map:void 0;return K=function(n){if(n===null||!P(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof l!="undefined"){if(l.has(n))return l.get(n);l.set(n,O)}function O(){return M(n,arguments,p(this).constructor)}return O.prototype=Object.create(n.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),x(O,n)},K(d)}function M(d,l,i){return r()?M=Reflect.construct:M=function(O,C,T){var R=[null];R.push.apply(R,C);var S=Function.bind.apply(O,R),y=new S;return T&&x(y,T.prototype),y},M.apply(null,arguments)}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(d){return!1}}function P(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function x(d,l){return x=Object.setPrototypeOf||function(n,O){return n.__proto__=O,n},x(d,l)}function p(d){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},p(d)}var m=Math.pow(2,17),c=function(){function d(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var l=d.prototype;return l.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},l.abort=function(){this.loader&&this.loader.abort()},l.load=function(n,O){var C=this,T=n.url;if(!T)return Promise.reject(new s({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var R=this.config,S=R.fLoader,y=R.loader;return new Promise(function(E,f){C.loader&&C.loader.destroy();var h=C.loader=n.loader=S?new S(R):new y(R),v=a(n),g={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:m};n.stats=h.stats,h.load(v,g,{onSuccess:function(N,H,A,F){C.resetLoader(n,h),E({frag:n,part:null,payload:N.data,networkDetails:F})},onError:function(N,H,A){C.resetLoader(n,h),f(new s({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,response:N,networkDetails:A}))},onAbort:function(N,H,A){C.resetLoader(n,h),f(new s({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,networkDetails:A}))},onTimeout:function(N,H,A){C.resetLoader(n,h),f(new s({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,networkDetails:A}))},onProgress:function(N,H,A,F){O&&O({frag:n,part:null,payload:A,networkDetails:F})}})})},l.loadPart=function(n,O,C){var T=this;this.abort();var R=this.config,S=R.fLoader,y=R.loader;return new Promise(function(E,f){T.loader&&T.loader.destroy();var h=T.loader=n.loader=S?new S(R):new y(R),v=a(n,O),g={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:m};O.stats=h.stats,h.load(v,g,{onSuccess:function(N,H,A,F){T.resetLoader(n,h),T.updateStatsFromPart(n,O);var U={frag:n,part:O,payload:N.data,networkDetails:F};C(U),E(U)},onError:function(N,H,A){T.resetLoader(n,h),f(new s({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,part:O,response:N,networkDetails:A}))},onAbort:function(N,H,A){n.stats.aborted=O.stats.aborted,T.resetLoader(n,h),f(new s({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,part:O,networkDetails:A}))},onTimeout:function(N,H,A){T.resetLoader(n,h),f(new s({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,part:O,networkDetails:A}))}})})},l.updateStatsFromPart=function(n,O){var C=n.stats,T=O.stats,R=T.total;if(C.loaded+=T.loaded,R){var S=Math.round(n.duration/O.duration),y=Math.min(Math.round(C.loaded/R),S),E=S-y,f=E*Math.round(C.loaded/y);C.total=C.loaded+f}else C.total=Math.max(C.loaded,C.total);var h=C.loading,v=T.loading;h.start?h.first+=v.first-v.start:(h.start=v.start,h.first=v.first),h.end=v.end},l.resetLoader=function(n,O){n.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.destroy()},d}();function a(d,l){l===void 0&&(l=null);var i=l||d,n={frag:d,part:l,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},O=i.byteRangeStartOffset,C=i.byteRangeEndOffset;return Object(z.isFiniteNumber)(O)&&Object(z.isFiniteNumber)(C)&&(n.rangeStart=O,n.rangeEnd=C),n}var s=function(d){D(l,d);function l(i){for(var n,O=arguments.length,C=new Array(O>1?O-1:0),T=1;T<O;T++)C[T-1]=arguments[T];return n=d.call.apply(d,[this].concat(C))||this,n.data=void 0,n.data=i,n}return l}(K(Error))},"./src/loader/fragment.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"ElementaryStreamTypes",function(){return c}),I.d(V,"BaseSegment",function(){return a}),I.d(V,"Fragment",function(){return s}),I.d(V,"Part",function(){return d});var z=I("./src/polyfills/number.ts"),L=I("./node_modules/url-toolkit/src/url-toolkit.js"),D=I.n(L),K=I("./src/utils/logger.ts"),M=I("./src/loader/level-key.ts"),r=I("./src/loader/load-stats.ts");function P(l,i){l.prototype=Object.create(i.prototype),l.prototype.constructor=l,x(l,i)}function x(l,i){return x=Object.setPrototypeOf||function(O,C){return O.__proto__=C,O},x(l,i)}function p(l,i){for(var n=0;n<i.length;n++){var O=i[n];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(l,O.key,O)}}function m(l,i,n){return i&&p(l.prototype,i),n&&p(l,n),l}var c;(function(l){l.AUDIO="audio",l.VIDEO="video",l.AUDIOVIDEO="audiovideo"})(c||(c={}));var a=function(){function l(n){var O;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(O={},O[c.AUDIO]=null,O[c.VIDEO]=null,O[c.AUDIOVIDEO]=null,O),this.baseurl=n}var i=l.prototype;return i.setByteRange=function(O,C){var T=O.split("@",2),R=[];T.length===1?R[0]=C?C.byteRangeEndOffset:0:R[0]=parseInt(T[1]),R[1]=parseInt(T[0])+R[0],this._byteRange=R},m(l,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(L.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(O){this._url=O}}]),l}(),s=function(l){P(i,l);function i(O,C){var T;return T=l.call(this,C)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new r.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=O,T}var n=i.prototype;return n.createInitializationVector=function(C){for(var T=new Uint8Array(16),R=12;R<16;R++)T[R]=C>>8*(15-R)&255;return T},n.setDecryptDataFromLevelKey=function(C,T){var R=C;return(C==null?void 0:C.method)==="AES-128"&&C.uri&&!C.iv&&(R=M.LevelKey.fromURI(C.uri),R.method=C.method,R.iv=this.createInitializationVector(T),R.keyFormat="identity"),R},n.setElementaryStreamInfo=function(C,T,R,S,y,E){E===void 0&&(E=!1);var f=this.elementaryStreams,h=f[C];if(!h){f[C]={startPTS:T,endPTS:R,startDTS:S,endDTS:y,partial:E};return}h.startPTS=Math.min(h.startPTS,T),h.endPTS=Math.max(h.endPTS,R),h.startDTS=Math.min(h.startDTS,S),h.endDTS=Math.max(h.endDTS,y)},n.clearElementaryStreamInfo=function(){var C=this.elementaryStreams;C[c.AUDIO]=null,C[c.VIDEO]=null,C[c.AUDIOVIDEO]=null},m(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var C=this.sn;typeof C!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),C=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,C)}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 C=Object(z.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+C*1e3}},{key:"encrypted",get:function(){var C;return!!((C=this.decryptdata)!==null&&C!==void 0&&C.keyFormat&&this.decryptdata.uri)}}]),i}(a),d=function(l){P(i,l);function i(n,O,C,T,R){var S;S=l.call(this,C)||this,S.fragOffset=0,S.duration=0,S.gap=!1,S.independent=!1,S.relurl=void 0,S.fragment=void 0,S.index=void 0,S.stats=new r.LoadStats,S.duration=n.decimalFloatingPoint("DURATION"),S.gap=n.bool("GAP"),S.independent=n.bool("INDEPENDENT"),S.relurl=n.enumeratedString("URI"),S.fragment=O,S.index=T;var y=n.enumeratedString("BYTERANGE");return y&&S.setByteRange(y,R),R&&(S.fragOffset=R.fragOffset+R.duration),S}return m(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var O=this.elementaryStreams;return!!(O.audio||O.video||O.audiovideo)}}]),i}(a)},"./src/loader/key-loader.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return K});var z=I("./src/events.ts"),L=I("./src/errors.ts"),D=I("./src/utils/logger.ts"),K=function(){function M(P){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=P,this._registerListeners()}var r=M.prototype;return r._registerListeners=function(){this.hls.on(z.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(z.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var x in this.loaders){var p=this.loaders[x];p&&p.destroy()}this.loaders={}},r.onKeyLoading=function(x,p){var m=p.frag,c=m.type,a=this.loaders[c];if(!m.decryptdata){D.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var s=m.decryptdata.uri;if(s!==this.decrypturl||this.decryptkey===null){var d=this.hls.config;if(a&&(D.logger.warn("abort previous key loader for type:"+c),a.abort()),!s){D.logger.warn("key uri is falsy");return}var l=d.loader,i=m.loader=this.loaders[c]=new l(d);this.decrypturl=s,this.decryptkey=null;var n={url:s,frag:m,responseType:"arraybuffer"},O={timeout:d.fragLoadingTimeOut,maxRetry:0,retryDelay:d.fragLoadingRetryDelay,maxRetryDelay:d.fragLoadingMaxRetryTimeout,highWaterMark:0},C={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(n,O,C)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(z.Events.KEY_LOADED,{frag:m}))},r.loadsuccess=function(x,p,m){var c=m.frag;if(!c.decryptdata){D.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})},r.loaderror=function(x,p){var m=p.frag,c=m.loader;c&&c.abort(),delete this.loaders[m.type],this.hls.trigger(z.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:x})},r.loadtimeout=function(x,p){var m=p.frag,c=m.loader;c&&c.abort(),delete this.loaders[m.type],this.hls.trigger(z.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},M}()},"./src/loader/level-details.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"LevelDetails",function(){return M});var z=I("./src/polyfills/number.ts");function L(r,P){for(var x=0;x<P.length;x++){var p=P[x];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(r,p.key,p)}}function D(r,P,x){return P&&L(r.prototype,P),x&&L(r,x),r}var K=10,M=function(){function r(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 P=r.prototype;return P.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var m=this.lastPartSn-p.lastPartSn,c=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!c||!!m,this.advanced=this.endSN>p.endSN||m>0||m===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},D(r,[{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||K}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var m=this.driftEnd-this.driftStart;return m*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}}]),r}()},"./src/loader/level-key.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"LevelKey",function(){return M});var z=I("./node_modules/url-toolkit/src/url-toolkit.js"),L=I.n(z);function D(r,P){for(var x=0;x<P.length;x++){var p=P[x];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(r,p.key,p)}}function K(r,P,x){return P&&D(r.prototype,P),x&&D(r,x),r}var M=function(){r.fromURL=function(x,p){return new r(x,p)},r.fromURI=function(x){return new r(x)};function r(P,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)(P,x,{alwaysNormalize:!0}):this._uri=P}return K(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"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(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return i});var z=I("./src/polyfills/number.ts"),L=I("./node_modules/url-toolkit/src/url-toolkit.js"),D=I.n(L),K=I("./src/loader/fragment.ts"),M=I("./src/loader/level-details.ts"),r=I("./src/loader/level-key.ts"),P=I("./src/utils/attr-list.ts"),x=I("./src/utils/logger.ts"),p=I("./src/utils/codecs.ts"),m=/#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"),s=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("|")),d=/\.(mp4|m4s|m4v|m4a)$/i;function l(R){var S,y;return d.test((S=(y=L.parseURL(R))===null||y===void 0?void 0:y.path)!=null?S:"")}var i=function(){function R(){}return R.findGroup=function(y,E){for(var f=0;f<y.length;f++){var h=y[f];if(h.id===E)return h}},R.convertAVC1ToAVCOTI=function(y){var E=y.split(".");if(E.length>2){var f=E.shift()+".";return f+=parseInt(E.shift()).toString(16),f+=("000"+parseInt(E.shift()).toString(16)).substr(-4),f}return y},R.resolve=function(y,E){return L.buildAbsoluteURL(E,y,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(y,E){var f=[],h={},v=!1;m.lastIndex=0;for(var g;(g=m.exec(y))!=null;)if(g[1]){var b=new P.AttrList(g[1]),N={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:R.resolve(g[2],E)},H=b.decimalResolution("RESOLUTION");H&&(N.width=H.width,N.height=H.height),n((b.CODECS||"").split(/[ ,]+/).filter(function(F){return F}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=R.convertAVC1ToAVCOTI(N.videoCodec)),f.push(N)}else if(g[3]){var A=new P.AttrList(g[3]);A["DATA-ID"]&&(v=!0,h[A["DATA-ID"]]=A)}return{levels:f,sessionData:v?h:null}},R.parseMasterPlaylistMedia=function(y,E,f,h){h===void 0&&(h=[]);var v,g=[],b=0;for(c.lastIndex=0;(v=c.exec(y))!==null;){var N=new P.AttrList(v[1]);if(N.TYPE===f){var H={attrs:N,bitrate:0,id:b++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:f,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?R.resolve(N.URI,E):""};if(h.length){var A=R.findGroup(h,H.groupId)||h[0];O(H,A,"audioCodec"),O(H,A,"textCodec")}g.push(H)}}return g},R.parseLevelPlaylist=function(y,E,f,h,v){var g=new M.LevelDetails(E),b=g.fragments,N=null,H=0,A=0,F=0,U=0,w=null,Y=new K.Fragment(h,E),Z,ce,be,Ze=-1,Ce=!1;for(a.lastIndex=0,g.m3u8=y;(Z=a.exec(y))!==null;){Ce&&(Ce=!1,Y=new K.Fragment(h,E),Y.start=F,Y.sn=H,Y.cc=U,Y.level=f,N&&(Y.initSegment=N,Y.rawProgramDateTime=N.rawProgramDateTime));var We=Z[1];if(We){Y.duration=parseFloat(We);var Ve=(" "+Z[2]).slice(1);Y.title=Ve||null,Y.tagList.push(Ve?["INF",We,Ve]:["INF",We])}else if(Z[3])Object(z.isFiniteNumber)(Y.duration)&&(Y.start=F,be&&(Y.levelkey=be),Y.sn=H,Y.level=f,Y.cc=U,Y.urlId=v,b.push(Y),Y.relurl=(" "+Z[3]).slice(1),T(Y,w),w=Y,F+=Y.duration,H++,A=0,Ce=!0);else if(Z[4]){var Ye=(" "+Z[4]).slice(1);w?Y.setByteRange(Ye,w):Y.setByteRange(Ye)}else if(Z[5])Y.rawProgramDateTime=(" "+Z[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),Ze===-1&&(Ze=b.length);else{if(Z=Z[0].match(s),!Z){x.logger.warn("No matches on slow regex match for level playlist!");continue}for(ce=1;ce<Z.length&&!(typeof Z[ce]!="undefined");ce++);var we=(" "+Z[ce]).slice(1),X=(" "+Z[ce+1]).slice(1),j=Z[ce+2]?(" "+Z[ce+2]).slice(1):"";switch(we){case"PLAYLIST-TYPE":g.type=X.toUpperCase();break;case"MEDIA-SEQUENCE":H=g.startSN=parseInt(X);break;case"SKIP":{var W=new P.AttrList(X),Q=W.decimalInteger("SKIPPED-SEGMENTS");if(Object(z.isFiniteNumber)(Q)){g.skippedSegments=Q;for(var re=Q;re--;)b.unshift(null);H+=Q}var G=W.enumeratedString("RECENTLY-REMOVED-DATERANGES");G&&(g.recentlyRemovedDateranges=G.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(X);break;case"VERSION":g.version=parseInt(X);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(X||j)&&Y.tagList.push(j?[X,j]:[X]);break;case"DIS":U++;case"GAP":Y.tagList.push([we]);break;case"BITRATE":Y.tagList.push([we,X]);break;case"DISCONTINUITY-SEQ":U=parseInt(X);break;case"KEY":{var xe,Ie=new P.AttrList(X),tt=Ie.enumeratedString("METHOD"),le=Ie.URI,Se=Ie.hexadecimalInteger("IV"),je=Ie.enumeratedString("KEYFORMATVERSIONS"),ze=Ie.enumeratedString("KEYID"),yt=(xe=Ie.enumeratedString("KEYFORMAT"))!=null?xe:"identity",Ot=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ot.indexOf(yt)>-1){x.logger.warn("Keyformat "+yt+" is not supported from the manifest");continue}else if(yt!=="identity")continue;tt&&(be=r.LevelKey.fromURL(E,le),le&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(tt)>=0&&(be.method=tt,be.keyFormat=yt,ze&&(be.keyID=ze),je&&(be.keyFormatVersions=je),be.iv=Se));break}case"START":{var Ut=new P.AttrList(X),Qe=Ut.decimalFloatingPoint("TIME-OFFSET");Object(z.isFiniteNumber)(Qe)&&(g.startTimeOffset=Qe);break}case"MAP":{var Bt=new P.AttrList(X);Y.relurl=Bt.URI,Bt.BYTERANGE&&Y.setByteRange(Bt.BYTERANGE),Y.level=f,Y.sn="initSegment",be&&(Y.levelkey=be),Y.initSegment=null,N=Y,Ce=!0;break}case"SERVER-CONTROL":{var ln=new P.AttrList(X);g.canBlockReload=ln.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=ln.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&ln.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=ln.optionalFloat("PART-HOLD-BACK",0),g.holdBack=ln.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ke=new P.AttrList(X);g.partTarget=Ke.decimalFloatingPoint("PART-TARGET");break}case"PART":{var He=g.partList;He||(He=g.partList=[]);var ct=A>0?He[He.length-1]:void 0,bt=A++,de=new K.Part(new P.AttrList(X),Y,E,bt,ct);He.push(de),Y.duration+=de.duration;break}case"PRELOAD-HINT":{var q=new P.AttrList(X);g.preloadHint=q;break}case"RENDITION-REPORT":{var te=new P.AttrList(X);g.renditionReports=g.renditionReports||[],g.renditionReports.push(te);break}default:x.logger.warn("line parsed but not handled: "+Z);break}}}w&&!w.relurl?(b.pop(),F-=w.duration,g.partList&&(g.fragmentHint=w)):g.partList&&(T(Y,w),Y.cc=U,g.fragmentHint=Y);var se=b.length,pe=b[0],ae=b[se-1];if(F+=g.skippedSegments*g.targetduration,F>0&&se&&ae){g.averagetargetduration=F/se;var ie=ae.sn;g.endSN=ie!=="initSegment"?ie:0,pe&&(g.startCC=pe.cc,pe.initSegment||g.fragments.every(function(me){return me.relurl&&l(me.relurl)})&&(x.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new K.Fragment(h,E),Y.relurl=ae.relurl,Y.level=f,Y.sn="initSegment",pe.initSegment=Y,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(F+=g.fragmentHint.duration),g.totalduration=F,g.endCC=U,Ze>0&&C(b,Ze),g},R}();function n(R,S){["video","audio","text"].forEach(function(y){var E=R.filter(function(h){return Object(p.isCodecType)(h,y)});if(E.length){var f=E.filter(function(h){return h.lastIndexOf("avc1",0)===0||h.lastIndexOf("mp4a",0)===0});S[y+"Codec"]=f.length>0?f[0]:E[0],R=R.filter(function(h){return E.indexOf(h)===-1})}}),S.unknownCodecs=R}function O(R,S,y){var E=S[y];E&&(R[y]=E)}function C(R,S){for(var y=R[S],E=S;E--;){var f=R[E];if(!f)return;f.programDateTime=y.programDateTime-f.duration*1e3,y=f}}function T(R,S){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):S!=null&&S.programDateTime&&(R.programDateTime=S.endProgramDateTime),Object(z.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/polyfills/number.ts"),L=I("./src/events.ts"),D=I("./src/errors.ts"),K=I("./src/utils/logger.ts"),M=I("./src/utils/mp4-tools.ts"),r=I("./src/loader/m3u8-parser.ts"),P=I("./src/types/loader.ts"),x=I("./src/utils/attr-list.ts");function p(a){var s=a.type;switch(s){case P.PlaylistContextType.AUDIO_TRACK:return P.PlaylistLevelType.AUDIO;case P.PlaylistContextType.SUBTITLE_TRACK:return P.PlaylistLevelType.SUBTITLE;default:return P.PlaylistLevelType.MAIN}}function m(a,s){var d=a.url;return(d===void 0||d.indexOf("data:")===0)&&(d=s.url),d}var c=function(){function a(d){this.hls=void 0,this.loaders=Object.create(null),this.hls=d,this.registerListeners()}var s=a.prototype;return s.registerListeners=function(){var l=this.hls;l.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.on(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.unregisterListeners=function(){var l=this.hls;l.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.off(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.createInternalLoader=function(l){var i=this.hls.config,n=i.pLoader,O=i.loader,C=n||O,T=new C(i);return l.loader=T,this.loaders[l.type]=T,T},s.getInternalLoader=function(l){return this.loaders[l.type]},s.resetInternalLoader=function(l){this.loaders[l]&&delete this.loaders[l]},s.destroyInternalLoaders=function(){for(var l in this.loaders){var i=this.loaders[l];i&&i.destroy(),this.resetInternalLoader(l)}},s.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},s.onManifestLoading=function(l,i){var n=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:P.PlaylistContextType.MANIFEST,url:n,deliveryDirectives:null})},s.onLevelLoading=function(l,i){var n=i.id,O=i.level,C=i.url,T=i.deliveryDirectives;this.load({id:n,groupId:null,level:O,responseType:"text",type:P.PlaylistContextType.LEVEL,url:C,deliveryDirectives:T})},s.onAudioTrackLoading=function(l,i){var n=i.id,O=i.groupId,C=i.url,T=i.deliveryDirectives;this.load({id:n,groupId:O,level:null,responseType:"text",type:P.PlaylistContextType.AUDIO_TRACK,url:C,deliveryDirectives:T})},s.onSubtitleTrackLoading=function(l,i){var n=i.id,O=i.groupId,C=i.url,T=i.deliveryDirectives;this.load({id:n,groupId:O,level:null,responseType:"text",type:P.PlaylistContextType.SUBTITLE_TRACK,url:C,deliveryDirectives:T})},s.load=function(l){var i,n=this.hls.config,O=this.getInternalLoader(l);if(O){var C=O.context;if(C&&C.url===l.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+l.type),O.abort()}var T,R,S,y;switch(l.type){case P.PlaylistContextType.MANIFEST:T=n.manifestLoadingMaxRetry,R=n.manifestLoadingTimeOut,S=n.manifestLoadingRetryDelay,y=n.manifestLoadingMaxRetryTimeout;break;case P.PlaylistContextType.LEVEL:case P.PlaylistContextType.AUDIO_TRACK:case P.PlaylistContextType.SUBTITLE_TRACK:T=0,R=n.levelLoadingTimeOut;break;default:T=n.levelLoadingMaxRetry,R=n.levelLoadingTimeOut,S=n.levelLoadingRetryDelay,y=n.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(l),(i=l.deliveryDirectives)!==null&&i!==void 0&&i.part){var E;if(l.type===P.PlaylistContextType.LEVEL&&l.level!==null?E=this.hls.levels[l.level].details:l.type===P.PlaylistContextType.AUDIO_TRACK&&l.id!==null?E=this.hls.audioTracks[l.id].details:l.type===P.PlaylistContextType.SUBTITLE_TRACK&&l.id!==null&&(E=this.hls.subtitleTracks[l.id].details),E){var f=E.partTarget,h=E.targetduration;f&&h&&(R=Math.min(Math.max(f*3,h*.8)*1e3,R))}}var v={timeout:R,maxRetry:T,retryDelay:S,maxRetryDelay:y,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(l,v,g)},s.loadsuccess=function(l,i,n,O){if(O===void 0&&(O=null),n.isSidxRequest){this.handleSidxRequest(l,n),this.handlePlaylistLoaded(l,i,n,O);return}this.resetInternalLoader(n.type);var C=l.data;if(C.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,n,"no EXTM3U delimiter",O);return}i.parsing.start=performance.now(),C.indexOf("#EXTINF:")>0||C.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(l,i,n,O):this.handleMasterPlaylist(l,i,n,O)},s.loaderror=function(l,i,n){n===void 0&&(n=null),this.handleNetworkError(i,n,!1,l)},s.loadtimeout=function(l,i,n){n===void 0&&(n=null),this.handleNetworkError(i,n,!0)},s.handleMasterPlaylist=function(l,i,n,O){var C=this.hls,T=l.data,R=m(l,n),S=r.default.parseMasterPlaylist(T,R),y=S.levels,E=S.sessionData;if(!y.length){this.handleManifestParsingError(l,n,"no level found in manifest",O);return}var f=y.map(function(H){return{id:H.attrs.AUDIO,audioCodec:H.audioCodec}}),h=y.map(function(H){return{id:H.attrs.SUBTITLES,textCodec:H.textCodec}}),v=r.default.parseMasterPlaylistMedia(T,R,"AUDIO",f),g=r.default.parseMasterPlaylistMedia(T,R,"SUBTITLES",h),b=r.default.parseMasterPlaylistMedia(T,R,"CLOSED-CAPTIONS");if(v.length){var N=v.some(function(H){return!H.url});!N&&y[0].audioCodec&&!y[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new x.AttrList({}),bitrate:0,url:""}))}C.trigger(L.Events.MANIFEST_LOADED,{levels:y,audioTracks:v,subtitles:g,captions:b,url:R,stats:i,networkDetails:O,sessionData:E})},s.handleTrackOrLevelPlaylist=function(l,i,n,O){var C=this.hls,T=n.id,R=n.level,S=n.type,y=m(l,n),E=Object(z.isFiniteNumber)(T)?T:0,f=Object(z.isFiniteNumber)(R)?R:E,h=p(n),v=r.default.parseLevelPlaylist(l.data,y,f,h,E);if(!v.fragments.length){C.trigger(L.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof n.level=="number"?n.level:void 0});return}if(S===P.PlaylistContextType.MANIFEST){var g={attrs:new x.AttrList({}),bitrate:0,details:v,name:"",url:y};C.trigger(L.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:y,stats:i,networkDetails:O,sessionData:null})}if(i.parsing.end=performance.now(),v.needSidxRanges){var b,N=(b=v.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:N,isSidxRequest:!0,type:S,level:R,levelDetails:v,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}n.levelDetails=v,this.handlePlaylistLoaded(l,i,n,O)},s.handleSidxRequest=function(l,i){var n=Object(M.parseSegmentIndex)(new Uint8Array(l.data));if(!n)return;var O=n.references,C=i.levelDetails;O.forEach(function(T,R){var S=T.info,y=C.fragments[R];y.byteRange.length===0&&y.setByteRange(String(1+S.end-S.start)+"@"+String(S.start)),y.initSegment&&y.initSegment.setByteRange(String(n.moovEndOffset)+"@0")})},s.handleManifestParsingError=function(l,i,n,O){this.hls.trigger(L.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===P.PlaylistContextType.MANIFEST,url:l.url,reason:n,response:l,context:i,networkDetails:O})},s.handleNetworkError=function(l,i,n,O){n===void 0&&(n=!1),K.logger.warn("[playlist-loader]: A network "+(n?"timeout":"error")+" occurred while loading "+l.type+" level: "+l.level+" id: "+l.id+' group-id: "'+l.groupId+'"');var C=D.ErrorDetails.UNKNOWN,T=!1,R=this.getInternalLoader(l);switch(l.type){case P.PlaylistContextType.MANIFEST:C=n?D.ErrorDetails.MANIFEST_LOAD_TIMEOUT:D.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case P.PlaylistContextType.LEVEL:C=n?D.ErrorDetails.LEVEL_LOAD_TIMEOUT:D.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case P.PlaylistContextType.AUDIO_TRACK:C=n?D.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:D.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case P.PlaylistContextType.SUBTITLE_TRACK:C=n?D.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:D.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}R&&this.resetInternalLoader(l.type);var S={type:D.ErrorTypes.NETWORK_ERROR,details:C,fatal:T,url:l.url,loader:R,context:l,networkDetails:i};O&&(S.response=O),this.hls.trigger(L.Events.ERROR,S)},s.handlePlaylistLoaded=function(l,i,n,O){var C=n.type,T=n.level,R=n.id,S=n.groupId,y=n.loader,E=n.levelDetails,f=n.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(l,n,"invalid target duration",O);return}if(!y)return;E.live&&(y.getCacheAge&&(E.ageHeader=y.getCacheAge()||0),(!y.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(C){case P.PlaylistContextType.MANIFEST:case P.PlaylistContextType.LEVEL:this.hls.trigger(L.Events.LEVEL_LOADED,{details:E,level:T||0,id:R||0,stats:i,networkDetails:O,deliveryDirectives:f});break;case P.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(L.Events.AUDIO_TRACK_LOADED,{details:E,id:R||0,groupId:S||"",stats:i,networkDetails:O,deliveryDirectives:f});break;case P.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADED,{details:E,id:R||0,groupId:S||"",stats:i,networkDetails:O,deliveryDirectives:f});break}},a}();V.default=c},"./src/polyfills/number.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"isFiniteNumber",function(){return z}),I.d(V,"MAX_SAFE_INTEGER",function(){return L});var z=Number.isFinite||function(D){return typeof D=="number"&&isFinite(D)},L=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ne,V,I){"use strict";I.r(V);var z=function(){function L(){}return L.getSilentFrame=function(K,M){switch(K){case"mp4a.40.2":if(M===1)return new Uint8Array([0,200,0,128,35,128]);if(M===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(M===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(M===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(M===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(M===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(M===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(M===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(M===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},L}();V.default=z},"./src/remux/mp4-generator.ts":function(ne,V,I){"use strict";I.r(V);var z=Math.pow(2,32)-1,L=function(){function D(){}return D.init=function(){D.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 M;for(M in D.types)D.types.hasOwnProperty(M)&&(D.types[M]=[M.charCodeAt(0),M.charCodeAt(1),M.charCodeAt(2),M.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),P=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]);D.HDLR_TYPES={video:r,audio:P};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]);D.STTS=D.STSC=D.STCO=p,D.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),D.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),D.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),D.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);D.FTYP=D.box(D.types.ftyp,m,a,m,c),D.DINF=D.box(D.types.dinf,D.box(D.types.dref,x))},D.box=function(M){for(var r=8,P=arguments.length,x=new Array(P>1?P-1:0),p=1;p<P;p++)x[p-1]=arguments[p];for(var m=x.length,c=m;m--;)r+=x[m].byteLength;var a=new Uint8Array(r);for(a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=r&255,a.set(M,4),m=0,r=8;m<c;m++)a.set(x[m],r),r+=x[m].byteLength;return a},D.hdlr=function(M){return D.box(D.types.hdlr,D.HDLR_TYPES[M])},D.mdat=function(M){return D.box(D.types.mdat,M)},D.mdhd=function(M,r){r*=M;var P=Math.floor(r/(z+1)),x=Math.floor(r%(z+1));return D.box(D.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,M>>24&255,M>>16&255,M>>8&255,M&255,P>>24,P>>16&255,P>>8&255,P&255,x>>24,x>>16&255,x>>8&255,x&255,85,196,0,0]))},D.mdia=function(M){return D.box(D.types.mdia,D.mdhd(M.timescale,M.duration),D.hdlr(M.type),D.minf(M))},D.mfhd=function(M){return D.box(D.types.mfhd,new Uint8Array([0,0,0,0,M>>24,M>>16&255,M>>8&255,M&255]))},D.minf=function(M){return M.type==="audio"?D.box(D.types.minf,D.box(D.types.smhd,D.SMHD),D.DINF,D.stbl(M)):D.box(D.types.minf,D.box(D.types.vmhd,D.VMHD),D.DINF,D.stbl(M))},D.moof=function(M,r,P){return D.box(D.types.moof,D.mfhd(M),D.traf(P,r))},D.moov=function(M){for(var r=M.length,P=[];r--;)P[r]=D.trak(M[r]);return D.box.apply(null,[D.types.moov,D.mvhd(M[0].timescale,M[0].duration)].concat(P).concat(D.mvex(M)))},D.mvex=function(M){for(var r=M.length,P=[];r--;)P[r]=D.trex(M[r]);return D.box.apply(null,[D.types.mvex].concat(P))},D.mvhd=function(M,r){r*=M;var P=Math.floor(r/(z+1)),x=Math.floor(r%(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,M>>24&255,M>>16&255,M>>8&255,M&255,P>>24,P>>16&255,P>>8&255,P&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 D.box(D.types.mvhd,p)},D.sdtp=function(M){var r=M.samples||[],P=new Uint8Array(4+r.length),x,p;for(x=0;x<r.length;x++)p=r[x].flags,P[x+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return D.box(D.types.sdtp,P)},D.stbl=function(M){return D.box(D.types.stbl,D.stsd(M),D.box(D.types.stts,D.STTS),D.box(D.types.stsc,D.STSC),D.box(D.types.stsz,D.STSZ),D.box(D.types.stco,D.STCO))},D.avc1=function(M){var r=[],P=[],x,p,m;for(x=0;x<M.sps.length;x++)p=M.sps[x],m=p.byteLength,r.push(m>>>8&255),r.push(m&255),r=r.concat(Array.prototype.slice.call(p));for(x=0;x<M.pps.length;x++)p=M.pps[x],m=p.byteLength,P.push(m>>>8&255),P.push(m&255),P=P.concat(Array.prototype.slice.call(p));var c=D.box(D.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|M.sps.length].concat(r).concat([M.pps.length]).concat(P))),a=M.width,s=M.height,d=M.pixelRatio[0],l=M.pixelRatio[1];return D.box(D.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,s>>8&255,s&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,D.box(D.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),D.box(D.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,d&255,l>>24,l>>16&255,l>>8&255,l&255])))},D.esds=function(M){var r=M.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(M.config).concat([6,1,2]))},D.mp4a=function(M){var r=M.samplerate;return D.box(D.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,M.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),D.box(D.types.esds,D.esds(M)))},D.mp3=function(M){var r=M.samplerate;return D.box(D.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,M.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},D.stsd=function(M){return M.type==="audio"?!M.isAAC&&M.codec==="mp3"?D.box(D.types.stsd,D.STSD,D.mp3(M)):D.box(D.types.stsd,D.STSD,D.mp4a(M)):D.box(D.types.stsd,D.STSD,D.avc1(M))},D.tkhd=function(M){var r=M.id,P=M.duration*M.timescale,x=M.width,p=M.height,m=Math.floor(P/(z+1)),c=Math.floor(P%(z+1));return D.box(D.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,m>>24,m>>16&255,m>>8&255,m&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]))},D.traf=function(M,r){var P=D.sdtp(M),x=M.id,p=Math.floor(r/(z+1)),m=Math.floor(r%(z+1));return D.box(D.types.traf,D.box(D.types.tfhd,new Uint8Array([0,0,0,0,x>>24,x>>16&255,x>>8&255,x&255])),D.box(D.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,m>>24,m>>16&255,m>>8&255,m&255])),D.trun(M,P.length+16+20+8+16+8+8),P)},D.trak=function(M){return M.duration=M.duration||4294967295,D.box(D.types.trak,D.tkhd(M),D.mdia(M))},D.trex=function(M){var r=M.id;return D.box(D.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},D.trun=function(M,r){var P=M.samples||[],x=P.length,p=12+16*x,m=new Uint8Array(p),c,a,s,d,l,i;for(r+=8+p,m.set([0,0,15,1,x>>>24&255,x>>>16&255,x>>>8&255,x&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),c=0;c<x;c++)a=P[c],s=a.duration,d=a.size,l=a.flags,i=a.cts,m.set([s>>>24&255,s>>>16&255,s>>>8&255,s&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,l.isLeading<<2|l.dependsOn,l.isDependedOn<<6|l.hasRedundancy<<4|l.paddingValue<<1|l.isNonSync,l.degradPrio&240<<8,l.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*c);return D.box(D.types.trun,m)},D.initSegment=function(M){D.types||D.init();var r=D.moov(M),P=new Uint8Array(D.FTYP.byteLength+r.byteLength);return P.set(D.FTYP),P.set(r,D.FTYP.byteLength),P},D}();L.types=void 0,L.HDLR_TYPES=void 0,L.STTS=void 0,L.STSC=void 0,L.STCO=void 0,L.STSZ=void 0,L.VMHD=void 0,L.SMHD=void 0,L.STSD=void 0,L.FTYP=void 0,L.DINF=void 0,V.default=L},"./src/remux/mp4-remuxer.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return i}),I.d(V,"normalizePts",function(){return n});var z=I("./src/polyfills/number.ts"),L=I("./src/remux/aac-helper.ts"),D=I("./src/remux/mp4-generator.ts"),K=I("./src/events.ts"),M=I("./src/errors.ts"),r=I("./src/utils/logger.ts"),P=I("./src/types/loader.ts"),x=I("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(R){for(var S=1;S<arguments.length;S++){var y=arguments[S];for(var E in y)Object.prototype.hasOwnProperty.call(y,E)&&(R[E]=y[E])}return R},p.apply(this,arguments)}var m=10*1e3,c=1024,a=1152,s=null,d=null,l=!1,i=function(){function R(y,E,f,h){if(h===void 0&&(h=""),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=y,this.config=E,this.typeSupported=f,this.ISGenerated=!1,s===null){var v=navigator.userAgent||"",g=v.match(/Chrome\/(\d+)/i);s=g?parseInt(g[1]):0}if(d===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);d=b?parseInt(b[1]):0}l=!!s&&s<75||!!d&&d<600}var S=R.prototype;return S.destroy=function(){},S.resetTimeStamp=function(E){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=E},S.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},S.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},S.getVideoStartPts=function(E){var f=!1,h=E.reduce(function(v,g){var b=g.pts-v;return b<-4294967296?(f=!0,n(v,g.pts)):b>0?v:g.pts},E[0].pts);return f&&r.logger.debug("PTS rollover detected"),h},S.remux=function(E,f,h,v,g,b,N,H){var A,F,U,w,Y,Z,ce=g,be=g,Ze=E.pid>-1,Ce=f.pid>-1,We=f.samples.length,Ve=E.samples.length>0,Ye=We>1,we=(!Ze||Ve)&&(!Ce||Ye)||this.ISGenerated||N;if(we){this.ISGenerated||(U=this.generateIS(E,f,g));var X=this.isVideoContiguous,j=-1;if(Ye&&(j=O(f.samples),!X&&this.config.forceKeyFrameOnDiscontinuity))if(Z=!0,j>0){r.logger.warn("[mp4-remuxer]: Dropped "+j+" out of "+We+" video samples due to a missing keyframe");var W=this.getVideoStartPts(f.samples);f.samples=f.samples.slice(j),f.dropped+=j,be+=(f.samples[0].pts-W)/(f.timescale||9e4)}else j===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+We+" video samples"),Z=!1);if(this.ISGenerated){if(Ve&&Ye){var Q=this.getVideoStartPts(f.samples),re=n(E.samples[0].pts,Q)-Q,G=re/f.inputTimeScale;ce+=Math.max(0,G),be+=Math.max(0,-G)}if(Ve){if(E.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(E,f,g)),F=this.remuxAudio(E,ce,this.isAudioContiguous,b,Ce||Ye||H===P.PlaylistLevelType.AUDIO?be:void 0),Ye){var xe=F?F.endPTS-F.startPTS:0;f.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(E,f,g)),A=this.remuxVideo(f,be,X,xe)}}else Ye&&(A=this.remuxVideo(f,be,X,0));A&&(A.firstKeyFrame=j,A.independent=j!==-1)}}return this.ISGenerated&&(h.samples.length&&(Y=this.remuxID3(h,g)),v.samples.length&&(w=this.remuxText(v,g))),{audio:F,video:A,initSegment:U,independent:Z,text:w,id3:Y}},S.generateIS=function(E,f,h){var v=E.samples,g=f.samples,b=this.typeSupported,N={},H=!Object(z.isFiniteNumber)(this._initPTS),A="audio/mp4",F,U,w;if(H&&(F=U=Infinity),E.config&&v.length&&(E.timescale=E.samplerate,E.isAAC||(b.mpeg?(A="audio/mpeg",E.codec=""):b.mp3&&(E.codec="mp3")),N.audio={id:"audio",container:A,codec:E.codec,initSegment:!E.isAAC&&b.mpeg?new Uint8Array(0):D.default.initSegment([E]),metadata:{channelCount:E.channelCount}},H&&(w=E.inputTimeScale,F=U=v[0].pts-Math.round(w*h))),f.sps&&f.pps&&g.length&&(f.timescale=f.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:f.codec,initSegment:D.default.initSegment([f]),metadata:{width:f.width,height:f.height}},H)){w=f.inputTimeScale;var Y=this.getVideoStartPts(g),Z=Math.round(w*h);U=Math.min(U,n(g[0].dts,Y)-Z),F=Math.min(F,Y-Z)}if(Object.keys(N).length)return this.ISGenerated=!0,H&&(this._initPTS=F,this._initDTS=U),{tracks:N,initPTS:F,timescale:w}},S.remuxVideo=function(E,f,h,v){var g=E.inputTimeScale,b=E.samples,N=[],H=b.length,A=this._initPTS,F=this.nextAvcDts,U=8,w,Y,Z,ce=Number.POSITIVE_INFINITY,be=Number.NEGATIVE_INFINITY,Ze=0,Ce=!1;if(!h||F===null){var We=f*g,Ve=b[0].pts-n(b[0].dts,b[0].pts);F=We-Ve}for(var Ye=0;Ye<H;Ye++){var we=b[Ye];if(we.pts=n(we.pts-A,F),we.dts=n(we.dts-A,F),we.dts>we.pts){var X=9e4*.2;Ze=Math.max(Math.min(Ze,we.pts-we.dts),-1*X)}we.dts<b[Ye>0?Ye-1:Ye].dts&&(Ce=!0)}Ce&&b.sort(function(Un,Cn){var vn=Un.dts-Cn.dts,er=Un.pts-Cn.pts;return vn||er}),Y=b[0].dts,Z=b[b.length-1].dts;var j=Math.round((Z-Y)/(H-1));if(Ze<0){if(Ze<j*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(x.toMsFromMpegTsClock)(-j,!0)+" ms");for(var W=Ze,Q=0;Q<H;Q++)b[Q].dts=W=Math.max(W,b[Q].pts-j),b[Q].pts=Math.max(W,b[Q].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(x.toMsFromMpegTsClock)(Ze,!0)+" ms to overcome this issue");for(var re=0;re<H;re++)b[re].dts=b[re].dts+Ze}Y=b[0].dts}if(h){var G=Y-F,xe=G>j,Ie=G<-1;if(xe||Ie){xe?r.logger.warn("AVC: "+Object(x.toMsFromMpegTsClock)(G,!0)+" ms ("+G+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(x.toMsFromMpegTsClock)(-G,!0)+" ms ("+G+"dts) overlapping between fragments detected"),Y=F;var tt=b[0].pts-G;b[0].dts=Y,b[0].pts=tt,r.logger.log("Video: First PTS/DTS adjusted: "+Object(x.toMsFromMpegTsClock)(tt,!0)+"/"+Object(x.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(x.toMsFromMpegTsClock)(G,!0)+" ms")}}l&&(Y=Math.max(0,Y));for(var le=0,Se=0,je=0;je<H;je++){for(var ze=b[je],yt=ze.units,Ot=yt.length,Ut=0,Qe=0;Qe<Ot;Qe++)Ut+=yt[Qe].data.length;Se+=Ut,le+=Ot,ze.length=Ut,ze.dts=Math.max(ze.dts,Y),ze.pts=Math.max(ze.pts,ze.dts,0),ce=Math.min(ze.pts,ce),be=Math.max(ze.pts,be)}Z=b[H-1].dts;var Bt=Se+4*le+8,ln;try{ln=new Uint8Array(Bt)}catch(Un){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:M.ErrorTypes.MUX_ERROR,details:M.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Bt,reason:"fail allocating video mdat "+Bt});return}var Ke=new DataView(ln.buffer);Ke.setUint32(0,Bt),ln.set(D.default.types.mdat,4);for(var He=0;He<H;He++){for(var ct=b[He],bt=ct.units,de=0,q=0,te=bt.length;q<te;q++){var se=bt[q],pe=se.data,ae=se.data.byteLength;Ke.setUint32(U,ae),U+=4,ln.set(pe,U),U+=ae,de+=4+ae}if(He<H-1)w=b[He+1].dts-ct.dts;else{var ie=this.config,me=ct.dts-b[He>0?He-1:He].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var _e=Math.floor(ie.maxBufferHole*g),Ee=(v?ce+v*g:this.nextAudioPts)-ct.pts;Ee>_e?(w=Ee-me,w<0&&(w=me),r.logger.log("[mp4-remuxer]: It is approximately "+Ee/90+" ms to the next segment; using duration "+w/90+" ms for the last video frame.")):w=me}else w=me}var Le=Math.round(ct.pts-ct.dts);N.push(new C(ct.key,w,de,Le))}if(N.length&&s&&s<70){var at=N[0].flags;at.dependsOn=2,at.isNonSync=0}console.assert(w!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=F=Z+w,this.isVideoContiguous=!0;var Ct=D.default.moof(E.sequenceNumber++,Y,p({},E,{samples:N})),Jt="video",lt={data1:Ct,data2:ln,startPTS:ce/g,endPTS:(be+w)/g,startDTS:Y/g,endDTS:F/g,type:Jt,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(ln.length,"MDAT length must not be zero"),lt},S.remuxAudio=function(E,f,h,v,g){var b=E.inputTimeScale,N=E.samplerate?E.samplerate:b,H=b/N,A=E.isAAC?c:a,F=A*H,U=this._initPTS,w=!E.isAAC&&this.typeSupported.mpeg,Y=[],Z=E.samples,ce=w?0:8,be=this.nextAudioPts||-1,Ze=f*b;if(this.isAudioContiguous=h=h||Z.length&&be>0&&(v&&Math.abs(Ze-be)<9e3||Math.abs(n(Z[0].pts-U,Ze)-be)<20*F),Z.forEach(function(pe){pe.pts=n(pe.pts-U,Ze)}),!h||be<0){if(Z=Z.filter(function(pe){return pe.pts>=0}),!Z.length)return;g===0?be=0:v?be=Math.max(0,Ze):be=Z[0].pts}if(E.isAAC)for(var Ce=g!==void 0,We=this.config.maxAudioFramesDrift,Ve=0,Ye=be;Ve<Z.length;Ve++){var we=Z[Ve],X=we.pts,j=X-Ye,W=Math.abs(1e3*j/b);if(j<=-We*F&&Ce)Ve===0&&(r.logger.warn("Audio frame @ "+(X/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*j/b)+" ms."),this.nextAudioPts=be=Ye=X);else if(j>=We*F&&W<m&&Ce){var Q=Math.round(j/F);Ye=X-Q*F,Ye<0&&(Q--,Ye+=F),Ve===0&&(this.nextAudioPts=be=Ye),r.logger.warn("[mp4-remuxer]: Injecting "+Q+" audio frame @ "+(Ye/b).toFixed(3)+"s due to "+Math.round(1e3*j/b)+" ms gap.");for(var re=0;re<Q;re++){var G=Math.max(Ye,0),xe=L.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);xe||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),xe=we.unit.subarray()),Z.splice(Ve,0,{unit:xe,pts:G}),Ye+=F,Ve++}}we.pts=Ye,Ye+=F}for(var Ie=null,tt=null,le,Se=0,je=Z.length;je--;)Se+=Z[je].unit.byteLength;for(var ze=0,yt=Z.length;ze<yt;ze++){var Ot=Z[ze],Ut=Ot.unit,Qe=Ot.pts;if(tt!==null){var Bt=Y[ze-1];Bt.duration=Math.round((Qe-tt)/H)}else if(h&&E.isAAC&&(Qe=be),Ie=Qe,Se>0){Se+=ce;try{le=new Uint8Array(Se)}catch(pe){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:M.ErrorTypes.MUX_ERROR,details:M.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Se,reason:"fail allocating audio mdat "+Se});return}if(!w){var ln=new DataView(le.buffer);ln.setUint32(0,Se),le.set(D.default.types.mdat,4)}}else return;le.set(Ut,ce);var Ke=Ut.byteLength;ce+=Ke,Y.push(new C(!0,A,Ke,0)),tt=Qe}var He=Y.length;if(!He)return;var ct=Y[Y.length-1];this.nextAudioPts=be=tt+H*ct.duration;var bt=w?new Uint8Array(0):D.default.moof(E.sequenceNumber++,Ie/H,p({},E,{samples:Y}));E.samples=[];var de=Ie/b,q=be/b,te="audio",se={data1:bt,data2:le,startPTS:de,endPTS:q,startDTS:de,endDTS:q,type:te,hasAudio:!0,hasVideo:!1,nb:He};return this.isAudioContiguous=!0,console.assert(le.length,"MDAT length must not be zero"),se},S.remuxEmptyAudio=function(E,f,h,v){var g=E.inputTimeScale,b=E.samplerate?E.samplerate:g,N=g/b,H=this.nextAudioPts,A=(H!==null?H:v.startDTS*g)+this._initDTS,F=v.endDTS*g+this._initDTS,U=N*c,w=Math.ceil((F-A)/U),Y=L.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!Y){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Z=[],ce=0;ce<w;ce++){var be=A+ce*U;Z.push({unit:Y,pts:be,dts:be})}return E.samples=Z,this.remuxAudio(E,f,h,!1)},S.remuxID3=function(E,f){var h=E.samples.length;if(!h)return;for(var v=E.inputTimeScale,g=this._initPTS,b=this._initDTS,N=0;N<h;N++){var H=E.samples[N];H.pts=n(H.pts-g,f*v)/v,H.dts=n(H.dts-b,f*v)/v}var A=E.samples;return E.samples=[],{samples:A}},S.remuxText=function(E,f){var h=E.samples.length;if(!h)return;for(var v=E.inputTimeScale,g=this._initPTS,b=0;b<h;b++){var N=E.samples[b];N.pts=n(N.pts-g,f*v)/v}E.samples.sort(function(A,F){return A.pts-F.pts});var H=E.samples;return E.samples=[],{samples:H}},R}();function n(R,S){var y;if(S===null)return R;for(S<R?y=-8589934592:y=8589934592;Math.abs(R-S)>4294967296;)R+=y;return R}function O(R){for(var S=0;S<R.length;S++)if(R[S].key)return S;return-1}var C=function(S,y,E,f){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=y,this.size=E,this.cts=f,this.flags=new T(S)},T=function(S){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=S?2:1,this.isNonSync=S?0:1}},"./src/remux/passthrough-remuxer.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/polyfills/number.ts"),L=I("./src/utils/mp4-tools.ts"),D=I("./src/loader/fragment.ts"),K=I("./src/utils/logger.ts"),M=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,s){this.audioCodec=a,this.videoCodec=s,this.generateInitSegment(c),this.emitInitSegment=!0},p.generateInitSegment=function(c){var a=this.audioCodec,s=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var d=this.initData=Object(L.parseInitSegment)(c);a||(a=P(d.audio,D.ElementaryStreamTypes.AUDIO)),s||(s=P(d.video,D.ElementaryStreamTypes.VIDEO));var l={};d.audio&&d.video?l.audiovideo={container:"video/mp4",codec:a+","+s,initSegment:c,id:"main"}:d.audio?l.audio={container:"audio/mp4",codec:a,initSegment:c,id:"audio"}:d.video?l.video={container:"video/mp4",codec:s,initSegment:c,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=l},p.remux=function(c,a,s,d,l){var i=this.initPTS,n=this.lastEndDTS,O={audio:void 0,video:void 0,text:d,id3:s,initSegment:void 0};Object(z.isFiniteNumber)(n)||(n=this.lastEndDTS=l||0);var C=a.samples;if(!C||!C.length)return O;var T={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(C),R=this.initData),!R||!R.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),O;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(z.isFiniteNumber)(i)||(this.initPTS=T.initPTS=i=r(R,C,n));var S=Object(L.getDuration)(C,R),y=n,E=S+y;Object(L.offsetStartDTS)(R,C,i),S>0?this.lastEndDTS=E:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var f=!!R.audio,h=!!R.video,v="";f&&(v+="audio"),h&&(v+="video");var g={data1:C,startPTS:y,startDTS:y,endPTS:E,endDTS:E,type:v,hasAudio:f,hasVideo:h,nb:1,dropped:0};return O.audio=g.type==="audio"?g:void 0,O.video=g.type!=="audio"?g:void 0,O.text=d,O.id3=s,O.initSegment=T,O},x}(),r=function(p,m,c){return Object(L.getStartDTS)(p,m)-c};function P(x,p){var m=x==null?void 0:x.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||p===D.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=M},"./src/task-loop.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return z});var z=function(){function L(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var D=L.prototype;return D.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},D.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},D.onHandlerDestroyed=function(){},D.hasInterval=function(){return!!this._tickInterval},D.hasNextTick=function(){return!!this._tickTimer},D.setInterval=function(M){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,M),!0)},D.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},D.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},D.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},D.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},D.doTick=function(){},L}()},"./src/types/cmcd.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"CMCDVersion",function(){return z}),I.d(V,"CMCDObjectType",function(){return L}),I.d(V,"CMCDStreamingFormat",function(){return D}),I.d(V,"CMCDStreamType",function(){return K});var z=1,L;(function(M){M.MANIFEST="m",M.AUDIO="a",M.VIDEO="v",M.MUXED="av",M.INIT="i",M.CAPTION="c",M.TIMED_TEXT="tt",M.KEY="k",M.OTHER="o"})(L||(L={}));var D;(function(M){M.DASH="d",M.HLS="h",M.SMOOTH="s",M.OTHER="o"})(D||(D={}));var K;(function(M){M.VOD="v",M.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"HlsSkip",function(){return D}),I.d(V,"getSkipValue",function(){return K}),I.d(V,"HlsUrlParameters",function(){return M}),I.d(V,"Level",function(){return r});function z(P,x){for(var p=0;p<x.length;p++){var m=x[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(P,m.key,m)}}function L(P,x,p){return x&&z(P.prototype,x),p&&z(P,p),P}var D;(function(P){P.No="",P.Yes="YES",P.v2="v2"})(D||(D={}));function K(P,x){var p=P.canSkipUntil,m=P.canSkipDateRanges,c=P.endSN,a=x!==void 0?x-c:0;return p&&a<p?m?D.v2:D.Yes:D.No}var M=function(){function P(p,m,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=m,this.skip=c}var x=P.prototype;return x.addDirectives=function(m){var c=new self.URL(m);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()},P}(),r=function(){function P(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 L(P,[{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 m=p%this.url.length;this._urlId!==m&&(this.details=void 0,this._urlId=m)}}]),P}()},"./src/types/loader.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"PlaylistContextType",function(){return z}),I.d(V,"PlaylistLevelType",function(){return L});var z;(function(D){D.MANIFEST="manifest",D.LEVEL="level",D.AUDIO_TRACK="audioTrack",D.SUBTITLE_TRACK="subtitleTrack"})(z||(z={}));var L;(function(D){D.MAIN="main",D.AUDIO="audio",D.SUBTITLE="subtitle"})(L||(L={}))},"./src/types/transmuxer.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"ChunkMetadata",function(){return z});var z=function(K,M,r,P,x,p){P===void 0&&(P=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=L(),this.buffering={audio:L(),video:L(),audiovideo:L()},this.level=K,this.sn=M,this.id=r,this.size=P,this.part=x,this.partial=p};function L(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"AttrList",function(){return D});var z=/^(\d+)x(\d+)$/,L=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,D=function(){function K(r){typeof r=="string"&&(r=K.parseAttrList(r));for(var P in r)r.hasOwnProperty(P)&&(this[P]=r[P])}var M=K.prototype;return M.decimalInteger=function(P){var x=parseInt(this[P],10);return x>Number.MAX_SAFE_INTEGER?Infinity:x},M.hexadecimalInteger=function(P){if(this[P]){var x=(this[P]||"0x").slice(2);x=(x.length&1?"0":"")+x;for(var p=new Uint8Array(x.length/2),m=0;m<x.length/2;m++)p[m]=parseInt(x.slice(m*2,m*2+2),16);return p}else return null},M.hexadecimalIntegerAsNumber=function(P){var x=parseInt(this[P],16);return x>Number.MAX_SAFE_INTEGER?Infinity:x},M.decimalFloatingPoint=function(P){return parseFloat(this[P])},M.optionalFloat=function(P,x){var p=this[P];return p?parseFloat(p):x},M.enumeratedString=function(P){return this[P]},M.bool=function(P){return this[P]==="YES"},M.decimalResolution=function(P){var x=z.exec(this[P]);return x===null?void 0:{width:parseInt(x[1],10),height:parseInt(x[2],10)}},K.parseAttrList=function(P){var x,p={},m='"';for(L.lastIndex=0;(x=L.exec(P))!==null;){var c=x[2];c.indexOf(m)===0&&c.lastIndexOf(m)===c.length-1&&(c=c.slice(1,-1)),p[x[1]]=c}return p},K}()},"./src/utils/binary-search.ts":function(ne,V,I){"use strict";I.r(V);var z={search:function(D,K){for(var M=0,r=D.length-1,P=null,x=null;M<=r;){P=(M+r)/2|0,x=D[P];var p=K(x);if(p>0)M=P+1;else if(p<0)r=P-1;else return x}return null}};V.default=z},"./src/utils/buffer-helper.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"BufferHelper",function(){return D});var z=I("./src/utils/logger.ts"),L={length:0,start:function(){return 0},end:function(){return 0}},D=function(){function K(){}return K.isBuffered=function(r,P){try{if(r){for(var x=K.getBuffered(r),p=0;p<x.length;p++)if(P>=x.start(p)&&P<=x.end(p))return!0}}catch(m){}return!1},K.bufferInfo=function(r,P,x){try{if(r){var p=K.getBuffered(r),m=[],c;for(c=0;c<p.length;c++)m.push({start:p.start(c),end:p.end(c)});return this.bufferedInfo(m,P,x)}}catch(a){}return{len:0,start:P,end:P,nextStart:void 0}},K.bufferedInfo=function(r,P,x){P=Math.max(0,P),r.sort(function(T,R){var S=T.start-R.start;return S||R.end-T.end});var p=[];if(x)for(var m=0;m<r.length;m++){var c=p.length;if(c){var a=p[c-1].end;r[m].start-a<x?r[m].end>a&&(p[c-1].end=r[m].end):p.push(r[m])}else p.push(r[m])}else p=r;for(var s=0,d,l=P,i=P,n=0;n<p.length;n++){var O=p[n].start,C=p[n].end;if(P+x>=O&&P<C)l=O,i=C,s=i-P;else if(P+x<O){d=O;break}}return{len:s,start:l||0,end:i||0,nextStart:d}},K.getBuffered=function(r){try{return r.buffered}catch(P){return z.logger.log("failed to get media.buffered",P),L}},K}()},"./src/utils/cea-608-parser.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"Row",function(){return i}),I.d(V,"CaptionScreen",function(){return n});var z=I("./src/utils/logger.ts"),L={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},D=function(E){var f=E;return L.hasOwnProperty(E)&&(f=L[E]),String.fromCharCode(f)},K=15,M=100,r={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},P={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},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c;(function(y){y[y.ERROR=0]="ERROR",y[y.TEXT=1]="TEXT",y[y.WARNING=2]="WARNING",y[y.INFO=2]="INFO",y[y.DEBUG=3]="DEBUG",y[y.DATA=3]="DATA"})(c||(c={}));var a=function(){function y(){this.time=null,this.verboseLevel=c.ERROR}var E=y.prototype;return E.log=function(h,v){this.verboseLevel>=h&&z.logger.log(this.time+" ["+h+"] "+v)},y}(),s=function(E){for(var f=[],h=0;h<E.length;h++)f.push(E[h].toString(16));return f},d=function(){function y(f,h,v,g,b){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=h||!1,this.italics=v||!1,this.background=g||"black",this.flash=b||!1}var E=y.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(h){for(var v=["foreground","underline","italics","background","flash"],g=0;g<v.length;g++){var b=v[g];h.hasOwnProperty(b)&&(this[b]=h[b])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(h){return this.foreground===h.foreground&&this.underline===h.underline&&this.italics===h.italics&&this.background===h.background&&this.flash===h.flash},E.copy=function(h){this.foreground=h.foreground,this.underline=h.underline,this.italics=h.italics,this.background=h.background,this.flash=h.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},y}(),l=function(){function y(f,h,v,g,b,N){this.uchar=void 0,this.penState=void 0,this.uchar=f||" ",this.penState=new d(h,v,g,b,N)}var E=y.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(h,v){this.uchar=h,this.penState.copy(v)},E.setPenState=function(h){this.penState.copy(h)},E.equals=function(h){return this.uchar===h.uchar&&this.penState.equals(h.penState)},E.copy=function(h){this.uchar=h.uchar,this.penState.copy(h.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},y}(),i=function(){function y(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 h=0;h<M;h++)this.chars.push(new l);this.logger=f,this.pos=0,this.currPenState=new d}var E=y.prototype;return E.equals=function(h){for(var v=!0,g=0;g<M;g++)if(!this.chars[g].equals(h.chars[g])){v=!1;break}return v},E.copy=function(h){for(var v=0;v<M;v++)this.chars[v].copy(h.chars[v])},E.isEmpty=function(){for(var h=!0,v=0;v<M;v++)if(!this.chars[v].isEmpty()){h=!1;break}return h},E.setCursor=function(h){this.pos!==h&&(this.pos=h),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>M&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=M)},E.moveCursor=function(h){var v=this.pos+h;if(h>1)for(var g=this.pos+1;g<v+1;g++)this.chars[g].setPenState(this.currPenState);this.setCursor(v)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(h){h>=144&&this.backSpace();var v=D(h);if(this.pos>=M){this.logger.log(c.ERROR,"Cannot insert "+h.toString(16)+" ("+v+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(v,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(h){var v;for(v=h;v<M;v++)this.chars[v].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var h=[],v=!0,g=0;g<M;g++){var b=this.chars[g].uchar;b!==" "&&(v=!1),h.push(b)}return v?"":h.join("")},E.setPenStyles=function(h){this.currPenState.setStyles(h);var v=this.chars[this.pos];v.setPenState(this.currPenState)},y}(),n=function(){function y(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 h=0;h<K;h++)this.rows.push(new i(f));this.logger=f,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=y.prototype;return E.reset=function(){for(var h=0;h<K;h++)this.rows[h].clear();this.currRow=K-1},E.equals=function(h){for(var v=!0,g=0;g<K;g++)if(!this.rows[g].equals(h.rows[g])){v=!1;break}return v},E.copy=function(h){for(var v=0;v<K;v++)this.rows[v].copy(h.rows[v])},E.isEmpty=function(){for(var h=!0,v=0;v<K;v++)if(!this.rows[v].isEmpty()){h=!1;break}return h},E.backSpace=function(){var h=this.rows[this.currRow];h.backSpace()},E.clearToEndOfRow=function(){var h=this.rows[this.currRow];h.clearToEndOfRow()},E.insertChar=function(h){var v=this.rows[this.currRow];v.insertChar(h)},E.setPen=function(h){var v=this.rows[this.currRow];v.setPenStyles(h)},E.moveCursor=function(h){var v=this.rows[this.currRow];v.moveCursor(h)},E.setCursor=function(h){this.logger.log(c.INFO,"setCursor: "+h);var v=this.rows[this.currRow];v.setCursor(h)},E.setPAC=function(h){this.logger.log(c.INFO,"pacData = "+JSON.stringify(h));var v=h.row-1;if(this.nrRollUpRows&&v<this.nrRollUpRows-1&&(v=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==v){for(var g=0;g<K;g++)this.rows[g].clear();var b=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var H=N.rows[b].cueStartTime,A=this.logger.time;if(H&&A!==null&&H<A)for(var F=0;F<this.nrRollUpRows;F++)this.rows[v-this.nrRollUpRows+F+1].copy(N.rows[b+F])}}this.currRow=v;var U=this.rows[this.currRow];if(h.indent!==null){var w=h.indent,Y=Math.max(w-1,0);U.setCursor(h.indent),h.color=U.chars[Y].penState.foreground}var Z={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen(Z)},E.setBkgData=function(h){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(h)),this.backSpace(),this.setPen(h),this.insertChar(32)},E.setRollUpRows=function(h){this.nrRollUpRows=h},E.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 h=this.currRow+1-this.nrRollUpRows,v=this.rows.splice(h,1)[0];v.clear(),this.rows.splice(this.currRow,0,v),this.logger.log(c.INFO,"Rolling up")},E.getDisplayText=function(h){h=h||!1;for(var v=[],g="",b=-1,N=0;N<K;N++){var H=this.rows[N].getTextString();H&&(b=N+1,h?v.push("Row "+b+": '"+H+"'"):v.push(H.trim()))}return v.length>0&&(h?g="["+v.join(" | ")+"]":g=v.join(`
|
|
`)),g},E.getTextAndFormat=function(){return this.rows},y}(),O=function(){function y(f,h,v){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=h,this.mode=null,this.verbose=0,this.displayedMemory=new n(v),this.nonDisplayedMemory=new n(v),this.lastOutputScreen=new n(v),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=v}var E=y.prototype;return E.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(h){this.outputFilter=h},E.setPAC=function(h){this.writeScreen.setPAC(h)},E.setBkgData=function(h){this.writeScreen.setBkgData(h)},E.setMode=function(h){if(h===this.mode)return;this.mode=h,this.logger.log(c.INFO,"MODE="+h),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=h},E.insertChars=function(h){for(var v=0;v<h.length;v++)this.writeScreen.insertChar(h[v]);var g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,g+": "+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())},E.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},E.ccAOF=function(){},E.ccAON=function(){},E.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.ccRU=function(h){this.logger.log(c.INFO,"RU("+h+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(h)},E.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var h=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=h,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},E.ccTO=function(h){this.logger.log(c.INFO,"TO("+h+") - Tab Offset"),this.writeScreen.moveCursor(h)},E.ccMIDROW=function(h){var v={flash:!1};if(v.underline=h%2===1,v.italics=h>=46,v.italics)v.foreground="white";else{var g=Math.floor(h/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];v.foreground=b[g]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(v)),this.writeScreen.setPen(v)},E.outputDataUpdate=function(h){h===void 0&&(h=!1);var v=this.logger.time;if(v===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=v:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,v,this.lastOutputScreen),h&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:v),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(h){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,h,this.displayedMemory),this.cueStartTime=h))},y}(),C=function(){function y(f,h,v){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new a;this.channels=[null,new O(f,h,g),new O(f+1,v,g)],this.cmdHistory=S(),this.logger=g}var E=y.prototype;return E.getHandler=function(h){return this.channels[h].getHandler()},E.setHandler=function(h,v){this.channels[h].setHandler(v)},E.addData=function(h,v){var g,b,N,H=!1;this.logger.time=h;for(var A=0;A<v.length;A+=2){if(b=v[A]&127,N=v[A+1]&127,b===0&&N===0)continue;if(this.logger.log(c.DATA,"["+s([v[A],v[A+1]])+"] -> ("+s([b,N])+")"),g=this.parseCmd(b,N),g||(g=this.parseMidrow(b,N)),g||(g=this.parsePAC(b,N)),g||(g=this.parseBackgroundAttributes(b,N)),!g&&(H=this.parseChars(b,N),H)){var F=this.currentChannel;if(F&&F>0){var U=this.channels[F];U.insertChars(H)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!H&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+s([b,N])+" orig: "+s([v[A],v[A+1]]))}},E.parseCmd=function(h,v){var g=this.cmdHistory,b=(h===20||h===28||h===21||h===29)&&v>=32&&v<=47,N=(h===23||h===31)&&v>=33&&v<=35;if(!(b||N))return!1;if(R(h,v,g))return T(null,null,g),this.logger.log(c.DEBUG,"Repeated command ("+s([h,v])+") is dropped"),!0;var H=h===20||h===21||h===23?1:2,A=this.channels[H];return h===20||h===21||h===28||h===29?v===32?A.ccRCL():v===33?A.ccBS():v===34?A.ccAOF():v===35?A.ccAON():v===36?A.ccDER():v===37?A.ccRU(2):v===38?A.ccRU(3):v===39?A.ccRU(4):v===40?A.ccFON():v===41?A.ccRDC():v===42?A.ccTR():v===43?A.ccRTD():v===44?A.ccEDM():v===45?A.ccCR():v===46?A.ccENM():v===47&&A.ccEOC():A.ccTO(v-32),T(h,v,g),this.currentChannel=H,!0},E.parseMidrow=function(h,v){var g=0;if((h===17||h===25)&&v>=32&&v<=47){if(h===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[g];return b?(b.ccMIDROW(v),this.logger.log(c.DEBUG,"MIDROW ("+s([h,v])+")"),!0):!1}return!1},E.parsePAC=function(h,v){var g,b=this.cmdHistory,N=(h>=17&&h<=23||h>=25&&h<=31)&&v>=64&&v<=127,H=(h===16||h===24)&&v>=64&&v<=95;if(!(N||H))return!1;if(R(h,v,b))return T(null,null,b),!0;var A=h<=23?1:2;v>=64&&v<=95?g=A===1?r[h]:x[h]:g=A===1?P[h]:p[h];var F=this.channels[A];return F?(F.setPAC(this.interpretPAC(g,v)),T(h,v,b),this.currentChannel=A,!0):!1},E.interpretPAC=function(h,v){var g,b={color:null,italics:!1,indent:null,underline:!1,row:h};return v>95?g=v-96:g=v-64,b.underline=(g&1)===1,g<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((g-16)/2)*4,b},E.parseChars=function(h,v){var g,b=null,N=null;if(h>=25?(g=2,N=h-8):(g=1,N=h),N>=17&&N<=19){var H;N===17?H=v+80:N===18?H=v+112:H=v+144,this.logger.log(c.INFO,"Special char '"+D(H)+"' in channel "+g),b=[H]}else h>=32&&h<=127&&(b=v===0?[h]:[h,v]);if(b){var A=s(b);this.logger.log(c.DEBUG,"Char codes = "+A.join(",")),T(h,v,this.cmdHistory)}return b},E.parseBackgroundAttributes=function(h,v){var g=(h===16||h===24)&&v>=32&&v<=47,b=(h===23||h===31)&&v>=45&&v<=47;if(!(g||b))return!1;var N,H={};h===16||h===24?(N=Math.floor((v-32)/2),H.background=m[N],v%2===1&&(H.background=H.background+"_semi")):v===45?H.background="transparent":(H.foreground="black",v===47&&(H.underline=!0));var A=h<=23?1:2,F=this.channels[A];return F.setBkgData(H),T(h,v,this.cmdHistory),!0},E.reset=function(){for(var h=0;h<Object.keys(this.channels).length;h++){var v=this.channels[h];v&&v.reset()}this.cmdHistory=S()},E.cueSplitAtTime=function(h){for(var v=0;v<this.channels.length;v++){var g=this.channels[v];g&&g.cueSplitAtTime(h)}},y}();function T(y,E,f){f.a=y,f.b=E}function R(y,E,f){return f.a===y&&f.b===E}function S(){return{a:null,b:null}}V.default=C},"./src/utils/codecs.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"isCodecType",function(){return L}),I.d(V,"isCodecSupportedInMp4",function(){return D});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 L(K,M){var r=z[M];return!!r&&r[K.slice(0,4)]===!0}function D(K,M){return MediaSource.isTypeSupported((M||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/utils/vttparser.ts"),L=I("./src/utils/webvtt-parser.ts"),D=I("./src/utils/texttrack-utils.ts"),K=/\s/,M={newCue:function(P,x,p,m){for(var c=[],a,s,d,l,i,n=self.VTTCue||self.TextTrackCue,O=0;O<m.rows.length;O++)if(a=m.rows[O],d=!0,l=0,i="",!a.isEmpty()){for(var C=0;C<a.chars.length;C++)K.test(a.chars[C].uchar)&&d?l++:(i+=a.chars[C].uchar,d=!1);a.cueStartTime=x,x===p&&(p+=1e-4),l>=16?l--:l++;var T=Object(z.fixLineBreaks)(i.trim()),R=Object(L.generateCueId)(x,p,T);(!P||!P.cues||!P.cues.getCueById(R))&&(s=new n(x,p,T),s.id=R,s.line=O+1,s.align="left",s.position=10+Math.min(80,Math.floor(l*8/32)*10),c.push(s))}return P&&c.length&&(c.sort(function(S,y){return S.line==="auto"||y.line==="auto"?0:S.line>8&&y.line>8?y.line-S.line:S.line-y.line}),c.forEach(function(S){return Object(D.addCueToTrack)(P,S)})),c}};V.default=M},"./src/utils/discontinuities.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"findFirstFragWithCC",function(){return K}),I.d(V,"shouldAlignOnDiscontinuities",function(){return M}),I.d(V,"findDiscontinuousReferenceFrag",function(){return r}),I.d(V,"adjustSlidingStart",function(){return x}),I.d(V,"alignStream",function(){return p}),I.d(V,"alignPDT",function(){return c}),I.d(V,"alignFragmentByPDTDelta",function(){return a}),I.d(V,"alignMediaPlaylistByPDT",function(){return s});var z=I("./src/polyfills/number.ts"),L=I("./src/utils/logger.ts"),D=I("./src/controller/level-helper.ts");function K(d,l){for(var i=null,n=0,O=d.length;n<O;n++){var C=d[n];if(C&&C.cc===l){i=C;break}}return i}function M(d,l,i){return!!(l.details&&(i.endCC>i.startCC||d&&d.cc<i.startCC))}function r(d,l){var i=d.fragments,n=l.fragments;if(!n.length||!i.length){L.logger.log("No fragments to align");return}var O=K(i,n[0].cc);if(!O||O&&!O.startPTS){L.logger.log("No frag in previous level to align on");return}return O}function P(d,l){if(d){var i=d.start+l;d.start=d.startPTS=i,d.endPTS=i+d.duration}}function x(d,l){for(var i=l.fragments,n=0,O=i.length;n<O;n++)P(i[n],d);l.fragmentHint&&P(l.fragmentHint,d),l.alignedSliding=!0}function p(d,l,i){if(!l)return;m(d,i,l),!i.alignedSliding&&l.details&&c(i,l.details),!i.alignedSliding&&l.details&&!i.skippedSegments&&Object(D.adjustSliding)(l.details,i)}function m(d,l,i){if(M(d,i,l)){var n=r(i.details,l);n&&Object(z.isFiniteNumber)(n.start)&&(L.logger.log("Adjusting PTS using last level due to CC increase within current level "+l.url),x(n.start,l))}}function c(d,l){if(!l.fragments.length||!d.hasProgramDateTime||!l.hasProgramDateTime)return;var i=l.fragments[0].programDateTime,n=d.fragments[0].programDateTime,O=(n-i)/1e3+l.fragments[0].start;O&&Object(z.isFiniteNumber)(O)&&(L.logger.log("Adjusting PTS using programDateTime delta "+(n-i)+"ms, sliding:"+O.toFixed(3)+" "+d.url+" "),x(O,d))}function a(d,l){var i=d.programDateTime;if(!i)return;var n=(i-l)/1e3;d.start=d.startPTS=n,d.endPTS=n+d.duration}function s(d,l){if(!l.fragments.length||!d.hasProgramDateTime||!l.hasProgramDateTime)return;var i=l.fragments[0].programDateTime,n=l.fragments[0].start,O=i-n*1e3;d.fragments.forEach(function(C){a(C,O)}),d.fragmentHint&&a(d.fragmentHint,O),d.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/utils/ewma.ts"),L=function(){function D(M,r,P){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=P,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new z.default(M),this.fast_=new z.default(r)}var K=D.prototype;return K.update=function(r,P){var x=this.slow_,p=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new z.default(r,x.getEstimate(),x.getTotalWeight())),this.fast_.halfLife!==P&&(this.fast_=new z.default(P,p.getEstimate(),p.getTotalWeight()))},K.sample=function(r,P){r=Math.max(r,this.minDelayMs_);var x=8*P,p=r/1e3,m=x/p;this.fast_.sample(p,m),this.slow_.sample(p,m)},K.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},D}();V.default=L},"./src/utils/ewma.ts":function(ne,V,I){"use strict";I.r(V);var z=function(){function L(K,M,r){M===void 0&&(M=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=M,this.totalWeight_=r}var D=L.prototype;return D.sample=function(M,r){var P=Math.pow(this.alpha_,M);this.estimate_=r*(1-P)+P*this.estimate_,this.totalWeight_+=M},D.getTotalWeight=function(){return this.totalWeight_},D.getEstimate=function(){if(this.alpha_){var M=1-Math.pow(this.alpha_,this.totalWeight_);if(M)return this.estimate_/M}return this.estimate_},L}();V.default=z},"./src/utils/fetch-loader.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"fetchSupported",function(){return a});var z=I("./src/polyfills/number.ts"),L=I("./src/loader/load-stats.ts"),D=I("./src/demux/chunk-cache.ts");function K(n,O){n.prototype=Object.create(O.prototype),n.prototype.constructor=n,p(n,O)}function M(n){var O=typeof Map=="function"?new Map:void 0;return M=function(T){if(T===null||!x(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O!="undefined"){if(O.has(T))return O.get(T);O.set(T,R)}function R(){return r(T,arguments,m(this).constructor)}return R.prototype=Object.create(T.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),p(R,T)},M(n)}function r(n,O,C){return P()?r=Reflect.construct:r=function(R,S,y){var E=[null];E.push.apply(E,S);var f=Function.bind.apply(R,E),h=new f;return y&&p(h,y.prototype),h},r.apply(null,arguments)}function P(){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(n){return!1}}function x(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function p(n,O){return p=Object.setPrototypeOf||function(T,R){return T.__proto__=R,T},p(n,O)}function m(n){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},m(n)}function c(){return c=Object.assign||function(n){for(var O=1;O<arguments.length;O++){var C=arguments[O];for(var T in C)Object.prototype.hasOwnProperty.call(C,T)&&(n[T]=C[T])}return n},c.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(n){}return!1}var s=function(){function n(C){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=C.fetchSetup||l,this.controller=new self.AbortController,this.stats=new L.LoadStats}var O=n.prototype;return O.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},O.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},O.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},O.load=function(T,R,S){var y=this,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var f=d(T,this.controller.signal),h=S.onProgress,v=T.responseType==="arraybuffer",g=v?"byteLength":"length";this.context=T,this.config=R,this.callbacks=S,this.request=this.fetchSetup(T,f),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){y.abortInternal(),S.onTimeout(E,T,y.response)},R.timeout),self.fetch(this.request).then(function(b){if(y.response=y.loader=b,!b.ok){var N=b.status,H=b.statusText;throw new i(H||"fetch, bad network response",N,b)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(b.headers.get("Content-Length")||"0"),h&&Object(z.isFiniteNumber)(R.highWaterMark)?y.loadProgressively(b,E,T,R.highWaterMark,h):v?b.arrayBuffer():b.text()}).then(function(b){var N=y.response;self.clearTimeout(y.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=b[g];var H={url:N.url,data:b};h&&!Object(z.isFiniteNumber)(R.highWaterMark)&&h(E,T,b,N),S.onSuccess(H,E,T,N)}).catch(function(b){if(self.clearTimeout(y.requestTimeout),E.aborted)return;var N=b.code||0;S.onError({code:N,text:b.message},T,b.details)})},O.getCacheAge=function(){var T=null;if(this.response){var R=this.response.headers.get("age");T=R?parseFloat(R):null}return T},O.loadProgressively=function(T,R,S,y,E){y===void 0&&(y=0);var f=new D.default,h=T.body.getReader(),v=function g(){return h.read().then(function(b){if(b.done)return f.dataLength&&E(R,S,f.flush(),T),Promise.resolve(new ArrayBuffer(0));var N=b.value,H=N.length;return R.loaded+=H,H<y||f.dataLength?(f.push(N),f.dataLength>=y&&E(R,S,f.flush(),T)):E(R,S,N,T),g()}).catch(function(){return Promise.reject()})};return v()},n}();function d(n,O){var C={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(c({},n.headers))};return n.rangeEnd&&C.headers.set("Range","bytes="+n.rangeStart+"-"+String(n.rangeEnd-1)),C}function l(n,O){return new self.Request(n.url,O)}var i=function(n){K(O,n);function O(C,T,R){var S;return S=n.call(this,C)||this,S.code=void 0,S.details=void 0,S.code=T,S.details=R,S}return O}(M(Error));V.default=s},"./src/utils/imsc1-ttml-parser.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"IMSC1_CODEC",function(){return x}),I.d(V,"parseIMSC1",function(){return a});var z=I("./src/utils/mp4-tools.ts"),L=I("./src/utils/vttparser.ts"),D=I("./src/utils/vttcue.ts"),K=I("./src/demux/id3.ts"),M=I("./src/utils/timescale-conversion.ts"),r=I("./src/utils/webvtt-parser.ts");function P(){return P=Object.assign||function(y){for(var E=1;E<arguments.length;E++){var f=arguments[E];for(var h in f)Object.prototype.hasOwnProperty.call(f,h)&&(y[h]=f[h])}return y},P.apply(this,arguments)}var x="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(y,E,f,h,v){var g=Object(z.findBox)(new Uint8Array(y),["mdat"]);if(g.length===0){v(new Error("Could not parse IMSC1 mdat"));return}var b=g[0],N=Object(K.utf8ArrayToStr)(new Uint8Array(y,b.start,b.end-b.start)),H=Object(M.toTimescaleFromScale)(E,1,f);try{h(s(N,H))}catch(A){v(A)}}function s(y,E){var f=new DOMParser,h=f.parseFromString(y,"text/xml"),v=h.getElementsByTagName("tt")[0];if(!v)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(g).reduce(function(U,w){return U[w]=v.getAttribute("ttp:"+w)||g[w],U},{}),N=v.getAttribute("xml:space")!=="preserve",H=l(d(v,"styling","style")),A=l(d(v,"layout","region")),F=d(v,"body","[begin]");return[].map.call(F,function(U){var w=i(U,N);if(!w||!U.hasAttribute("begin"))return null;var Y=T(U.getAttribute("begin"),b),Z=T(U.getAttribute("dur"),b),ce=T(U.getAttribute("end"),b);if(Y===null)throw C(U);if(ce===null){if(Z===null)throw C(U);ce=Y+Z}var be=new D.default(Y-E,ce-E,w);be.id=Object(r.generateCueId)(be.startTime,be.endTime,be.text);var Ze=A[U.getAttribute("region")],Ce=H[U.getAttribute("style")];be.position=10,be.size=80;var We=n(Ze,Ce),Ve=We.textAlign;if(Ve){var Ye=c[Ve];Ye&&(be.lineAlign=Ye),be.align=Ve}return P(be,We),be}).filter(function(U){return U!==null})}function d(y,E,f){var h=y.getElementsByTagName(E)[0];return h?[].slice.call(h.querySelectorAll(f)):[]}function l(y){return y.reduce(function(E,f){var h=f.getAttribute("xml:id");return h&&(E[h]=f),E},{})}function i(y,E){return[].slice.call(y.childNodes).reduce(function(f,h,v){var g;return h.nodeName==="br"&&v?f+`
|
|
`:(g=h.childNodes)!==null&&g!==void 0&&g.length?i(h,E):E?f+h.textContent.trim().replace(/\s+/g," "):f+h.textContent},"")}function n(y,E){var f="http://www.w3.org/ns/ttml#styling",h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return h.reduce(function(v,g){var b=O(E,f,g)||O(y,f,g);return b&&(v[g]=b),v},{})}function O(y,E,f){return y.hasAttributeNS(E,f)?y.getAttributeNS(E,f):null}function C(y){return new Error("Could not parse ttml timestamp "+y)}function T(y,E){if(!y)return null;var f=Object(L.parseTimeStamp)(y);return f===null&&(p.test(y)?f=R(y,E):m.test(y)&&(f=S(y,E))),f}function R(y,E){var f=p.exec(y),h=(f[4]|0)+(f[5]|0)/E.subFrameRate;return(f[1]|0)*3600+(f[2]|0)*60+(f[3]|0)+h/E.frameRate}function S(y,E){var f=m.exec(y),h=Number(f[1]),v=f[2];switch(v){case"h":return h*3600;case"m":return h*60;case"ms":return h*1e3;case"f":return h/E.frameRate;case"t":return h/E.tickRate}return h}},"./src/utils/logger.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"enableLogs",function(){return r}),I.d(V,"logger",function(){return P});var z=function(){},L={trace:z,debug:z,log:z,warn:z,info:z,error:z},D=L;function K(x){var p=self.console[x];return p?p.bind(self.console,"["+x+"] >"):z}function M(x){for(var p=arguments.length,m=new Array(p>1?p-1:0),c=1;c<p;c++)m[c-1]=arguments[c];m.forEach(function(a){D[a]=x[a]?x[a].bind(x):K(a)})}function r(x){if(self.console&&x===!0||typeof x=="object"){M(x,"debug","log","info","warn","error");try{D.log()}catch(p){D=L}}else D=L}var P=D},"./src/utils/mediakeys-helper.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"KeySystems",function(){return z}),I.d(V,"requestMediaKeySystemAccess",function(){return L});var z;(function(D){D.WIDEVINE="com.widevine.alpha",D.PLAYREADY="com.microsoft.playready"})(z||(z={}));var L=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"getMediaSource",function(){return z});function z(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"bin2str",function(){return M}),I.d(V,"readUint16",function(){return r}),I.d(V,"readUint32",function(){return P}),I.d(V,"writeUint32",function(){return x}),I.d(V,"findBox",function(){return p}),I.d(V,"parseSegmentIndex",function(){return m}),I.d(V,"parseInitSegment",function(){return c}),I.d(V,"getStartDTS",function(){return a}),I.d(V,"getDuration",function(){return s}),I.d(V,"computeRawDurationFromSamples",function(){return d}),I.d(V,"offsetStartDTS",function(){return l}),I.d(V,"segmentValidRange",function(){return i}),I.d(V,"appendUint8Array",function(){return n});var z=I("./src/utils/typed-array.ts"),L=I("./src/loader/fragment.ts"),D=Math.pow(2,32)-1,K=[].push;function M(O){return String.fromCharCode.apply(null,O)}function r(O,C){"data"in O&&(C+=O.start,O=O.data);var T=O[C]<<8|O[C+1];return T<0?65536+T:T}function P(O,C){"data"in O&&(C+=O.start,O=O.data);var T=O[C]<<24|O[C+1]<<16|O[C+2]<<8|O[C+3];return T<0?4294967296+T:T}function x(O,C,T){"data"in O&&(C+=O.start,O=O.data),O[C]=T>>24,O[C+1]=T>>16&255,O[C+2]=T>>8&255,O[C+3]=T&255}function p(O,C){var T=[];if(!C.length)return T;var R,S,y;"data"in O?(R=O.data,S=O.start,y=O.end):(R=O,S=0,y=R.byteLength);for(var E=S;E<y;){var f=P(R,E),h=M(R.subarray(E+4,E+8)),v=f>1?E+f:y;if(h===C[0])if(C.length===1)T.push({data:R,start:E+8,end:v});else{var g=p({data:R,start:E+8,end:v},C.slice(1));g.length&&K.apply(T,g)}E=v}return T}function m(O){var C=p(O,["moov"]),T=C[0],R=T?T.end:null,S=p(O,["sidx"]);if(!S||!S[0])return null;var y=[],E=S[0],f=E.data[0],h=f===0?8:16,v=P(E,h);h+=4;var g=0,b=0;f===0?h+=8:h+=16,h+=2;var N=E.end+b,H=r(E,h);h+=2;for(var A=0;A<H;A++){var F=h,U=P(E,F);F+=4;var w=U&2147483647,Y=(U&2147483648)>>>31;if(Y===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Z=P(E,F);F+=4,y.push({referenceSize:w,subsegmentDuration:Z,info:{duration:Z/v,start:N,end:N+w-1}}),N+=w,F+=4,h=F}return{earliestPresentationTime:g,timescale:v,version:f,referencesCount:H,references:y,moovEndOffset:R}}function c(O){for(var C=[],T=p(O,["moov","trak"]),R=0;R<T.length;R++){var S=T[R],y=p(S,["tkhd"])[0];if(y){var E=y.data[y.start],f=E===0?12:20,h=P(y,f),v=p(S,["mdia","mdhd"])[0];if(v){E=v.data[v.start],f=E===0?12:20;var g=P(v,f),b=p(S,["mdia","hdlr"])[0];if(b){var N=M(b.data.subarray(b.start+8,b.start+12)),H={soun:L.ElementaryStreamTypes.AUDIO,vide:L.ElementaryStreamTypes.VIDEO}[N];if(H){var A=p(S,["mdia","minf","stbl","stsd"])[0],F=void 0;A&&(F=M(A.data.subarray(A.start+12,A.start+16))),C[h]={timescale:g,type:H},C[H]={timescale:g,id:h,codec:F}}}}}}var U=p(O,["moov","mvex","trex"]);return U.forEach(function(w){var Y=P(w,4),Z=C[Y];Z&&(Z.default={duration:P(w,12),flags:P(w,20)})}),C}function a(O,C){return p(C,["moof","traf"]).reduce(function(T,R){var S=p(R,["tfdt"])[0],y=S.data[S.start],E=p(R,["tfhd"]).reduce(function(f,h){var v=P(h,4),g=O[v];if(g){var b=P(S,4);y===1&&(b*=Math.pow(2,32),b+=P(S,8));var N=g.timescale||9e4,H=b/N;if(isFinite(H)&&(f===null||H<f))return H}return f},null);return E!==null&&isFinite(E)&&(T===null||E<T)?E:T},null)||0}function s(O,C){for(var T=0,R=0,S=0,y=p(O,["moof","traf"]),E=0;E<y.length;E++){var f=y[E],h=p(f,["tfhd"])[0],v=P(h,4),g=C[v];if(!g)continue;var b=g.default,N=P(h,0)|(b==null?void 0:b.flags),H=b==null?void 0:b.duration;N&8&&(N&2?H=P(h,12):H=P(h,8));for(var A=g.timescale||9e4,F=p(f,["trun"]),U=0;U<F.length;U++){if(H){var w=P(F[U],4);T=H*w}else T=d(F[U]);g.type===L.ElementaryStreamTypes.VIDEO?R+=T/A:g.type===L.ElementaryStreamTypes.AUDIO&&(S+=T/A)}}if(R===0&&S===0){var Y=m(O);if(Y!=null&&Y.references)return Y.references.reduce(function(Z,ce){return Z+ce.info.duration||0},0)}return R||S}function d(O){var C=P(O,0),T=8;C&1&&(T+=4),C&4&&(T+=4);for(var R=0,S=P(O,4),y=0;y<S;y++){if(C&256){var E=P(O,T);R+=E,T+=4}C&512&&(T+=4),C&1024&&(T+=4),C&2048&&(T+=4)}return R}function l(O,C,T){p(C,["moof","traf"]).forEach(function(R){p(R,["tfhd"]).forEach(function(S){var y=P(S,4),E=O[y];if(!E)return;var f=E.timescale||9e4;p(R,["tfdt"]).forEach(function(h){var v=h.data[h.start],g=P(h,4);if(v===0)x(h,4,g-T*f);else{g*=Math.pow(2,32),g+=P(h,8),g-=T*f,g=Math.max(g,0);var b=Math.floor(g/(D+1)),N=Math.floor(g%(D+1));x(h,4,b),x(h,8,N)}})})})}function i(O){var C={valid:null,remainder:null},T=p(O,["moof"]);if(T){if(T.length<2)return C.remainder=O,C}else return C;var R=T[T.length-1];return C.valid=Object(z.sliceUint8)(O,0,R.start-8),C.remainder=Object(z.sliceUint8)(O,R.start-8),C}function n(O,C){var T=new Uint8Array(O.length+C.length);return T.set(O),T.set(C,O.length),T}},"./src/utils/output-filter.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"default",function(){return z});var z=function(){function L(K,M){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=M}var D=L.prototype;return D.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},D.newCue=function(M,r,P){(this.startTime===null||this.startTime>M)&&(this.startTime=M),this.endTime=r,this.screen=P,this.timelineController.createCaptionsTrack(this.trackName)},D.reset=function(){this.cueRanges=[]},L}()},"./src/utils/texttrack-utils.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"sendAddTrackEvent",function(){return L}),I.d(V,"addCueToTrack",function(){return D}),I.d(V,"clearCurrentCues",function(){return K}),I.d(V,"removeCuesInRange",function(){return M}),I.d(V,"getCuesInRange",function(){return P});var z=I("./src/utils/logger.ts");function L(x,p){var m;try{m=new Event("addtrack")}catch(c){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=x,p.dispatchEvent(m)}function D(x,p){var m=x.mode;if(m==="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)}m==="disabled"&&(x.mode=m)}function K(x){var p=x.mode;if(p==="disabled"&&(x.mode="hidden"),x.cues)for(var m=x.cues.length;m--;)x.removeCue(x.cues[m]);p==="disabled"&&(x.mode=p)}function M(x,p,m){var c=x.mode;if(c==="disabled"&&(x.mode="hidden"),x.cues&&x.cues.length>0)for(var a=P(x.cues,p,m),s=0;s<a.length;s++)x.removeCue(a[s]);c==="disabled"&&(x.mode=c)}function r(x,p){if(p<x[0].startTime)return 0;var m=x.length-1;if(p>x[m].endTime)return-1;for(var c=0,a=m;c<=a;){var s=Math.floor((a+c)/2);if(p<x[s].startTime)a=s-1;else if(p>x[s].startTime&&c<m)c=s+1;else return s}return x[c].startTime-p<p-x[a].startTime?c:a}function P(x,p,m){var c=[],a=r(x,p);if(a>-1)for(var s=a,d=x.length;s<d;s++){var l=x[s];if(l.startTime>=p&&l.endTime<=m)c.push(l);else if(l.startTime>m)return c}return c}},"./src/utils/time-ranges.ts":function(ne,V,I){"use strict";I.r(V);var z={toString:function(D){for(var K="",M=D.length,r=0;r<M;r++)K+="["+D.start(r).toFixed(3)+","+D.end(r).toFixed(3)+"]";return K}};V.default=z},"./src/utils/timescale-conversion.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"toTimescaleFromBase",function(){return L}),I.d(V,"toTimescaleFromScale",function(){return D}),I.d(V,"toMsFromMpegTsClock",function(){return K}),I.d(V,"toMpegTsClockFromTimescale",function(){return M});var z=9e4;function L(r,P,x,p){x===void 0&&(x=1),p===void 0&&(p=!1);var m=r*P*x;return p?Math.round(m):m}function D(r,P,x,p){return x===void 0&&(x=1),p===void 0&&(p=!1),L(r,P,1/x,p)}function K(r,P){return P===void 0&&(P=!1),L(r,1e3,1/z,P)}function M(r,P){return P===void 0&&(P=1),L(r,z,1/P)}},"./src/utils/typed-array.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"sliceUint8",function(){return z});function z(L,D,K){return Uint8Array.prototype.slice?L.slice(D,K):new Uint8Array(Array.prototype.slice.call(L,D,K))}},"./src/utils/vttcue.ts":function(ne,V,I){"use strict";I.r(V),V.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var z=["","lr","rl"],L=["start","middle","end","left","right"];function D(x,p){if(typeof p!="string")return!1;if(!Array.isArray(x))return!1;var m=p.toLowerCase();return~x.indexOf(m)?m:!1}function K(x){return D(z,x)}function M(x){return D(L,x)}function r(x){for(var p=arguments.length,m=new Array(p>1?p-1:0),c=1;c<p;c++)m[c-1]=arguments[c];for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var d in s)x[d]=s[d]}return x}function P(x,p,m){var c=this,a={enumerable:!0};c.hasBeenReset=!1;var s="",d=!1,l=x,i=p,n=m,O=null,C="",T=!0,R="auto",S="start",y=50,E="middle",f=50,h="middle";Object.defineProperty(c,"id",r({},a,{get:function(){return s},set:function(g){s=""+g}})),Object.defineProperty(c,"pauseOnExit",r({},a,{get:function(){return d},set:function(g){d=!!g}})),Object.defineProperty(c,"startTime",r({},a,{get:function(){return l},set:function(g){if(typeof g!="number")throw new TypeError("Start time must be set to a number.");l=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",r({},a,{get:function(){return i},set:function(g){if(typeof g!="number")throw new TypeError("End time must be set to a number.");i=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",r({},a,{get:function(){return n},set:function(g){n=""+g,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",r({},a,{get:function(){return O},set:function(g){O=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",r({},a,{get:function(){return C},set:function(g){var b=K(g);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");C=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",r({},a,{get:function(){return T},set:function(g){T=!!g,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",r({},a,{get:function(){return R},set:function(g){if(typeof g!="number"&&g!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",r({},a,{get:function(){return S},set:function(g){var b=M(g);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");S=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",r({},a,{get:function(){return y},set:function(g){if(g<0||g>100)throw new Error("Position must be between 0 and 100.");y=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",r({},a,{get:function(){return E},set:function(g){var b=M(g);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",r({},a,{get:function(){return f},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");f=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",r({},a,{get:function(){return h},set:function(g){var b=M(g);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");h=b,this.hasBeenReset=!0}})),c.displayState=void 0}return P.prototype.getCueAsHTML=function(){var x=self.WebVTT;return x.convertCueToDOMTree(self,this.text)},P}()},"./src/utils/vttparser.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"parseTimeStamp",function(){return D}),I.d(V,"fixLineBreaks",function(){return p}),I.d(V,"VTTParser",function(){return m});var z=I("./src/utils/vttcue.ts"),L=function(){function c(){}var a=c.prototype;return a.decode=function(d,l){if(!d)return"";if(typeof d!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(d))},c}();function D(c){function a(d,l,i,n){return(d|0)*3600+(l|0)*60+(i|0)+parseFloat(n||0)}var s=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return s?parseFloat(s[2])>59?a(s[2],s[3],0,s[4]):a(s[1],s[2],s[3],s[4]):null}var K=function(){function c(){this.values=Object.create(null)}var a=c.prototype;return a.set=function(d,l){!this.get(d)&&l!==""&&(this.values[d]=l)},a.get=function(d,l,i){return i?this.has(d)?this.values[d]:l[i]:this.has(d)?this.values[d]:l},a.has=function(d){return d in this.values},a.alt=function(d,l,i){for(var n=0;n<i.length;++n)if(l===i[n]){this.set(d,l);break}},a.integer=function(d,l){/^-?\d+$/.test(l)&&this.set(d,parseInt(l,10))},a.percent=function(d,l){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(l)){var i=parseFloat(l);if(i>=0&&i<=100)return this.set(d,i),!0}return!1},c}();function M(c,a,s,d){var l=d?c.split(d):[c];for(var i in l){if(typeof l[i]!="string")continue;var n=l[i].split(s);if(n.length!==2)continue;var O=n[0],C=n[1];a(O,C)}}var r=new z.default(0,0,""),P=r.align==="middle"?"middle":"center";function x(c,a,s){var d=c;function l(){var O=D(c);if(O===null)throw new Error("Malformed timestamp: "+d);return c=c.replace(/^[^\sa-zA-Z-]+/,""),O}function i(O,C){var T=new K;M(O,function(y,E){var f;switch(y){case"region":for(var h=s.length-1;h>=0;h--)if(s[h].id===E){T.set(y,s[h].region);break}break;case"vertical":T.alt(y,E,["rl","lr"]);break;case"line":f=E.split(","),T.integer(y,f[0]),T.percent(y,f[0])&&T.set("snapToLines",!1),T.alt(y,f[0],["auto"]),f.length===2&&T.alt("lineAlign",f[1],["start",P,"end"]);break;case"position":f=E.split(","),T.percent(y,f[0]),f.length===2&&T.alt("positionAlign",f[1],["start",P,"end","line-left","line-right","auto"]);break;case"size":T.percent(y,E);break;case"align":T.alt(y,E,["start",P,"end","left","right"]);break}},/:/,/\s/),C.region=T.get("region",null),C.vertical=T.get("vertical","");var R=T.get("line","auto");R==="auto"&&r.line===-1&&(R=-1),C.line=R,C.lineAlign=T.get("lineAlign","start"),C.snapToLines=T.get("snapToLines",!0),C.size=T.get("size",100),C.align=T.get("align",P);var S=T.get("position","auto");S==="auto"&&r.position===50&&(S=C.align==="start"||C.align==="left"?0:C.align==="end"||C.align==="right"?100:50),C.position=S}function n(){c=c.replace(/^\s+/,"")}if(n(),a.startTime=l(),n(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+d);c=c.substr(3),n(),a.endTime=l(),n(),i(c,a)}function p(c){return c.replace(/<br(?: \/)?>/gi,`
|
|
`)}var m=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new L,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(d){var l=this;d&&(l.buffer+=l.decoder.decode(d,{stream:!0}));function i(){var S=l.buffer,y=0;for(S=p(S);y<S.length&&S[y]!=="\r"&&S[y]!==`
|
|
`;)++y;var E=S.substr(0,y);return S[y]==="\r"&&++y,S[y]===`
|
|
`&&++y,l.buffer=S.substr(y),E}function n(S){M(S,function(y,E){},/:/)}try{var O="";if(l.state==="INITIAL"){if(!/\r\n|\n/.test(l.buffer))return this;O=i();var C=O.match(/^()?WEBVTT([ \t].*)?$/);if(!C||!C[0])throw new Error("Malformed WebVTT signature.");l.state="HEADER"}for(var T=!1;l.buffer;){if(!/\r\n|\n/.test(l.buffer))return this;T?T=!1:O=i();switch(l.state){case"HEADER":/:/.test(O)?n(O):O||(l.state="ID");continue;case"NOTE":O||(l.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(O)){l.state="NOTE";break}if(!O)continue;if(l.cue=new z.default(0,0,""),l.state="CUE",O.indexOf("-->")===-1){l.cue.id=O;continue}case"CUE":if(!l.cue){l.state="BADCUE";continue}try{x(O,l.cue,l.regionList)}catch(S){l.cue=null,l.state="BADCUE";continue}l.state="CUETEXT";continue;case"CUETEXT":{var R=O.indexOf("-->")!==-1;if(!O||R&&(T=!0)){l.oncue&&l.cue&&l.oncue(l.cue),l.cue=null,l.state="ID";continue}if(l.cue===null)continue;l.cue.text&&(l.cue.text+=`
|
|
`),l.cue.text+=O}continue;case"BADCUE":O||(l.state="ID")}}}catch(S){l.state==="CUETEXT"&&l.cue&&l.oncue&&l.oncue(l.cue),l.cue=null,l.state=l.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var d=this;try{if((d.cue||d.state==="HEADER")&&(d.buffer+=`
|
|
|
|
`,d.parse()),d.state==="INITIAL"||d.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(l){d.onparsingerror&&d.onparsingerror(l)}return d.onflush&&d.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(ne,V,I){"use strict";I.r(V),I.d(V,"generateCueId",function(){return m}),I.d(V,"parseWebVTT",function(){return a});var z=I("./src/polyfills/number.ts"),L=I("./src/utils/vttparser.ts"),D=I("./src/demux/id3.ts"),K=I("./src/utils/timescale-conversion.ts"),M=I("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,P=function(d,l,i){return i===void 0&&(i=0),d.substr(i,l.length)===l},x=function(d){var l=parseInt(d.substr(-3)),i=parseInt(d.substr(-6,2)),n=parseInt(d.substr(-9,2)),O=d.length>9?parseInt(d.substr(0,d.indexOf(":"))):0;if(!Object(z.isFiniteNumber)(l)||!Object(z.isFiniteNumber)(i)||!Object(z.isFiniteNumber)(n)||!Object(z.isFiniteNumber)(O))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+d);return l+=1e3*i,l+=60*1e3*n,l+=60*60*1e3*O,l},p=function(d){for(var l=5381,i=d.length;i;)l=l*33^d.charCodeAt(--i);return(l>>>0).toString()};function m(s,d,l){return p(s.toString())+p(d.toString())+p(l)}var c=function(d,l,i){var n=d[l],O=d[n.prevCC];if(!O||!O.new&&n.new){d.ccOffset=d.presentationOffset=n.start,n.new=!1;return}for(;(C=O)!==null&&C!==void 0&&C.new;){var C;d.ccOffset+=n.start-O.start,n.new=!1,n=O,O=d[n.prevCC]}d.presentationOffset=i};function a(s,d,l,i,n,O,C,T){var R=new L.VTTParser,S=Object(D.utf8ArrayToStr)(new Uint8Array(s)).trim().replace(r,`
|
|
`).split(`
|
|
`),y=[],E=Object(K.toMpegTsClockFromTimescale)(d,l),f="00:00.000",h=0,v=0,g,b=!0,N=!1;R.oncue=function(H){var A=i[n],F=i.ccOffset,U=(h-E)/9e4;if(A!=null&&A.new&&(v!==void 0?F=i.ccOffset=A.start:c(i,n,U)),U&&(F=U-i.presentationOffset),N){var w=H.endTime-H.startTime,Y=Object(M.normalizePts)((H.startTime+F-v)*9e4,O*9e4)/9e4;H.startTime=Y,H.endTime=Y+w}var Z=H.text.trim();H.text=decodeURIComponent(encodeURIComponent(Z)),H.id||(H.id=m(H.startTime,H.endTime,Z)),H.endTime>0&&y.push(H)},R.onparsingerror=function(H){g=H},R.onflush=function(){if(g){T(g);return}C(y)},S.forEach(function(H){if(b)if(P(H,"X-TIMESTAMP-MAP=")){b=!1,N=!0,H.substr(16).split(",").forEach(function(A){P(A,"LOCAL:")?f=A.substr(6):P(A,"MPEGTS:")&&(h=parseInt(A.substr(7)))});try{v=x(f)/1e3}catch(A){N=!1,g=A}return}else H===""&&(b=!1);R.parse(H+`
|
|
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(ne,V,I){"use strict";I.r(V);var z=I("./src/utils/logger.ts"),L=I("./src/loader/load-stats.ts"),D=/^age:\s*[\d.]+\s*$/m,K=function(){function M(P){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=P?P.xhrSetup:null,this.stats=new L.LoadStats,this.retryDelay=0}var r=M.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.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()))},r.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(x,p,m){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=m,this.retryDelay=p.retryDelay,this.loadInternal()},r.loadInternal=function(){var x=this.config,p=this.context;if(!x)return;var m=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var a=this.xhrSetup;try{if(a)try{a(m,p.url)}catch(l){m.open("GET",p.url,!0),a(m,p.url)}m.readyState||m.open("GET",p.url,!0);var s=this.context.headers;if(s)for(var d in s)m.setRequestHeader(d,s[d])}catch(l){this.callbacks.onError({code:m.status,text:l.message},p,m);return}p.rangeEnd&&m.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),x.timeout),m.send()},r.readystatechange=function(){var x=this.context,p=this.loader,m=this.stats;if(!x||!p)return;var c=p.readyState,a=this.config;if(m.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),c===4){p.onreadystatechange=null,p.onprogress=null;var s=p.status;if(s>=200&&s<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var d,l;if(x.responseType==="arraybuffer"?(d=p.response,l=d.byteLength):(d=p.responseText,l=d.length),m.loaded=m.total=l,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(m,x,d,p),!this.callbacks)return;var n={url:p.responseURL,data:d};this.callbacks.onSuccess(n,m,x,p)}else m.retry>=a.maxRetry||s>=400&&s<499?(z.logger.error(s+" while loading "+x.url),this.callbacks.onError({code:s,text:p.statusText},x,p)):(z.logger.warn(s+" 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),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},r.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))},r.loadprogress=function(x){var p=this.stats;p.loaded=x.loaded,x.lengthComputable&&(p.total=x.total)},r.getCacheAge=function(){var x=null;if(this.loader&&D.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");x=p?parseFloat(p):null}return x},M}();V.default=K}}).default})},vHTk:function(Lt,ve,k){Lt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return Ut});var ne=k("rePB"),V=k("VTBJ"),I=k("KQm4"),z=k("U8pU"),L=k("ODXe"),D=k("q1tI"),K=k("TSYQ"),M=k.n(K),r=k("Gytx"),P=k.n(r),x=k("Kwbf"),p=k("t23M"),m=k("qx4F"),c=k("6eGT"),a=k("IBYe"),s=k("Ff2n"),d=k("c+Xe"),l=k("fyJ8"),i=k("biw7");function n(Ke,He,ct,bt,de){var q=ct[Ke]||{},te=ct[He]||{},se,pe;q.fixed==="left"?se=bt.left[Ke]:te.fixed==="right"&&(pe=bt.right[He]);var ae=!1,ie=!1,me=!1,_e=!1,Ee=ct[He+1],Le=ct[Ke-1];if(de==="rtl"){if(se!==void 0){var at=Le&&Le.fixed==="left";_e=!at}else if(pe!==void 0){var Ct=Ee&&Ee.fixed==="right";me=!Ct}}else if(se!==void 0){var Jt=Ee&&Ee.fixed==="left";ae=!Jt}else if(pe!==void 0){var lt=Le&&Le.fixed==="right";ie=!lt}return{fixLeft:se,fixRight:pe,lastFixLeft:ae,firstFixRight:ie,lastFixRight:me,firstFixLeft:_e,isSticky:bt.isSticky}}var O=k("sR1s");function C(Ke){var He=Ke.cells,ct=Ke.stickyOffsets,bt=Ke.flattenColumns,de=Ke.rowComponent,q=Ke.cellComponent,te=Ke.onHeaderRow,se=Ke.index,pe=D.useContext(i.a),ae=pe.prefixCls,ie=pe.direction,me;te&&(me=te(He.map(function(Ee){return Ee.column}),se));var _e=Object(O.a)(He.map(function(Ee){return Ee.column}));return D.createElement(de,Object.assign({},me),He.map(function(Ee,Le){var at=Ee.column,Ct=n(Ee.colStart,Ee.colEnd,bt,ct,ie),Jt;return at&&at.onHeaderCell&&(Jt=Ee.column.onHeaderCell(at)),D.createElement(l.a,Object.assign({},Ee,{ellipsis:at.ellipsis,align:at.align,component:q,prefixCls:ae,key:_e[Le]},Ct,{additionalProps:Jt,rowType:"header"}))}))}C.displayName="HeaderRow";var T=C;function R(Ke){var He=[];function ct(te,se){var pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;He[pe]=He[pe]||[];var ae=se,ie=te.filter(Boolean).map(function(me){var _e={key:me.key,className:me.className||"",children:me.title,column:me,colStart:ae},Ee=1,Le=me.children;return Le&&Le.length>0&&(Ee=ct(Le,ae,pe+1).reduce(function(at,Ct){return at+Ct},0),_e.hasSubColumns=!0),"colSpan"in me&&(Ee=me.colSpan),"rowSpan"in me&&(_e.rowSpan=me.rowSpan),_e.colSpan=Ee,_e.colEnd=_e.colStart+Ee-1,He[pe].push(_e),ae+=Ee,Ee});return ie}ct(Ke,0);for(var bt=He.length,de=function(se){He[se].forEach(function(pe){!("rowSpan"in pe)&&!pe.hasSubColumns&&(pe.rowSpan=bt-se)})},q=0;q<bt;q+=1)de(q);return He}function S(Ke){var He=Ke.stickyOffsets,ct=Ke.columns,bt=Ke.flattenColumns,de=Ke.onHeaderRow,q=D.useContext(i.a),te=q.prefixCls,se=q.getComponent,pe=D.useMemo(function(){return R(ct)},[ct]),ae=se(["header","wrapper"],"thead"),ie=se(["header","row"],"tr"),me=se(["header","cell"],"th");return D.createElement(ae,{className:"".concat(te,"-thead")},pe.map(function(_e,Ee){var Le=D.createElement(T,{key:Ee,flattenColumns:bt,cells:_e,stickyOffsets:He,rowComponent:ie,cellComponent:me,onHeaderRow:de,index:Ee});return Le}))}var y=S,E=k("hW8S");function f(Ke){for(var He=Ke.colWidths,ct=Ke.columns,bt=Ke.columCount,de=[],q=bt||ct.length,te=!1,se=q-1;se>=0;se-=1){var pe=He[se],ae=ct&&ct[se],ie=ae&&ae[E.a];(pe||ie||te)&&(de.unshift(D.createElement("col",Object.assign({key:se,style:{width:pe,minWidth:pe}},ie))),te=!0)}return D.createElement("colgroup",null,de)}var h=f;function v(Ke,He){return Object(D.useMemo)(function(){for(var ct=[],bt=0;bt<He;bt+=1){var de=Ke[bt];if(de!==void 0)ct[bt]=de;else return null}return ct},[Ke.join("_"),He])}var g=D.forwardRef(function(Ke,He){var ct=Ke.noData,bt=Ke.columns,de=Ke.flattenColumns,q=Ke.colWidths,te=Ke.columCount,se=Ke.stickyOffsets,pe=Ke.direction,ae=Ke.fixHeader,ie=Ke.offsetHeader,me=Ke.stickyClassName,_e=Ke.onScroll,Ee=Object(s.a)(Ke,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Le=D.useContext(i.a),at=Le.prefixCls,Ct=Le.scrollbarSize,Jt=Le.isSticky,lt=Jt&&!ae?0:Ct,Un=D.useRef(null),Cn=D.useCallback(function(Zn){Object(d.b)(He,Zn),Object(d.b)(Un,Zn)},[]);D.useEffect(function(){var Zn;function dr(jt){var Ft=jt.currentTarget,zt=jt.deltaX;zt&&(_e({currentTarget:Ft,scrollLeft:Ft.scrollLeft+zt}),jt.preventDefault())}return(Zn=Un.current)===null||Zn===void 0||Zn.addEventListener("wheel",dr),function(){var jt;(jt=Un.current)===null||jt===void 0||jt.removeEventListener("wheel",dr)}},[]);var vn=de[de.length-1],er={fixed:vn?vn.fixed:null,onHeaderCell:function(){return{className:"".concat(at,"-cell-scrollbar")}}},kn=Object(D.useMemo)(function(){return lt?[].concat(Object(I.a)(bt),[er]):bt},[lt,bt]),Yn=Object(D.useMemo)(function(){return lt?[].concat(Object(I.a)(de),[er]):de},[lt,de]),vr=Object(D.useMemo)(function(){var Zn=se.right,dr=se.left;return Object(V.a)(Object(V.a)({},se),{},{left:pe==="rtl"?[].concat(Object(I.a)(dr.map(function(jt){return jt+lt})),[0]):dr,right:pe==="rtl"?Zn:[].concat(Object(I.a)(Zn.map(function(jt){return jt+lt})),[0]),isSticky:Jt})},[lt,se,Jt]),Mn=v(q,te);return D.createElement("div",{style:Object(V.a)({overflow:"hidden"},Jt?{top:ie}:{}),ref:Cn,className:M()("".concat(at,"-header"),Object(ne.a)({},me,!!me))},D.createElement("table",{style:{tableLayout:"fixed",visibility:ct||Mn?null:"hidden"}},D.createElement(h,{colWidths:Mn?[].concat(Object(I.a)(Mn),[lt]):[],columCount:te+1,columns:Yn}),D.createElement(y,Object.assign({},Ee,{stickyOffsets:vr,columns:kn,flattenColumns:Yn}))))});g.displayName="FixedHeader";var b=g,N=D.createContext(null),H=N;function A(Ke){var He=Ke.prefixCls,ct=Ke.children,bt=Ke.component,de=Ke.cellComponent,q=Ke.fixHeader,te=Ke.fixColumn,se=Ke.horizonScroll,pe=Ke.className,ae=Ke.expanded,ie=Ke.componentWidth,me=Ke.colSpan,_e=D.useContext(i.a),Ee=_e.scrollbarSize;return D.useMemo(function(){var Le=ct;return te&&(Le=D.createElement("div",{style:{width:ie-(q?Ee:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(He,"-expanded-row-fixed")},Le)),D.createElement(bt,{className:pe,style:{display:ae?null:"none"}},D.createElement(l.a,{component:de,prefixCls:He,colSpan:me},Le))},[ct,bt,q,se,pe,ae,ie,me,Ee])}var F=A;function U(Ke){var He=Ke.className,ct=Ke.style,bt=Ke.record,de=Ke.index,q=Ke.rowKey,te=Ke.getRowKey,se=Ke.rowExpandable,pe=Ke.expandedKeys,ae=Ke.onRow,ie=Ke.indent,me=ie===void 0?0:ie,_e=Ke.rowComponent,Ee=Ke.cellComponent,Le=Ke.childrenColumnName,at=D.useContext(i.a),Ct=at.prefixCls,Jt=at.fixedInfoList,lt=D.useContext(H),Un=lt.fixHeader,Cn=lt.fixColumn,vn=lt.horizonScroll,er=lt.componentWidth,kn=lt.flattenColumns,Yn=lt.expandableType,vr=lt.expandRowByClick,Mn=lt.onTriggerExpand,Zn=lt.rowClassName,dr=lt.expandedRowClassName,jt=lt.indentSize,Ft=lt.expandIcon,zt=lt.expandedRowRender,dn=lt.expandIconColumnIndex,yn=D.useState(!1),bn=Object(L.a)(yn,2),_r=bn[0],Bn=bn[1],Qt=pe&&pe.has(Ke.recordKey);D.useEffect(function(){Qt&&Bn(!0)},[Qt]);var Hn=Yn==="row"&&(!se||se(bt)),lr=Yn==="nest",Sn=Le&&bt&&bt[Le],zn=Hn||lr,tr;ae&&(tr=ae(bt,de));var Gr=function(Fn){if(vr&&zn&&Mn(bt,Fn),tr&&tr.onClick){for(var pi,Zt=arguments.length,qr=new Array(Zt>1?Zt-1:0),zr=1;zr<Zt;zr++)qr[zr-1]=arguments[zr];(pi=tr).onClick.apply(pi,[Fn].concat(qr))}},Ar;typeof Zn=="string"?Ar=Zn:typeof Zn=="function"&&(Ar=Zn(bt,de,me));var Yt=Object(O.a)(kn),Vn=D.createElement(_e,Object.assign({},tr,{"data-row-key":q,className:M()(He,"".concat(Ct,"-row"),"".concat(Ct,"-row-level-").concat(me),Ar,tr&&tr.className),style:Object(V.a)(Object(V.a)({},ct),tr?tr.style:null),onClick:Gr}),kn.map(function(Lr,Fn){var pi=Lr.render,Zt=Lr.dataIndex,qr=Lr.className,zr=Yt[Fn],xi=Jt[Fn],mi;Fn===(dn||0)&&lr&&(mi=D.createElement(D.Fragment,null,D.createElement("span",{style:{paddingLeft:"".concat(jt*me,"px")},className:"".concat(Ct,"-row-indent indent-level-").concat(me)}),Ft({prefixCls:Ct,expanded:Qt,expandable:Sn,record:bt,onExpand:Mn})));var ni;return Lr.onCell&&(ni=Lr.onCell(bt,de)),D.createElement(l.a,Object.assign({className:qr,ellipsis:Lr.ellipsis,align:Lr.align,component:Ee,prefixCls:Ct,key:zr,record:bt,index:de,dataIndex:Zt,render:pi,shouldCellUpdate:Lr.shouldCellUpdate},xi,{appendNode:mi,additionalProps:ni}))})),vi;if(Hn&&(_r||Qt)){var Pi=zt(bt,de,me+1,Qt),ai=dr&&dr(bt,de,me);vi=D.createElement(F,{expanded:Qt,className:M()("".concat(Ct,"-expanded-row"),"".concat(Ct,"-expanded-row-level-").concat(me+1),ai),prefixCls:Ct,fixHeader:Un,fixColumn:Cn,horizonScroll:vn,component:_e,componentWidth:er,cellComponent:Ee,colSpan:kn.length},Pi)}var Yr;return Sn&&Qt&&(Yr=(bt[Le]||[]).map(function(Lr,Fn){var pi=te(Lr,Fn);return D.createElement(U,Object.assign({},Ke,{key:pi,rowKey:pi,record:Lr,recordKey:pi,index:Fn,indent:me+1}))})),D.createElement(D.Fragment,null,Vn,vi,Yr)}U.displayName="BodyRow";var w=U,Y=D.createContext(null),Z=Y;function ce(Ke){var He=Ke.columnKey,ct=Ke.onColumnResize,bt=D.useRef();return D.useEffect(function(){bt.current&&ct(He,bt.current.offsetWidth)},[]),D.createElement(p.a,{onResize:function(q){var te=q.offsetWidth;ct(He,te)}},D.createElement("td",{ref:bt,style:{padding:0,border:0,height:0}},D.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function be(Ke){var He=Ke.data,ct=Ke.getRowKey,bt=Ke.measureColumnWidth,de=Ke.expandedKeys,q=Ke.onRow,te=Ke.rowExpandable,se=Ke.emptyNode,pe=Ke.childrenColumnName,ae=D.useContext(Z),ie=ae.onColumnResize,me=D.useContext(i.a),_e=me.prefixCls,Ee=me.getComponent,Le=D.useContext(H),at=Le.fixHeader,Ct=Le.horizonScroll,Jt=Le.flattenColumns,lt=Le.componentWidth;return D.useMemo(function(){var Un=Ee(["body","wrapper"],"tbody"),Cn=Ee(["body","row"],"tr"),vn=Ee(["body","cell"],"td"),er;He.length?er=He.map(function(Yn,vr){var Mn=ct(Yn,vr);return D.createElement(w,{key:Mn,rowKey:Mn,record:Yn,recordKey:Mn,index:vr,rowComponent:Cn,cellComponent:vn,expandedKeys:de,onRow:q,getRowKey:ct,rowExpandable:te,childrenColumnName:pe})}):er=D.createElement(F,{expanded:!0,className:"".concat(_e,"-placeholder"),prefixCls:_e,fixHeader:at,fixColumn:Ct,horizonScroll:Ct,component:Cn,componentWidth:lt,cellComponent:vn,colSpan:Jt.length},se);var kn=Object(O.a)(Jt);return D.createElement(Un,{className:"".concat(_e,"-tbody")},bt&&D.createElement("tr",{"aria-hidden":"true",className:"".concat(_e,"-measure-row"),style:{height:0}},kn.map(function(Yn){return D.createElement(ce,{key:Yn,columnKey:Yn,onColumnResize:ie})})),er)},[He,_e,q,bt,de,ct,Ee,lt,se,Jt])}var Ze=D.memo(be);Ze.displayName="Body";var Ce=Ze,We=k("wRmb"),Ve=k("xEkU"),Ye=k.n(Ve);function we(Ke){var He=Object(D.useRef)(Ke),ct=Object(D.useState)({}),bt=Object(L.a)(ct,2),de=bt[1],q=Object(D.useRef)(null),te=Object(D.useRef)([]);function se(pe){q.current===null&&(te.current=[],q.current=Ye()(function(){te.current.forEach(function(ae){He.current=ae(He.current)}),q.current=null,de({})})),te.current.push(pe)}return Object(D.useEffect)(function(){return function(){Ye.a.cancel(q.current)}},[]),[He.current,se]}function X(Ke){var He=Object(D.useRef)(Ke),ct=Object(D.useRef)(null);function bt(){window.clearTimeout(ct.current)}function de(te){He.current=te,bt(),ct.current=window.setTimeout(function(){He.current=null,ct.current=null},100)}function q(){return He.current}return Object(D.useEffect)(function(){return bt},[]),[de,q]}function j(Ke,He,ct){var bt=Object(D.useMemo)(function(){for(var de=[],q=[],te=0,se=0,pe=0;pe<He;pe+=1)if(ct==="rtl"){q[pe]=se,se+=Ke[pe]||0;var ae=He-pe-1;de[ae]=te,te+=Ke[ae]||0}else{de[pe]=te,te+=Ke[pe]||0;var ie=He-pe-1;q[ie]=se,se+=Ke[ie]||0}return{left:de,right:q}},[Ke,He,ct]);return bt}var W=j;function Q(Ke){var He=Ke.className,ct=Ke.children;return D.createElement("div",{className:He},ct)}var re=Q,G=k("n6Qo");function xe(Ke){var He,ct=Ke.prefixCls,bt=Ke.record,de=Ke.onExpand,q=Ke.expanded,te=Ke.expandable,se="".concat(ct,"-row-expand-icon");if(!te)return D.createElement("span",{className:M()(se,"".concat(ct,"-row-spaced"))});var pe=function(ie){de(bt,ie),ie.stopPropagation()};return D.createElement("span",{className:M()(se,(He={},Object(ne.a)(He,"".concat(ct,"-row-expanded"),q),Object(ne.a)(He,"".concat(ct,"-row-collapsed"),!q),He)),onClick:pe})}function Ie(Ke,He,ct){var bt=[];function de(q){(q||[]).forEach(function(te,se){bt.push(He(te,se)),de(te[ct])})}return de(Ke),bt}var tt=k("zT1h"),le=k("y0+3"),Se=function(He,ct){var bt,de,q=He.scrollBodyRef,te=He.onScroll,se=He.offsetScroll,pe=D.useContext(i.a),ae=pe.prefixCls,ie=((bt=q.current)===null||bt===void 0?void 0:bt.scrollWidth)||0,me=((de=q.current)===null||de===void 0?void 0:de.clientWidth)||0,_e=ie&&me*(me/ie),Ee=D.useRef(),Le=we({scrollLeft:0,isHiddenScrollBar:!1}),at=Object(L.a)(Le,2),Ct=at[0],Jt=at[1],lt=D.useRef({delta:0,x:0}),Un=D.useState(!1),Cn=Object(L.a)(Un,2),vn=Cn[0],er=Cn[1],kn=function(){er(!1)},Yn=function(jt){jt.persist(),lt.current.delta=jt.pageX-Ct.scrollLeft,lt.current.x=0,er(!0),jt.preventDefault()},vr=function(jt){var Ft,zt=jt||((Ft=window)===null||Ft===void 0?void 0:Ft.event),dn=zt.buttons;if(!vn||dn===0){vn&&er(!1);return}var yn=lt.current.x+jt.pageX-lt.current.x-lt.current.delta;yn<=0&&(yn=0),yn+_e>=me&&(yn=me-_e),te({scrollLeft:yn/me*(ie+2)}),lt.current.x=jt.pageX},Mn=function(){var jt=Object(le.b)(q.current).top,Ft=jt+q.current.offsetHeight,zt=document.documentElement.scrollTop+window.innerHeight;Ft-Object(m.a)()<=zt||jt>=zt-se?Jt(function(dn){return Object(V.a)(Object(V.a)({},dn),{},{isHiddenScrollBar:!0})}):Jt(function(dn){return Object(V.a)(Object(V.a)({},dn),{},{isHiddenScrollBar:!1})})},Zn=function(jt){Jt(function(Ft){return Object(V.a)(Object(V.a)({},Ft),{},{scrollLeft:jt/ie*me||0})})};return D.useImperativeHandle(ct,function(){return{setScrollLeft:Zn}}),D.useEffect(function(){var dr=Object(tt.a)(document.body,"mouseup",kn,!1),jt=Object(tt.a)(document.body,"mousemove",vr,!1);return Mn(),function(){dr.remove(),jt.remove()}},[_e,vn]),D.useEffect(function(){var dr=Object(tt.a)(window,"scroll",Mn,!1),jt=Object(tt.a)(window,"resize",Mn,!1);return function(){dr.remove(),jt.remove()}},[]),D.useEffect(function(){Ct.isHiddenScrollBar||Jt(function(dr){var jt,Ft;return Object(V.a)(Object(V.a)({},dr),{},{scrollLeft:q.current.scrollLeft/((jt=q.current)===null||jt===void 0?void 0:jt.scrollWidth)*((Ft=q.current)===null||Ft===void 0?void 0:Ft.clientWidth)})})},[Ct.isHiddenScrollBar]),ie<=me||!_e||Ct.isHiddenScrollBar?null:D.createElement("div",{style:{height:Object(m.a)(),width:me,bottom:se},className:"".concat(ae,"-sticky-scroll")},D.createElement("div",{onMouseDown:Yn,ref:Ee,className:M()("".concat(ae,"-sticky-scroll-bar"),Object(ne.a)({},"".concat(ae,"-sticky-scroll-bar-active"),vn)),style:{width:"".concat(_e,"px"),transform:"translate3d(".concat(Ct.scrollLeft,"px, 0, 0)")}}))},je=D.forwardRef(Se);function ze(Ke,He){return D.useMemo(function(){var ct=!!Ke;return{isSticky:ct,stickyClassName:ct?"".concat(He,"-sticky-header"):"",offsetHeader:Object(z.a)(Ke)==="object"&&Ke.offsetHeader||0,offsetScroll:Object(z.a)(Ke)==="object"&&Ke.offsetScroll||0}},[Ke,He])}var yt=[],Ot={},Ut="rc-table-internal-hook",Qe=D.memo(function(Ke){var He=Ke.children;return He},function(Ke,He){return P()(Ke.props,He.props)?Ke.pingLeft!==He.pingLeft||Ke.pingRight!==He.pingRight:!1});function Bt(Ke){var He,ct=Ke.prefixCls,bt=Ke.className,de=Ke.rowClassName,q=Ke.style,te=Ke.data,se=Ke.rowKey,pe=Ke.scroll,ae=Ke.tableLayout,ie=Ke.direction,me=Ke.title,_e=Ke.footer,Ee=Ke.summary,Le=Ke.id,at=Ke.showHeader,Ct=Ke.components,Jt=Ke.emptyText,lt=Ke.onRow,Un=Ke.onHeaderRow,Cn=Ke.internalHooks,vn=Ke.transformColumns,er=Ke.internalRefs,kn=Ke.sticky,Yn=te||yt,vr=!!Yn.length,Mn=D.useState(0),Zn=Object(L.a)(Mn,2),dr=Zn[0],jt=Zn[1];D.useEffect(function(){jt(Object(m.a)())});var Ft=D.useMemo(function(){return Object(O.c)(Ct,{})},[Ct]),zt=D.useCallback(function(un,nn){return Object(O.b)(Ft,un)||nn},[Ft]),dn=D.useMemo(function(){return typeof se=="function"?se:function(un){var nn=un&&un[se];return nn}},[se]),yn=Object(E.c)(Ke),bn=yn.expandIcon,_r=yn.expandedRowKeys,Bn=yn.defaultExpandedRowKeys,Qt=yn.defaultExpandAllRows,Hn=yn.expandedRowRender,lr=yn.onExpand,Sn=yn.onExpandedRowsChange,zn=yn.expandRowByClick,tr=yn.rowExpandable,Gr=yn.expandIconColumnIndex,Ar=yn.expandedRowClassName,Yt=yn.childrenColumnName,Vn=yn.indentSize,vi=bn||xe,Pi=Yt||"children",ai=D.useMemo(function(){return Hn?"row":Ke.expandable&&Cn===Ut&&Ke.expandable.__PARENT_RENDER_ICON__||Yn.some(function(un){return un&&Object(z.a)(un)==="object"&&un[Pi]})?"nest":!1},[!!Hn,Yn]),Yr=D.useState(function(){return Bn||(Qt?Ie(Yn,dn,Pi):[])}),Lr=Object(L.a)(Yr,2),Fn=Lr[0],pi=Lr[1],Zt=D.useMemo(function(){return new Set(_r||Fn||[])},[_r,Fn]),qr=D.useCallback(function(un){var nn=dn(un,Yn.indexOf(un)),mt,Xe=Zt.has(nn);Xe?(Zt.delete(nn),mt=Object(I.a)(Zt)):mt=[].concat(Object(I.a)(Zt),[nn]),pi(mt),lr&&lr(!Xe,un),Sn&&Sn(mt)},[dn,Zt,Yn,lr,Sn]),zr=D.useState(0),xi=Object(L.a)(zr,2),mi=xi[0],ni=xi[1],Bi=Object(We.b)(Object(V.a)(Object(V.a)(Object(V.a)({},Ke),yn),{},{expandable:!!Hn,expandedKeys:Zt,getRowKey:dn,onTriggerExpand:qr,expandIcon:vi,expandIconColumnIndex:Gr,direction:ie}),Cn===Ut?vn:null),Hi=Object(L.a)(Bi,2),ri=Hi[0],wr=Hi[1],Si=D.useMemo(function(){return{columns:ri,flattenColumns:wr}},[ri,wr]),Oi=D.useRef(),ci=D.useRef(),_i=D.useRef(),oa=D.useState(!1),$i=Object(L.a)(oa,2),yr=$i[0],br=$i[1],oi=D.useState(!1),kr=Object(L.a)(oi,2),Tn=kr[0],qt=kr[1],fn=we(new Map),tn=Object(L.a)(fn,2),Xn=tn[0],Qn=tn[1],J=Object(O.a)(wr),ge=J.map(function(un){return Xn.get(un)}),Oe=D.useMemo(function(){return ge},[ge.join("_")]),Re=W(Oe,wr.length,ie),qe=pe&&Object(O.d)(pe.y),Ue=pe&&Object(O.d)(pe.x),Je=Ue&&wr.some(function(un){var nn=un.fixed;return nn}),dt=D.useRef(),wt=ze(kn,ct),Tt=wt.isSticky,Be=wt.offsetHeader,ft=wt.offsetScroll,et=wt.stickyClassName,rt,ht,_t;qe&&(ht={overflowY:"scroll",maxHeight:pe.y}),Ue&&(rt={overflowX:"auto"},qe||(ht={overflowY:"hidden"}),_t={width:pe.x===!0?"auto":pe.x,minWidth:"100%"});var st=D.useCallback(function(un,nn){Qn(function(mt){var Xe=new Map(mt);return Xe.set(un,nn),Xe})},[]),Pt=X(null),Wt=Object(L.a)(Pt,2),cn=Wt[0],On=Wt[1];function an(un,nn){if(!nn)return;typeof nn=="function"?nn(un):nn.scrollLeft!==un&&(nn.scrollLeft=un)}var mn=function(nn){var mt=nn.currentTarget,Xe=nn.scrollLeft,Et=typeof Xe=="number"?Xe:mt.scrollLeft,vt=mt||Ot;if(!On()||On()===vt){var Ht;cn(vt),an(Et,ci.current),an(Et,_i.current),an(Et,(Ht=dt.current)===null||Ht===void 0?void 0:Ht.setScrollLeft)}if(mt){var Rn=mt.scrollWidth,pn=mt.clientWidth;br(Et>0),qt(Et<Rn-pn)}},hn=function(){_i.current&&mn({currentTarget:_i.current})},gt=function(nn){var mt=nn.width;hn(),ni(Oi.current?Oi.current.offsetWidth:mt)};D.useEffect(function(){return hn},[]),D.useEffect(function(){Ue&&hn()},[Ue]),D.useEffect(function(){Cn===Ut&&er&&(er.body.current=_i.current)});var Kt=zt(["table"],"table"),St=D.useMemo(function(){return ae||(Je?pe.x==="max-content"?"auto":"fixed":qe||wr.some(function(un){var nn=un.ellipsis;return nn})?"fixed":"auto")},[qe,Je,wr,ae]),pt,gn={colWidths:Oe,columCount:wr.length,stickyOffsets:Re,onHeaderRow:Un,fixHeader:qe},on=D.useMemo(function(){return vr?null:typeof Jt=="function"?Jt():Jt},[vr,Jt]),Dt=D.createElement(Ce,{data:Yn,measureColumnWidth:qe||Ue||Tt,expandedKeys:Zt,rowExpandable:tr,getRowKey:dn,onRow:lt,emptyNode:on,childrenColumnName:Pi}),it=D.createElement(h,{colWidths:wr.map(function(un){var nn=un.width;return nn}),columns:wr}),_n=Ee&&D.createElement(G.b,null,Ee(Yn)),Gt=zt(["body"]);if(qe||Tt){var In;typeof Gt=="function"?(In=Gt(Yn,{scrollbarSize:dr,ref:_i,onScroll:mn}),gn.colWidths=wr.map(function(un,nn){var mt=un.width,Xe=nn===ri.length-1?mt-dr:mt;return typeof Xe=="number"&&!Number.isNaN(Xe)?Xe:(Object(x.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):In=D.createElement("div",{style:Object(V.a)(Object(V.a)({},rt),ht),onScroll:mn,ref:_i,className:M()("".concat(ct,"-body"))},D.createElement(Kt,{style:Object(V.a)(Object(V.a)({},_t),{},{tableLayout:St})},it,Dt,_n),Tt&&D.createElement(je,{ref:dt,offsetScroll:ft,scrollBodyRef:_i,onScroll:mn})),pt=D.createElement(D.Fragment,null,at!==!1&&D.createElement(b,Object.assign({noData:!Yn.length},gn,Si,{direction:ie,offsetHeader:Be,stickyClassName:et,ref:ci,onScroll:mn})),In)}else pt=D.createElement("div",{style:Object(V.a)(Object(V.a)({},rt),ht),className:M()("".concat(ct,"-content")),onScroll:mn,ref:_i},D.createElement(Kt,{style:Object(V.a)(Object(V.a)({},_t),{},{tableLayout:St})},it,at!==!1&&D.createElement(y,Object.assign({},gn,Si)),Dt,_n));var kt=Object(E.b)(Ke),sn=D.createElement("div",Object.assign({className:M()(ct,bt,(He={},Object(ne.a)(He,"".concat(ct,"-rtl"),ie==="rtl"),Object(ne.a)(He,"".concat(ct,"-ping-left"),yr),Object(ne.a)(He,"".concat(ct,"-ping-right"),Tn),Object(ne.a)(He,"".concat(ct,"-layout-fixed"),ae==="fixed"),Object(ne.a)(He,"".concat(ct,"-fixed-header"),qe),Object(ne.a)(He,"".concat(ct,"-fixed-column"),Je),Object(ne.a)(He,"".concat(ct,"-scroll-horizontal"),Ue),Object(ne.a)(He,"".concat(ct,"-has-fix-left"),wr[0]&&wr[0].fixed),Object(ne.a)(He,"".concat(ct,"-has-fix-right"),wr[wr.length-1]&&wr[wr.length-1].fixed==="right"),He)),style:q,id:Le,ref:Oi},kt),D.createElement(Qe,{pingLeft:yr,pingRight:Tn,props:Object(V.a)(Object(V.a)({},Ke),{},{stickyOffsets:Re,mergedExpandedKeys:Zt})},me&&D.createElement(re,{className:"".concat(ct,"-title")},me(Yn)),D.createElement("div",{className:"".concat(ct,"-container")},pt),_e&&D.createElement(re,{className:"".concat(ct,"-footer")},_e(Yn))));Ue&&(sn=D.createElement(p.a,{onResize:gt},sn));var En=D.useMemo(function(){return{prefixCls:ct,getComponent:zt,scrollbarSize:dr,direction:ie,fixedInfoList:wr.map(function(un,nn){return n(nn,nn,wr,Re,ie)}),isSticky:Tt}},[ct,zt,dr,ie,wr,Re,ie,Tt]),$t=D.useMemo(function(){return Object(V.a)(Object(V.a)({},Si),{},{tableLayout:St,rowClassName:de,expandedRowClassName:Ar,componentWidth:mi,fixHeader:qe,fixColumn:Je,horizonScroll:Ue,expandIcon:vi,expandableType:ai,expandRowByClick:zn,expandedRowRender:Hn,onTriggerExpand:qr,expandIconColumnIndex:Gr,indentSize:Vn})},[Si,St,de,Ar,mi,qe,Je,Ue,vi,ai,zn,Hn,qr,Gr,Vn]),sr=D.useMemo(function(){return{onColumnResize:st}},[st]);return D.createElement(i.a.Provider,{value:En},D.createElement(H.Provider,{value:$t},D.createElement(Z.Provider,{value:sr},sn)))}Bt.Column=a.a,Bt.ColumnGroup=c.a,Bt.Summary=G.a,Bt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var ln=ve.b=Bt},wRmb:function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return P});var ne=k("rePB"),V=k("KQm4"),I=k("VTBJ"),z=k("Ff2n"),L=k("q1tI"),D=k.n(L),K=k("Kwbf"),M=k("Zm9Q"),r=k("hW8S");function P(a){return Object(M.a)(a).filter(function(s){return L.isValidElement(s)}).map(function(s){var d=s.key,l=s.props,i=l.children,n=Object(z.a)(l,["children"]),O=Object(I.a)({key:d},n);return i&&(O.children=P(i)),O})}function x(a){return a.reduce(function(s,d){var l=d.fixed,i=l===!0?"left":l,n=d.children;return n&&n.length>0?[].concat(Object(V.a)(s),Object(V.a)(x(n).map(function(O){return Object(I.a)({fixed:i},O)}))):[].concat(Object(V.a)(s),[Object(I.a)(Object(I.a)({},d),{},{fixed:i})])},[])}function p(a){for(var s=!0,d=0;d<a.length;d+=1){var l=a[d];if(s&&l.fixed!=="left")s=!1;else if(!s&&l.fixed==="left"){Object(K.a)(!1,"Index ".concat(d-1," of `columns` missing `fixed='left'` prop."));break}}for(var i=!0,n=a.length-1;n>=0;n-=1){var O=a[n];if(i&&O.fixed!=="right")i=!1;else if(!i&&O.fixed==="right"){Object(K.a)(!1,"Index ".concat(n+1," of `columns` missing `fixed='right'` prop."));break}}}function m(a){return a.map(function(s){var d=s.fixed,l=Object(z.a)(s,["fixed"]),i=d;return d==="left"?i="right":d==="right"&&(i="left"),Object(I.a)({fixed:i},l)})}function c(a,s){var d=a.prefixCls,l=a.columns,i=a.children,n=a.expandable,O=a.expandedKeys,C=a.getRowKey,T=a.onTriggerExpand,R=a.expandIcon,S=a.rowExpandable,y=a.expandIconColumnIndex,E=a.direction,f=a.expandRowByClick,h=L.useMemo(function(){return l||P(i)},[l,i]),v=L.useMemo(function(){if(n){var N,H=y||0,A=h[H],F=(N={},Object(ne.a)(N,r.a,{className:"".concat(d,"-expand-icon-col")}),Object(ne.a)(N,"title",""),Object(ne.a)(N,"fixed",A?A.fixed:null),Object(ne.a)(N,"className","".concat(d,"-row-expand-icon-cell")),Object(ne.a)(N,"render",function(Y,Z,ce){var be=C(Z,ce),Ze=O.has(be),Ce=S?S(Z):!0,We=R({prefixCls:d,expanded:Ze,expandable:Ce,record:Z,onExpand:T});return f?L.createElement("span",{onClick:function(Ye){return Ye.stopPropagation()}},We):We}),N),U=h.slice();return H>=0&&U.splice(H,0,F),U}return h},[n,h,C,O,R,E]),g=L.useMemo(function(){var N=v;return s&&(N=s(N)),N.length||(N=[{render:function(){return null}}]),N},[s,v,E]),b=L.useMemo(function(){return E==="rtl"?m(x(g)):x(g)},[g,E]);return[g,b]}ve.b=c},wwSX:function(Lt,ve,k){Lt.exports=k.p+"static/b2.2c844a2a.svg"},xOL1:function(Lt,ve){Lt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC"},xb3X:function(Lt,ve,k){Lt.exports={flex_box_center:"flex_box_center___2oNqn",flex_space_between:"flex_space_between___eTRhm",flex_box_vertical_center:"flex_box_vertical_center___1jD6_",flex_box_center_end:"flex_box_center_end___3s_Sd",flex_box_column:"flex_box_column___11Wn_",form:"form___34z-w",btns:"btns___3O6K5",hackList:"hackList___2L3co",title:"title___2fVFF",subtitle:"subtitle___Ydv-g",efficiency:"efficiency___1wrjh"}},"y0+3":function(Lt,ve,k){"use strict";k.d(ve,"a",function(){return x}),k.d(ve,"b",function(){return m});var ne=/margin|padding|width|height|max|min|offset/,V={left:!0,top:!0},I={cssFloat:1,styleFloat:1,float:1};function z(c){return c.nodeType===1?c.ownerDocument.defaultView.getComputedStyle(c,null):{}}function L(c,a,s){if(a=a.toLowerCase(),s==="auto"){if(a==="height")return c.offsetHeight;if(a==="width")return c.offsetWidth}return a in V||(V[a]=ne.test(a)),V[a]?parseFloat(s)||0:s}function D(c,a){var s=arguments.length,d=z(c);return a=I[a]?"cssFloat"in c.style?"cssFloat":"styleFloat":a,s===1?d:L(c,a,d[a]||c.style[a])}function K(c,a,s){var d=arguments.length;if(a=I[a]?"cssFloat"in c.style?"cssFloat":"styleFloat":a,d===3)return typeof s=="number"&&ne.test(a)&&(s="".concat(s,"px")),c.style[a]=s,s;for(var l in a)a.hasOwnProperty(l)&&K(c,l,a[l]);return z(c)}function M(c){return c===document.body?document.documentElement.clientWidth:c.offsetWidth}function r(c){return c===document.body?window.innerHeight||document.documentElement.clientHeight:c.offsetHeight}function P(){var c=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:c,height:a}}function x(){var c=document.documentElement.clientWidth,a=window.innerHeight||document.documentElement.clientHeight;return{width:c,height:a}}function p(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function m(c){var a=c.getBoundingClientRect(),s=document.documentElement;return{left:a.left+(window.pageXOffset||s.scrollLeft)-(s.clientLeft||document.body.clientLeft||0),top:a.top+(window.pageYOffset||s.scrollTop)-(s.clientTop||document.body.clientTop||0)}}},"yTi+":function(Lt,ve,k){Lt.exports=k.p+"static/AssistantCode3.fdd8db3c.jpeg"},zetH:function(Lt,ve,k){Lt.exports={flex_box_center:"flex_box_center___Joa_H",flex_space_between:"flex_space_between___3VhCy",flex_box_vertical_center:"flex_box_vertical_center___3wSNZ",flex_box_center_end:"flex_box_center_end___3z8HR",flex_box_column:"flex_box_column___KdHzx",form:"form___3KoYn",efficiency:"efficiency___1LMk4"}},zlzj:function(Lt,ve,k){Lt.exports=k.p+"static/b3.30079151.svg"}}]);
|