(window.webpackJsonp=window.webpackJsonp||[]).push([[191,5,6,7,8,10],{"+NIl":function(I,J,P){(function(M){M(P("VrN/"))})(function(M){"use strict";M.defineMode("stex",function(u,_){"use strict";function D(p,w){p.cmdState.push(w)}function f(p){return p.cmdState.length>0?p.cmdState[p.cmdState.length-1]:null}function l(p){var w=p.cmdState.pop();w&&w.closeBracket()}function C(p){for(var w=p.cmdState,g=w.length-1;g>=0;g--){var c=w[g];if(c.name=="DEFAULT")continue;return c}return{styleIdentifier:function(){return null}}}function v(p,w,g){return function(){this.name=p,this.bracketNo=0,this.style=w,this.styles=g,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var o={};o.importmodule=v("importmodule","tag",["string","builtin"]),o.documentclass=v("documentclass","tag",["","atom"]),o.usepackage=v("usepackage","tag",["atom"]),o.begin=v("begin","tag",["atom"]),o.end=v("end","tag",["atom"]),o.label=v("label","tag",["atom"]),o.ref=v("ref","tag",["atom"]),o.eqref=v("eqref","tag",["atom"]),o.cite=v("cite","tag",["atom"]),o.bibitem=v("bibitem","tag",["atom"]),o.Bibitem=v("Bibitem","tag",["atom"]),o.RBibitem=v("RBibitem","tag",["atom"]),o.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function a(p,w){p.f=w}function r(p,w){var g;if(p.match(/^\\[a-zA-Z@]+/)){var c=p.current().slice(1);return g=o.hasOwnProperty(c)?o[c]:o.DEFAULT,g=new g,D(w,g),a(w,m),g.style}if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/\\]/))return"tag";if(p.match("\\["))return a(w,function(s,d){return h(s,d,"\\]")}),"keyword";if(p.match("\\("))return a(w,function(s,d){return h(s,d,"\\)")}),"keyword";if(p.match("$$"))return a(w,function(s,d){return h(s,d,"$$")}),"keyword";if(p.match("$"))return a(w,function(s,d){return h(s,d,"$")}),"keyword";var n=p.next();if(n=="%")return p.skipToEnd(),"comment";if(n=="}"||n=="]"){if(g=f(w),g)g.closeBracket(n),a(w,m);else return"error";return"bracket"}else return n=="{"||n=="["?(g=o.DEFAULT,g=new g,D(w,g),"bracket"):/\d/.test(n)?(p.eatWhile(/[\w.%]/),"atom"):(p.eatWhile(/[\w\-_]/),g=C(w),g.name=="begin"&&(g.argument=p.current()),g.styleIdentifier())}function h(p,w,g){if(p.eatSpace())return null;if(g&&p.match(g))return a(w,r),"keyword";if(p.match(/^\\[a-zA-Z@]+/))return"tag";if(p.match(/^[a-zA-Z]+/))return"variable-2";if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/]/))return"tag";if(p.match(/^[\^_&]/))return"tag";if(p.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(p.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var c=p.next();return c=="{"||c=="}"||c=="["||c=="]"||c=="("||c==")"?"bracket":c=="%"?(p.skipToEnd(),"comment"):"error"}function m(p,w){var g=p.peek(),c;return g=="{"||g=="["?(c=f(w),c.openBracket(g),p.eat(g),a(w,r),"bracket"):/[ \t\r]/.test(g)?(p.eat(g),null):(a(w,r),l(w),r(p,w))}return{startState:function(){var p=_.inMathMode?function(w,g){return h(w,g)}:r;return{cmdState:[],f:p}},copyState:function(p){return{cmdState:p.cmdState.slice(),f:p.f}},token:function(p,w){return w.f(p,w)},blankLine:function(p){p.f=r,p.cmdState.length=0},lineComment:"%"}}),M.defineMIME("text/x-stex","stex"),M.defineMIME("text/x-latex","stex")})},"19Vz":function(I,J,P){(function(M){M(P("VrN/"))})(function(M){M.defineOption("placeholder","",function(v,o,a){var r=a&&a!=M.Init;if(o&&!r)v.on("blur",f),v.on("change",l),v.on("swapDoc",l),M.on(v.getInputField(),"compositionupdate",v.state.placeholderCompose=function(){D(v)}),l(v);else if(!o&&r){v.off("blur",f),v.off("change",l),v.off("swapDoc",l),M.off(v.getInputField(),"compositionupdate",v.state.placeholderCompose),u(v);var h=v.getWrapperElement();h.className=h.className.replace(" CodeMirror-empty","")}o&&!v.hasFocus()&&f(v)});function u(v){v.state.placeholder&&(v.state.placeholder.parentNode.removeChild(v.state.placeholder),v.state.placeholder=null)}function _(v){u(v);var o=v.state.placeholder=document.createElement("pre");o.style.cssText="height: 0; overflow: visible",o.style.direction=v.getOption("direction"),o.className="CodeMirror-placeholder CodeMirror-line-like";var a=v.getOption("placeholder");typeof a=="string"&&(a=document.createTextNode(a)),o.appendChild(a),v.display.lineSpace.insertBefore(o,v.display.lineSpace.firstChild)}function D(v){setTimeout(function(){var o=!1,a=v.getInputField();a.nodeName=="TEXTAREA"?o=!a.value:v.lineCount()==1&&(o=!/[^\u200b]/.test(a.querySelector(".CodeMirror-line").textContent)),o?_(v):u(v)},20)}function f(v){C(v)&&_(v)}function l(v){var o=v.getWrapperElement(),a=C(v);o.className=o.className.replace(" CodeMirror-empty","")+(a?" CodeMirror-empty":""),a?_(v):u(v)}function C(v){return v.lineCount()===1&&v.getLine(0)===""}})},"1T2W":function(I,J,P){I.exports={"code-panel-container":"code-panel-container___1BMQ9","action-oj-bar":"action-oj-bar___1PRBr",active:"active___2710v"}},"1eCo":function(I,J,P){(function(M){M(P("VrN/"))})(function(M){"use strict";var u={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},_={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};M.defineMode("xml",function(D,f){var l=D.indentUnit,C={},v=f.htmlMode?u:_;for(var o in v)C[o]=v[o];for(var o in f)C[o]=f[o];var a,r;function h(T,N){function j(K){return N.tokenize=K,K(T,N)}var L=T.next();if(L=="<")return T.eat("!")?T.eat("[")?T.match("CDATA[")?j(w("atom","]]>")):null:T.match("--")?j(w("comment","-->")):T.match("DOCTYPE",!0,!0)?(T.eatWhile(/[\w\._\-]/),j(g(1))):null:T.eat("?")?(T.eatWhile(/[\w\._\-]/),N.tokenize=w("meta","?>"),"meta"):(a=T.eat("/")?"closeTag":"openTag",N.tokenize=m,"tag bracket");if(L=="&"){var V;return T.eat("#")?T.eat("x")?V=T.eatWhile(/[a-fA-F\d]/)&&T.eat(";"):V=T.eatWhile(/[\d]/)&&T.eat(";"):V=T.eatWhile(/[\w\.\-:]/)&&T.eat(";"),V?"atom":"error"}else return T.eatWhile(/[^&<]/),null}h.isInText=!0;function m(T,N){var j=T.next();if(j==">"||j=="/"&&T.eat(">"))return N.tokenize=h,a=j==">"?"endTag":"selfcloseTag","tag bracket";if(j=="=")return a="equals",null;if(j=="<"){N.tokenize=h,N.state=d,N.tagName=N.tagStart=null;var L=N.tokenize(T,N);return L?L+" tag error":"tag error"}else return/[\'\"]/.test(j)?(N.tokenize=p(j),N.stringStartCol=T.column(),N.tokenize(T,N)):(T.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(T){var N=function(j,L){for(;!j.eol();)if(j.next()==T){L.tokenize=m;break}return"string"};return N.isInAttribute=!0,N}function w(T,N){return function(j,L){for(;!j.eol();){if(j.match(N)){L.tokenize=h;break}j.next()}return T}}function g(T){return function(N,j){for(var L;(L=N.next())!=null;){if(L=="<")return j.tokenize=g(T+1),j.tokenize(N,j);if(L==">")if(T==1){j.tokenize=h;break}else return j.tokenize=g(T-1),j.tokenize(N,j)}return"meta"}}function c(T,N,j){this.prev=T.context,this.tagName=N,this.indent=T.indented,this.startOfLine=j,(C.doNotIndent.hasOwnProperty(N)||T.context&&T.context.noIndent)&&(this.noIndent=!0)}function n(T){T.context&&(T.context=T.context.prev)}function s(T,N){for(var j;;){if(!T.context)return;if(j=T.context.tagName,!C.contextGrabbers.hasOwnProperty(j)||!C.contextGrabbers[j].hasOwnProperty(N))return;n(T)}}function d(T,N,j){return T=="openTag"?(j.tagStart=N.column(),S):T=="closeTag"?y:d}function S(T,N,j){return T=="word"?(j.tagName=N.current(),r="tag",O):C.allowMissingTagName&&T=="endTag"?(r="tag bracket",O(T,N,j)):(r="error",S)}function y(T,N,j){if(T=="word"){var L=N.current();return j.context&&j.context.tagName!=L&&C.implicitlyClosed.hasOwnProperty(j.context.tagName)&&n(j),j.context&&j.context.tagName==L||C.matchClosing===!1?(r="tag",i):(r="tag error",k)}else return C.allowMissingTagName&&T=="endTag"?(r="tag bracket",i(T,N,j)):(r="error",k)}function i(T,N,j){return T!="endTag"?(r="error",i):(n(j),d)}function k(T,N,j){return r="error",i(T,N,j)}function O(T,N,j){if(T=="word")return r="attribute",b;if(T=="endTag"||T=="selfcloseTag"){var L=j.tagName,V=j.tagStart;return j.tagName=j.tagStart=null,T=="selfcloseTag"||C.autoSelfClosers.hasOwnProperty(L)?s(j,L):(s(j,L),j.context=new c(j,L,V==j.indented)),d}return r="error",O}function b(T,N,j){return T=="equals"?E:(C.allowMissing||(r="error"),O(T,N,j))}function E(T,N,j){return T=="string"?x:T=="word"&&C.allowUnquoted?(r="string",O):(r="error",O(T,N,j))}function x(T,N,j){return T=="string"?x:O(T,N,j)}return{startState:function(T){var N={tokenize:h,state:d,indented:T||0,tagName:null,tagStart:null,context:null};return T!=null&&(N.baseIndent=T),N},token:function(T,N){if(!N.tagName&&T.sol()&&(N.indented=T.indentation()),T.eatSpace())return null;a=null;var j=N.tokenize(T,N);return(j||a)&&j!="comment"&&(r=null,N.state=N.state(a||j,T,N),r&&(j=r=="error"?j+" error":r)),j},indent:function(T,N,j){var L=T.context;if(T.tokenize.isInAttribute)return T.tagStart==T.indented?T.stringStartCol+1:T.indented+l;if(L&&L.noIndent)return M.Pass;if(T.tokenize!=m&&T.tokenize!=h)return j?j.match(/^(\s*)/)[0].length:0;if(T.tagName)return C.multilineTagIndentPastTag!==!1?T.tagStart+T.tagName.length+2:T.tagStart+l*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/$/,blockCommentStart:"",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(T){T.state==E&&(T.state=O)},xmlCurrentTag:function(T){return T.tagName?{name:T.tagName,close:T.type=="closeTag"}:null},xmlCurrentContext:function(T){for(var N=[],j=T.context;j;j=j.prev)j.tagName&&N.push(j.tagName);return N.reverse()}}}),M.defineMIME("text/xml","xml"),M.defineMIME("application/xml","xml"),M.mimeModes.hasOwnProperty("text/html")||M.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1uat":function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("MlIO"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.Hasher,f=u.x64,l=f.Word,C=f.WordArray,v=u.algo;function o(){return l.create.apply(l,arguments)}var a=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],r=[];(function(){for(var m=0;m<80;m++)r[m]=o()})();var h=v.SHA512=D.extend({_doReset:function(){this._hash=new C.init([new l.init(1779033703,4089235720),new l.init(3144134277,2227873595),new l.init(1013904242,4271175723),new l.init(2773480762,1595750129),new l.init(1359893119,2917565137),new l.init(2600822924,725511199),new l.init(528734635,4215389547),new l.init(1541459225,327033209)])},_doProcessBlock:function(m,p){for(var w=this._hash.words,g=w[0],c=w[1],n=w[2],s=w[3],d=w[4],S=w[5],y=w[6],i=w[7],k=g.high,O=g.low,b=c.high,E=c.low,x=n.high,T=n.low,N=s.high,j=s.low,L=d.high,V=d.low,K=S.high,W=S.low,G=y.high,F=y.low,B=i.high,H=i.low,q=k,re=O,ee=b,Ce=E,Ee=x,pe=T,Me=N,_e=j,he=L,ce=V,oe=K,Se=W,te=G,ue=F,Oe=B,le=H,Q=0;Q<80;Q++){var Y,Z,be=r[Q];if(Q<16)Z=be.high=m[p+Q*2]|0,Y=be.low=m[p+Q*2+1]|0;else{var ge=r[Q-15],Re=ge.high,Ze=ge.low,qe=(Re>>>1|Ze<<31)^(Re>>>8|Ze<<24)^Re>>>7,et=(Ze>>>1|Re<<31)^(Ze>>>8|Re<<24)^(Ze>>>7|Re<<25),nt=r[Q-2],ut=nt.high,ot=nt.low,je=(ut>>>19|ot<<13)^(ut<<3|ot>>>29)^ut>>>6,De=(ot>>>19|ut<<13)^(ot<<3|ut>>>29)^(ot>>>6|ut<<26),rt=r[Q-7],lt=rt.high,Je=rt.low,tt=r[Q-16],Ue=tt.high,ke=tt.low;Y=et+Je,Z=qe+lt+(Y>>>0>>0?1:0),Y=Y+De,Z=Z+je+(Y>>>0>>0?1:0),Y=Y+ke,Z=Z+Ue+(Y>>>0>>0?1:0),be.high=Z,be.low=Y}var Ie=he&oe^~he&te,ye=ce&Se^~ce&ue,Te=q&ee^q&Ee^ee&Ee,Ae=re&Ce^re&pe^Ce&pe,Pe=(q>>>28|re<<4)^(q<<30|re>>>2)^(q<<25|re>>>7),$e=(re>>>28|q<<4)^(re<<30|q>>>2)^(re<<25|q>>>7),Ke=(he>>>14|ce<<18)^(he>>>18|ce<<14)^(he<<23|ce>>>9),ct=(ce>>>14|he<<18)^(ce>>>18|he<<14)^(ce<<23|he>>>9),gt=a[Q],wt=gt.high,vt=gt.low,It=le+ct,Lt=Oe+Ke+(It>>>0>>0?1:0),It=It+ye,Lt=Lt+Ie+(It>>>0>>0?1:0),It=It+vt,Lt=Lt+wt+(It>>>0>>0?1:0),It=It+Y,Lt=Lt+Z+(It>>>0>>0?1:0),_t=$e+Ae,rr=Pe+Te+(_t>>>0<$e>>>0?1:0);Oe=te,le=ue,te=oe,ue=Se,oe=he,Se=ce,ce=_e+It|0,he=Me+Lt+(ce>>>0<_e>>>0?1:0)|0,Me=Ee,_e=pe,Ee=ee,pe=Ce,ee=q,Ce=re,re=It+_t|0,q=Lt+rr+(re>>>0>>0?1:0)|0}O=g.low=O+re,g.high=k+q+(O>>>0>>0?1:0),E=c.low=E+Ce,c.high=b+ee+(E>>>0>>0?1:0),T=n.low=T+pe,n.high=x+Ee+(T>>>0>>0?1:0),j=s.low=j+_e,s.high=N+Me+(j>>>0<_e>>>0?1:0),V=d.low=V+ce,d.high=L+he+(V>>>0>>0?1:0),W=S.low=W+Se,S.high=K+oe+(W>>>0>>0?1:0),F=y.low=F+ue,y.high=G+te+(F>>>0>>0?1:0),H=i.low=H+le,i.high=B+Oe+(H>>>0>>0?1:0)},_doFinalize:function(){var m=this._data,p=m.words,w=this._nDataBytes*8,g=m.sigBytes*8;p[g>>>5]|=128<<24-g%32,p[(g+128>>>10<<5)+30]=Math.floor(w/4294967296),p[(g+128>>>10<<5)+31]=w,m.sigBytes=p.length*4,this._process();var c=this._hash.toX32();return c},clone:function(){var m=D.clone.call(this);return m._hash=this._hash.clone(),m},blockSize:1024/32});u.SHA512=D._createHelper(h),u.HmacSHA512=D._createHmacHelper(h)}(),M.SHA512})},"3y9D":function(I,J,P){(function(M,u){I.exports=J=u(P("Ib8C"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.WordArray,f=_.Hasher,l=u.algo,C=[],v=l.SHA1=f.extend({_doReset:function(){this._hash=new D.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(o,a){for(var r=this._hash.words,h=r[0],m=r[1],p=r[2],w=r[3],g=r[4],c=0;c<80;c++){if(c<16)C[c]=o[a+c]|0;else{var n=C[c-3]^C[c-8]^C[c-14]^C[c-16];C[c]=n<<1|n>>>31}var s=(h<<5|h>>>27)+g+C[c];c<20?s+=(m&p|~m&w)+1518500249:c<40?s+=(m^p^w)+1859775393:c<60?s+=(m&p|m&w|p&w)-1894007588:s+=(m^p^w)-899497514,g=w,w=p,p=m<<30|m>>>2,m=h,h=s}r[0]=r[0]+h|0,r[1]=r[1]+m|0,r[2]=r[2]+p|0,r[3]=r[3]+w|0,r[4]=r[4]+g|0},_doFinalize:function(){var o=this._data,a=o.words,r=this._nDataBytes*8,h=o.sigBytes*8;return a[h>>>5]|=128<<24-h%32,a[(h+64>>>9<<4)+14]=Math.floor(r/4294967296),a[(h+64>>>9<<4)+15]=r,o.sigBytes=a.length*4,this._process(),this._hash},clone:function(){var o=f.clone.call(this);return o._hash=this._hash.clone(),o}});u.SHA1=f._createHelper(v),u.HmacSHA1=f._createHmacHelper(v)}(),M.SHA1})},4:function(I,J){},"5hvy":function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("MlIO"))})(this,function(M){return function(u){var _=M,D=_.lib,f=D.WordArray,l=D.Hasher,C=_.x64,v=C.Word,o=_.algo,a=[],r=[],h=[];(function(){for(var w=1,g=0,c=0;c<24;c++){a[w+5*g]=(c+1)*(c+2)/2%64;var n=g%5,s=(2*w+3*g)%5;w=n,g=s}for(var w=0;w<5;w++)for(var g=0;g<5;g++)r[w+5*g]=g+(2*w+3*g)%5*5;for(var d=1,S=0;S<24;S++){for(var y=0,i=0,k=0;k<7;k++){if(d&1){var O=(1<>>24)&16711935|(d<<24|d>>>8)&4278255360,S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360;var y=c[s];y.high^=S,y.low^=d}for(var i=0;i<24;i++){for(var k=0;k<5;k++){for(var O=0,b=0,E=0;E<5;E++){var y=c[k+5*E];O^=y.high,b^=y.low}var x=m[k];x.high=O,x.low=b}for(var k=0;k<5;k++)for(var T=m[(k+4)%5],N=m[(k+1)%5],j=N.high,L=N.low,O=T.high^(j<<1|L>>>31),b=T.low^(L<<1|j>>>31),E=0;E<5;E++){var y=c[k+5*E];y.high^=O,y.low^=b}for(var V=1;V<25;V++){var O,b,y=c[V],K=y.high,W=y.low,G=a[V];G<32?(O=K<>>32-G,b=W<>>32-G):(O=W<>>64-G,b=K<>>64-G);var F=m[r[V]];F.high=O,F.low=b}var B=m[0],H=c[0];B.high=H.high,B.low=H.low;for(var k=0;k<5;k++)for(var E=0;E<5;E++){var V=k+5*E,y=c[V],q=m[V],re=m[(k+1)%5+5*E],ee=m[(k+2)%5+5*E];y.high=q.high^~re.high&ee.high,y.low=q.low^~re.low&ee.low}var y=c[0],Ce=h[i];y.high^=Ce.high,y.low^=Ce.low}},_doFinalize:function(){var w=this._data,g=w.words,c=this._nDataBytes*8,n=w.sigBytes*8,s=this.blockSize*32;g[n>>>5]|=1<<24-n%32,g[(u.ceil((n+1)/s)*s>>>5)-1]|=128,w.sigBytes=g.length*4,this._process();for(var d=this._state,S=this.cfg.outputLength/8,y=S/8,i=[],k=0;k>>24)&16711935|(b<<24|b>>>8)&4278255360,E=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,i.push(E),i.push(b)}return new f.init(i,S)},clone:function(){for(var w=l.clone.call(this),g=w._state=this._state.slice(0),c=0;c<25;c++)g[c]=g[c].clone();return w}});_.SHA3=l._createHelper(p),_.HmacSHA3=l._createHmacHelper(p)}(Math),M.SHA3})},"5nXd":function(I,J,P){var M=P("MFOe"),u=M.slice,_=M.pluck,D=M.each,f=M.bind,l=M.create,C=M.isList,v=M.isFunction,o=M.isObject;I.exports={createStore:h};var a={version:"2.0.12",enabled:!1,get:function(m,p){var w=this.storage.read(this._namespacePrefix+m);return this._deserialize(w,p)},set:function(m,p){return p===void 0?this.remove(m):(this.storage.write(this._namespacePrefix+m,this._serialize(p)),p)},remove:function(m){this.storage.remove(this._namespacePrefix+m)},each:function(m){var p=this;this.storage.each(function(w,g){m.call(p,p._deserialize(w),(g||"").replace(p._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(m){return this._namespacePrefix=="__storejs_"+m+"_"},createStore:function(){return h.apply(this,arguments)},addPlugin:function(m){this._addPlugin(m)},namespace:function(m){return h(this.storage,this.plugins,m)}};function r(){var m=typeof console=="undefined"?null:console;if(!m)return;var p=m.warn?m.warn:m.log;p.apply(m,arguments)}function h(m,p,w){w||(w=""),m&&!C(m)&&(m=[m]),p&&!C(p)&&(p=[p]);var g=w?"__storejs_"+w+"_":"",c=w?new RegExp("^"+g):null,n=/^[a-zA-Z0-9_\-]*$/;if(!n.test(w))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var s={_namespacePrefix:g,_namespaceRegexp:c,_testStorage:function(S){try{var y="__storejs__test__";S.write(y,y);var i=S.read(y)===y;return S.remove(y),i}catch(k){return!1}},_assignPluginFnProp:function(S,y){var i=this[y];this[y]=function(){var O=u(arguments,0),b=this;function E(){return i?(D(arguments,function(T,N){O[N]=T}),i.apply(b,O)):void 0}var x=[E].concat(O);return S.apply(b,x)}},_serialize:function(S){return JSON.stringify(S)},_deserialize:function(S,y){if(!S)return y;var i="";try{i=JSON.parse(S)}catch(k){i=S}return i!==void 0?i:y},_addStorage:function(S){if(this.enabled)return;this._testStorage(S)&&(this.storage=S,this.enabled=!0)},_addPlugin:function(S){var y=this;if(C(S)){D(S,function(O){y._addPlugin(O)});return}var i=_(this.plugins,function(O){return S===O});if(i)return;if(this.plugins.push(S),!v(S))throw new Error("Plugins must be function values that return objects");var k=S.call(this);if(!o(k))throw new Error("Plugins must return an object of function properties");D(k,function(O,b){if(!v(O))throw new Error("Bad plugin property: "+b+" from plugin "+S.name+". Plugins should only return functions.");y._assignPluginFnProp(O,b)})},addStorage:function(S){r("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(S)}},d=l(s,a,{plugins:[]});return d.raw={},D(d,function(S,y){v(S)&&(d.raw[y]=f(d,S))}),D(m,function(S){d._addStorage(S)}),D(p,function(S){d._addPlugin(S)}),d}},"6+eU":function(I,J,P){"use strict";P.d(J,"a",function(){return i});var M=P("wx14"),u=P("rePB"),_=P("VTBJ"),D=P("1OyB"),f=P("vuIU"),l=P("Ji7U"),C=P("LK+K"),v=P("q1tI"),o=P.n(v),a=P("TSYQ"),r=P.n(a),h=function(O){var b,E="".concat(O.rootPrefixCls,"-item"),x=r()(E,"".concat(E,"-").concat(O.page),(b={},Object(u.a)(b,"".concat(E,"-active"),O.active),Object(u.a)(b,O.className,!!O.className),Object(u.a)(b,"".concat(E,"-disabled"),!O.page),b)),T=function(){O.onClick(O.page)},N=function(L){O.onKeyPress(L,O.onClick,O.page)};return o.a.createElement("li",{title:O.showTitle?O.page:null,className:x,onClick:T,onKeyPress:N,tabIndex:"0"},O.itemRender(O.page,"page",o.a.createElement("a",{rel:"nofollow"},O.page)))},m=h,p={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},w=function(k){Object(l.a)(b,k);var O=Object(C.a)(b);function b(){var E;Object(D.a)(this,b);for(var x=arguments.length,T=new Array(x),N=0;N=0||j.relatedTarget.className.indexOf("".concat(W,"-next"))>=0))return;E.setState({goInputText:""}),K(E.getValidValue())},E.go=function(j){var L=E.state.goInputText;if(L==="")return;(j.keyCode===p.ENTER||j.type==="click")&&(E.setState({goInputText:""}),E.props.quickGo(E.getValidValue()))},E}return Object(f.a)(b,[{key:"getValidValue",value:function(){var x=this.state,T=x.goInputText,N=x.current;return!T||isNaN(T)?N:Number(T)}},{key:"getPageSizeOptions",value:function(){var x=this.props,T=x.pageSize,N=x.pageSizeOptions;return N.some(function(j){return j.toString()===T.toString()})?N:N.concat([T.toString()]).sort(function(j,L){var V=isNaN(Number(j))?0:Number(j),K=isNaN(Number(L))?0:Number(L);return V-K})}},{key:"render",value:function(){var x=this,T=this.props,N=T.pageSize,j=T.locale,L=T.rootPrefixCls,V=T.changeSize,K=T.quickGo,W=T.goButton,G=T.selectComponentClass,F=T.buildOptionText,B=T.selectPrefixCls,H=T.disabled,q=this.state.goInputText,re="".concat(L,"-options"),ee=G,Ce=null,Ee=null,pe=null;if(!V&&!K)return null;var Me=this.getPageSizeOptions();if(V&&ee){var _e=Me.map(function(he,ce){return o.a.createElement(ee.Option,{key:ce,value:he.toString()},(F||x.buildOptionText)(he))});Ce=o.a.createElement(ee,{disabled:H,prefixCls:B,showSearch:!1,className:"".concat(re,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(N||Me[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ce){return ce.parentNode}},_e)}return K&&(W&&(pe=typeof W=="boolean"?o.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(re,"-quick-jumper-button")},j.jump_to_confirm):o.a.createElement("span",{onClick:this.go,onKeyUp:this.go},W)),Ee=o.a.createElement("div",{className:"".concat(re,"-quick-jumper")},j.jump_to,o.a.createElement("input",{disabled:H,type:"text",value:q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),j.page,pe)),o.a.createElement("li",{className:"".concat(re)},Ce,Ee)}}]),b}(o.a.Component);w.defaultProps={pageSizeOptions:["10","20","50","100"]};var g=w,c=P("N2Kk");function n(){}function s(k){return typeof k=="number"&&isFinite(k)&&Math.floor(k)===k}function d(k,O,b){return b}function S(k,O,b){var E=typeof k=="undefined"?O.pageSize:k;return Math.floor((b.total-1)/E)+1}var y=function(k){Object(l.a)(b,k);var O=Object(C.a)(b);function b(E){var x;Object(D.a)(this,b),x=O.call(this,E),x.getJumpPrevPage=function(){return Math.max(1,x.state.current-(x.props.showLessItems?3:5))},x.getJumpNextPage=function(){return Math.min(S(void 0,x.state,x.props),x.state.current+(x.props.showLessItems?3:5))},x.getItemIcon=function(V,K){var W=x.props.prefixCls,G=V||o.a.createElement("button",{type:"button","aria-label":K,className:"".concat(W,"-item-link")});return typeof V=="function"&&(G=o.a.createElement(V,Object(_.a)({},x.props))),G},x.savePaginationNode=function(V){x.paginationNode=V},x.isValid=function(V){return s(V)&&V!==x.state.current},x.shouldDisplayQuickJumper=function(){var V=x.props,K=V.showQuickJumper,W=V.pageSize,G=V.total;return G<=W?!1:K},x.handleKeyDown=function(V){(V.keyCode===p.ARROW_UP||V.keyCode===p.ARROW_DOWN)&&V.preventDefault()},x.handleKeyUp=function(V){var K=x.getValidValue(V),W=x.state.currentInputValue;K!==W&&x.setState({currentInputValue:K}),V.keyCode===p.ENTER?x.handleChange(K):V.keyCode===p.ARROW_UP?x.handleChange(K-1):V.keyCode===p.ARROW_DOWN&&x.handleChange(K+1)},x.changePageSize=function(V){var K=x.state.current,W=S(V,x.state,x.props);K=K>W?W:K,W===0&&(K=x.state.current),typeof V=="number"&&("pageSize"in x.props||x.setState({pageSize:V}),"current"in x.props||x.setState({current:K,currentInputValue:K})),x.props.onShowSizeChange(K,V),"onChange"in x.props&&x.props.onChange&&x.props.onChange(K,V)},x.handleChange=function(V){var K=x.props.disabled,W=V;if(x.isValid(W)&&!K){var G=S(void 0,x.state,x.props);W>G?W=G:W<1&&(W=1),"current"in x.props||x.setState({current:W,currentInputValue:W});var F=x.state.pageSize;return x.props.onChange(W,F),W}return x.state.current},x.prev=function(){x.hasPrev()&&x.handleChange(x.state.current-1)},x.next=function(){x.hasNext()&&x.handleChange(x.state.current+1)},x.jumpPrev=function(){x.handleChange(x.getJumpPrevPage())},x.jumpNext=function(){x.handleChange(x.getJumpNextPage())},x.hasPrev=function(){return x.state.current>1},x.hasNext=function(){return x.state.current2?W-2:0),F=2;F=N?L=N:L=Number(T),L}},{key:"getShowSizeChanger",value:function(){var x=this.props,T=x.showSizeChanger,N=x.total,j=x.totalBoundaryShowSizeChanger;return typeof T!="undefined"?T:N>j}},{key:"renderPrev",value:function(x){var T=this.props,N=T.prevIcon,j=T.itemRender,L=j(x,"prev",this.getItemIcon(N,"prev page")),V=!this.hasPrev();return Object(v.isValidElement)(L)?Object(v.cloneElement)(L,{disabled:V}):L}},{key:"renderNext",value:function(x){var T=this.props,N=T.nextIcon,j=T.itemRender,L=j(x,"next",this.getItemIcon(N,"next page")),V=!this.hasNext();return Object(v.isValidElement)(L)?Object(v.cloneElement)(L,{disabled:V}):L}},{key:"render",value:function(){var x=this,T=this.props,N=T.prefixCls,j=T.className,L=T.style,V=T.disabled,K=T.hideOnSinglePage,W=T.total,G=T.locale,F=T.showQuickJumper,B=T.showLessItems,H=T.showTitle,q=T.showTotal,re=T.simple,ee=T.itemRender,Ce=T.showPrevNextJumpers,Ee=T.jumpPrevIcon,pe=T.jumpNextIcon,Me=T.selectComponentClass,_e=T.selectPrefixCls,he=T.pageSizeOptions,ce=this.state,oe=ce.current,Se=ce.pageSize,te=ce.currentInputValue;if(K===!0&&W<=Se)return null;var ue=S(void 0,this.state,this.props),Oe=[],le=null,Q=null,Y=null,Z=null,be=null,ge=F&&F.goButton,Re=B?1:2,Ze=oe-1>0?oe-1:0,qe=oe+1=Re*2&&oe!==1+2&&(Oe[0]=Object(v.cloneElement)(Oe[0],{className:"".concat(N,"-item-after-jump-prev")}),Oe.unshift(le)),ue-oe>=Re*2&&oe!==ue-2&&(Oe[Oe.length-1]=Object(v.cloneElement)(Oe[Oe.length-1],{className:"".concat(N,"-item-before-jump-next")}),Oe.push(Q)),rt!==1&&Oe.unshift(Y),lt!==ue&&Oe.push(Z)}var Ue=null;q&&(Ue=o.a.createElement("li",{className:"".concat(N,"-total-text")},q(W,[W===0?0:(oe-1)*Se+1,oe*Se>W?W:oe*Se])));var ke=!this.hasPrev()||!ue,Ie=!this.hasNext()||!ue;return o.a.createElement("ul",Object(M.a)({className:r()(N,j,Object(u.a)({},"".concat(N,"-disabled"),V)),style:L,unselectable:"unselectable",ref:this.savePaginationNode},et),Ue,o.a.createElement("li",{title:H?G.prev_page:null,onClick:this.prev,tabIndex:ke?null:0,onKeyPress:this.runIfEnterPrev,className:r()("".concat(N,"-prev"),Object(u.a)({},"".concat(N,"-disabled"),ke)),"aria-disabled":ke},this.renderPrev(Ze)),Oe,o.a.createElement("li",{title:H?G.next_page:null,onClick:this.next,tabIndex:Ie?null:0,onKeyPress:this.runIfEnterNext,className:r()("".concat(N,"-next"),Object(u.a)({},"".concat(N,"-disabled"),Ie)),"aria-disabled":Ie},this.renderNext(qe)),o.a.createElement(g,{disabled:V,locale:G,rootPrefixCls:N,selectComponentClass:Me,selectPrefixCls:_e,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:oe,pageSize:Se,pageSizeOptions:he,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ge}))}}],[{key:"getDerivedStateFromProps",value:function(x,T){var N={};if("current"in x&&(N.current=x.current,x.current!==T.current&&(N.currentInputValue=N.current)),"pageSize"in x&&x.pageSize!==T.pageSize){var j=T.current,L=S(x.pageSize,T,x);j=j>L?L:j,"current"in x||(N.current=j,N.currentInputValue=j),N.pageSize=x.pageSize}return N}}]),b}(o.a.Component);y.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:n,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:n,locale:c.a,style:{},itemRender:d,totalBoundaryShowSizeChanger:50};var i=y},"6RRn":function(I,J,P){"use strict";var M=P("wCXF"),u=P("n6Qo");P.d(J,"b",function(){return u.a});var _=P("IBYe"),D=P("6eGT"),f=P("hW8S");P.d(J,"a",function(){return f.a}),J.c=M.b},"6eGT":function(I,J,P){"use strict";function M(u){return null}J.a=M},"7Cbv":function(I,J,P){"use strict";var M=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),u=new Uint8Array(16);function _(){if(!M)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return M(u)}var D=/^(?:[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 f(m){return typeof m=="string"&&D.test(m)}for(var l=f,C=[],v=0;v<256;++v)C.push((v+256).toString(16).substr(1));function o(m){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,w=(C[m[p+0]]+C[m[p+1]]+C[m[p+2]]+C[m[p+3]]+"-"+C[m[p+4]]+C[m[p+5]]+"-"+C[m[p+6]]+C[m[p+7]]+"-"+C[m[p+8]]+C[m[p+9]]+"-"+C[m[p+10]]+C[m[p+11]]+C[m[p+12]]+C[m[p+13]]+C[m[p+14]]+C[m[p+15]]).toLowerCase();if(!l(w))throw TypeError("Stringified UUID is invalid");return w}var a=o;function r(m,p,w){m=m||{};var g=m.random||(m.rng||_)();if(g[6]=g[6]&15|64,g[8]=g[8]&63|128,p){w=w||0;for(var c=0;c<16;++c)p[w+c]=g[c];return p}return a(g)}var h=J.a=r},"7ahc":function(I,J,P){"use strict";P.d(J,"a",function(){return S});var M=P("k1fw"),u=P("0Owb"),_=P("+L6B"),D=P("2/Rp"),f=P("y8nQ"),l=P("Vl3Y"),C=P("tJVT"),v=P("OaEy"),o=P("2fM7"),a=P("q1tI"),r=P.n(a),h=P("VrN/"),m=P.n(h),p=P("p77/"),w=P.n(p),g=P("c5Ni"),c=P.n(g),n=o.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};J.b=function(y){var i=y.callback,k=y.onCancel,O=Object(a.useState)("python"),b=Object(C.a)(O,2),E=b[0],x=b[1];function T(j){x(d[j][1])}function N(j){i(j)}return r.a.createElement(l.a,Object(u.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:N}),r.a.createElement(l.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},r.a.createElement(o.a,{onChange:T},Object.keys(d).map(function(j){return r.a.createElement(n,{key:j,value:j},d[j][0])}))),r.a.createElement(l.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},r.a.createElement(S,{mode:E})),r.a.createElement("div",{className:"flex-container flex-end"},r.a.createElement(D.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),r.a.createElement(D.a,{type:"ghost",onClick:k},"\u53D6\u6D88")))};function S(y){var i=y.value,k=y.onChange,O=y.mode,b=y.options,E=b===void 0?{}:b,x=Object(a.useRef)(),T=Object(a.useState)(),N=Object(C.a)(T,2),j=N[0],L=N[1];return Object(a.useEffect)(function(){if(j){function V(K){var W=K.getValue();k&&k(W)}return j.on("change",V),function(){j.off("change",V)}}},[j,k]),Object(a.useEffect)(function(){j&&j.setOption("mode",O)},[j,O]),Object(a.useEffect)(function(){j&&((i!==j.getValue()||i==="")&&setTimeout(function(){j.setValue(i||" ")},300))},[j,i]),Object(a.useEffect)(function(){if(x.current&&!j){var V=m.a.fromTextArea(x.current,Object(M.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));L(V)}},[x.current,j]),r.a.createElement("div",{className:"my-codemirror-container"},r.a.createElement("textarea",{ref:x}))}},"815F":function(I,J,P){"use strict";P.d(J,"e",function(){return C}),P.d(J,"c",function(){return o}),P.d(J,"d",function(){return a}),P.d(J,"a",function(){return h}),P.d(J,"f",function(){return m}),P.d(J,"b",function(){return p});var M=P("KQm4"),u=P("VTBJ"),_=P("Ff2n"),D=P("Zm9Q"),f=P("Kwbf"),l=P("OZM5");function C(w,g){return w!=null?w:g}function v(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],g=new Map;function c(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(d){var S=d.key,y=d.children;Object(f.a)(S!=null,"Tree node must have a certain key: [".concat(s).concat(S,"]"));var i=String(S);Object(f.a)(!g.has(i)||S===null||S===void 0,"Same 'key' exist in the Tree: ".concat(i)),g.set(i,!0),c(y,"".concat(s).concat(i," > "))})}c(w)}function o(w){function g(c){var n=Object(D.a)(c);return n.map(function(s){if(!Object(l.i)(s))return Object(f.a)(!s,"Tree/TreeNode can only accept TreeNode as children."),null;var d=s.key,S=s.props,y=S.children,i=Object(_.a)(S,["children"]),k=Object(u.a)({key:d},i),O=g(y);return O.length&&(k.children=O),k}).filter(function(s){return s})}return g(w)}function a(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=new Set(g===!0?[]:g),n=[];function s(d){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d.map(function(y,i){var k=Object(l.h)(S?S.pos:"0",i),O=C(y.key,k),b=Object(u.a)(Object(u.a)({},y),{},{parent:S,pos:k,children:null,data:y,isStart:[].concat(Object(M.a)(S?S.isStart:[]),[i===0]),isEnd:[].concat(Object(M.a)(S?S.isEnd:[]),[i===d.length-1])});return n.push(b),g===!0||c.has(O)?b.children=s(y.children||[],b):b.children=[],b})}return s(w),n}function r(w,g,c){var n;c?typeof c=="string"?n=function(S){return S[c]}:typeof c=="function"&&(n=function(S){return c(S)}):n=function(S,y){return C(S.key,y)};function s(d,S,y){var i=d?d.children:w,k=d?Object(l.h)(y.pos,S):"0";if(d){var O=n(d,k),b={node:d,index:S,pos:k,key:O,parentPos:y.node?y.pos:null,level:y.level+1};g(b)}i&&i.forEach(function(E,x){s(E,x,{node:d,pos:k,level:y?y.level+1:-1})})}s(null)}function h(w){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=g.initWrapper,n=g.processEntity,s=g.onProcessFinished,d=arguments.length>2?arguments[2]:void 0,S={},y={},i={posEntities:S,keyEntities:y};return c&&(i=c(i)||i),r(w,function(k){var O=k.node,b=k.index,E=k.pos,x=k.key,T=k.parentPos,N=k.level,j={node:O,index:b,key:x,pos:E,level:N},L=C(x,E);S[E]=j,y[L]=j,j.parent=S[T],j.parent&&(j.parent.children=j.parent.children||[],j.parent.children.push(j)),n&&n(j,i)},d),s&&s(i),i}function m(w,g){var c=g.expandedKeys,n=g.selectedKeys,s=g.loadedKeys,d=g.loadingKeys,S=g.checkedKeys,y=g.halfCheckedKeys,i=g.dragOverNodeKey,k=g.dropPosition,O=g.keyEntities,b=O[w],E={eventKey:w,expanded:c.indexOf(w)!==-1,selected:n.indexOf(w)!==-1,loaded:s.indexOf(w)!==-1,loading:d.indexOf(w)!==-1,checked:S.indexOf(w)!==-1,halfChecked:y.indexOf(w)!==-1,pos:String(b?b.pos:""),dragOver:i===w&&k===0,dragOverGapTop:i===w&&k===-1,dragOverGapBottom:i===w&&k===1};return E}function p(w){var g=w.data,c=w.expanded,n=w.selected,s=w.checked,d=w.loaded,S=w.loading,y=w.halfChecked,i=w.dragOver,k=w.dragOverGapTop,O=w.dragOverGapBottom,b=w.pos,E=w.active,x=Object(u.a)(Object(u.a)({},g),{},{expanded:c,selected:n,checked:s,loaded:d,loading:S,halfChecked:y,dragOver:i,dragOverGapTop:k,dragOverGapBottom:O,pos:b,active:E});return"props"in x||Object.defineProperty(x,"props",{get:function(){return Object(f.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),w}}),x}},"8EBN":function(I,J,P){(function(M){M(P("VrN/"))})(function(M){"use strict";M.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 u=0;u-1&&D.substring(C+1,D.length);if(v)return M.findModeByExtension(v)},M.findModeByName=function(D){D=D.toLowerCase();for(var f=0;f=ne.length?de.slice(ne.length):de}).join(` `)}var c=[],n=["
    "],s=new p.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function S(){c.length=0,n=["
      "]}var y={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function i(se,z,X,ne){if(z>=se.length||se[z].level<=X)return z;var de=se[z];ne.push("
    • "+de.text+""),z++;var ie=[];return z=i(se,z,de.level,ie),ie.length>0&&(ne.push("
        "),ie.forEach(function(ze){ne.push(ze)}),ne.push("
      ")),ne.push("
    • "),z=i(se,z,X,ne),z}function k(){return i(c,0,0,n),n.push("
    "),n.join("")}var O={heading:function(z){var X=d.exec(z);if(X)return{type:"heading",raw:X[0],depth:X[1].length,text:X[2]}},fences:function(z){var X=this.rules.block.fences.exec(z);if(X){var ne=X[0],de=g(ne,X[3]||""),ie=X[2]?X[2].trim():X[2];if(["latex","katex","math"].indexOf(ie)>=0){var ze=x(),ht=de;de=ze,T[ze]={type:"block",expression:ht}}return{type:"code",raw:ne,lang:ie,text:de}}}},b=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,x=function(){return"__special_katext_id_".concat(E++,"__")},T={};function N(){return T}function j(){E=0,T={}}function L(se){return se=se.replace(b,function(z,X){var ne=x();return T[ne]={type:"inline",expression:X},ne}),se}var V=s.listitem;s.listitem=function(se){return V(L(se))};var K=s.paragraph;s.paragraph=function(se){return K(L(se))};var W=s.tablecell;s.tablecell=function(se,z){return W(L(se),z)},s.code=function(se,z,X){var ne=(z||"").match(/\S*/)[0];return ne?["latex","katex","math"].indexOf(ne)>=0?"

    ".concat(se,"

    "):'
    ').concat(X?se:Object(w.escape)(se,!0),`
    `):'
    '+(X?se:Object(w.escape)(se,!0))+"
    "},s.heading=function(se,z,X){var ne=this.options.headerPrefix+X.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:ne,level:z,text:se}),"'+se+""},p.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),p.a.use({tokenizer:O,renderer:s});var G=p.a,F=P("SJMd"),B=P("ulZh"),H=P.n(B),q=P("m3rI"),re=P("Oy/b"),ee=P("p5ED"),Ce=P("ErOA");/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Ee=function(se,z){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,ne){X.__proto__=ne}||function(X,ne){for(var de in ne)Object.prototype.hasOwnProperty.call(ne,de)&&(X[de]=ne[de])})(se,z)};function pe(se,z){function X(){this.constructor=se}Ee(se,z),se.prototype=z===null?Object.create(z):(X.prototype=z.prototype,new X)}function Me(se,z,X,ne){return new(X||(X=Promise))(function(de,ie){function ze(Pt){try{St(ne.next(Pt))}catch(pt){ie(pt)}}function ht(Pt){try{St(ne.throw(Pt))}catch(pt){ie(pt)}}function St(Pt){var pt;Pt.done?de(Pt.value):(pt=Pt.value,pt instanceof X?pt:new X(function(Ht){Ht(pt)})).then(ze,ht)}St((ne=ne.apply(se,z||[])).next())})}function _e(se,z){var X,ne,de,ie,ze={label:0,sent:function(){if(1&de[0])throw de[1];return de[1]},trys:[],ops:[]};return ie={next:ht(0),throw:ht(1),return:ht(2)},typeof Symbol=="function"&&(ie[Symbol.iterator]=function(){return this}),ie;function ht(St){return function(Pt){return function(pt){if(X)throw new TypeError("Generator is already executing.");for(;ze;)try{if(X=1,ne&&(de=2&pt[0]?ne.return:pt[0]?ne.throw||((de=ne.return)&&de.call(ne),0):ne.next)&&!(de=de.call(ne,pt[1])).done)return de;switch(ne=0,de&&(pt=[2&pt[0],de.value]),pt[0]){case 0:case 1:de=pt;break;case 4:return ze.label++,{value:pt[1],done:!1};case 5:ze.label++,ne=pt[1],pt=[0];continue;case 7:pt=ze.ops.pop(),ze.trys.pop();continue;default:if(!(de=ze.trys,(de=de.length>0&&de[de.length-1])||pt[0]!==6&&pt[0]!==2)){ze=0;continue}if(pt[0]===3&&(!de||pt[1]>de[0]&&pt[1]',"select"),this.addActionButton(ne,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ne,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ne,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ne,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ne,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ne,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ne,'',"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(ie){var ze=document.createElement("div");ze.className=""+X.toolbarButtonStyleClass.name,ze.setAttribute("data-type-name",ie.typeName),ze.innerHTML=ie.icon,ze.addEventListener("click",function(){X.markerToolbarButtonClicked(ze,ie)}),X.buttons.push(ze),X.markerButtons.push(ze)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var de=document.createElement("div");de.className=this.toolbarBlockStyleClass.name,de.style.whiteSpace="nowrap",de.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(de),this.addActionButton(de,'',"render"),this.addActionButton(de,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},se.prototype.addButtonClickListener=function(z){this.buttonClickListeners.push(z)},se.prototype.removeButtonClickListener=function(z){this.buttonClickListeners.indexOf(z)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(z),1)},se.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},se.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var z=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var X=0;X0&&this.buttonClickListeners.forEach(function(ne){return ne("marker",X)}),this.markerButtonOverflowBlock.style.display="none"},se.prototype.actionToolbarButtonClicked=function(z,X){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ne){return ne("action",X)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},se.prototype.setActiveButton=function(z){this.resetButtonStyles(),z.className=z.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),z.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},se.prototype.setActiveMarkerButton=function(z){var X=this.markerButtons.find(function(ne){return ne.getAttribute("data-type-name")===z});X&&this.setActiveButton(X)},se.prototype.setCurrentMarker=function(z){var X=this;this.currentMarker=z,this.buttons.filter(function(ne){return/delete|notes/.test(ne.getAttribute("data-action"))}).forEach(function(ne){X.currentMarker===void 0?(ne.style.fillOpacity="0.4",ne.style.pointerEvents="none"):(ne.style.fillOpacity="1",ne.style.pointerEvents="all")})},se}(),Y=function(){function se(z,X,ne,de){this.panels=[],this.panelButtons=[],this.markerjsContainer=z,this.displayMode=X,this.uiStyleSettings=ne,this.styles=de,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return se.prototype.addStyles=function(){var z;this.toolboxStyleClass=this.styles.addClass(new le("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 le("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var X=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new le("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new le("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new le("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 le("toolbox-panel-row_colors",` background-color: `+((z=this.uiStyleSettings.toolboxBackgroundColor)!==null&&z!==void 0?z:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new le("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*X)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*X)+`px; padding: `+X+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new le("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new le("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new Oe("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new Oe("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},se.prototype.show=function(z){var X;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=z,this.uiContainer.className=this.toolboxStyleClass.name+" "+((X=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},se.prototype.setPanelButtons=function(z){var X,ne,de=this;this.panels=z,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((X=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ne=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ne!==void 0?ne:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(ie){var ze;ie.uiStyleSettings=de.uiStyleSettings;var ht=document.createElement("div");ht.className=de.toolboxButtonStyleClass.name+" "+((ze=de.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ze!==void 0?ze:de.toolboxButtonStyleColorsClass.name),ht.innerHTML=ie.icon,ht.title=ie.title,ht.addEventListener("click",function(){de.panelButtonClick(ie)}),de.panelButtons.push(ht),de.buttonRow.appendChild(ht)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},se.prototype.panelButtonClick=function(z){var X=this,ne=-1;if(z!==this.activePanel){ne=this.panels.indexOf(z),this.panelRow.innerHTML="";var de=z.getUi();de.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(de),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=z}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){X.displayMode==="inline"?X.panelRow.style.display="none":X.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(ie,ze){var ht,St;ie.className=X.toolboxButtonStyleClass.name+" "+(ze===ne?""+((ht=X.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ht!==void 0?ht:X.toolboxActiveButtonStyleColorsClass.name):""+((St=X.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&St!==void 0?St:X.toolboxButtonStyleColorsClass.name))})},se}(),Z=function(se,z){this.title=se,this.icon=z},be=function(se){function z(X,ne,de,ie){var ze=se.call(this,X,ie||'')||this;return ze.colors=[],ze.addTransparent=!1,ze.colorBoxes=[],ze.colors=ne,ze.currentColor=de,ze.setCurrentColor=ze.setCurrentColor.bind(ze),ze.getColorBox=ze.getColorBox.bind(ze),ze}return pe(z,se),z.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.overflow="hidden",ne.style.whiteSpace="nowrap",this.colors.forEach(function(de){var ie=X.getColorBox(de);ne.appendChild(ie),X.colorBoxes.push(ie)}),ne},z.prototype.getColorBox=function(X){var ne=this,de=this.uiStyleSettings.toolbarHeight/4,ie=this.uiStyleSettings.toolbarHeight-de,ze=document.createElement("div");ze.style.display="inline-block",ze.style.boxSizing="content-box",ze.style.width=ie-2+"px",ze.style.height=ie-2+"px",ze.style.padding="1px",ze.style.marginRight="2px",ze.style.marginBottom="2px",ze.style.borderWidth="2px",ze.style.borderStyle="solid",ze.style.borderRadius=(ie+2)/2+"px",ze.style.borderColor=X===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ze.addEventListener("click",function(){ne.setCurrentColor(X,ze)});var ht=document.createElement("div");return ht.style.display="inline-block",ht.style.width=ie-2+"px",ht.style.height=ie-2+"px",ht.style.backgroundColor=X,ht.style.borderRadius=ie/2+"px",X==="transparent"&&(ht.style.fill=this.uiStyleSettings.toolboxAccentColor,ht.innerHTML=` `),ze.appendChild(ht),ze},z.prototype.setCurrentColor=function(X,ne){var de=this;this.currentColor=X,this.colorBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?de.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(X)},z}(Z),ge=function(){function se(z,X,ne){this._state="new",this._isSelected=!1,this._container=z,this._overlayContainer=X,this.globalSettings=ne,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(se.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(z){return!1},Object.defineProperty(se.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),se.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},se.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},se.prototype.pointerDown=function(z,X){},se.prototype.dblClick=function(z,X){},se.prototype.manipulate=function(z){},se.prototype.pointerUp=function(z){this.stateChanged()},se.prototype.dispose=function(){},se.prototype.addMarkerVisualToContainer=function(z){this.container.childNodes.length>0?this.container.insertBefore(z,this.container.childNodes[0]):this.container.appendChild(z)},se.prototype.getState=function(){return{typeName:se.typeName,state:this.state,notes:this.notes}},se.prototype.restoreState=function(z){this._state=z.state,this.notes=z.notes},se.prototype.scale=function(z,X){},se.prototype.colorChanged=function(z){this.onColorChanged&&this.onColorChanged(z),this.stateChanged()},se.prototype.fillColorChanged=function(z){this.onFillColorChanged&&this.onFillColorChanged(z),this.stateChanged()},se.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var z=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),z.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(z)&&this.onStateChanged(this)}},se.typeName="MarkerBase",se}(),Re=function(){function se(){this.findGripByVisual=this.findGripByVisual.bind(this)}return se.prototype.findGripByVisual=function(z){return this.topLeft.ownsTarget(z)?this.topLeft:this.topCenter.ownsTarget(z)?this.topCenter:this.topRight.ownsTarget(z)?this.topRight:this.centerLeft.ownsTarget(z)?this.centerLeft:this.centerRight.ownsTarget(z)?this.centerRight:this.bottomLeft.ownsTarget(z)?this.bottomLeft:this.bottomCenter.ownsTarget(z)?this.bottomCenter:this.bottomRight.ownsTarget(z)?this.bottomRight:void 0},se}(),Ze=function(){function se(){this.GRIP_SIZE=10,this.visual=ce.createGroup(),this.visual.appendChild(ce.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ce.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return se.prototype.ownsTarget=function(z){return z===this.visual||z===this.visual.childNodes[0]||z===this.visual.childNodes[1]},se}(),qe=function(){function se(){}return se.toITransformMatrix=function(z){return{a:z.a,b:z.b,c:z.c,d:z.d,e:z.e,f:z.f}},se.toSVGMatrix=function(z,X){return z.a=X.a,z.b=X.b,z.c=X.c,z.d=X.d,z.e=X.e,z.f=X.f,z},se}(),et=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.left=0,ie.top=0,ie.width=0,ie.height=0,ie.defaultSize={x:50,y:20},ie.offsetX=0,ie.offsetY=0,ie.rotationAngle=0,ie.CB_DISTANCE=10,ie._suppressMarkerCreateEvent=!1,ie.container.transform.baseVal.appendItem(ce.createTransform()),ie.setupControlBox(),ie}return pe(z,se),Object.defineProperty(z.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"visual",{get:function(){return this._visual},set:function(X){this._visual=X;var ne=ce.createTransform();this._visual.transform.baseVal.appendItem(ne)},enumerable:!1,configurable:!0}),z.prototype.ownsTarget=function(X){return!!se.prototype.ownsTarget.call(this,X)||!!(this.controlGrips.findGripByVisual(X)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(X))},z.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="new"&&(this.left=X.x,this.top=X.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var de=this.unrotatePoint(X);if(this.manipulationStartX=de.x,this.manipulationStartY=de.y,this.offsetX=de.x-this.left,this.offsetY=de.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ne),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ne)){this.activeGrip=this.rotatorGrip;var ie=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=ie.x-this.width/2,this.top=ie.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ze=this.container.transform.baseVal.getItem(0);ze.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ze,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},z.prototype.pointerUp=function(X){var ne=this.state;se.prototype.pointerUp.call(this,X),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(X),this._state="select",ne==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},z.prototype.moveVisual=function(X){this.visual.style.transform="translate("+X.x+"px, "+X.y+"px)"},z.prototype.manipulate=function(X){var ne=this.unrotatePoint(X);this.state==="creating"?this.resize(X):this.state==="move"?(this.left=this.manipulationStartLeft+(ne.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ne.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ne):this.state==="rotate"&&this.rotate(X)},z.prototype.resize=function(X){var ne=this.manipulationStartLeft,de=this.manipulationStartWidth,ie=this.manipulationStartTop,ze=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ne=this.manipulationStartLeft+X.x-this.manipulationStartX,de=this.manipulationStartWidth+this.manipulationStartLeft-ne;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:de=this.manipulationStartWidth+X.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:ie=this.manipulationStartTop+X.y-this.manipulationStartY,ze=this.manipulationStartHeight+this.manipulationStartTop-ie;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ze=this.manipulationStartHeight+X.y-this.manipulationStartY}de>=0?(this.left=ne,this.width=de):(this.left=ne+de,this.width=-de),ze>=0?(this.top=ie,this.height=ze):(this.top=ie+ze,this.height=-ze),this.setSize()},z.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},z.prototype.rotate=function(X){if(Math.abs(X.x-this.centerX)>.1){var ne=Math.sign(X.x-this.centerX);this.rotationAngle=180*Math.atan((X.y-this.centerY)/(X.x-this.centerX))/Math.PI+90*ne,this.applyRotation()}},z.prototype.applyRotation=function(){var X=this.container.transform.baseVal.getItem(0);X.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(X,0)},z.prototype.rotatePoint=function(X){if(this.rotationAngle===0)return X;var ne=this.container.getCTM(),de=ce.createPoint(X.x,X.y);return{x:(de=de.matrixTransform(ne)).x,y:de.y}},z.prototype.unrotatePoint=function(X){if(this.rotationAngle===0)return X;var ne=this.container.getCTM();ne=ne.inverse();var de=ce.createPoint(X.x,X.y);return{x:(de=de.matrixTransform(ne)).x,y:de.y}},z.prototype.select=function(){se.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},z.prototype.deselect=function(){se.prototype.deselect.call(this),this.controlBox.style.display="none"},z.prototype.setupControlBox=function(){this.controlBox=ce.createGroup();var X=ce.createTransform();X.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(X),this.container.appendChild(this.controlBox),this.controlRect=ce.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=ce.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 Re,this.addControlGrips(),this.controlBox.style.display="none"},z.prototype.adjustControlBox=function(){var X=this.controlBox.transform.baseVal.getItem(0);X.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(X,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()},z.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()},z.prototype.createGrip=function(){var X=new Ze;return X.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(X.visual),X},z.prototype.positionGrips=function(){var X=this.controlGrips.topLeft.GRIP_SIZE,ne=-X/2,de=ne,ie=(this.width+this.CB_DISTANCE)/2-X/2,ze=(this.height+this.CB_DISTANCE)/2-X/2,ht=this.height+this.CB_DISTANCE-X/2,St=this.width+this.CB_DISTANCE-X/2;this.positionGrip(this.controlGrips.topLeft.visual,ne,de),this.positionGrip(this.controlGrips.topCenter.visual,ie,de),this.positionGrip(this.controlGrips.topRight.visual,St,de),this.positionGrip(this.controlGrips.centerLeft.visual,ne,ze),this.positionGrip(this.controlGrips.centerRight.visual,St,ze),this.positionGrip(this.controlGrips.bottomLeft.visual,ne,ht),this.positionGrip(this.controlGrips.bottomCenter.visual,ie,ht),this.positionGrip(this.controlGrips.bottomRight.visual,St,ht),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,ie,de-3*this.CB_DISTANCE)},z.prototype.positionGrip=function(X,ne,de){var ie=X.transform.baseVal.getItem(0);ie.setTranslate(ne,de),X.transform.baseVal.replaceItem(ie,0)},z.prototype.hideControlBox=function(){this.controlBox.style.display="none"},z.prototype.showControlBox=function(){this.controlBox.style.display=""},z.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:qe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:qe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},se.prototype.getState.call(this))},z.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.left=ne.left,this.top=ne.top,this.width=ne.width,this.height=ne.height,this.rotationAngle=ne.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(qe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ne.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(qe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ne.containerTransformMatrix))},z.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne);var de=this.rotatePoint({x:this.left,y:this.top}),ie=this.unrotatePoint({x:de.x*X,y:de.y*ne});this.left=ie.x,this.top=ie.y,this.width=this.width*X,this.height=this.height*ne,this.adjustControlBox()},z}(ge),nt=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.fillColor="transparent",ie.strokeColor="transparent",ie.strokeWidth=0,ie.strokeDasharray="",ie.opacity=1,ie.setStrokeColor=ie.setStrokeColor.bind(ie),ie.setFillColor=ie.setFillColor.bind(ie),ie.setStrokeWidth=ie.setStrokeWidth.bind(ie),ie.setStrokeDasharray=ie.setStrokeDasharray.bind(ie),ie.createVisual=ie.createVisual.bind(ie),ie}return pe(z,se),z.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual)},z.prototype.createVisual=function(){this.visual=ce.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)},z.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},z.prototype.manipulate=function(X){se.prototype.manipulate.call(this,X)},z.prototype.resize=function(X){se.prototype.resize.call(this,X),this.setSize()},z.prototype.setSize=function(){se.prototype.setSize.call(this),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},z.prototype.pointerUp=function(X){se.prototype.pointerUp.call(this,X),this.setSize()},z.prototype.setStrokeColor=function(X){this.strokeColor=X,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(X),this.stateChanged()},z.prototype.setFillColor=function(X){this.fillColor=X,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},z.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},z.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},z.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},se.prototype.getState.call(this))},z.prototype.restoreState=function(X){var ne=X;this.fillColor=ne.fillColor,this.strokeColor=ne.strokeColor,this.strokeWidth=ne.strokeWidth,this.strokeDasharray=ne.strokeDasharray,this.opacity=ne.opacity,this.createVisual(),se.prototype.restoreState.call(this,X),this.setSize()},z.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.setSize()},z.title="Rectangle marker",z}(et),ut=function(se){function z(X,ne,de,ie){var ze=se.call(this,X,ie||'')||this;return ze.widths=[],ze.widthBoxes=[],ze.widths=ne,ze.currentWidth=de,ze.setCurrentWidth=ze.setCurrentWidth.bind(ze),ze}return pe(z,se),z.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.display="flex",ne.style.overflow="hidden",ne.style.flexGrow="2",this.widths.forEach(function(de){var ie=document.createElement("div");ie.style.display="flex",ie.style.flexGrow="2",ie.style.alignItems="center",ie.style.justifyContent="space-between",ie.style.padding="5px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.borderColor=de===X.currentWidth?X.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){X.setCurrentWidth(de,ie)}),ne.appendChild(ie);var ze=document.createElement("div");ze.innerText=de.toString(),ze.style.marginRight="5px",ie.appendChild(ze);var ht=document.createElement("div");ht.style.minHeight="20px",ht.style.flexGrow="2",ht.style.display="flex",ht.style.alignItems="center";var St=document.createElement("hr");St.style.minWidth="20px",St.style.border="0px",St.style.borderTop=de+"px solid "+X.uiStyleSettings.toolboxColor,St.style.flexGrow="2",ht.appendChild(St),ie.appendChild(ht),X.widthBoxes.push(ie)}),ne},z.prototype.setCurrentWidth=function(X,ne){var de=this;this.currentWidth=X,this.widthBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?de.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},z}(Z),ot=function(se){function z(X,ne,de,ie){var ze=se.call(this,X,ie||'')||this;return ze.styles=[],ze.styleBoxes=[],ze.styles=ne,ze.currentStyle=de,ze.setCurrentStyle=ze.setCurrentStyle.bind(ze),ze}return pe(z,se),z.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.display="flex",ne.style.overflow="hidden",ne.style.flexGrow="2",this.styles.forEach(function(de){var ie=document.createElement("div");ie.style.display="flex",ie.style.alignItems="center",ie.style.justifyContent="space-between",ie.style.padding="5px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.overflow="hidden",ie.style.maxWidth=100/X.styles.length-5+"%",ie.style.borderColor=de===X.currentStyle?X.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){X.setCurrentStyle(de,ie)}),ne.appendChild(ie);var ze=document.createElement("div");ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.overflow="hidden";var ht=` `;ze.innerHTML=ht,ie.appendChild(ze),X.styleBoxes.push(ie)}),ne},z.prototype.setCurrentStyle=function(X,ne){var de=this;this.currentStyle=X,this.styleBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?de.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},z}(Z),je=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.strokeColor=de.defaultColor,ie.strokeWidth=de.defaultStrokeWidth,ie.strokeDasharray=de.defaultStrokeDasharray,ie.strokePanel=new be("Line color",de.defaultColorSet,de.defaultColor),ie.strokePanel.onColorChanged=ie.setStrokeColor,ie.strokeWidthPanel=new ut("Line width",de.defaultStrokeWidths,de.defaultStrokeWidth),ie.strokeWidthPanel.onWidthChanged=ie.setStrokeWidth,ie.strokeStylePanel=new ot("Line style",de.defaultStrokeDasharrays,de.defaultStrokeDasharray),ie.strokeStylePanel.onStyleChanged=ie.setStrokeDasharray,ie}return pe(z,se),Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=z.typeName,X},z.typeName="FrameMarker",z.title="Frame marker",z.icon='',z}(nt),De=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},rt=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.x1=0,ie.y1=0,ie.x2=0,ie.y2=0,ie.defaultLength=50,ie.manipulationStartX=0,ie.manipulationStartY=0,ie.manipulationStartX1=0,ie.manipulationStartY1=0,ie.manipulationStartX2=0,ie.manipulationStartY2=0,ie.setupControlBox(),ie}return pe(z,se),z.prototype.ownsTarget=function(X){return!!se.prototype.ownsTarget.call(this,X)||!(!this.grip1.ownsTarget(X)&&!this.grip2.ownsTarget(X))},z.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.manipulationStartX=X.x,this.manipulationStartY=X.y,this.state==="new"&&(this.x1=X.x,this.y1=X.y,this.x2=X.x,this.y2=X.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(ne)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ne)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},z.prototype.pointerUp=function(X){var ne=this.state;se.prototype.pointerUp.call(this,X),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(X),this._state="select",ne==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},z.prototype.adjustVisual=function(){},z.prototype.manipulate=function(X){this.state==="creating"?this.resize(X):this.state==="move"?(this.x1=this.manipulationStartX1+X.x-this.manipulationStartX,this.y1=this.manipulationStartY1+X.y-this.manipulationStartY,this.x2=this.manipulationStartX2+X.x-this.manipulationStartX,this.y2=this.manipulationStartY2+X.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(X)},z.prototype.resize=function(X){switch(this.activeGrip){case this.grip1:this.x1=X.x,this.y1=X.y;break;case this.grip2:case void 0:this.x2=X.x,this.y2=X.y}this.adjustVisual(),this.adjustControlBox()},z.prototype.select=function(){se.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},z.prototype.deselect=function(){se.prototype.deselect.call(this),this.controlBox.style.display="none"},z.prototype.setupControlBox=function(){this.controlBox=ce.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},z.prototype.adjustControlBox=function(){this.positionGrips()},z.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},z.prototype.createGrip=function(){var X=new Ze;return X.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(X.visual),X},z.prototype.positionGrips=function(){var X=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-X/2,this.y1-X/2),this.positionGrip(this.grip2.visual,this.x2-X/2,this.y2-X/2)},z.prototype.positionGrip=function(X,ne,de){var ie=X.transform.baseVal.getItem(0);ie.setTranslate(ne,de),X.transform.baseVal.replaceItem(ie,0)},z.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},se.prototype.getState.call(this))},z.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.x1=ne.x1,this.y1=ne.y1,this.x2=ne.x2,this.y2=ne.y2},z.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.x1=this.x1*X,this.y1=this.y1*ne,this.x2=this.x2*X,this.y2=this.y2*ne,this.adjustVisual(),this.adjustControlBox()},z}(ge),lt=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.strokeColor="transparent",ie.strokeWidth=0,ie.strokeDasharray="",ie.setStrokeColor=ie.setStrokeColor.bind(ie),ie.setStrokeWidth=ie.setStrokeWidth.bind(ie),ie.setStrokeDasharray=ie.setStrokeDasharray.bind(ie),ie.strokeColor=de.defaultColor,ie.strokeWidth=de.defaultStrokeWidth,ie.strokeDasharray=de.defaultStrokeDasharray,ie.strokePanel=new be("Line color",de.defaultColorSet,de.defaultColor),ie.strokePanel.onColorChanged=ie.setStrokeColor,ie.strokeWidthPanel=new ut("Line width",de.defaultStrokeWidths,de.defaultStrokeWidth),ie.strokeWidthPanel.onWidthChanged=ie.setStrokeWidth,ie.strokeStylePanel=new ot("Line style",de.defaultStrokeDasharrays,de.defaultStrokeDasharray),ie.strokeStylePanel.onStyleChanged=ie.setStrokeDasharray,ie}return pe(z,se),z.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.selectorLine&&X!==this.visibleLine)},z.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorLine=ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ce.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)},z.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},z.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()),ce.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},z.prototype.setStrokeColor=function(X){this.strokeColor=X,this.adjustVisual(),this.colorChanged(X)},z.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.adjustVisual()},z.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.adjustVisual(),this.stateChanged()},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var X=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},se.prototype.getState.call(this));return X.typeName=z.typeName,X},z.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.strokeColor=ne.strokeColor,this.strokeWidth=ne.strokeWidth,this.strokeDasharray=ne.strokeDasharray,this.createVisual(),this.adjustVisual()},z.typeName="LineMarker",z.title="Line marker",z.icon='',z}(rt),Je=function(se){function z(X,ne,de,ie){var ze=se.call(this,X,ie||'')||this;return ze.fonts=[],ze.fontBoxes=[],ze.fonts=ne,ze.currentFont=de,ze.setCurrentFont=ze.setCurrentFont.bind(ze),ze}return pe(z,se),z.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.overflow="hidden",ne.style.flexGrow="2",this.fonts.forEach(function(de){var ie=document.createElement("div");ie.style.display="inline-block",ie.style.alignItems="center",ie.style.justifyContent="space-between",ie.style.padding="5px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.overflow="hidden",ie.style.maxWidth=100/X.fonts.length-5+"%",ie.style.borderColor=de===X.currentFont?X.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){X.setCurrentFont(de,ie)}),ne.appendChild(ie);var ze=document.createElement("div");ze.style.display="flex",ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.fontFamily=de,ze.style.overflow="hidden";var ht=document.createElement("div");ht.style.whiteSpace="nowrap",ht.style.overflow="hidden",ht.style.textOverflow="ellipsis",ht.innerHTML="The quick brown fox jumps over the lazy dog",ze.appendChild(ht),ie.appendChild(ze),X.fontBoxes.push(ie)}),ne},z.prototype.setCurrentFont=function(X,ne){var de=this;this.currentFont=X,this.fontBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?de.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},z}(Z),tt=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.color="transparent",ie.padding=5,ie.DEFAULT_TEXT="your text here",ie.text=ie.DEFAULT_TEXT,ie.isMoved=!1,ie.color=de.defaultColor,ie.fontFamily=de.defaultFontFamily,ie.defaultSize={x:100,y:30},ie.setColor=ie.setColor.bind(ie),ie.setFont=ie.setFont.bind(ie),ie.renderText=ie.renderText.bind(ie),ie.sizeText=ie.sizeText.bind(ie),ie.textEditDivClicked=ie.textEditDivClicked.bind(ie),ie.showTextEditor=ie.showTextEditor.bind(ie),ie.setSize=ie.setSize.bind(ie),ie.positionTextEditor=ie.positionTextEditor.bind(ie),ie.colorPanel=new be("Color",de.defaultColorSet,de.defaultColor),ie.colorPanel.onColorChanged=ie.setColor,ie.fontFamilyPanel=new Je("Font",de.defaultFontFamilies,de.defaultFontFamily),ie.fontFamilyPanel.onFontChanged=ie.setFont,ie}return pe(z,se),z.prototype.ownsTarget=function(X){if(se.prototype.ownsTarget.call(this,X)||X===this.visual||X===this.textElement||X===this.bgRectangle)return!0;var ne=!1;return this.textElement.childNodes.forEach(function(de){de===X&&(ne=!0)}),ne},z.prototype.createVisual=function(){this.visual=ce.createGroup(),this.bgRectangle=ce.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ce.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},z.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.isMoved=!1,this.pointerDownPoint=X,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},z.prototype.renderText=function(){var X=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(ne){X.textElement.appendChild(ce.createTSpan(ne.trim()===""?" ":ne.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},z.prototype.getTextScale=function(){var X=this.textElement.getBBox(),ne=1;if(X.width>0&&X.height>0){var de=(1*this.width-this.width*this.padding*2/100)/X.width,ie=(1*this.height-this.height*this.padding*2/100)/X.height;ne=Math.min(de,ie)}return ne},z.prototype.getTextPosition=function(X){var ne=this.textElement.getBBox(),de=0,ie=0;return ne.width>0&&ne.height>0&&(de=(this.width-ne.width*X)/2,ie=this.height/2-ne.height*X/2),{x:de,y:ie}},z.prototype.sizeText=function(){var X=this.textElement.getBBox(),ne=this.getTextScale(),de=this.getTextPosition(ne);de.y-=X.y*ne,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+de.x+"px, "+de.y+"px) scale("+ne+", "+ne+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(de.x,de.y),this.textElement.transform.baseVal.getItem(1).setScale(ne,ne))},z.prototype.manipulate=function(X){se.prototype.manipulate.call(this,X),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(X.x-this.pointerDownPoint.x)>5||Math.abs(X.y-this.pointerDownPoint.y)>5)},z.prototype.resize=function(X){se.prototype.resize.call(this,X),this.isMoved=!0,this.setSize(),this.sizeText()},z.prototype.setSize=function(){se.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},z.prototype.pointerUp=function(X){var ne=this.state;ne==="creating"&&(this._suppressMarkerCreateEvent=!0),se.prototype.pointerUp.call(this,X),this.setSize(),(ne==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},z.prototype.showTextEditor=function(){var X=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(ne){ne.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ne=Number.parseFloat(X.textEditor.style.fontSize);X.textEditor.clientWidth>=Number.parseInt(X.textEditor.style.maxWidth)&&ne>.9;)ne-=.1,X.textEditor.style.fontSize=Math.max(ne,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ne){ne.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ne){if(ne.clipboardData){var de=ne.clipboardData.getData("text"),ie=window.getSelection();if(!ie.rangeCount)return!1;ie.deleteFromDocument(),ie.getRangeAt(0).insertNode(document.createTextNode(de)),ne.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){X.textEditDivClicked(X.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},z.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var X=this.getTextScale(),ne=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),de=this.textElement.getBBox(),ie={x:de.width*X,y:de.height*X};ne.x-=ie.x/2,ne.y-=ie.y/2,this.textEditor.style.top=ne.y+"px",this.textEditor.style.left=ne.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ne.x+"px",this.textEditor.style.fontSize=Math.max(16*X,12)+"px",this.textElement.style.display="none"}},z.prototype.textEditDivClicked=function(X){this.text=X.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},z.prototype.select=function(){se.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},z.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),se.prototype.deselect.call(this)},z.prototype.dblClick=function(X,ne){se.prototype.dblClick.call(this,X,ne),this.showTextEditor()},z.prototype.setColor=function(X){this.textElement&&ce.setAttributes(this.textElement,[["fill",X]]),this.color=X,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(X)},z.prototype.setFont=function(X){this.textElement&&ce.setAttributes(this.textElement,[["font-family",X]]),this.fontFamily=X,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},z.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},z.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var X=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},se.prototype.getState.call(this));return X.typeName=z.typeName,X},z.prototype.restoreState=function(X){var ne=X;this.color=ne.color,this.fontFamily=ne.fontFamily,this.padding=ne.padding,this.text=ne.text,this.createVisual(),se.prototype.restoreState.call(this,X),this.setSize()},z.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.setSize(),this.sizeText(),this.positionTextEditor()},z.typeName="TextMarker",z.title="Text marker",z.icon='',z}(et),Ue=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.color="transparent",ie.lineWidth=3,ie.drawing=!1,ie.pixelRatio=1,ie.color=de.defaultColor,ie.lineWidth=de.defaultStrokeWidth,ie.pixelRatio=de.freehandPixelRatio,ie.setColor=ie.setColor.bind(ie),ie.addCanvas=ie.addCanvas.bind(ie),ie.finishCreation=ie.finishCreation.bind(ie),ie.setLineWidth=ie.setLineWidth.bind(ie),ie.colorPanel=new be("Color",de.defaultColorSet,de.defaultColor),ie.colorPanel.onColorChanged=ie.setColor,ie.lineWidthPanel=new ut("Line width",de.defaultStrokeWidths,de.defaultStrokeWidth),ie.lineWidthPanel.onWidthChanged=ie.setLineWidth,ie}return pe(z,se),z.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.drawingImage)},z.prototype.createVisual=function(){this.visual=ce.createGroup(),this.drawingImage=ce.createImage(),this.visual.appendChild(this.drawingImage);var X=ce.createTransform();this.visual.transform.baseVal.appendItem(X),this.addMarkerVisualToContainer(this.visual)},z.prototype.pointerDown=function(X,ne){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(X.x,X.y),this.drawing=!0):se.prototype.pointerDown.call(this,X,ne)},z.prototype.manipulate=function(X){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(X.x,X.y),this.canvasContext.stroke()):se.prototype.manipulate.call(this,X)},z.prototype.resize=function(X){se.prototype.resize.call(this,X),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},z.prototype.pointerUp=function(X){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):se.prototype.pointerUp.call(this,X)},z.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)},z.prototype.select=function(){this.state==="creating"&&this.finishCreation(),se.prototype.select.call(this)},z.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),se.prototype.deselect.call(this)},z.prototype.finishCreation=function(){for(var X=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ne=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],de=ne[0],ie=ne[1],ze=ne[2],ht=ne[3],St=!1,Pt=0;Pt0&&(St=!0,Ptht&&(ht=Pt),pt>ze&&(ze=pt));if(St){this.left=de/this.pixelRatio,this.top=ie/this.pixelRatio,this.width=(ze-de)/this.pixelRatio,this.height=(ht-ie)/this.pixelRatio;var Ht=document.createElement("canvas");Ht.width=ze-de,Ht.height=ht-ie,Ht.getContext("2d").putImageData(this.canvasContext.getImageData(de,ie,ze-de,ht-ie),0,0),this.drawingImgUrl=Ht.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},z.prototype.setDrawingImage=function(){ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},z.prototype.setColor=function(X){this.color=X,this.colorChanged(X)},z.prototype.setLineWidth=function(X){this.lineWidth=X},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var X=Object.assign({drawingImgUrl:this.drawingImgUrl},se.prototype.getState.call(this));return X.typeName=z.typeName,X},z.prototype.restoreState=function(X){this.createVisual(),se.prototype.restoreState.call(this,X),this.drawingImgUrl=X.drawingImgUrl,this.setDrawingImage()},z.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.setDrawingImage()},z.typeName="FreehandMarker",z.title="Freehand marker",z.icon='',z}(et),ke=function(se){function z(X,ne,de){var ie=se.call(this,X,de||'')||this;return ie.typeBoxes=[],ie.currentType=ne,ie.setCurrentType=ie.setCurrentType.bind(ie),ie}return pe(z,se),z.prototype.getUi=function(){var X=this,ne=document.createElement("div");ne.style.display="flex",ne.style.overflow="hidden",ne.style.flexGrow="2";for(var de=function(ht){var St="both";switch(ht){case 0:St="both";break;case 1:St="start";break;case 2:St="end";break;case 3:St="none"}var Pt=document.createElement("div");if(Pt.style.display="flex",Pt.style.flexGrow="2",Pt.style.alignItems="center",Pt.style.justifyContent="space-between",Pt.style.padding="5px",Pt.style.borderWidth="2px",Pt.style.borderStyle="solid",Pt.style.borderColor=St===ie.currentType?ie.uiStyleSettings.toolboxAccentColor:"transparent",Pt.addEventListener("click",function(){X.setCurrentType(St,Pt)}),ne.appendChild(Pt),St==="both"||St==="start"){var pt=document.createElement("div");pt.style.display="flex",pt.style.alignItems="center",pt.style.minHeight="20px",pt.innerHTML=` `,pt.style.marginLeft="5px",Pt.appendChild(pt)}var Ht=document.createElement("div");Ht.style.display="flex",Ht.style.alignItems="center",Ht.style.minHeight="20px",Ht.style.flexGrow="2";var zt=document.createElement("hr");if(zt.style.minWidth="20px",zt.style.border="0px",zt.style.borderTop="3px solid "+(ie.uiStyleSettings!==void 0?ie.uiStyleSettings.toolboxColor:"#eeeeee"),zt.style.flexGrow="2",Ht.appendChild(zt),Pt.appendChild(Ht),St==="both"||St==="end"){var Mr=document.createElement("div");Mr.style.display="flex",Mr.style.alignItems="center",Mr.style.minHeight="20px",Mr.innerHTML=` `,Mr.style.marginRight="5px",Pt.appendChild(Mr)}ie.typeBoxes.push(Pt)},ie=this,ze=0;ze<4;ze++)de(ze);return ne},z.prototype.setCurrentType=function(X,ne){var de=this;this.currentType=X,this.typeBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?de.uiStyleSettings!==void 0?de.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},z}(Z),Ie=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.arrowType="end",ie.arrowBaseHeight=10,ie.arrowBaseWidth=10,ie.getArrowPoints=ie.getArrowPoints.bind(ie),ie.setArrowType=ie.setArrowType.bind(ie),ie.arrowTypePanel=new ke("Arrow type","end"),ie.arrowTypePanel.onArrowTypeChanged=ie.setArrowType,ie}return pe(z,se),z.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.arrow1&&X!==this.arrow2)},z.prototype.getArrowPoints=function(X,ne){var de=this.arrowBaseWidth+2*this.strokeWidth,ie=this.arrowBaseHeight+2*this.strokeWidth;return X-de/2+","+(ne+ie/2)+" "+X+","+(ne-ie/2)+" "+(X+de/2)+","+(ne+ie/2)},z.prototype.createTips=function(){this.arrow1=ce.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ce.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow2)},z.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="creating"&&this.createTips()},z.prototype.adjustVisual=function(){if(se.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",ce.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ce.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var X=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ne=this.arrow1.transform.baseVal.getItem(0);ne.setRotate(X,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ne,0);var de=this.arrow2.transform.baseVal.getItem(0);de.setRotate(X+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(de,0)}},z.prototype.setArrowType=function(X){this.arrowType=X,this.adjustVisual(),this.stateChanged()},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var X=Object.assign({arrowType:this.arrowType},se.prototype.getState.call(this));return X.typeName=z.typeName,X},z.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.arrowType=ne.arrowType,this.createTips(),this.adjustVisual()},z.typeName="ArrowMarker",z.title="Arrow marker",z.icon='',z}(lt),ye=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.fillColor=de.defaultFillColor,ie.strokeWidth=0,ie.fillPanel=new be("Color",de.defaultColorSet,de.defaultFillColor),ie.fillPanel.onColorChanged=ie.setFillColor,ie}return pe(z,se),Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=z.typeName,X},z.typeName="CoverMarker",z.title="Cover marker",z.icon='',z}(nt),Te=function(se){function z(X,ne,de,ie){var ze=se.call(this,X,ie||'')||this;return ze.opacities=[],ze.opacityBoxes=[],ze.opacities=ne,ze.currentOpacity=de,ze.setCurrentOpacity=ze.setCurrentOpacity.bind(ze),ze}return pe(z,se),z.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.display="flex",ne.style.overflow="hidden",ne.style.flexGrow="2",ne.style.justifyContent="space-between",this.opacities.forEach(function(de){var ie=document.createElement("div");ie.style.display="flex",ie.style.alignItems="center",ie.style.justifyContent="center",ie.style.padding="5px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.borderColor=de===X.currentOpacity?X.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){X.setCurrentOpacity(de,ie)}),ne.appendChild(ie);var ze=document.createElement("div");ze.innerText=100*de+"%",ie.appendChild(ze),X.opacityBoxes.push(ie)}),ne},z.prototype.setCurrentOpacity=function(X,ne){var de=this;this.currentOpacity=X,this.opacityBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?de.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},z}(Z),Ae=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.setOpacity=ie.setOpacity.bind(ie),ie.fillColor=de.defaultHighlightColor,ie.strokeWidth=0,ie.opacity=de.defaultHighlightOpacity,ie.fillPanel=new be("Color",de.defaultColorSet,ie.fillColor),ie.fillPanel.onColorChanged=ie.setFillColor,ie.opacityPanel=new Te("Opacity",de.defaultOpacitySteps,ie.opacity),ie.opacityPanel.onOpacityChanged=ie.setOpacity,ie}return pe(z,se),z.prototype.setOpacity=function(X){this.opacity=X,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=z.typeName,X},z.typeName="HighlightMarker",z.title="Highlight marker",z.icon='',z}(ye),Pe='',$e=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.bgColor="transparent",ie.tipPosition={x:0,y:0},ie.tipBase1Position={x:0,y:0},ie.tipBase2Position={x:0,y:0},ie.tipMoving=!1,ie.color=de.defaultStrokeColor,ie.bgColor=de.defaultFillColor,ie.fontFamily=de.defaultFontFamily,ie.defaultSize={x:100,y:30},ie.setBgColor=ie.setBgColor.bind(ie),ie.getTipPoints=ie.getTipPoints.bind(ie),ie.positionTip=ie.positionTip.bind(ie),ie.setTipPoints=ie.setTipPoints.bind(ie),ie.colorPanel=new be("Text color",de.defaultColorSet,ie.color,''),ie.colorPanel.onColorChanged=ie.setColor,ie.bgColorPanel=new be("Fill color",de.defaultColorSet,ie.bgColor,Pe),ie.bgColorPanel.onColorChanged=ie.setBgColor,ie.fontFamilyPanel=new Je("Font",de.defaultFontFamilies,de.defaultFontFamily),ie.fontFamilyPanel.onFontChanged=ie.setFont,ie.tipGrip=new Ze,ie.tipGrip.visual.transform.baseVal.appendItem(ce.createTransform()),ie.controlBox.appendChild(ie.tipGrip.visual),ie}return pe(z,se),z.prototype.ownsTarget=function(X){return se.prototype.ownsTarget.call(this,X)||this.tipGrip.ownsTarget(X)||this.tip===X},z.prototype.createTip=function(){ce.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ce.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},z.prototype.pointerDown=function(X,ne){this.state==="new"&&se.prototype.pointerDown.call(this,X,ne),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ne)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):se.prototype.pointerDown.call(this,X,ne)},z.prototype.pointerUp=function(X){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,se.prototype.pointerUp.call(this,X);else{var ne=this.state==="creating";se.prototype.pointerUp.call(this,X),this.setTipPoints(ne),this.positionTip()}},z.prototype.manipulate=function(X){if(this.tipMoving){var ne=this.unrotatePoint(X);this.tipPosition={x:ne.x-this.manipulationStartLeft,y:ne.y-this.manipulationStartTop},this.positionTip()}else se.prototype.manipulate.call(this,X)},z.prototype.setBgColor=function(X){this.bgRectangle&&this.tip&&(ce.setAttributes(this.bgRectangle,[["fill",X]]),ce.setAttributes(this.tip,[["fill",X]])),this.bgColor=X,this.fillColorChanged(X)},z.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},z.prototype.setTipPoints=function(X){X===void 0&&(X=!1);var ne=Math.min(this.height/2,15),de=this.height/5;X&&(this.tipPosition={x:ne+de/2,y:this.height+20});var ie=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?ie.1)){var X=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ne=this.tip1.transform.baseVal.getItem(0);ne.setRotate(X,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ne,0);var de=this.tip2.transform.baseVal.getItem(0);de.setRotate(X+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(de,0)}},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=z.typeName,X},z.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X),this.createTips(),this.adjustVisual()},z.typeName="MeasurementMarker",z.title="Measurement marker",z.icon='',z}(lt),gt=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.strokePanel.colors=de.defaultColorSet,ie.fillColor="transparent",ie}return pe(z,se),Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=z.typeName,X},z.typeName="EllipseFrameMarker",z.title="Ellipse frame marker",z.icon='',z}(Ke),wt=function(){function se(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(se.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),se.prototype.addUndoStep=function(z){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(z)||(this.undoStack.push(z),JSON.stringify(this.lastRedoStep)!==JSON.stringify(z)&&this.redoStack.splice(0,this.redoStack.length))},se.prototype.replaceLastUndoStep=function(z){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=z)},se.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},se.prototype.undo=function(){if(this.undoStack.length>1){var z=this.undoStack.pop();return z!==void 0&&this.redoStack.push(z),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},se.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},se}(),vt=function(se){function z(X,ne,de){var ie=se.call(this,X,ne,de)||this;return ie.strokeColor="transparent",ie.strokeWidth=0,ie.strokeDasharray="",ie.curveX=0,ie.curveY=0,ie.manipulationStartCurveX=0,ie.manipulationStartCurveY=0,ie.setStrokeColor=ie.setStrokeColor.bind(ie),ie.setStrokeWidth=ie.setStrokeWidth.bind(ie),ie.setStrokeDasharray=ie.setStrokeDasharray.bind(ie),ie.positionGrips=ie.positionGrips.bind(ie),ie.addControlGrips=ie.addControlGrips.bind(ie),ie.adjustVisual=ie.adjustVisual.bind(ie),ie.setupControlBox=ie.setupControlBox.bind(ie),ie.resize=ie.resize.bind(ie),ie.strokeColor=de.defaultColor,ie.strokeWidth=de.defaultStrokeWidth,ie.strokeDasharray=de.defaultStrokeDasharray,ie.strokePanel=new be("Line color",de.defaultColorSet,de.defaultColor),ie.strokePanel.onColorChanged=ie.setStrokeColor,ie.strokeWidthPanel=new ut("Line width",de.defaultStrokeWidths,de.defaultStrokeWidth),ie.strokeWidthPanel.onWidthChanged=ie.setStrokeWidth,ie.strokeStylePanel=new ot("Line style",de.defaultStrokeDasharrays,de.defaultStrokeDasharray),ie.strokeStylePanel.onStyleChanged=ie.setStrokeDasharray,ie}return pe(z,se),z.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.selectorCurve&&X!==this.visibleCurve&&!this.curveGrip.ownsTarget(X))},z.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},z.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorCurve=ce.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ce.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)},z.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=X.x,this.curveY=X.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ne)&&(this.activeGrip=this.curveGrip,this._state="resize")},z.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ce.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},z.prototype.setupControlBox=function(){se.prototype.setupControlBox.call(this),this.curveControlLine1=ce.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ce.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)},z.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,se.prototype.addControlGrips.call(this)},z.prototype.positionGrips=function(){se.prototype.positionGrips.call(this);var X=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-X/2,this.curveY-X/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()))},z.prototype.manipulate=function(X){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+X.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+X.y-this.manipulationStartY),se.prototype.manipulate.call(this,X)},z.prototype.resize=function(X){this.activeGrip===this.curveGrip&&(this.curveX=X.x,this.curveY=X.y),se.prototype.resize.call(this,X),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},z.prototype.setStrokeColor=function(X){this.strokeColor=X,this.adjustVisual(),this.colorChanged(X)},z.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.adjustVisual()},z.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.adjustVisual()},z.prototype.scale=function(X,ne){this.curveX=this.curveX*X,this.curveY=this.curveY*ne,se.prototype.scale.call(this,X,ne)},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var X=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},se.prototype.getState.call(this));return X.typeName=z.typeName,X},z.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.strokeColor=ne.strokeColor,this.strokeWidth=ne.strokeWidth,this.strokeDasharray=ne.strokeDasharray,this.curveX=ne.curveX,this.curveY=ne.curveY,this.createVisual(),this.adjustVisual()},z.typeName="CurveMarker",z.title="Curve marker",z.icon='',z}(rt),It=function(){function se(z,X){X===void 0&&(X=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=z,this.cancelable=X}return Object.defineProperty(se.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),se.prototype.preventDefault=function(){this._defaultPrevented=!0},se}(),Lt=function(se){function z(X,ne,de){var ie=se.call(this,X,!1)||this;return ie.dataUrl=ne,ie.state=de,ie}return pe(z,se),z}(It),_t=function(se){function z(X,ne,de){de===void 0&&(de=!1);var ie=se.call(this,X,de)||this;return ie.marker=ne,ie}return pe(z,se),z}(It),rr=function(){function se(){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 se.prototype.addEventListener=function(z,X){this[z].push(X)},se.prototype.removeEventListener=function(z,X){var ne=this[z].indexOf(X);ne>-1&&this[z].splice(ne,1)},se}(),sr=function(){function se(z){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new De,this._isOpen=!1,this.undoRedoManager=new wt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new rr,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=se.instanceCounter++,this.styles=new ue(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=z,this.targetRoot=document.body,this.width=z.clientWidth,this.height=z.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(se.prototype,"ALL_MARKER_TYPES",{get:function(){return[je,Ue,Ie,tt,gt,Ke,Ae,$e,ct,ye,lt,vt]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[je,Ue,Ie,tt,Ke,Ae,$e]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"BASIC_MARKER_TYPES",{get:function(){return[je,Ue,Ie,tt,Ae]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(z){var X=this;this._availableMarkerTypes.splice(0),z.forEach(function(ne){if(typeof ne=="string"){var de=X.ALL_MARKER_TYPES.find(function(ie){return ie.typeName===ne});de!==void 0&&X._availableMarkerTypes.push(de)}else X._availableMarkerTypes.push(ne)})},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(z){this._zoomLevel=z,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(se.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),se.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),oe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},se.prototype.show=function(){var z=this;this.styles.styleSheetRoot===void 0&&te.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=te.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(X){return X(new It(z))})},se.prototype.render=function(){return Me(this,void 0,void 0,function(){var z;return _e(this,function(X){switch(X.label){case 0:return this.setCurrentMarker(),(z=new Se).naturalSize=this.renderAtNaturalSize,z.imageType=this.renderImageType,z.imageQuality=this.renderImageQuality,z.markersOnly=this.renderMarkersOnly,z.width=this.renderWidth,z.height=this.renderHeight,[4,z.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return X.sent(),[4,z.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,X.sent()]}})})},se.prototype.close=function(z){var X=this;if(z===void 0&&(z=!1),this.isOpen){var ne=!1;z||this.eventListeners.beforeclose.forEach(function(de){var ie=new It(X,!0);de(ie),ie.defaultPrevented&&(ne=!0)}),ne||(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(de){return de(new It(X))}),this.detachEvents(),this._isOpen=!1)}},se.prototype.addMarkersToToolbar=function(){for(var z,X=[],ne=0;nethis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*z:this.editorCanvas.clientWidth,ne=X',z.title="Powered by marker.js",z.style.display="grid",z.style.alignItems="center",z.style.justifyItems="center",z.style.padding="3px",z.style.width="20px",z.style.height="20px",this.logoUI.appendChild(z),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},se.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")},se.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"},se.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},se.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 z=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=z+"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 Q(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-1&&this.markers.splice(this.markers.indexOf(z),1),z.dispose()},se.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())},se.prototype.toolbarButtonClicked=function(z,X){if(z==="marker"&&X!==void 0)this.createNewMarker(X);else if(z==="action")switch(X){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()}},se.prototype.deleteSelectedMarker=function(){var z=this;if(this._currentMarker!==void 0){var X=!1;if(this.eventListeners.markerbeforedelete.forEach(function(de){var ie=new _t(z,z._currentMarker,!0);de(ie),ie.defaultPrevented&&(X=!0)}),!X){var ne=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(de){return de(new _t(z,ne))})}}},se.prototype.clear=function(){var z=this,X=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ze){var ht=new _t(z,void 0,!0);ze(ht),ht.defaultPrevented&&(X=!0)}),!X)){this.setCurrentMarker();for(var ne=function(ze){var ht=de.markers[ze];de.setCurrentMarker(de.markers[ze]),de._currentMarker.dispose(),de.markerImage.removeChild(de._currentMarker.container),de.markers.splice(de.markers.indexOf(de._currentMarker),1),de.eventListeners.markerdelete.forEach(function(St){return St(new _t(z,ht))})},de=this,ie=this.markers.length-1;ie>=0;ie--)ne(ie);this.addUndoStep()}},Object.defineProperty(se.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),se.prototype.showNotesEditor=function(){var z;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=(z=this._currentMarker.notes)!==null&&z!==void 0?z:"",this.overlayContainer.appendChild(this.notesArea))},se.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)},se.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},se.prototype.addUndoStep=function(){var z=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var X=this.getState(),ne=this.undoRedoManager.getLastUndoStep();if(!ne||ne.width===X.width&&ne.height===X.height){var de=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(X),de1&&this.panTo({x:z.clientX,y:z.clientY}))},se.prototype.onPointerUp=function(z){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(z.clientX,z.clientY)),this.isDragging=!1,this.addUndoStep()},se.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},se.prototype.onKeyUp=function(z){this._currentMarker===void 0||this.notesArea!==void 0||z.key!=="Delete"&&z.key!=="Backspace"||this.deleteSelectedMarker()},se.prototype.clientToLocalCoordinates=function(z,X){var ne=this.markerImage.getBoundingClientRect();return{x:(z-ne.left)/this.zoomLevel,y:(X-ne.top)/this.zoomLevel}},se.prototype.onWindowResize=function(){this.positionUI()},se.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var z=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=z+"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()},se.prototype.addLicenseKey=function(z){oe.addKey(z)},se.prototype.addEventListener=function(z,X){this.eventListeners.addEventListener(z,X)},se.prototype.removeEventListener=function(z,X){this.eventListeners.removeEventListener(z,X)},se.prototype.renderState=function(z){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(z),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(se.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),se.prototype.focus=function(){var z=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(X){return X(new It(z))}))},se.prototype.blur=function(){var z=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(X){return X(new It(z))}))},se.instanceCounter=0,se}();/* ********************************** 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 $t=function(se,z){return($t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,ne){X.__proto__=ne}||function(X,ne){for(var de in ne)Object.prototype.hasOwnProperty.call(ne,de)&&(X[de]=ne[de])})(se,z)};function cr(se,z){if(typeof z!="function"&&z!==null)throw new TypeError("Class extends value "+String(z)+" is not a constructor or null");function X(){this.constructor=se}$t(se,z),se.prototype=z===null?Object.create(z):(X.prototype=z.prototype,new X)}function Wt(se,z,X,ne){return new(X||(X=Promise))(function(de,ie){function ze(Pt){try{St(ne.next(Pt))}catch(pt){ie(pt)}}function ht(Pt){try{St(ne.throw(Pt))}catch(pt){ie(pt)}}function St(Pt){var pt;Pt.done?de(Pt.value):(pt=Pt.value,pt instanceof X?pt:new X(function(Ht){Ht(pt)})).then(ze,ht)}St((ne=ne.apply(se,z||[])).next())})}function Lr(se,z){var X,ne,de,ie,ze={label:0,sent:function(){if(1&de[0])throw de[1];return de[1]},trys:[],ops:[]};return ie={next:ht(0),throw:ht(1),return:ht(2)},typeof Symbol=="function"&&(ie[Symbol.iterator]=function(){return this}),ie;function ht(St){return function(Pt){return function(pt){if(X)throw new TypeError("Generator is already executing.");for(;ze;)try{if(X=1,ne&&(de=2&pt[0]?ne.return:pt[0]?ne.throw||((de=ne.return)&&de.call(ne),0):ne.next)&&!(de=de.call(ne,pt[1])).done)return de;switch(ne=0,de&&(pt=[2&pt[0],de.value]),pt[0]){case 0:case 1:de=pt;break;case 4:return ze.label++,{value:pt[1],done:!1};case 5:ze.label++,ne=pt[1],pt=[0];continue;case 7:pt=ze.ops.pop(),ze.trys.pop();continue;default:if(!(de=ze.trys,(de=de.length>0&&de[de.length-1])||pt[0]!==6&&pt[0]!==2)){ze=0;continue}if(pt[0]===3&&(!de||pt[1]>de[0]&&pt[1]0&&X>0){var ne=new Ar(z,X),de=ne.ratio>=1?20:ne.getHorizontalLength(20),ie=ne.ratio<1?20:ne.getVerticalLength(20),ze=document.createElementNS("http://www.w3.org/2000/svg","svg");ze.setAttribute("xmlns","http://www.w3.org/2000/svg"),ze.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ze);var ht=Ct.createDefs();ze.appendChild(ht);var St=Ct.createElement("clipPath",[["id","text-bg-clip"]]);ht.appendChild(St);var Pt=Ct.createPath(Ct.getHollowRectanglePath((24-de)/2,(24-ie)/2,de,ie,(24-de)/2+2,(24-ie)/2+2,de-4,ie-4));ze.appendChild(Pt);var pt=Ct.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);pt.appendChild(Ct.createTSpan(z+":"+X)),ze.appendChild(pt);var Ht=pt.getBBox();Ct.setAttributes(pt,[["x",((24-Ht.width)/2).toString()],["y",((24-Ht.height)/2-Ht.y).toString()]]);var zt=Ct.createPath(Ct.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ht.width))/2,(24-Math.ceil(Ht.height))/2,Math.ceil(Ht.width),Math.ceil(Ht.height)));return St.appendChild(zt),Ct.setAttributes(Pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ze),ze.outerHTML}return''},se}(),Xt=function(se){function z(X,ne,de){var ie=se.call(this,X,ne)||this;return ie.isDropdownOpen=!1,ie.onClick=ie.dropdownButtonClicked,ie.dropdownButtons=de,ie}return cr(z,se),z.prototype.setupDropdown=function(){var X=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ne){ne.className=X.className,ne.colorsClassName=X.colorsClassName,X.dropdownBlock.appendChild(ne.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},z.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},z.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},z.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},z.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},z.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},z}(Rt),Nt=function(){function se(z,X){this.GRIP_SIZE=10,this.color=z,this.fillColor=X,this.visual=Ct.createGroup(),this.visual.appendChild(Ct.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ct.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return se.prototype.ownsTarget=function(z){return z===this.visual||z===this.visual.childNodes[0]||z===this.visual.childNodes[1]},se.prototype.setCenter=function(z,X){this.visual.childNodes.forEach(function(ne){return Ct.setAttributes(ne,[["cx",z.toString()],["cy",X.toString()]])})},se}(),jr=function(){function se(z,X,ne,de){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=z,this.canvasHeight=X,this.margin=ne,this.container=de,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(se.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(z){this._aspectRatio=z,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(z){this._isGridVisible=z,this.gridContainer&&Ct.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(z){this._zoomFactor=z,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),se.prototype.open=function(){var z=this;this.cropShadeElement=Ct.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ct.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var X=0;Xthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-X.height/2),Ct.setAttributes(this.cropRectElement,[["x",X.x.toString()],["y",X.y.toString()],["width",X.width.toString()],["height",X.height.toString()]]);var ne=X.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ie,ze){var ht=X.y+ne*(ze+1);Ct.setAttributes(ie,[["x1",""+X.x],["y1",""+ht],["x2",""+(X.x+X.width)],["y2",""+ht]])});var de=X.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ie,ze){var ht=X.x+de*(ze+1);Ct.setAttributes(ie,[["x1",""+ht],["y1",""+X.y],["x2",""+ht],["y2",""+(X.y+X.height)]])}),Ct.setAttributes(this.cropShadeElement,[["d",Ct.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,X.x,X.y,X.width,X.height)]]),this.topLeftGrip.setCenter(X.x,X.y),this.topRightGrip.setCenter(X.x+X.width,X.y),this.bottomLeftGrip.setCenter(X.x,X.y+X.height),this.bottomRightGrip.setCenter(X.x+X.width,X.y+X.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},se.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)},se.prototype.clientToLocalCoordinates=function(z,X){var ne=this.container.getBoundingClientRect();return{x:z-ne.left+this.margin,y:X-ne.top+this.margin}},se.prototype.onPointerDown=function(z){this.container.setPointerCapture(z.pointerId),this.previousPoint=this.clientToLocalCoordinates(z.clientX,z.clientY),this.cropRectElement===z.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(z.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(z.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(z.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(z.target)&&(this.activeGrip=this.bottomRightGrip)},se.prototype.onPointerMove=function(z){if(this.isMoving)this.move(this.clientToLocalCoordinates(z.clientX,z.clientY));else if(this.activeGrip){var X=this.clientToLocalCoordinates(z.clientX,z.clientY);this.resize(X)}z.preventDefault()},se.prototype.onPointerUp=function(z){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(z.pointerId)},se.prototype.move=function(z){var X=z.x-this.previousPoint.x,ne=z.y-this.previousPoint.y;this.zoomFactor!==1&&(X=-X/this.zoomFactor,ne=-ne/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+X),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ne),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=z},se.prototype.resize=function(z){var X=Object.assign({},this.cropRect),ne=z.x-this.previousPoint.x,de=z.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:X.x+nethis.canvasWidth*this.zoomFactor&&(ne=this.canvasWidth*this.zoomFactor-X.width),X.width+=ne}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(X.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ne),X.height=this.aspectRatio.getVerticalLength(X.width)):(X.y+=de,X.height=this.cropRect.y+this.cropRect.height-X.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?X.height=this.aspectRatio.getVerticalLength(X.width):X.height+=de}X.width<10&&(X.x=this.cropRect.x,X.width=10),X.height<10&&(X.y=this.cropRect.y,X.height=10),this.previousPoint=z,X.x>=this.margin&&X.y>=this.margin&&X.x-this.margin+X.width<=this.canvasWidth&&X.y-this.margin+X.height<=this.canvasHeight&&(this.cropRect=X,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},se.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var z=this.cropRect.x+this.cropRect.width/2,X=this.cropRect.y+this.cropRect.height/2,ne=this.aspectRatio.getHorizontalLength(this.cropRect.height),de=this.aspectRatio.getVerticalLength(this.cropRect.width);ne/this.canvasWidththis.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=z-this.cropRect.width/2,this.cropRect.y=X-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)}},se.prototype.getRescaledRect=function(z,X,ne,de,ie,ze){var ht=ne/z,St=de/X;return{x:(ie.x-ze)*ht+ze,y:(ie.y-ze)*St+ze,width:ie.width*ht,height:ie.height*St}},se.prototype.scaleCanvas=function(z,X){var ne=this.getRescaledRect(this.canvasWidth,this.canvasHeight,z,X,this.cropRect,this.margin);this.canvasWidth=z,this.canvasHeight=X,this.onCropChange&&this.onCropChange(ne),this.setCropRectangle(ne)},se}(),bn=function(){function se(z){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=z,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(se.prototype,"angle",{get:function(){return this._angle},set:function(z){this._angle=z,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),se.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},se.prototype.onPointerDown=function(z){this.controlContainer.setPointerCapture(z.pointerId),this.isDragging=!0,this.previousPoint={x:z.clientX,y:z.clientY}},se.prototype.onPointerMove=function(z){this.isDragging&&(this.onAngleChange&&this.onAngleChange((z.clientX-this.previousPoint.x)/5),this.previousPoint.x=z.clientX)},se.prototype.onPointerUp=function(z){this.isDragging&&this.onAngleChange&&this.onAngleChange((z.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(z.pointerId)},se.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var z=this.angleLabelText.getBBox();Ct.setAttributes(this.angleLabelElement,[["x",((this.width-z.width)/2).toString()],["y",(this.height/2).toString()]])}},se.prototype.positionScaleShape=function(){if(this.scaleShape){var z=this.scaleShape.transform.baseVal.getItem(0);z.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(z,0)}},se.prototype.getVisual=function(){var z=document.createElementNS("http://www.w3.org/2000/svg","svg");z.setAttribute("xmlns","http://www.w3.org/2000/svg"),z.setAttribute("width",this.width+"px"),z.setAttribute("height",this.height+"px"),z.setAttribute("viewBox","0 0 "+this.width+" "+this.height),z.style.flexShrink="0",document.body.appendChild(z);for(var X="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ne=1;ne<=this.width/5+10;ne++){var de=ne%5==0?this.height/3:this.height/6;X+="h4v"+-de+"h1v"+de}X+="v1H0Z",this.scaleShape=Ct.createPath(X);var ie=Ct.createTransform();this.scaleShape.transform.baseVal.appendItem(ie),z.appendChild(this.scaleShape),this.angleLabelElement=Ct.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ct.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ze=Ct.createTSpan("");return ze.innerHTML="°",this.angleLabelElement.appendChild(ze),z.appendChild(this.angleLabelElement),document.body.removeChild(z),z},se}(),zr=function(){function se(){this.naturalSize=!1,this.imageType="image/png"}return se.prototype.rasterize=function(z,X,ne,de,ie,ze,ht){var St=this;return new Promise(function(Pt){var pt=document.createElement("canvas");pt.width=z.width.baseVal.value-2*de,pt.height=z.height.baseVal.value-2*de;var Ht=1,zt=1;St.naturalSize===!0?(Ht=X.naturalWidth/(z.width.baseVal.value-2*de)/ze,zt=X.naturalHeight/(z.height.baseVal.value-2*de)/ht,pt.width=X.naturalWidth/ze,pt.height=X.naturalHeight/ht):St.width!==void 0&&St.height!==void 0&&(Ht=St.width/ne.width,zt=St.height/ne.height,pt.width*=Ht,pt.height*=zt);var Mr=pt.getContext("2d");Mr.translate(pt.width/2,pt.height/2),Mr.rotate(ie*Math.PI/180),Mr.scale(ze,ht),Mr.translate(-pt.width/2,-pt.height/2),Mr.drawImage(X,0,0,pt.width,pt.height);var on=document.createElement("canvas");on.width=ne.width*Ht,on.height=ne.height*zt,on.getContext("2d").putImageData(Mr.getImageData((ne.x-de)*Ht,(ne.y-de)*zt,ne.width*Ht,ne.height*zt),0,0),Pt(on.toDataURL(St.imageType,St.imageQuality))})},se}(),mt=function(){function se(z){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=se.instanceCounter++,this.styles=new lr(this.instanceNo),this.target=z,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(se.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(z){this._zoomToCropEnabled=z,z?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(z){this._isGridVisible=z,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"gridLines",{get:function(){return this._gridLines},set:function(z){this._gridLines=z,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(z){this._rotationAngle=z,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"aspectRatio",{get:function(){var z;return(z=this._aspectRatio)!==null&&z!==void 0?z:this.aspectRatios[0]},set:function(z){this._aspectRatio=z},enumerable:!1,configurable:!0}),se.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},se.prototype.show=function(){this.showUI(),this.open()},se.prototype.close=function(z){z===void 0&&(z=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),z||this.closeEventListeners.forEach(function(X){return X()}),this._isOpen=!1)},se.prototype.addRenderEventListener=function(z){this.renderEventListeners.push(z)},se.prototype.removeRenderEventListener=function(z){this.renderEventListeners.indexOf(z)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(z),1)},se.prototype.addCloseEventListener=function(z){this.closeEventListeners.push(z)},se.prototype.removeCloseEventListener=function(z){this.closeEventListeners.indexOf(z)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(z),1)},se.prototype.setupResizeObserver=function(){var z=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){z.resize(z.target.clientWidth,z.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))},se.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var z=1*this.target.clientWidth/this.target.clientHeight,X=this.contentDiv.clientWidth/z>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*z:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ne=X+2*this.CANVAS_MARGINz+this.CANVAS_MARGIN?this.target.offsetTop-(z+this.CANVAS_MARGIN):0;this.coverDiv.style.top=X+"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},se.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},se.prototype.addTopToolbar=function(){var z=this;this.topToolbar=new Hr,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 X=new Tt;X.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(X);var ne=[];this.aspectRatios.forEach(function(zt){var Mr=new Rt(Br.getIcon(zt.horizontal,zt.vertical),zt.horizontal===0&&zt.vertical===0?"FREE":zt.horizontal+":"+zt.vertical);Mr.onClick=function(){return z.ratioButtonClicked(zt)},ne.push(Mr)}),this.aspectRatioButton=new Xt(Br.getIcon(0,0),"Aspect ratio",ne),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,X.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var de=new Rt('',"Toggle grid");de.isActive=this.isGridVisible,de.onClick=function(){z.isGridVisible=!z.isGridVisible,de.isActive=z.isGridVisible},X.addButton(de);var ie=new Rt('',"Zoom to selection");if(ie.isActive=this.zoomToCropEnabled,ie.onClick=function(){z.zoomToCropEnabled=!z.zoomToCropEnabled,ie.isActive=z.zoomToCropEnabled},X.addButton(ie),!Cr.isLicensed){var ze=new Et;this.topToolbar.addElementBlock(ze);var ht=document.createElement("div");ht.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var St=document.createElement("a");St.style.color="currentColor",St.href="https://markerjs.com/products/cropro",St.target="_blank",St.innerHTML='',ht.appendChild(St),ze.addElement(ht)}var Pt=new Tt;Pt.minWidth=3*this.toolbarHeight+"px",Pt.contentAlign="end",this.topToolbar.addButtonBlock(Pt);var pt=new Rt('',"OK");pt.onClick=this.startRenderAndClose,Pt.addButton(pt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(pt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ht=new Rt('',"Close");Ht.onClick=this.close,Pt.addButton(Ht),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ht.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},se.prototype.addBottomToolbar=function(){var z=this;this.bottomToolbar=new Hr,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 X=new Tt;X.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(X);var ne=new Rt('',"Rotate left");ne.onClick=this.rotateLeftButtonClicked,X.addButton(ne);var de=new Rt('',"Rotate right");de.onClick=this.rotateRightButtonClicked,X.addButton(de);var ie=new Et;ie.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ie),this.straightener=new bn("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Pt){z.rotateBy(Pt),z.straightener.angle=z.rotationAngle},ie.addElement(this.straightener.getUI());var ze=new Tt;ze.minWidth=2*this.toolbarHeight+"px",ze.contentAlign="end",this.bottomToolbar.addButtonBlock(ze);var ht=new Rt('',"Flip horizontal");ht.onClick=this.flipHorizontallyButtonClicked,ze.addButton(ht);var St=new Rt('',"Flip vertical");St.onClick=this.flipVerticallyButtonClicked,ze.addButton(St)},se.prototype.ratioButtonClicked=function(z){this.aspectRatio=z,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},se.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Br.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},se.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ar(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},se.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},se.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},se.prototype.restoreState=function(z){if(z){var X=this.cropLayer.getRescaledRect(z.width,z.height,this.imageWidth,this.imageHeight,z.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(X),this.cropRectChanged(X),this.flippedHorizontally=z.flippedHorizontally,this.flippedVertically=z.flippedVertically,this.applyFlip(),this.rotationAngle=z.rotationAngle,this.applyRotation()}},se.prototype.clientToLocalCoordinates=function(z,X){var ne=this.cropImage.getBoundingClientRect();return{x:z-ne.left,y:X-ne.top}},se.prototype.onWindowResize=function(){this.positionUI()},se.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var z=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=z+"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()},se.prototype.rotateLeftButtonClicked=function(){var z=this.rotationAngle-90;this.rotationAngle%90!=0&&(z+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(z)},se.prototype.rotateRightButtonClicked=function(){var z=this.rotationAngle+90;this.rotationAngle%90!=0&&(z-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(z)},se.prototype.rotateTo=function(z){z=(z=z>180?z-360:z)<=-180?z+360:z,this.rotationAngle=z,this.applyRotation()},se.prototype.rotateBy=function(z){this.rotateTo((this.rotationAngle+z)%360)},se.prototype.applyRotation=function(){var z=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var X=this.editingTargetRotationContainer.transform.baseVal.getItem(0);X.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(X,0);var ne=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ne.width,this.imageHeight/ne.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=z},se.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},se.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},se.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},se.prototype.startRenderAndClose=function(){return Wt(this,void 0,void 0,function(){var z,X;return Lr(this,function(ne){switch(ne.label){case 0:return[4,this.render()];case 1:return z=ne.sent(),X=this.getState(),this.renderEventListeners.forEach(function(de){return de(z,X)}),this.close(!0),[2]}})})},se.prototype.render=function(){return Wt(this,void 0,void 0,function(){var z;return Lr(this,function(X){switch(X.label){case 0:return(z=new zr).naturalSize=this.renderAtNaturalSize,z.imageType=this.renderImageType,z.imageQuality=this.renderImageQuality,z.width=this.renderWidth,z.height=this.renderHeight,this.unzoomFromCrop(),Ct.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,z.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 X.sent(),[4,z.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,X.sent()]}})})},se.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new $r("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 $r("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new $r("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var z=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new $r("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*z)+`px; height: `+(this.toolbarHeight-2*z)+`px; padding: `+z+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new $r("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new $r("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new Fr("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new Fr("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new $r("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 $r("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new $r("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 $r("toolbar_straightener",` display: flex; overflow: hidden; justify-content: center; height: `+(this.toolbarHeight-2*z)+`px; padding: `+z+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new $r("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},se.instanceCounter=0,se}(),Ut=P("8hTe"),an=P.n(Ut),xn=/]*>/g;function On(se){var z=document.createElement("div");return z.innerHTML=se,z.childNodes.length===0?"":z.childNodes[0].nodeValue}var An=J.a=function(se){var z=se.value,X=z===void 0?"":z,ne=se.edit,de=ne===void 0?!1:ne,ie=se.className,ze=se.showTextOnly,ht=se.showLines,St=se.replaces,Pt=se.zoomImg,pt=se.hasMask,Ht=se.style,zt=Ht===void 0?{}:Ht,Mr=se.stylesPrev,on=Mr===void 0?{}:Mr,Zr=String(X),Qt=Object(a.useRef)(),Kr=Object(a.useRef)(),or=Object(a.useState)(""),Yt=Object(C.a)(or,2),nr=Yt[0],dr=Yt[1],Jr=Object(a.useState)("office"),un=Object(C.a)(Jr,2),En=un[0],wi=un[1],Vi=function(){var ir=new mt(Kr.current);ir.displayMode="popup",ir.addRenderEventListener(function(){var qr=Object(l.a)(o.a.mark(function Tr(dn){var _r;return o.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return Qt.current.style.display="none",hn.next=3,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:dn}});case 3:_r=hn.sent,_r!=null&&_r.id&&St(Kr.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(_r==null?void 0:_r.id,"?type=").concat(_r.content_type));case 5:case"end":return hn.stop()}},Tr)}));return function(Tr){return qr.apply(this,arguments)}}()),ir.show()},Fi=function(){var ir=new sr(Kr.current);ir.settings.displayMode="popup",ir.addEventListener("render",function(){var qr=Object(l.a)(o.a.mark(function Tr(dn){var _r;return o.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:if(Qt.current.style.display="none",!Kr.current){hn.next=6;break}return hn.next=4,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:dn.dataUrl}});case 4:_r=hn.sent,_r!=null&&_r.id&&St(Kr.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(_r==null?void 0:_r.id,"?type=").concat(_r.content_type));case 6:case"end":return hn.stop()}},Tr)}));return function(Tr){return qr.apply(this,arguments)}}()),ir.show(),window.markerArea=ir},Qn=Object(a.useMemo)(function(){try{var Gr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,ir=/\"\/api\/attachments\/|\"\/attachments\/download\//g,qr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Zr=Zr.replace(Gr,"("+q.a.API_SERVER+"/api/attachments/").replace(ir,'"'+q.a.API_SERVER+"/api/attachments/").replace(qr,'"'+q.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `),Zr=Zr.replace(new RegExp("(?[TOC]

    ",k()),S()),Tr=Tr.replace(/(__special_katext_id_\d+__)/g,function(fi,hn){var Hn=dn[hn],Di=Hn.type,yi=Hn.expression;return Object(re.renderToString)(On(yi)||"",{displayMode:Di==="block",throwOnError:!1,output:"html"})}),Tr=Tr.replace(/▁/g,"\u2581\u2581\u2581"),j(),ze){var _r=document.createElement("div");return _r.innerHTML=Tr,_r.innerText}return setTimeout(function(){return sn()},500),Tr},[Zr]),rn=Object(a.useRef)();y.WebkitLineClamp=ht,ht&&(zt=Object(f.a)(Object(f.a)({},zt),y));function Ri(Gr){var ir=Gr.target;if(ir.tagName.toUpperCase()==="IMG"){if(Pt){var qr=ir.getAttribute("src");dr(qr),wi("image")}}else if(ir.tagName.toUpperCase()==="A"){var Tr=ir.getAttribute("href");if(Tr.indexOf("office")>-1)Gr.preventDefault(),dr(Tr),wi("office");else if(Tr.indexOf("application/pdf")>-1)Gr.preventDefault(),dr(Tr),wi("pdf");else if(Tr.indexOf("type=text")>-1)Gr.preventDefault(),dr(Tr),wi("html");else if(Tr.startsWith("#")){Gr.preventDefault();var dn=document.getElementById(Tr.replace("#",""));dn&&dn.scrollIntoView(!0)}}}var sn=function(){var ir,qr=(ir=rn.current)===null||ir===void 0?void 0:ir.querySelectorAll("video");qr==null||qr.forEach(function(Tr){if(Tr.oncontextmenu=function(){return!1},Tr.src.indexOf(".m3u8")>-1&&!Tr.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var dn=new H.a;dn.loadSource(Tr.src),dn.attachMedia(Tr)}}})};Object(a.useEffect)(function(){if(rn.current&&Qn&&(Qn.match(xn)&&window.PR.prettyPrint()),rn.current)return rn.current.addEventListener("click",Ri),function(){rn.current.removeEventListener("click",Ri),j(),S()}},[Qn,rn.current,Ri]);var hi=function(ir){if(!de)return;ir.target.nodeName==="IMG"?(Qt.current.style.display="flex",Qt.current.style.width=ir.target.clientWidth+"px",Qt.current.style.height=ir.target.clientHeight+"px",Qt.current.style.top=ir.target.offsetTop+"px",Qt.current.style.left=ir.target.offsetLeft+"px",Kr.current.src=ir.target.getAttribute("src")):Qt.current.style.display="none"};return r.a.createElement("div",{style:{position:"relative"}},r.a.createElement("div",{ref:rn,style:Object(f.a)({},zt),className:"".concat(ie||""," markdown-body ").concat(an.a.mdBody),onMouseOver:hi,dangerouslySetInnerHTML:{__html:Qn}}),r.a.createElement("div",{ref:Qt,className:an.a.button},r.a.createElement(u.a,null,r.a.createElement(D.a,{onClick:function(){return Vi()}},"\u88C1\u526A"),r.a.createElement(D.a,{onClick:function(){return Fi()}},"\u7F16\u8F91"))),r.a.createElement("img",{ref:Kr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),r.a.createElement(ee.a,{close:!0,data:nr,hasMask:pt,type:nr!=null&&nr.length?En:"",style:Object(f.a)({},on),onClose:function(){return dr("")}}))}},"9OqN":function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(M){return M.mode.CTR=function(){var u=M.lib.BlockCipherMode.extend(),_=u.Encryptor=u.extend({processBlock:function(D,f){var l=this._cipher,C=l.blockSize,v=this._iv,o=this._counter;v&&(o=this._counter=v.slice(0),this._iv=void 0);var a=o.slice(0);l.encryptBlock(a,0),o[C-1]=o[C-1]+1|0;for(var r=0;r-1?"."+nt.split(".").pop():"");H===null&&(je="testsets/".concat(ot).concat(nt.indexOf(".")>-1?"."+nt.split(".").pop():"")),et.multipartUpload(je,new Blob([qe.file],{type:qe.file.type}),{timeout:3600*1e3,partSize:1002400,callback:{customValue:{id:nt+""},url:Me==null?void 0:Me.callback_url,host:Me==null?void 0:Me.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(b.e)(ut)}}).then(function(De){if(De.data.status===0){ue.current=ue.current+1;var rt=te.current.map(function(Je){var tt,Ue;if(Je.name===((tt=De.data)===null||tt===void 0||((Ue=tt.data)===null||Ue===void 0)?void 0:Ue.file_name)){var ke,Ie,ye,Te=Object(C.a)({},Je);if((ke=De.data)!==null&&ke!==void 0&&(Ie=ke.data)!==null&&Ie!==void 0&&(ye=Ie.file_name)!==null&&ye!==void 0&&ye.includes(".in")){var Ae,Pe,$e,Ke,ct,gt;Te.in_object_key=(Ae=De.data)===null||Ae===void 0||((Pe=Ae.data)===null||Pe===void 0)?void 0:Pe.object,Te.in_object_size=($e=De.data)===null||$e===void 0||((Ke=$e.data)===null||Ke===void 0)?void 0:Ke.size,Te.input=(ct=De.data)===null||ct===void 0||((gt=ct.data)===null||gt===void 0)?void 0:gt.file_name,Te.in_file=qe}else{var wt,vt,It,Lt,_t,rr;Te.out_object_key=(wt=De.data)===null||wt===void 0||((vt=wt.data)===null||vt===void 0)?void 0:vt.object,Te.out_object_size=(It=De.data)===null||It===void 0||((Lt=It.data)===null||Lt===void 0)?void 0:Lt.size,Te.output=(_t=De.data)===null||_t===void 0||((rr=_t.data)===null||rr===void 0)?void 0:rr.file_name,Te.out_file=qe}return Te}return Je});if(te.current=Object(h.a)(rt),Ce(Object(h.a)(rt)),ue.current>0&&ue.current===ee.length){Se(!1);var lt=N(rt);lt=lt.filter(function(Je){var tt,Ue;return!!((tt=Je[0])!==null&&tt!==void 0&&tt.name&&(Ue=Je[1])!==null&&Ue!==void 0&&Ue.name)}),lt=lt.map(function(Je){return Object(C.a)(Object(C.a)(Object(C.a)({},Je[0]),Je[1]),{},{is_file:!0})}),G(lt),W()}}})},be=function(){if(ee.length===0){o.b.warn("\u8BF7\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6");return}Se(!0);var qe=N(ee);if(qe.some(function(et){var nt,ut;return!((nt=et[0])!==null&&nt!==void 0&&nt.name&&(ut=et[1])!==null&&ut!==void 0&&ut.name)})){l.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u4E0A\u4F20\u7684\u6D4B\u8BD5\u7528\u4F8B\u4E2D\u5B58\u5728\u672A\u914D\u5BF9\u7684\u6587\u4EF6\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4EC5\u4FDD\u5B58\u5DF2\u914D\u5BF9\u7684\u6D4B\u8BD5\u7528\u4F8B\uFF1F",onOk:function(){var et=Object(a.a)(g.a.mark(function ut(){return g.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:ee.map(function(){var De=Object(a.a)(g.a.mark(function rt(lt){return g.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:Z(lt);case 1:case"end":return tt.stop()}},rt)}));return function(rt){return De.apply(this,arguments)}}());case 1:case"end":return je.stop()}},ut)}));function nt(){return et.apply(this,arguments)}return nt}(),onCancel:function(){Se(!1)}});return}ee.map(function(){var et=Object(a.a)(g.a.mark(function nt(ut){return g.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:Z(ut);case 1:case"end":return je.stop()}},nt)}));return function(nt){return et.apply(this,arguments)}}())},ge={name:"file",fileList:ee,multiple:!0,accept:".in, .out",showUploadList:!1,beforeUpload:function(qe){if(ee!=null&&ee.some(function(nt){return nt.name===qe.name}))return o.b.info("".concat(qe.name,"\u6587\u4EF6\u5DF2\u5B58\u5728")),!1;if(qe.size/1024/1024>100)return o.b.info("\u6587\u4EF6\u8D85\u8FC7100M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;if(!/\.(in|out|IN|OUT)$/.test(qe.name))return o.b.warn("\u8F93\u5165\u6587\u4EF6\u53EA\u80FD\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6"),!1;var et={name:qe.name,uid:qe.uid,file:qe,percent:0};return ee.push(et),te.current=Object(h.a)(ee),Ce(Object(h.a)(ee)),!1}},Re=N(ee);return console.log(ee,Re,"fileList"),n.a.createElement(l.a,{visible:F,wrapClassName:B,onOk:be,centered:!0,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",okButtonProps:{loading:oe},onCancel:Oe,width:"1000px",title:"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"},n.a.createElement("div",{className:d.a.wrap},ee.length?n.a.createElement("div",null,n.a.createElement(p.a,ge,n.a.createElement(D.a,{className:d.a.btnS},"\u4E0A\u4F20\u6587\u4EF6")),n.a.createElement(L,{data:Re,onRemove:Y})):n.a.createElement("div",{className:d.a.noData},n.a.createElement("img",{src:y.a,alt:""}),n.a.createElement(p.a,ge,n.a.createElement(D.a,{className:d.a.btn},"\u4E0A\u4F20\u6587\u4EF6"))),n.a.createElement("div",{className:d.a.text},"\u4E0A\u4F20\u9650\u5236\uFF1A",n.a.createElement("br",null),"1\u3001\u6587\u4EF6\u5FC5\u987B\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6\u3002",n.a.createElement("br",null),"2\u3001\u8F93\u5165\u8F93\u51FA\u6587\u4EF6\u9700\u6587\u4EF6\u540D\u79F0\u4E00\u4E00\u5BF9\u5E94\uFF0C\u672A\u5BF9\u5E94\u65F6\uFF0C\u5C06\u65E0\u6CD5\u4E0A\u4F20\u3002",n.a.createElement("br",null),"3\u3001\u5355\u4E2A\u4E0A\u4F20\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7100MB\uFF0C\u8D85\u8FC7\u65F6\u53EF\u4EE5\u5206\u6279\u6B21\u4E0A\u4F20\u3002")))},L=function(K){var W=K.data,G=W===void 0?[]:W,F=K.onRemove,B=K.width,H=B===void 0?"auto":B,q=K.showScore,re=q===void 0?!1:q,ee=K.disabled,Ce=ee===void 0?!1:ee,Ee=K.inputChange,pe=function(ce){var oe=document.createElement("a");document.body.appendChild(oe);var Se=URL.createObjectURL(ce.file);oe.href=Se,oe.download=ce.name,oe.click(),URL.revokeObjectURL(Se),document.body.removeChild(oe)},Me=function(ce,oe){Object(x.w)(ce,oe)},_e=function(ce,oe){l.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc font16"},"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\u8BE5\u6D4B\u8BD5\u7528\u4F8B?"),onOk:function(){F(ce,oe)},onCancel:function(){}})};return G.length?n.a.createElement("div",{style:{width:H}},n.a.createElement("div",{className:d.a.head},n.a.createElement("div",{style:{width:"20%"}},"\u7528\u4F8B"),n.a.createElement("div",{style:{width:re?"25%":"35%"}},"\u8F93\u5165"),n.a.createElement("div",{style:{width:re?"25%":"35%"}},"\u8F93\u51FA"),re&&n.a.createElement("div",{style:{width:"20%"}},"\u5F97\u5206\u6BD4\u4F8B"),n.a.createElement("div",{style:{width:"10%"}},"\u64CD\u4F5C")),G.map(function(he,ce){var oe,Se,te,ue;return n.a.createElement("div",{key:ce,className:d.a.list},n.a.createElement("div",{style:{width:"20%"}},"\u6D4B\u8BD5\u7528\u4F8B",ce+1),n.a.createElement("div",{className:d.a.info,style:{width:re?"25%":"35%"}},n.a.createElement("span",{title:he.input||((oe=he[0])===null||oe===void 0?void 0:oe.name),onClick:function(){he.input?he.input_file_url?Me(he.input_file_url,he.input):pe(he.in_file):pe(he[0])}},he.input||((Se=he[0])===null||Se===void 0?void 0:Se.name))),n.a.createElement("div",{className:d.a.info,style:{width:re?"25%":"35%"}},n.a.createElement("span",{title:he.output||((te=he[1])===null||te===void 0?void 0:te.name),onClick:function(){he.input?he.output_file_url?Me(he.output_file_url,he.output):pe(he.out_file):pe(he[1])}},he.output||((ue=he[1])===null||ue===void 0?void 0:ue.name))),re&&n.a.createElement("div",{style:{width:"20%"}},n.a.createElement(u.a,{disabled:Ce,style:{width:"70%"},onChange:function(le){return Ee(le,ce)},value:he.score}),n.a.createElement("span",null,"\xA0%")),n.a.createElement("div",{onClick:function(){return _e(he,ce)},style:{width:"10%"}},n.a.createElement("span",{className:d.a.del},"\u5220\u9664")))})):n.a.createElement(n.a.Fragment,null)};J.b=j},BU3w:function(I,J,P){"use strict";P.d(J,"a",function(){return l});var M=P("MNnm"),u="rc-util-key";function _(C){if(C.attachTo)return C.attachTo;var v=document.querySelector("head");return v||document.body}function D(C){var v,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(M.a)())return null;var a=document.createElement("style");if((v=o.csp)===null||v===void 0?void 0:v.nonce){var r;a.nonce=(r=o.csp)===null||r===void 0?void 0:r.nonce}a.innerHTML=C;var h=_(o),m=h.firstChild;return o.prepend&&h.prepend?h.prepend(a):o.prepend&&m?h.insertBefore(a,m):h.appendChild(a),a}var f=new Map;function l(C,v){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=_(o);if(!f.has(a)){var r=D("",o),h=r.parentNode;f.set(a,h),h.removeChild(r)}var m=Array.from(f.get(a).children).find(function(n){return n.tagName==="STYLE"&&n[u]===v});if(m){var p,w;if(((p=o.csp)===null||p===void 0?void 0:p.nonce)&&m.nonce!==((w=o.csp)===null||w===void 0?void 0:w.nonce)){var g;m.nonce=(g=o.csp)===null||g===void 0?void 0:g.nonce}return m.innerHTML!==C&&(m.innerHTML=C),m}var c=D(C,o);return c[u]=v,c}},Bd2K:function(I,J,P){(function(M){M(P("VrN/"),P("osHv"))})(function(M){M.defineOption("autoCloseTags",!1,function(o,a,r){if(r!=M.Init&&r&&o.removeKeyMap("autoCloseTags"),!a)return;var h={name:"autoCloseTags"};(typeof a!="object"||a.whenClosing!==!1)&&(h["'/'"]=function(m){return l(m)}),(typeof a!="object"||a.whenOpening!==!1)&&(h["'>'"]=function(m){return D(m)}),o.addKeyMap(h)});var u=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],_=["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 D(o){if(o.getOption("disableInput"))return M.Pass;for(var a=o.listSelections(),r=[],h=o.getOption("autoCloseTags"),m=0;mp.ch&&(s=s.slice(0,s.length-w.end+p.ch));var i=s.toLowerCase();if(!s||w.type=="string"&&(w.end!=p.ch||!/[\"\']/.test(w.string.charAt(w.string.length-1))||w.string.length==1)||w.type=="tag"&&n.close||w.string.indexOf("/")==p.ch-w.start-1||S&&C(S,i)>-1||v(o,g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(c)||[],s,p,!0))return M.Pass;var k=typeof h=="object"&&h.emptyTags;if(k&&C(k,s)>-1){r[m]={text:"/>",newPos:M.Pos(p.line,p.ch+2)};continue}var O=y&&C(y,i)>-1;r[m]={indent:O,text:">"+(O?` `:"")+"",newPos:O?M.Pos(p.line+1,0):M.Pos(p.line,p.ch+1)}}for(var b=typeof h=="object"&&h.dontIndentOnAutoClose,m=a.length-1;m>=0;m--){var E=r[m];o.replaceRange(E.text,a[m].head,a[m].anchor,"+insert");var x=o.listSelections().slice(0);x[m]={head:E.newPos,anchor:E.newPos},o.setSelections(x),!b&&E.indent&&(o.indentLine(E.newPos.line,null,!0),o.indentLine(E.newPos.line+1,null,!0))}}function f(o,a){for(var r=o.listSelections(),h=[],m=a?"/":""&&(S+=">"),h[g]=S}if(o.replaceSelections(h),r=o.listSelections(),!w)for(var g=0;g=0&&a[c]==r;c--)++g;h=w.to;for(var c=1;c0){for(var a=0;a1&&arguments[1]!==void 0?arguments[1]:"",a=[],r=0;r=0;a--){var r=_().key(a);o(D(r),r)}}function C(o){return _().removeItem(o)}function v(){return _().clear()}},DlQD:function(I,J,P){(function(M,u){I.exports=u()})(this,function(){"use strict";function M(Ue,ke){for(var Ie=0;IeUe.length)&&(ke=Ue.length);for(var Ie=0,ye=new Array(ke);Ie=Ue.length?{done:!0}:{done:!1,value:Ue[ye++]}}}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 Ie=Ue[Symbol.iterator](),Ie.next.bind(Ie)}function l(Ue,ke){return ke={exports:{}},Ue(ke,ke.exports),ke.exports}var C=l(function(Ue){function ke(){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 Ie(ye){Ue.exports.defaults=ye}Ue.exports={defaults:ke(),getDefaults:ke,changeDefaults:Ie}}),v=C.defaults,o=C.getDefaults,a=C.changeDefaults,r=/[&<>"']/,h=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,p=/[<>"']|&(?!#?\w+;)/g,w={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(ke){return w[ke]};function c(Ue,ke){if(ke){if(r.test(Ue))return Ue.replace(h,g)}else if(m.test(Ue))return Ue.replace(p,g);return Ue}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Ue){return Ue.replace(n,function(ke,Ie){return Ie=Ie.toLowerCase(),Ie==="colon"?":":Ie.charAt(0)==="#"?Ie.charAt(1)==="x"?String.fromCharCode(parseInt(Ie.substring(2),16)):String.fromCharCode(+Ie.substring(1)):""})}var d=/(^|[^\[])\^/g;function S(Ue,ke){Ue=Ue.source||Ue,ke=ke||"";var Ie={replace:function(Te,Ae){return Ae=Ae.source||Ae,Ae=Ae.replace(d,"$1"),Ue=Ue.replace(Te,Ae),Ie},getRegex:function(){return new RegExp(Ue,ke)}};return Ie}var y=/[^\w:]/g,i=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(Ue,ke,Ie){if(Ue){var ye;try{ye=decodeURIComponent(s(Ie)).replace(y,"").toLowerCase()}catch(Te){return null}if(ye.indexOf("javascript:")===0||ye.indexOf("vbscript:")===0||ye.indexOf("data:")===0)return null}ke&&!i.test(Ie)&&(Ie=T(ke,Ie));try{Ie=encodeURI(Ie).replace(/%25/g,"%")}catch(Te){return null}return Ie}var O={},b=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function T(Ue,ke){O[" "+Ue]||(b.test(Ue)?O[" "+Ue]=Ue+"/":O[" "+Ue]=V(Ue,"/",!0)),Ue=O[" "+Ue];var Ie=Ue.indexOf(":")===-1;return ke.substring(0,2)==="//"?Ie?ke:Ue.replace(E,"$1")+ke:ke.charAt(0)==="/"?Ie?ke:Ue.replace(x,"$1")+ke:Ue+ke}var N={exec:function(){}};function j(Ue){for(var ke=1,Ie,ye;ke=0&&$e[ct]==="\\";)Ke=!Ke;return Ke?"|":" |"}),ye=Ie.split(/ \|/),Te=0;if(ye.length>ke)ye.splice(ke);else for(;ye.length=ye.length?Te.slice(ye.length):Te}).join(` `)}var Ee=function(){function Ue(Ie){this.options=Ie||F}var ke=Ue.prototype;return ke.space=function(ye){var Te=this.rules.block.newline.exec(ye);if(Te)return Te[0].length>1?{type:"space",raw:Te[0]}:{raw:` `}},ke.code=function(ye,Te){var Ae=this.rules.block.code.exec(ye);if(Ae){var Pe=Te[Te.length-1];if(Pe&&Pe.type==="paragraph")return{raw:Ae[0],text:Ae[0].trimRight()};var $e=Ae[0].replace(/^ {4}/gm,"");return{type:"code",raw:Ae[0],codeBlockStyle:"indented",text:this.options.pedantic?$e:B($e,` `)}}},ke.fences=function(ye){var Te=this.rules.block.fences.exec(ye);if(Te){var Ae=Te[0],Pe=Ce(Ae,Te[3]||"");return{type:"code",raw:Ae,lang:Te[2]?Te[2].trim():Te[2],text:Pe}}},ke.heading=function(ye){var Te=this.rules.block.heading.exec(ye);if(Te)return{type:"heading",raw:Te[0],depth:Te[1].length,text:Te[2]}},ke.nptable=function(ye){var Te=this.rules.block.nptable.exec(ye);if(Te){var Ae={type:"table",header:H(Te[1].replace(/^ *| *\| *$/g,"")),align:Te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Te[3]?Te[3].replace(/\n$/,"").split(` `):[],raw:Te[0]};if(Ae.header.length===Ae.align.length){var Pe=Ae.align.length,$e;for($e=0;$e ?/gm,"");return{type:"blockquote",raw:Te[0],text:Ae}}},ke.list=function(ye){var Te=this.rules.block.list.exec(ye);if(Te){for(var Ae=Te[0],Pe=Te[2],$e=Pe.length>1,Ke=Pe[Pe.length-1]===")",ct={type:"list",raw:Ae,ordered:$e,start:$e?+Pe.slice(0,-1):"",loose:!1,items:[]},gt=Te[0].match(this.rules.block.item),wt=!1,vt,It,Lt,_t,rr,sr,$t,cr=gt.length,Wt=0;Wt1||this.options.smartLists&&Lt!==Pe)&&(_t=gt.slice(Wt+1).join(` `),ct.raw=ct.raw.substring(0,ct.raw.length-_t.length),Wt=cr-1)),rr=wt||/\n\n(?!\s*$)/.test(vt),Wt!==cr-1&&(wt=vt.charAt(vt.length-1)===` `,rr||(rr=wt)),rr&&(ct.loose=!0),sr=/^\[[ xX]\] /.test(vt),$t=void 0,sr&&($t=vt[1]!==" ",vt=vt.replace(/^\[[ xX]\] +/,"")),ct.items.push({type:"list_item",raw:Ae,task:sr,checked:$t,loose:rr,text:vt});return ct}},ke.html=function(ye){var Te=this.rules.block.html.exec(ye);if(Te)return{type:this.options.sanitize?"paragraph":"html",raw:Te[0],pre:!this.options.sanitizer&&(Te[1]==="pre"||Te[1]==="script"||Te[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Te[0]):q(Te[0]):Te[0]}},ke.def=function(ye){var Te=this.rules.block.def.exec(ye);if(Te){Te[3]&&(Te[3]=Te[3].substring(1,Te[3].length-1));var Ae=Te[1].toLowerCase().replace(/\s+/g," ");return{tag:Ae,raw:Te[0],href:Te[2],title:Te[3]}}},ke.table=function(ye){var Te=this.rules.block.table.exec(ye);if(Te){var Ae={type:"table",header:H(Te[1].replace(/^ *| *\| *$/g,"")),align:Te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Te[3]?Te[3].replace(/\n$/,"").split(` `):[]};if(Ae.header.length===Ae.align.length){Ae.raw=Te[0];var Pe=Ae.align.length,$e;for($e=0;$e/i.test(Pe[0])&&(Te=!1),!Ae&&/^<(pre|code|kbd|script)(\s|>)/i.test(Pe[0])?Ae=!0:Ae&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Pe[0])&&(Ae=!1),{type:this.options.sanitize?"text":"html",raw:Pe[0],inLink:Te,inRawBlock:Ae,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Pe[0]):q(Pe[0]):Pe[0]}},ke.link=function(ye){var Te=this.rules.inline.link.exec(ye);if(Te){var Ae=re(Te[2],"()");if(Ae>-1){var Pe=Te[0].indexOf("!")===0?5:4,$e=Pe+Te[1].length+Ae;Te[2]=Te[2].substring(0,Ae),Te[0]=Te[0].substring(0,$e).trim(),Te[3]=""}var Ke=Te[2],ct="";if(this.options.pedantic){var gt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ke);gt?(Ke=gt[1],ct=gt[3]):ct=""}else ct=Te[3]?Te[3].slice(1,-1):"";Ke=Ke.trim().replace(/^<([\s\S]*)>$/,"$1");var wt=ee(Te,{href:Ke&&Ke.replace(this.rules.inline._escapes,"$1"),title:ct&&ct.replace(this.rules.inline._escapes,"$1")},Te[0]);return wt}},ke.reflink=function(ye,Te){var Ae;if((Ae=this.rules.inline.reflink.exec(ye))||(Ae=this.rules.inline.nolink.exec(ye))){var Pe=(Ae[2]||Ae[1]).replace(/\s+/g," ");if(Pe=Te[Pe.toLowerCase()],!Pe||!Pe.href){var $e=Ae[0].charAt(0);return{type:"text",raw:$e,text:$e}}var Ke=ee(Ae,Pe,Ae[0]);return Ke}},ke.strong=function(ye,Te,Ae){Ae===void 0&&(Ae="");var Pe=this.rules.inline.strong.start.exec(ye);if(Pe&&(!Pe[1]||Pe[1]&&(Ae===""||this.rules.inline.punctuation.exec(Ae)))){Te=Te.slice(-1*ye.length);var $e=Pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;$e.lastIndex=0;for(var Ke;(Pe=$e.exec(Te))!=null;)if(Ke=this.rules.inline.strong.middle.exec(Te.slice(0,Pe.index+3)),Ke)return{type:"strong",raw:ye.slice(0,Ke[0].length),text:ye.slice(2,Ke[0].length-2)}}},ke.em=function(ye,Te,Ae){Ae===void 0&&(Ae="");var Pe=this.rules.inline.em.start.exec(ye);if(Pe&&(!Pe[1]||Pe[1]&&(Ae===""||this.rules.inline.punctuation.exec(Ae)))){Te=Te.slice(-1*ye.length);var $e=Pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;$e.lastIndex=0;for(var Ke;(Pe=$e.exec(Te))!=null;)if(Ke=this.rules.inline.em.middle.exec(Te.slice(0,Pe.index+2)),Ke)return{type:"em",raw:ye.slice(0,Ke[0].length),text:ye.slice(1,Ke[0].length-1)}}},ke.codespan=function(ye){var Te=this.rules.inline.code.exec(ye);if(Te){var Ae=Te[2].replace(/\n/g," "),Pe=/[^ ]/.test(Ae),$e=Ae.startsWith(" ")&&Ae.endsWith(" ");return Pe&&$e&&(Ae=Ae.substring(1,Ae.length-1)),Ae=q(Ae,!0),{type:"codespan",raw:Te[0],text:Ae}}},ke.br=function(ye){var Te=this.rules.inline.br.exec(ye);if(Te)return{type:"br",raw:Te[0]}},ke.del=function(ye){var Te=this.rules.inline.del.exec(ye);if(Te)return{type:"del",raw:Te[0],text:Te[1]}},ke.autolink=function(ye,Te){var Ae=this.rules.inline.autolink.exec(ye);if(Ae){var Pe,$e;return Ae[2]==="@"?(Pe=q(this.options.mangle?Te(Ae[1]):Ae[1]),$e="mailto:"+Pe):(Pe=q(Ae[1]),$e=Pe),{type:"link",raw:Ae[0],text:Pe,href:$e,tokens:[{type:"text",raw:Pe,text:Pe}]}}},ke.url=function(ye,Te){var Ae;if(Ae=this.rules.inline.url.exec(ye)){var Pe,$e;if(Ae[2]==="@")Pe=q(this.options.mangle?Te(Ae[0]):Ae[0]),$e="mailto:"+Pe;else{var Ke;do Ke=Ae[0],Ae[0]=this.rules.inline._backpedal.exec(Ae[0])[0];while(Ke!==Ae[0]);Pe=q(Ae[0]),Ae[1]==="www."?$e="http://"+Pe:$e=Pe}return{type:"link",raw:Ae[0],text:Pe,href:$e,tokens:[{type:"text",raw:Pe,text:Pe}]}}},ke.inlineText=function(ye,Te,Ae){var Pe=this.rules.inline.text.exec(ye);if(Pe){var $e;return Te?$e=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Pe[0]):q(Pe[0]):Pe[0]:$e=q(this.options.smartypants?Ae(Pe[0]):Pe[0]),{type:"text",raw:Pe[0],text:$e}}},Ue}(),pe=G.noopTest,Me=G.edit,_e=G.merge,he={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:pe,table:pe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,he.def=Me(he.def).replace("label",he._label).replace("title",he._title).getRegex(),he.bullet=/(?:[*+-]|\d{1,9}[.)])/,he.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,he.item=Me(he.item,"gm").replace(/bull/g,he.bullet).getRegex(),he.list=Me(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex(),he._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",he._comment=//,he.html=Me(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he.paragraph=Me(he._paragraph).replace("hr",he.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",")|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.blockquote=Me(he.blockquote).replace("paragraph",he.paragraph).getRegex(),he.normal=_e({},he),he.gfm=_e({},he.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*|$)"}),he.gfm.nptable=Me(he.gfm.nptable).replace("hr",he.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",")|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.gfm.table=Me(he.gfm.table).replace("hr",he.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",")|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.pedantic=_e({},he.normal,{html:Me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:pe,paragraph:Me(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:pe,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:pe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ce.punctuation=Me(ce.punctuation).replace(/punctuation/g,ce._punctuation).getRegex(),ce._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ce._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ce.em.start=Me(ce.em.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.middle=Me(ce.em.middle).replace(/punctuation/g,ce._punctuation).replace(/overlapSkip/g,ce._overlapSkip).getRegex(),ce.em.endAst=Me(ce.em.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.endUnd=Me(ce.em.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.start=Me(ce.strong.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.middle=Me(ce.strong.middle).replace(/punctuation/g,ce._punctuation).replace(/blockSkip/g,ce._blockSkip).getRegex(),ce.strong.endAst=Me(ce.strong.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.endUnd=Me(ce.strong.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.blockSkip=Me(ce._blockSkip,"g").getRegex(),ce.overlapSkip=Me(ce._overlapSkip,"g").getRegex(),ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ce._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])?)+(?![-_])/,ce.autolink=Me(ce.autolink).replace("scheme",ce._scheme).replace("email",ce._email).getRegex(),ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ce.tag=Me(ce.tag).replace("comment",he._comment).replace("attribute",ce._attribute).getRegex(),ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ce._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ce.link=Me(ce.link).replace("label",ce._label).replace("href",ce._href).replace("title",ce._title).getRegex(),ce.reflink=Me(ce.reflink).replace("label",ce._label).getRegex(),ce.reflinkSearch=Me(ce.reflinkSearch,"g").replace("reflink",ce.reflink).replace("nolink",ce.nolink).getRegex(),ce.normal=_e({},ce),ce.pedantic=_e({},ce.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:Me(/^!?\[(label)\]\((.*?)\)/).replace("label",ce._label).getRegex(),reflink:Me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce._label).getRegex()}),ce.gfm=_e({},ce.normal,{escape:Me(ce.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]*?(?:(?=[\\.5&&(ye="x"+ye.toString(16)),ke+="&#"+ye+";";return ke}var Q=function(){function Ue(Ie){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ie||Se,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ye={block:te.normal,inline:ue.normal};this.options.pedantic?(ye.block=te.pedantic,ye.inline=ue.pedantic):this.options.gfm&&(ye.block=te.gfm,this.options.breaks?ye.inline=ue.breaks:ye.inline=ue.gfm),this.tokenizer.rules=ye}Ue.lex=function(ye,Te){var Ae=new Ue(Te);return Ae.lex(ye)};var ke=Ue.prototype;return ke.lex=function(ye){return ye=ye.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(ye,this.tokens,!0),this.inline(this.tokens),this.tokens},ke.blockTokens=function(ye,Te,Ae){Te===void 0&&(Te=[]),Ae===void 0&&(Ae=!0),ye=ye.replace(/^ +$/gm,"");for(var Pe,$e,Ke,ct;ye;){if(Pe=this.tokenizer.space(ye)){ye=ye.substring(Pe.raw.length),Pe.type&&Te.push(Pe);continue}if(Pe=this.tokenizer.code(ye,Te)){ye=ye.substring(Pe.raw.length),Pe.type?Te.push(Pe):(ct=Te[Te.length-1],ct.raw+=` `+Pe.raw,ct.text+=` `+Pe.text);continue}if(Pe=this.tokenizer.fences(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.heading(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.nptable(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.hr(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.blockquote(ye)){ye=ye.substring(Pe.raw.length),Pe.tokens=this.blockTokens(Pe.text,[],Ae),Te.push(Pe);continue}if(Pe=this.tokenizer.list(ye)){for(ye=ye.substring(Pe.raw.length),Ke=Pe.items.length,$e=0;$e0)for(;(gt=this.tokenizer.rules.inline.reflinkSearch.exec(ct))!=null;)wt.includes(gt[0].slice(gt[0].lastIndexOf("[")+1,-1))&&(ct=ct.slice(0,gt.index)+"["+"a".repeat(gt[0].length-2)+"]"+ct.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(gt=this.tokenizer.rules.inline.blockSkip.exec(ct))!=null;)ct=ct.slice(0,gt.index)+"["+"a".repeat(gt[0].length-2)+"]"+ct.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ye;){if(Ke=this.tokenizer.escape(ye)){ye=ye.substring(Ke.raw.length),Te.push(Ke);continue}if(Ke=this.tokenizer.tag(ye,Ae,Pe)){ye=ye.substring(Ke.raw.length),Ae=Ke.inLink,Pe=Ke.inRawBlock,Te.push(Ke);continue}if(Ke=this.tokenizer.link(ye)){ye=ye.substring(Ke.raw.length),Ke.type==="link"&&(Ke.tokens=this.inlineTokens(Ke.text,[],!0,Pe)),Te.push(Ke);continue}if(Ke=this.tokenizer.reflink(ye,this.tokens.links)){ye=ye.substring(Ke.raw.length),Ke.type==="link"&&(Ke.tokens=this.inlineTokens(Ke.text,[],!0,Pe)),Te.push(Ke);continue}if(Ke=this.tokenizer.strong(ye,ct,$e)){ye=ye.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],Ae,Pe),Te.push(Ke);continue}if(Ke=this.tokenizer.em(ye,ct,$e)){ye=ye.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],Ae,Pe),Te.push(Ke);continue}if(Ke=this.tokenizer.codespan(ye)){ye=ye.substring(Ke.raw.length),Te.push(Ke);continue}if(Ke=this.tokenizer.br(ye)){ye=ye.substring(Ke.raw.length),Te.push(Ke);continue}if(Ke=this.tokenizer.del(ye)){ye=ye.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],Ae,Pe),Te.push(Ke);continue}if(Ke=this.tokenizer.autolink(ye,le)){ye=ye.substring(Ke.raw.length),Te.push(Ke);continue}if(!Ae&&(Ke=this.tokenizer.url(ye,le))){ye=ye.substring(Ke.raw.length),Te.push(Ke);continue}if(Ke=this.tokenizer.inlineText(ye,Pe,Oe)){ye=ye.substring(Ke.raw.length),$e=Ke.raw.slice(-1),Te.push(Ke);continue}if(ye){var vt="Infinite loop on byte: "+ye.charCodeAt(0);if(this.options.silent){console.error(vt);break}else throw new Error(vt)}}return Te},u(Ue,null,[{key:"rules",get:function(){return{block:te,inline:ue}}}]),Ue}(),Y=C.defaults,Z=G.cleanUrl,be=G.escape,ge=function(){function Ue(Ie){this.options=Ie||Y}var ke=Ue.prototype;return ke.code=function(ye,Te,Ae){var Pe=(Te||"").match(/\S*/)[0];if(this.options.highlight){var $e=this.options.highlight(ye,Pe);$e!=null&&$e!==ye&&(Ae=!0,ye=$e)}return Pe?'
    '+(Ae?ye:be(ye,!0))+`
    `:"
    "+(Ae?ye:be(ye,!0))+`
    `},ke.blockquote=function(ye){return`
    `+ye+`
    `},ke.html=function(ye){return ye},ke.heading=function(ye,Te,Ae,Pe){return this.options.headerIds?"'+ye+" `:""+ye+" `},ke.hr=function(){return this.options.xhtml?`
    `:`
    `},ke.list=function(ye,Te,Ae){var Pe=Te?"ol":"ul",$e=Te&&Ae!==1?' start="'+Ae+'"':"";return"<"+Pe+$e+`> `+ye+" `},ke.listitem=function(ye){return"
  • "+ye+`
  • `},ke.checkbox=function(ye){return" "},ke.paragraph=function(ye){return"

    "+ye+`

    `},ke.table=function(ye,Te){return Te&&(Te=""+Te+""),` `+ye+` `+Te+`
    `},ke.tablerow=function(ye){return` `+ye+` `},ke.tablecell=function(ye,Te){var Ae=Te.header?"th":"td",Pe=Te.align?"<"+Ae+' align="'+Te.align+'">':"<"+Ae+">";return Pe+ye+" `},ke.strong=function(ye){return""+ye+""},ke.em=function(ye){return""+ye+""},ke.codespan=function(ye){return""+ye+""},ke.br=function(){return this.options.xhtml?"
    ":"
    "},ke.del=function(ye){return""+ye+""},ke.link=function(ye,Te,Ae){if(ye=Z(this.options.sanitize,this.options.baseUrl,ye),ye===null)return Ae;var Pe='",Pe},ke.image=function(ye,Te,Ae){if(ye=Z(this.options.sanitize,this.options.baseUrl,ye),ye===null)return Ae;var Pe=''+Ae+'":">",Pe},ke.text=function(ye){return ye},Ue}(),Re=function(){function Ue(){}var ke=Ue.prototype;return ke.strong=function(ye){return ye},ke.em=function(ye){return ye},ke.codespan=function(ye){return ye},ke.del=function(ye){return ye},ke.html=function(ye){return ye},ke.text=function(ye){return ye},ke.link=function(ye,Te,Ae){return""+Ae},ke.image=function(ye,Te,Ae){return""+Ae},ke.br=function(){return""},Ue}(),Ze=function(){function Ue(){this.seen={}}var ke=Ue.prototype;return ke.slug=function(ye){var Te=ye.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Te)){var Ae=Te;do this.seen[Ae]++,Te=Ae+"-"+this.seen[Ae];while(this.seen.hasOwnProperty(Te))}return this.seen[Te]=0,Te},Ue}(),qe=C.defaults,et=G.unescape,nt=function(){function Ue(Ie){this.options=Ie||qe,this.options.renderer=this.options.renderer||new ge,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Re,this.slugger=new Ze}Ue.parse=function(ye,Te){var Ae=new Ue(Te);return Ae.parse(ye)};var ke=Ue.prototype;return ke.parse=function(ye,Te){Te===void 0&&(Te=!0);var Ae="",Pe,$e,Ke,ct,gt,wt,vt,It,Lt,_t,rr,sr,$t,cr,Wt,Lr,Cr,Ct,lr=ye.length;for(Pe=0;Pe0&&Wt.tokens[0].type==="text"?(Wt.tokens[0].text=Ct+" "+Wt.tokens[0].text,Wt.tokens[0].tokens&&Wt.tokens[0].tokens.length>0&&Wt.tokens[0].tokens[0].type==="text"&&(Wt.tokens[0].tokens[0].text=Ct+" "+Wt.tokens[0].tokens[0].text)):Wt.tokens.unshift({type:"text",text:Ct}):cr+=Ct),cr+=this.parse(Wt.tokens,$t),Lt+=this.renderer.listitem(cr,Cr,Lr);Ae+=this.renderer.list(Lt,rr,sr);continue}case"html":{Ae+=this.renderer.html(_t.text);continue}case"paragraph":{Ae+=this.renderer.paragraph(this.parseInline(_t.tokens));continue}case"text":{for(Lt=_t.tokens?this.parseInline(_t.tokens):_t.text;Pe+1An error occurred:

    "+je(Ke.message+"",!0)+"
    ";throw Ke}}Je.options=Je.setOptions=function(Ue){return ut(Je.defaults,Ue),rt(Je.defaults),Je},Je.getDefaults=De,Je.defaults=lt,Je.use=function(Ue){var ke=ut({},Ue);if(Ue.renderer&&function(){var ye=Je.defaults.renderer||new ge,Te=function($e){var Ke=ye[$e];ye[$e]=function(){for(var ct=arguments.length,gt=new Array(ct),wt=0;wt=0;m--){if(!_(h[m]))continue;var p=h[m].split("="),w=unescape(p[0]),g=unescape(p[1]);r(g,w)}}function C(r,h){if(!r)return;D.cookie=escape(r)+"="+escape(h)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function v(r){if(!r||!a(r))return;D.cookie=escape(r)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function o(){l(function(r,h){v(h)})}function a(r){return new RegExp("(?:^|;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(D.cookie)}},E4JC:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("ETIr"),P("cv67"),P("K3mO"),P("OLod"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.StreamCipher,f=u.algo,l=[],C=[],v=[],o=f.Rabbit=D.extend({_doReset:function(){for(var r=this._key.words,h=this.cfg.iv,m=0;m<4;m++)r[m]=(r[m]<<8|r[m]>>>24)&16711935|(r[m]<<24|r[m]>>>8)&4278255360;var p=this._X=[r[0],r[3]<<16|r[2]>>>16,r[1],r[0]<<16|r[3]>>>16,r[2],r[1]<<16|r[0]>>>16,r[3],r[2]<<16|r[1]>>>16],w=this._C=[r[2]<<16|r[2]>>>16,r[0]&4294901760|r[1]&65535,r[3]<<16|r[3]>>>16,r[1]&4294901760|r[2]&65535,r[0]<<16|r[0]>>>16,r[2]&4294901760|r[3]&65535,r[1]<<16|r[1]>>>16,r[3]&4294901760|r[0]&65535];this._b=0;for(var m=0;m<4;m++)a.call(this);for(var m=0;m<8;m++)w[m]^=p[m+4&7];if(h){var g=h.words,c=g[0],n=g[1],s=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,d=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,S=s>>>16|d&4294901760,y=d<<16|s&65535;w[0]^=s,w[1]^=S,w[2]^=d,w[3]^=y,w[4]^=s,w[5]^=S,w[6]^=d,w[7]^=y;for(var m=0;m<4;m++)a.call(this)}},_doProcessBlock:function(r,h){var m=this._X;a.call(this),l[0]=m[0]^m[5]>>>16^m[3]<<16,l[1]=m[2]^m[7]>>>16^m[5]<<16,l[2]=m[4]^m[1]>>>16^m[7]<<16,l[3]=m[6]^m[3]>>>16^m[1]<<16;for(var p=0;p<4;p++)l[p]=(l[p]<<8|l[p]>>>24)&16711935|(l[p]<<24|l[p]>>>8)&4278255360,r[h+p]^=l[p]},blockSize:128/32,ivSize:64/32});function a(){for(var r=this._X,h=this._C,m=0;m<8;m++)C[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var p=r[m]+h[m],w=p&65535,g=p>>>16,c=((w*w>>>17)+w*g>>>15)+g*g,n=((p&4294901760)*p|0)+((p&65535)*p|0);v[m]=c^n}r[0]=v[0]+(v[7]<<16|v[7]>>>16)+(v[6]<<16|v[6]>>>16)|0,r[1]=v[1]+(v[0]<<8|v[0]>>>24)+v[7]|0,r[2]=v[2]+(v[1]<<16|v[1]>>>16)+(v[0]<<16|v[0]>>>16)|0,r[3]=v[3]+(v[2]<<8|v[2]>>>24)+v[1]|0,r[4]=v[4]+(v[3]<<16|v[3]>>>16)+(v[2]<<16|v[2]>>>16)|0,r[5]=v[5]+(v[4]<<8|v[4]>>>24)+v[3]|0,r[6]=v[6]+(v[5]<<16|v[5]>>>16)+(v[4]<<16|v[4]>>>16)|0,r[7]=v[7]+(v[6]<<8|v[6]>>>24)+v[5]|0}u.Rabbit=D._createHelper(o)}(),M.Rabbit})},ELLl:function(I,J,P){(function(M){M(P("VrN/"))})(function(M){var u={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},_=M.Pos;M.defineOption("autoCloseBrackets",!1,function(w,g,c){c&&c!=M.Init&&(w.removeKeyMap(f),w.state.closeBrackets=null),g&&(l(D(g,"pairs")),w.state.closeBrackets=g,w.addKeyMap(f))});function D(w,g){return g=="pairs"&&typeof w=="string"?w:typeof w=="object"&&w[g]!=null?w[g]:u[g]}var f={Backspace:o,Enter:a};function l(w){for(var g=0;g=0;s--){var S=n[s].head;w.replaceRange("",_(S.line,S.ch-1),_(S.line,S.ch+1),"+delete")}}function a(w){var g=v(w),c=g&&D(g,"explode");if(!c||w.getOption("disableInput"))return M.Pass;for(var n=w.listSelections(),s=0;s0;return{anchor:new _(w.anchor.line,w.anchor.ch+(g?-1:1)),head:new _(w.head.line,w.head.ch+(g?1:-1))}}function h(w,g){var c=v(w);if(!c||w.getOption("disableInput"))return M.Pass;var n=D(c,"pairs"),s=n.indexOf(g);if(s==-1)return M.Pass;for(var d=D(c,"closeBefore"),S=D(c,"triples"),y=n.charAt(s+1)==g,i=w.listSelections(),k=s%2==0,O,b=0;b=0&&w.getRange(x,_(x.line,x.ch+3))==g+g+g?T="skipThree":T="skip";else if(y&&x.ch>1&&S.indexOf(g)>=0&&w.getRange(_(x.line,x.ch-2),x)==g+g){if(x.ch>2&&/\bstring/.test(w.getTokenTypeAt(_(x.line,x.ch-2))))return M.Pass;T="addFour"}else if(y){var j=x.ch==0?" ":w.getRange(_(x.line,x.ch-1),x);if(!M.isWordChar(N)&&j!=g&&!M.isWordChar(j))T="both";else return M.Pass}else if(k&&(N.length===0||/\s/.test(N)||d.indexOf(N)>-1))T="both";else return M.Pass;if(!O)O=T;else if(O!=T)return M.Pass}var L=s%2?n.charAt(s-1):g,V=s%2?g:n.charAt(s+1);w.operation(function(){if(O=="skip")w.execCommand("goCharRight");else if(O=="skipThree")for(var K=0;K<3;K++)w.execCommand("goCharRight");else if(O=="surround"){for(var W=w.getSelections(),K=0;K>>24)&16711935|(O<<24|O>>>8)&4278255360}var b=this._hash.words,E=h.words,x=m.words,T=v.words,N=o.words,j=a.words,L=r.words,V,K,W,G,F,B,H,q,re,ee;B=V=b[0],H=K=b[1],q=W=b[2],re=G=b[3],ee=F=b[4];for(var Ce,i=0;i<80;i+=1)Ce=V+S[y+T[i]]|0,i<16?Ce+=w(K,W,G)+E[0]:i<32?Ce+=g(K,W,G)+E[1]:i<48?Ce+=c(K,W,G)+E[2]:i<64?Ce+=n(K,W,G)+E[3]:Ce+=s(K,W,G)+E[4],Ce=Ce|0,Ce=d(Ce,j[i]),Ce=Ce+F|0,V=F,F=G,G=d(W,10),W=K,K=Ce,Ce=B+S[y+N[i]]|0,i<16?Ce+=s(H,q,re)+x[0]:i<32?Ce+=n(H,q,re)+x[1]:i<48?Ce+=c(H,q,re)+x[2]:i<64?Ce+=g(H,q,re)+x[3]:Ce+=w(H,q,re)+x[4],Ce=Ce|0,Ce=d(Ce,L[i]),Ce=Ce+ee|0,B=ee,ee=re,re=d(q,10),q=H,H=Ce;Ce=b[1]+W+re|0,b[1]=b[2]+G+ee|0,b[2]=b[3]+F+B|0,b[3]=b[4]+V+H|0,b[4]=b[0]+K+q|0,b[0]=Ce},_doFinalize:function(){var S=this._data,y=S.words,i=this._nDataBytes*8,k=S.sigBytes*8;y[k>>>5]|=128<<24-k%32,y[(k+64>>>9<<4)+14]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,S.sigBytes=(y.length+1)*4,this._process();for(var O=this._hash,b=O.words,E=0;E<5;E++){var x=b[E];b[E]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}return O},clone:function(){var S=l.clone.call(this);return S._hash=this._hash.clone(),S}});function w(S,y,i){return S^y^i}function g(S,y,i){return S&y|~S&i}function c(S,y,i){return(S|~y)^i}function n(S,y,i){return S&i|y&~i}function s(S,y,i){return S^(y|~i)}function d(S,y){return S<>>32-y}_.RIPEMD160=l._createHelper(p),_.HmacRIPEMD160=l._createHmacHelper(p)}(Math),M.RIPEMD160})},ETIr:function(I,J,P){(function(M,u){I.exports=J=u(P("Ib8C"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.WordArray,f=u.enc,l=f.Base64={stringify:function(v){var o=v.words,a=v.sigBytes,r=this._map;v.clamp();for(var h=[],m=0;m>>2]>>>24-m%4*8&255,w=o[m+1>>>2]>>>24-(m+1)%4*8&255,g=o[m+2>>>2]>>>24-(m+2)%4*8&255,c=p<<16|w<<8|g,n=0;n<4&&m+n*.75>>6*(3-n)&63));var s=r.charAt(64);if(s)for(;h.length%4;)h.push(s);return h.join("")},parse:function(v){var o=v.length,a=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var h=0;h>>6-m%4*2,g=p|w;r[h>>>2]|=g<<24-h%4*8,h++}return D.create(r,h)}}(),M.enc.Base64})},"F+F2":function(I,J,P){(function(M,u){I.exports=J=u(P("Ib8C"))})(this,function(M){return function(){if(typeof ArrayBuffer!="function")return;var u=M,_=u.lib,D=_.WordArray,f=D.init,l=D.init=function(C){if(C instanceof ArrayBuffer&&(C=new Uint8Array(C)),(C instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&C instanceof Uint8ClampedArray||C instanceof Int16Array||C instanceof Uint16Array||C instanceof Int32Array||C instanceof Uint32Array||C instanceof Float32Array||C instanceof Float64Array)&&(C=new Uint8Array(C.buffer,C.byteOffset,C.byteLength)),C instanceof Uint8Array){for(var v=C.byteLength,o=[],a=0;a>>2]|=C[a]<<24-a%4*8;f.call(this,o,v)}else f.apply(this,arguments)};l.prototype=D}(),M.lib.WordArray})},GRuw:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("lPiR"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.WordArray,f=u.algo,l=f.SHA256,C=f.SHA224=l.extend({_doReset:function(){this._hash=new D.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var v=l._doFinalize.call(this);return v.sigBytes-=4,v}});u.SHA224=l._createHelper(C),u.HmacSHA224=l._createHmacHelper(C)}(),M.SHA224})},GfqC:function(I,J,P){"use strict";var M=P("q1tI"),u=P.n(M),_=P("TSYQ"),D=P.n(_);function f(G,F){var B="cannot "+G.method+" "+G.action+" "+F.status+"'",H=new Error(B);return H.status=F.status,H.method=G.method,H.url=G.action,H}function l(G){var F=G.responseText||G.response;if(!F)return F;try{return JSON.parse(F)}catch(B){return F}}function C(G){var F=new XMLHttpRequest;G.onProgress&&F.upload&&(F.upload.onprogress=function(re){re.total>0&&(re.percent=re.loaded/re.total*100),G.onProgress(re)});var B=new FormData;G.data&&Object.keys(G.data).forEach(function(q){var re=G.data[q];if(Array.isArray(re)){re.forEach(function(ee){B.append(q+"[]",ee)});return}B.append(q,G.data[q])}),G.file instanceof Blob?B.append(G.filename,G.file,G.file.name):B.append(G.filename,G.file),F.onerror=function(re){G.onError(re)},F.onload=function(){return F.status<200||F.status>=300?G.onError(f(G,F),l(F)):G.onSuccess(l(F),F)},F.open(G.method,G.action,!0),G.withCredentials&&"withCredentials"in F&&(F.withCredentials=!0);var H=G.headers||{};return H["X-Requested-With"]!==null&&F.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function(q){H[q]!==null&&F.setRequestHeader(q,H[q])}),F.send(B),{abort:function(){F.abort()}}}var v=+new Date,o=0;function a(){return"rc-upload-"+v+"-"+ ++o}function r(G,F){return G.indexOf(F,G.length-F.length)!==-1}var h=function(G,F){if(G&&F){var B=Array.isArray(F)?F:F.split(","),H=G.name||"",q=G.type||"",re=q.replace(/\/.*$/,"");return B.some(function(ee){var Ce=ee.trim();return Ce.charAt(0)==="."?r(H.toLowerCase(),Ce.toLowerCase()):/\/\*$/.test(Ce)?re===Ce.replace(/\/.*$/,""):q===Ce})}return!0};function m(G,F){var B=G.createReader(),H=[];function q(){B.readEntries(function(re){var ee=Array.prototype.slice.apply(re);H=H.concat(ee);var Ce=!ee.length;Ce?F(H):q()})}q()}var p=function(F,B,H){var q=function re(ee,Ce){Ce=Ce||"",ee.isFile?ee.file(function(Ee){H(Ee)&&(ee.fullPath&&!Ee.webkitRelativePath&&(Object.defineProperties(Ee,{webkitRelativePath:{writable:!0}}),Ee.webkitRelativePath=ee.fullPath.replace(/^\//,""),Object.defineProperties(Ee,{webkitRelativePath:{writable:!1}})),B([Ee]))}):ee.isDirectory&&m(ee,function(Ee){Ee.forEach(function(pe){re(pe,""+Ce+ee.name+"/")})})};F.forEach(function(re){q(re.webkitGetAsEntry())})},w=p,g=Object.assign||function(G){for(var F=1;F=0)continue;if(!Object.prototype.hasOwnProperty.call(G,H))continue;B[H]=G[H]}return B}function S(G,F){if(!(G instanceof F))throw new TypeError("Cannot call a class as a function")}function y(G,F){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:G}function i(G,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);G.prototype=Object.create(F&&F.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(G,F):G.__proto__=F)}var k=function(F){return Object.keys(F).reduce(function(B,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(B[H]=F[H]),B},{})},O=function(G){i(F,G);function F(){var B,H,q,re;S(this,F);for(var ee=arguments.length,Ce=Array(ee),Ee=0;Ee>>2]>>>24-k%4*8&255;d[y+k>>>2]|=O<<24-(y+k)%4*8}else for(var b=0;b>>2]=S[b>>>2];return this.sigBytes+=i,this},clamp:function(){var s=this.words,d=this.sigBytes;s[d>>>2]&=4294967295<<32-d%4*8,s.length=_.ceil(d/4)},clone:function(){var s=a.clone.call(this);return s.words=this.words.slice(0),s},random:function(s){for(var d=[],S=0;S>>2]>>>24-i%4*8&255;y.push((k>>>4).toString(16)),y.push((k&15).toString(16))}return y.join("")},parse:function(s){for(var d=s.length,S=[],y=0;y>>3]|=parseInt(s.substr(y,2),16)<<24-y%8*4;return new r.init(S,d/2)}},p=h.Latin1={stringify:function(s){for(var d=s.words,S=s.sigBytes,y=[],i=0;i>>2]>>>24-i%4*8&255;y.push(String.fromCharCode(k))}return y.join("")},parse:function(s){for(var d=s.length,S=[],y=0;y>>2]|=(s.charCodeAt(y)&255)<<24-y%4*8;return new r.init(S,d)}},w=h.Utf8={stringify:function(s){try{return decodeURIComponent(escape(p.stringify(s)))}catch(d){throw new Error("Malformed UTF-8 data")}},parse:function(s){return p.parse(unescape(encodeURIComponent(s)))}},g=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(s){typeof s=="string"&&(s=w.parse(s)),this._data.concat(s),this._nDataBytes+=s.sigBytes},_process:function(s){var d,S=this._data,y=S.words,i=S.sigBytes,k=this.blockSize,O=k*4,b=i/O;s?b=_.ceil(b):b=_.max((b|0)-this._minBufferSize,0);var E=b*k,x=_.min(E*4,i);if(E){for(var T=0;T>>6)+o(128|V&63):o(224|V>>>12&15)+o(128|V>>>6&63)+o(128|V&63)}else{var V=65536+(L.charCodeAt(0)-55296)*1024+(L.charCodeAt(1)-56320);return o(240|V>>>18&7)+o(128|V>>>12&63)+o(128|V>>>6&63)+o(128|V&63)}},r=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,h=function(L){return L.replace(r,a)},m=function(L){var V=[0,2,1][L.length%3],K=L.charCodeAt(0)<<16|(L.length>1?L.charCodeAt(1):0)<<8|(L.length>2?L.charCodeAt(2):0),W=[C.charAt(K>>>18),C.charAt(K>>>12&63),V>=2?"=":C.charAt(K>>>6&63),V>=1?"=":C.charAt(K&63)];return W.join("")},p=D.btoa&&typeof D.btoa=="function"?function(L){return D.btoa(L)}:function(L){if(L.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return L.replace(/[\s\S]{1,3}/g,m)},w=function(L){return p(h(String(L)))},g=function(L){return L.replace(/[+\/]/g,function(V){return V=="+"?"-":"_"}).replace(/=/g,"")},c=function(L,V){return V?g(w(L)):w(L)},n=function(L){return c(L,!0)},s;D.Uint8Array&&(s=function(L,V){for(var K="",W=0,G=L.length;W>>18)+C.charAt(q>>>12&63)+(typeof B!="undefined"?C.charAt(q>>>6&63):"=")+(typeof H!="undefined"?C.charAt(q&63):"=")}return V?g(K):K});var d=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,S=function(L){switch(L.length){case 4:var V=(7&L.charCodeAt(0))<<18|(63&L.charCodeAt(1))<<12|(63&L.charCodeAt(2))<<6|63&L.charCodeAt(3),K=V-65536;return o((K>>>10)+55296)+o((K&1023)+56320);case 3:return o((15&L.charCodeAt(0))<<12|(63&L.charCodeAt(1))<<6|63&L.charCodeAt(2));default:return o((31&L.charCodeAt(0))<<6|63&L.charCodeAt(1))}},y=function(L){return L.replace(d,S)},i=function(L){var V=L.length,K=V%4,W=(V>0?v[L.charAt(0)]<<18:0)|(V>1?v[L.charAt(1)]<<12:0)|(V>2?v[L.charAt(2)]<<6:0)|(V>3?v[L.charAt(3)]:0),G=[o(W>>>16),o(W>>>8&255),o(W&255)];return G.length-=[0,0,2,1][K],G.join("")},k=D.atob&&typeof D.atob=="function"?function(L){return D.atob(L)}:function(L){return L.replace(/\S{1,4}/g,i)},O=function(L){return k(String(L).replace(/[^A-Za-z0-9\+\/]/g,""))},b=function(L){return y(k(L))},E=function(L){return String(L).replace(/[-_]/g,function(V){return V=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},x=function(L){return b(E(L))},T;D.Uint8Array&&(T=function(L){return Uint8Array.from(O(E(L)),function(V){return V.charCodeAt(0)})});var N=function(){var L=D.Base64;return D.Base64=f,L};if(D.Base64={VERSION:l,atob:O,btoa:p,fromBase64:x,toBase64:c,utob:h,encode:c,encodeURI:n,btou:y,decode:x,noConflict:N,fromUint8Array:s,toUint8Array:T},typeof Object.defineProperty=="function"){var j=function(L){return{value:L,enumerable:!1,writable:!0,configurable:!0}};D.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",j(function(){return x(this)})),Object.defineProperty(String.prototype,"toBase64",j(function(L){return c(this,L)})),Object.defineProperty(String.prototype,"toBase64URI",j(function(){return c(this,!0)}))}}return D.Meteor&&(Base64=D.Base64),I.exports?I.exports.Base64=D.Base64:!(u=[],_=function(){return D.Base64}.apply(J,u),_!==void 0&&(I.exports=_)),{Base64:D.Base64}})}).call(this,P("IyRk"))},K3mO:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("3y9D"),P("WYAk"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.Base,f=_.WordArray,l=u.algo,C=l.MD5,v=l.EvpKDF=D.extend({cfg:D.extend({keySize:128/32,hasher:C,iterations:1}),init:function(o){this.cfg=this.cfg.extend(o)},compute:function(o,a){for(var r,h=this.cfg,m=h.hasher.create(),p=f.create(),w=p.words,g=h.keySize,c=h.iterations;w.lengthMe)){he.next=7;break}return _.b.info("\u6587\u4EF6\u8D85\u8FC7".concat(Me/1024/1024/1024,"GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42")),he.abrupt("return",!1);case 7:return K.push({name:pe.name,file:pe}),W(Object(D.a)(K)),j.onChange(K),he.abrupt("return",!1);case 11:case"end":return he.stop()}},Ee)}));function Ce(Ee){return ee.apply(this,arguments)}return Ce}()},re=function(){var ee=Object(v.a)(h.a.mark(function Ce(Ee,pe){var Me,_e,he,ce,oe,Se,te,ue,Oe;return h.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return pe.file_name=Ee.name,te=Ee.name,Q.next=4,Object(w.a)("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});case 4:if(ue=Q.sent,ue.data=JSON.parse(i(ue.data)),!((ue==null?void 0:ue.status)!==0)){Q.next=12;break}return K[K.findIndex(function(Y){return Y.name===te})].status="error",K[K.findIndex(function(Y){return Y.name===te})].file.status="error",j.onChange(K),_.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),Q.abrupt("return");case 12:return B=new S.a({endpoint:ue==null||((Me=ue.data)===null||Me===void 0)?void 0:Me.end_point,region:ue==null||((_e=ue.data)===null||_e===void 0)?void 0:_e.region,accessKeyId:ue==null||((he=ue.data)===null||he===void 0)?void 0:he.access_key_id,accessKeySecret:ue==null||((ce=ue.data)===null||ce===void 0)?void 0:ce.access_key_secret,bucket:ue==null||((oe=ue.data)===null||oe===void 0)?void 0:oe.bucket,stsToken:ue==null||((Se=ue.data)===null||Se===void 0)?void 0:Se.security_token}),console.log(Ee,"file"),H(B),Oe=Object(n.a)(),Q.abrupt("return",new Promise(function(Y,Z){try{var be;B.multipartUpload("".concat(j.identifier,"/").concat(Oe).concat(te.indexOf(".")>-1?"."+te.split(".").pop():""),new Blob([Ee.file],{type:Ee.file.type}),{timeout:3600*1e3,partSize:1002400,progress:function(Re,Ze,qe){try{console.log("\u8FDB\u5EA6",Re,Ze,qe);var et=K.findIndex(function(nt){return nt.name===te});K[et].file.percent=Re*100,K[et].tempCheckpoint=Ze,W(Object(D.a)(K))}catch(nt){}},checkpoint:K[K.findIndex(function(ge){return ge.name===te})].tempCheckpoint,callback:{customValue:{id:te+""},url:ue==null||((be=ue.data)===null||be===void 0)?void 0:be.callback_url,host:ue==null?void 0:ue.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(w.e)(pe)}}).then(function(ge){var Re,Ze=K.findIndex(function(ot){return ot.name===te}),qe="done";if(((Re=ge.data)===null||Re===void 0?void 0:Re.status)===0){var et;Ee.response=(et=ge.data)===null||et===void 0?void 0:et.data;var nt=K.findIndex(function(ot){return ot.name===te});K[nt].status="done",K[nt].file.status="done"}else{var ut;_.b.warn((ut=ge.data)===null||ut===void 0?void 0:ut.message),qe="error"}K[Ze].status=qe,K[Ze].file.status=qe,j.onChange(K),Y(ge==null?void 0:ge.data)}).catch(function(ge){K[K.findIndex(function(Re){return Re.name===te})].status="error",K[K.findIndex(function(Re){return Re.name===te})].file.status="error",_.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),W(Object(D.a)(K)),j.onChange(K),Z(ge),console.log("err:",ge)})}catch(ge){}}));case 17:case"end":return Q.stop()}},Ce)}));return function(Ee,pe){return ee.apply(this,arguments)}}();return Object(m.useEffect)(function(){K.every(function(ee){return ee==="done"||ee==="error"})&&j.onComplete(K)},[K]),Object(m.useEffect)(function(){if(N){var ee;(ee=B)===null||ee===void 0||ee.cancel()}},[N]),Object(m.useEffect)(function(){j.uploading&&K.map(function(){var ee=Object(v.a)(h.a.mark(function Ce(Ee){var pe,Me;return h.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:if(!((!Ee.status||Ee.status==="error")&&!N)){he.next=6;break}return Ee.status="uploading",Ee.file.status="uploading",he.next=5,re(Ee,{login:T==null||((pe=T.userInfo)===null||pe===void 0)?void 0:pe.login,container_type:j.container_type,container_id:j.container_id,description:j.description});case 5:Me=he.sent;case 6:case"end":return he.stop()}},Ce)}));return function(Ce){return ee.apply(this,arguments)}}())},[j.uploading]),p.a.createElement(y,Object(M.a)({},q,{height:j.height,className:j.className}),p.a.createElement("p",{className:"ant-upload-hint"},j.text||"\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20"))};J.b=Object(s.a)(function(E){var x=E.loading,T=E.globalSetting,N=E.user;return{globalSetting:T,loading:x.models.competitions,user:N}})(b)},KmYQ:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(M){return M.pad.ZeroPadding={pad:function(u,_){var D=_*4;u.clamp(),u.sigBytes+=D-(u.sigBytes%D||D)},unpad:function(u){for(var _=u.words,D=u.sigBytes-1,D=u.sigBytes-1;D>=0;D--)if(_[D>>>2]>>>24-D%4*8&255){u.sigBytes=D+1;break}}},M.pad.ZeroPadding})},L9qf:function(I,J,P){I.exports={flex_box_center:"flex_box_center___3J7Qj",flex_space_between:"flex_space_between___3P3xx",flex_box_vertical_center:"flex_box_vertical_center___3QrMz",flex_box_center_end:"flex_box_center_end___37g4V",flex_box_column:"flex_box_column___2PxMN",wrap:"wrap___1xDeN",in:"in___364z1",btns:"btns___8vHXH",customModal:"customModal___2Vkln"}},LdHM:function(I,J,P){"use strict";P.d(J,"b",function(){return d}),P.d(J,"a",function(){return y});var M=P("1OyB"),u=P("vuIU"),_=P("Ji7U"),D=P("LK+K"),f=P("q1tI"),l=P("rePB"),C=P("Ff2n"),v=P("ODXe"),o=P("4IlW"),a=P("bX4T"),r=P("YrtM"),h=P("TSYQ"),m=P.n(h),p=P("+nKL"),w=P("8OUc"),g=function(H,q){var re=H.prefixCls,ee=H.id,Ce=H.flattenOptions,Ee=H.childrenAsData,pe=H.values,Me=H.searchValue,_e=H.multiple,he=H.defaultActiveFirstOption,ce=H.height,oe=H.itemHeight,Se=H.notFoundContent,te=H.open,ue=H.menuItemSelectedIcon,Oe=H.virtual,le=H.onSelect,Q=H.onToggleOpen,Y=H.onActiveValue,Z=H.onScroll,be=H.onMouseEnter,ge="".concat(re,"-item"),Re=Object(r.a)(function(){return Ce},[te,Ce],function(tt,Ue){return Ue[0]&&tt[1]!==Ue[1]}),Ze=f.useRef(null),qe=function(Ue){Ue.preventDefault()},et=function(Ue){Ze.current&&Ze.current.scrollTo({index:Ue})},nt=function(Ue){for(var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ie=Re.length,ye=0;ye1&&arguments[1]!==void 0?arguments[1]:!1;return Object(k.a)(B).map(function(q,re){if(!f.isValidElement(q)||!q.type)return null;var ee=q.type.isSelectOptGroup,Ce=q.key,Ee=q.props,pe=Ee.children,Me=Object(C.a)(Ee,["children"]);return H||!ee?O(q):Object(i.a)(Object(i.a)({key:"__RC_SELECT_GRP__".concat(Ce===null?re:Ce,"__"),label:Ce},Me),{},{options:b(pe)})}).filter(function(q){return q})}var E=P("2Qr1"),x=P("qNPg"),T=P("U8pU"),N=P("Kwbf"),j=P("WKfj");function L(B){var H=B.mode,q=B.options,re=B.children,ee=B.backfill,Ce=B.allowClear,Ee=B.placeholder,pe=B.getInputElement,Me=B.showSearch,_e=B.onSearch,he=B.defaultOpen,ce=B.autoFocus,oe=B.labelInValue,Se=B.value,te=B.inputValue,ue=B.optionLabelProp,Oe=H==="multiple"||H==="tags",le=Me!==void 0?Me:Oe||H==="combobox",Q=q||b(re);if(Object(N.a)(H!=="tags"||Q.every(function(ge){return!ge.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var Y=Q.some(function(ge){return ge.options?ge.options.some(function(Re){return typeof("value"in Re?Re.value:Re.key)=="number"}):typeof("value"in ge?ge.value:ge.key)=="number"});Object(N.a)(!Y,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(N.a)(H!=="combobox"||!ue,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(N.a)(H==="combobox"||!ee,"`backfill` only works with `combobox` mode."),Object(N.a)(H==="combobox"||!pe,"`getInputElement` only work with `combobox` mode."),Object(N.b)(H!=="combobox"||!pe||!Ce||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),_e&&!le&&H!=="combobox"&&H!=="tags"&&Object(N.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(N.b)(!he||ce,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Se!=null){var Z=Object(j.d)(Se);Object(N.a)(!oe||Z.every(function(ge){return Object(T.a)(ge)==="object"&&("key"in ge||"value"in ge)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(N.a)(!Oe||Array.isArray(Se),"`value` should be array when `mode` is `multiple` or `tags`")}if(re){var be=null;Object(k.a)(re).some(function(ge){if(!f.isValidElement(ge)||!ge.type)return!1;var Re=ge.type;if(Re.isSelectOption)return!1;if(Re.isSelectOptGroup){var Ze=Object(k.a)(ge.props.children).every(function(qe){return!f.isValidElement(qe)||!ge.type||qe.type.isSelectOption?!0:(be=qe.type,!1)});return!Ze}return be=Re,!0}),be&&Object(N.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(be.displayName||be.name||be,"`.")),Object(N.a)(te===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var V=L,K=Object(x.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:b,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:V,fillOptionsWithMissingValue:E.a}),W=function(B){Object(_.a)(q,B);var H=Object(D.a)(q);function q(){var re;return Object(M.a)(this,q),re=H.apply(this,arguments),re.selectRef=f.createRef(),re.focus=function(){re.selectRef.current.focus()},re.blur=function(){re.selectRef.current.blur()},re}return Object(u.a)(q,[{key:"render",value:function(){return f.createElement(K,Object.assign({ref:this.selectRef},this.props))}}]),q}(f.Component);W.Option=d,W.OptGroup=y;var G=W,F=J.c=G},M8RZ:function(I,J,P){"use strict";P.d(J,"a",function(){return o});var M=P("fWQN"),u=P("mtLc"),_=P("yKVA"),D=P("879j"),f=P("q1tI"),l=P.n(f),C=P("i8i4"),v=P.n(C),o=function(a){Object(_.a)(h,a);var r=Object(D.a)(h);function h(m){var p;Object(M.a)(this,h),p=r.call(this,m);var w=window.document;return p.node=w.createElement("div"),w.body.appendChild(p.node),p}return Object(u.a)(h,[{key:"render",value:function(){var p=this.props.children;return Object(C.createPortal)(p,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),h}(l.a.Component)},MFOe:function(I,J,P){(function(M){var u=l(),_=C(),D=v(),f=typeof window!="undefined"?window:M;I.exports={assign:u,create:_,trim:D,bind:o,slice:a,each:r,map:h,pluck:m,isList:p,isFunction:w,isObject:g,Global:f};function l(){return Object.assign?Object.assign:function(n,s,d,S){for(var y=1;y=0;g-=1){var c=v.get(g)||new Set;c.forEach(function(n){var s=n.parent,d=n.node;if(a(d)||!n.parent||w.has(n.parent.key))return;if(a(n.parent.node)){w.add(s.key);return}var S=!0,y=!1;(s.children||[]).filter(function(i){return!a(i.node)}).forEach(function(i){var k=i.key,O=r.has(k);S&&!O&&(S=!1),!y&&(O||h.has(k))&&(y=!0)}),S&&r.add(s.key),y&&h.add(s.key),w.add(s.key)})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(u(h,r))}}function f(C,v,o,a,r){for(var h=new Set(C),m=new Set(v),p=0;p<=a;p+=1){var w=o.get(p)||new Set;w.forEach(function(s){var d=s.key,S=s.node,y=s.children,i=y===void 0?[]:y;!h.has(d)&&!m.has(d)&&!r(S)&&i.filter(function(k){return!r(k.node)}).forEach(function(k){h.delete(k.key)})})}m=new Set;for(var g=new Set,c=a;c>=0;c-=1){var n=o.get(c)||new Set;n.forEach(function(s){var d=s.parent,S=s.node;if(r(S)||!s.parent||g.has(s.parent.key))return;if(r(s.parent.node)){g.add(d.key);return}var y=!0,i=!1;(d.children||[]).filter(function(k){return!r(k.node)}).forEach(function(k){var O=k.key,b=h.has(O);y&&!b&&(y=!1),!i&&(b||m.has(O))&&(i=!0)}),y||h.delete(d.key),i&&m.add(d.key),g.add(d.key)})}return{checkedKeys:Array.from(h),halfCheckedKeys:Array.from(u(m,h))}}function l(C,v,o,a){var r=[],h;a?h=a:h=_;var m=new Set(C.filter(function(c){var n=!!o[c];return n||r.push(c),n})),p=new Map,w=0;Object.keys(o).forEach(function(c){var n=o[c],s=n.level,d=p.get(s);d||(d=new Set,p.set(s,d)),d.add(n),w=Math.max(w,s)}),Object(M.a)(!r.length,"Tree missing follow keys: ".concat(r.slice(0,100).map(function(c){return"'".concat(c,"'")}).join(", ")));var g;return v===!0?g=D(m,p,w,h):g=f(m,v.halfCheckedKeys,p,w,h),g}},OLod:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("K3mO"))})(this,function(M){M.lib.Cipher||function(u){var _=M,D=_.lib,f=D.Base,l=D.WordArray,C=D.BufferedBlockAlgorithm,v=_.enc,o=v.Utf8,a=v.Base64,r=_.algo,h=r.EvpKDF,m=D.Cipher=C.extend({cfg:f.extend(),createEncryptor:function(x,T){return this.create(this._ENC_XFORM_MODE,x,T)},createDecryptor:function(x,T){return this.create(this._DEC_XFORM_MODE,x,T)},init:function(x,T,N){this.cfg=this.cfg.extend(N),this._xformMode=x,this._key=T,this.reset()},reset:function(){C.reset.call(this),this._doReset()},process:function(x){return this._append(x),this._process()},finalize:function(x){x&&this._append(x);var T=this._doFinalize();return T},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function x(T){return typeof T=="string"?E:k}return function(T){return{encrypt:function(N,j,L){return x(j).encrypt(T,N,j,L)},decrypt:function(N,j,L){return x(j).decrypt(T,N,j,L)}}}}()}),p=D.StreamCipher=m.extend({_doFinalize:function(){var x=this._process(!0);return x},blockSize:1}),w=_.mode={},g=D.BlockCipherMode=f.extend({createEncryptor:function(x,T){return this.Encryptor.create(x,T)},createDecryptor:function(x,T){return this.Decryptor.create(x,T)},init:function(x,T){this._cipher=x,this._iv=T}}),c=w.CBC=function(){var x=g.extend();x.Encryptor=x.extend({processBlock:function(N,j){var L=this._cipher,V=L.blockSize;T.call(this,N,j,V),L.encryptBlock(N,j),this._prevBlock=N.slice(j,j+V)}}),x.Decryptor=x.extend({processBlock:function(N,j){var L=this._cipher,V=L.blockSize,K=N.slice(j,j+V);L.decryptBlock(N,j),T.call(this,N,j,V),this._prevBlock=K}});function T(N,j,L){var V,K=this._iv;K?(V=K,this._iv=u):V=this._prevBlock;for(var W=0;W>>2]&255;x.sigBytes-=T}},d=D.BlockCipher=m.extend({cfg:m.cfg.extend({mode:c,padding:s}),reset:function(){var x;m.reset.call(this);var T=this.cfg,N=T.iv,j=T.mode;this._xformMode==this._ENC_XFORM_MODE?x=j.createEncryptor:(x=j.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==x?this._mode.init(this,N&&N.words):(this._mode=x.call(j,this,N&&N.words),this._mode.__creator=x)},_doProcessBlock:function(x,T){this._mode.processBlock(x,T)},_doFinalize:function(){var x,T=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(T.pad(this._data,this.blockSize),x=this._process(!0)):(x=this._process(!0),T.unpad(x)),x},blockSize:128/32}),S=D.CipherParams=f.extend({init:function(x){this.mixIn(x)},toString:function(x){return(x||this.formatter).stringify(this)}}),y=_.format={},i=y.OpenSSL={stringify:function(x){var T,N=x.ciphertext,j=x.salt;return j?T=l.create([1398893684,1701076831]).concat(j).concat(N):T=N,T.toString(a)},parse:function(x){var T,N=a.parse(x),j=N.words;return j[0]==1398893684&&j[1]==1701076831&&(T=l.create(j.slice(2,4)),j.splice(0,4),N.sigBytes-=16),S.create({ciphertext:N,salt:T})}},k=D.SerializableCipher=f.extend({cfg:f.extend({format:i}),encrypt:function(x,T,N,j){j=this.cfg.extend(j);var L=x.createEncryptor(N,j),V=L.finalize(T),K=L.cfg;return S.create({ciphertext:V,key:N,iv:K.iv,algorithm:x,mode:K.mode,padding:K.padding,blockSize:x.blockSize,formatter:j.format})},decrypt:function(x,T,N,j){j=this.cfg.extend(j),T=this._parse(T,j.format);var L=x.createDecryptor(N,j).finalize(T.ciphertext);return L},_parse:function(x,T){return typeof x=="string"?T.parse(x,this):x}}),O=_.kdf={},b=O.OpenSSL={execute:function(x,T,N,j){j||(j=l.random(64/8));var L=h.create({keySize:T+N}).compute(x,j),V=l.create(L.words.slice(T),N*4);return L.sigBytes=T*4,S.create({key:L,iv:V,salt:j})}},E=D.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:b}),encrypt:function(x,T,N,j){j=this.cfg.extend(j);var L=j.kdf.execute(N,x.keySize,x.ivSize);j.iv=L.iv;var V=k.encrypt.call(this,x,T,L.key,j);return V.mixIn(L),V},decrypt:function(x,T,N,j){j=this.cfg.extend(j),T=this._parse(T,j.format);var L=j.kdf.execute(N,x.keySize,x.ivSize,T.salt);j.iv=L.iv;var V=k.decrypt.call(this,x,T,L.key,j);return V}})}()})},OZM5:function(I,J,P){"use strict";P.d(J,"b",function(){return a}),P.d(J,"a",function(){return r}),P.d(J,"k",function(){return h}),P.d(J,"h",function(){return m}),P.d(J,"i",function(){return p}),P.d(J,"g",function(){return w}),P.d(J,"c",function(){return g}),P.d(J,"d",function(){return c}),P.d(J,"j",function(){return d}),P.d(J,"e",function(){return S}),P.d(J,"f",function(){return y});var M=P("KQm4"),u=P("U8pU"),_=P("Ff2n"),D=P("q1tI"),f=P.n(D),l=P("Kwbf"),C=P("WaYH"),v=.25,o=2;function a(i,k){var O=i.slice(),b=O.indexOf(k);return b>=0&&O.splice(b,1),O}function r(i,k){var O=i.slice();return O.indexOf(k)===-1&&O.push(k),O}function h(i){return i.split("-")}function m(i,k){return"".concat(i,"-").concat(k)}function p(i){return i&&i.type&&i.type.isTreeNode}function w(i,k){var O=[i],b=k[i];function E(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];x.forEach(function(T){var N=T.key,j=T.children;O.push(N),E(j)})}return E(b.children),O}function g(i,k){var O=i.clientY,b=k.selectHandle.getBoundingClientRect(),E=b.top,x=b.bottom,T=b.height,N=Math.max(T*v,o);return O<=E+N?-1:O>=x-N?1:0}function c(i,k){if(!i)return;var O=k.multiple;return O?i.slice():i.length?[i[0]]:i}var n=function(k){return k};function s(i,k){if(!i)return[];var O=k||{},b=O.processProps,E=b===void 0?n:b,x=Array.isArray(i)?i:[i];return x.map(function(T){var N=T.children,j=Object(_.a)(T,["children"]),L=s(N,k);return f.a.createElement(C.a,Object.assign({},E(j)),L)})}function d(i){if(!i)return null;var k;if(Array.isArray(i))k={checkedKeys:i,halfCheckedKeys:void 0};else if(Object(u.a)(i)==="object")k={checkedKeys:i.checked||void 0,halfCheckedKeys:i.halfChecked||void 0};else return Object(l.a)(!1,"`checkedKeys` is not an array or an object"),null;return k}function S(i,k){var O=new Set;function b(E){if(O.has(E))return;var x=k[E];if(!x)return;O.add(E);var T=x.parent,N=x.node;if(N.disabled)return;T&&b(T.key)}return(i||[]).forEach(function(E){b(E)}),Object(M.a)(O)}function y(i){var k={};return Object.keys(i).forEach(function(O){(O.startsWith("data-")||O.startsWith("aria-"))&&(k[O]=i[O])}),k}},Ot1p:function(I,J,P){"use strict";var M=P("2qtc"),u=P("kLXV"),_=P("rAM+"),D=P("miYZ"),f=P("tsqr"),l=P("9og8"),C=P("tJVT"),v=P("jrin"),o=P("WmNS"),a=P.n(o),r=P("q1tI"),h=P.n(r),m=P("VrN/"),p=P.n(m),w=P("bdgK"),g=P("p77/"),c=P("Bd2K"),n=P("ELLl"),s=P("19Vz"),d=P("lZu9"),S=P("+NIl"),y=P("kSUc"),i=P("9Bee"),k=function(Ke){var ct=Ke.value,gt=ct===void 0?"":ct,wt=Ke.className,vt=Ke.showTextOnly,It=Ke.showLines,Lt=Ke.style,_t=Lt===void 0?{}:Lt,rr=Object(r.useMemo)(function(){return""},[gt]);return h.a.createElement(h.a.Fragment,null,h.a.createElement("div",{dangerouslySetInnerHTML:{__html:rr}}))},O=P("0Owb"),b=P("dejd"),E=P("C+DQ"),x=P("1vsH"),T=P("m3rI"),N=[{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 j(Ke){var ct=Ke.onActionCallback,gt=Ke.title,wt=Ke.icon,vt=Ke.actionName,It=Ke.className,Lt=It===void 0?"":It,_t=Ke.children;function rr(){ct(vt)}return h.a.createElement("a",{title:gt,className:Lt,onClick:rr},h.a.createElement("i",{className:"md-iconfont ".concat(wt)}),_t)}var L=function(Ke){var ct=Ke.watch,gt=Ke.showNullButton,wt=Ke.onActionCallback,vt=Ke.fullScreen,It=Ke.insertTemp,Lt=Ke.hidetoolBar,_t=Ke.uuid,rr=Ke.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.E)("_educoder_session"),"&key=").concat(_t,"&api=").concat(encodeURIComponent(T.a.PROXY_SERVER)));var sr=[].concat(N,[{title:"".concat(ct?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ct?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return h.a.createElement("ul",{className:"markdown-toolbar-container"},!Lt&&sr.map(function($t,cr){return h.a.createElement("li",{key:cr},$t.actionName?h.a.createElement(j,Object(O.a)({},$t,{onActionCallback:wt})):h.a.createElement("span",{className:"v-line"}))}),gt?h.a.createElement("li",null,h.a.createElement(j,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:wt},h.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,It&&h.a.createElement("li",null,h.a.createElement(j,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(It),onActionCallback:wt},h.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),h.a.createElement("li",{className:"btn-full-screen"},h.a.createElement(j,{icon:"".concat(vt?"icon-shrink":"icon-enlarge"),title:vt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:wt})))},V=P("M8RZ"),K=P("+L6B"),W=P("2/Rp"),G=P("y8nQ"),F=P("Vl3Y"),B=P("5NDa"),H=P("5rEg"),q={labelCol:{span:4},wrapperCol:{span:20}},re=function(Ke){var ct=Ke.callback,gt=Ke.onCancel;function wt(vt){ct(vt)}return h.a.createElement(F.a,Object(O.a)({},q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:wt}),h.a.createElement(F.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},h.a.createElement(H.a,null)),h.a.createElement(F.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},h.a.createElement(H.a,null)),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(W.a,{type:"ghost",onClick:gt},"\u53D6\u6D88")))},ee=P("7ahc"),Ce=P("k1fw"),Ee=P("HmJG"),pe=P("BjJ7"),Me=F.a.useForm,_e={width:280,marginRight:10},he={labelCol:{span:5},wrapperCol:{span:19}},ce=function(Ke){var ct=Ke.callback,gt=Ke.onCancel,wt=Me(),vt=Object(C.a)(wt,1),It=vt[0],Lt=Object(r.useRef)();function _t($t){ct(Object(Ce.a)(Object(Ce.a)({},$t),{},{name:Lt.current}))}function rr($t,cr){It.setFieldsValue({src:"/api/attachments/".concat($t.id,"?type=").concat($t.content_type),type:cr.type})}function sr($t){var cr=$t.target.files[0];Lt.current=cr.name,Se(cr,rr)}return h.a.createElement(F.a,Object(O.a)({form:It},he,{className:"upload-image-panel",onFinish:_t}),h.a.createElement(F.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},h.a.createElement("div",{className:"flex-container"},h.a.createElement(F.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},h.a.createElement(H.a,{style:_e})),h.a.createElement(oe,{onFileChange:sr}))),h.a.createElement(F.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},h.a.createElement(H.a,{style:{width:264}})),h.a.createElement(F.a.Item,{style:{textAlign:"right"}},h.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(W.a,{type:"ghost",onClick:gt},"\u53D6\u6D88")))};function oe(Ke){var ct=Ke.onFileChange;return h.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",h.a.createElement("input",{type:"file",onChange:ct}))}function Se(Ke,ct){if(!Ke)throw new String("\u6CA1\u6709\u6587\u4EF6");var gt=new FormData;gt.append("editormd-image-file",Ke),gt.append("file_param_name","editormd-image-file"),gt.append("byxhr","true");var wt=new window.XMLHttpRequest;wt.withCredentials=!0,wt.addEventListener("load",function(vt){ct(JSON.parse(vt.target.responseText),Ke)},!1),wt.addEventListener("error",function(vt){console.error(vt)},!1),wt.open("POST","".concat(pe.a,"/api/attachments.json")),wt.send(gt)}var te=P("giR+"),ue=P("fyUT"),Oe=P("7Kak"),le=P("9yH6"),Q=le.a.Group,Y={margin:"0 8px"},Z=function(Ke){var ct=Ke.callback,gt=Ke.onCancel;function wt(vt){ct(vt)}return h.a.createElement(F.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:wt},h.a.createElement("div",{className:"flex-container"},h.a.createElement("span",{style:Y},"\u5355\u5143\u683C\u6570\uFF1A"),h.a.createElement("span",{style:Y},"\u884C\u6570"),h.a.createElement(F.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},h.a.createElement(ue.a,null)),h.a.createElement("span",{style:Y},"\u5217\u6570"),h.a.createElement(F.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},h.a.createElement(ue.a,null))),h.a.createElement("div",{className:"flex-container",style:{marginTop:12}},h.a.createElement("span",{style:Y},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),h.a.createElement(F.a.Item,{name:"align"},h.a.createElement(Q,null,h.a.createElement(le.a,{value:"default"},h.a.createElement("i",{className:"fa fa-align-justify"})),h.a.createElement(le.a,{value:"left"},h.a.createElement("i",{className:"fa fa-align-left"})),h.a.createElement(le.a,{value:"center"},h.a.createElement("i",{className:"fa fa-align-center"})),h.a.createElement(le.a,{value:"right"},h.a.createElement("i",{className:"fa fa-align-right"}))))),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(W.a,{type:"ghost",onClick:gt},"\u53D6\u6D88")))},be=P("ErOA"),ge=P("7Cbv"),Re="link",Ze="upload-image",qe="code-block",et="add-table",nt="------------",ut={default:nt,left:":".concat(nt),center:":".concat(nt,":"),right:"".concat(nt,":")},ot=P("9VGf"),je,De;function rt(){}var lt=0,Je=1e4,tt="\u2581",Ue=` **\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 ke(Ke){return/^\d+$/.test(Ke)?"".concat(Ke,"px"):Ke}var Ie=navigator.platform.toUpperCase().indexOf("MAC")>=0,ye=Ie?"Cmd":"Ctrl",Te=["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"],Ae=(je={},Object(v.a)(je,ye+"-B","bold"),Object(v.a)(je,ye+"-I","italic"),je),Pe=(De={},Object(v.a)(De,Re,"\u6DFB\u52A0\u94FE\u63A5"),Object(v.a)(De,qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(v.a)(De,Ze,"\u6DFB\u52A0\u6587\u4EF6"),Object(v.a)(De,et,"\u6DFB\u52A0\u8868\u683C"),De),$e=J.a=function(Ke){var ct=Ke.defaultValue,gt=ct===void 0?"":ct,wt=Ke.onChange,vt=Ke.width,It=vt===void 0?"100%":vt,Lt=Ke.height,_t=Lt===void 0?400:Lt,rr=Ke.miniToolbar,sr=rr===void 0?!1:rr,$t=Ke.isFocus,cr=$t===void 0?!1:$t,Wt=Ke.watch,Lr=Ke.insertTemp,Cr=Ke.mode,Ct=Cr===void 0?"markdown":Cr,lr=Ke.id,Fr=lr===void 0?"markdown-editor-id":lr,$r=Ke.showResizeBar,Hr=$r===void 0?!1:$r,oi=Ke.noStorage,Tt=oi===void 0?!1:oi,Rt=Ke.showNullButton,Et=Rt===void 0?!1:Rt,Ar=Ke.hidetoolBar,Br=Ar===void 0?!1:Ar,Xt=Ke.fullScreen,Nt=Xt===void 0?!1:Xt,jr=Ke.onBlur,bn=Ke.onCMBeforeChange,zr=Ke.onFullScreen,mt=Ke.className,Ut=mt===void 0?"":mt,an=Ke.disablePaste,xn=an===void 0?!1:an,On=Ke.placeholder,An=On===void 0?"":On,se=Ke.values,z=se===void 0?"":se,X=Object(r.useState)(null),ne=Object(C.a)(X,2),de=ne[0],ie=ne[1],ze=Object(r.useState)(gt),ht=Object(C.a)(ze,2),St=ht[0],Pt=ht[1],pt=Object(r.useState)(Wt),Ht=Object(C.a)(pt,2),zt=Ht[0],Mr=Ht[1],on=Object(r.useState)(Nt),Zr=Object(C.a)(on,2),Qt=Zr[0],Kr=Zr[1],or=Object(r.useState)(""),Yt=Object(C.a)(or,2),nr=Yt[0],dr=Yt[1],Jr=Object(r.useState)(0),un=Object(C.a)(Jr,2),En=un[0],wi=un[1],Vi=Object(r.useState)(_t),Fi=Object(C.a)(Vi,2),Qn=Fi[0],rn=Fi[1],Ri=Object(r.useState)(!1),sn=Object(C.a)(Ri,2),hi=sn[0],Gr=sn[1],ir=Object(r.useRef)(Object(ge.a)()),qr=Object(r.useRef)(!1),Tr=Object(r.useRef)(),dn=Object(r.useRef)(),_r=Object(r.useRef)(),fi=Object(r.useRef)(),hn=Object(r.useRef)(),Hn=function(){var Ft=Object(l.a)(a.a.mark(function Jt(){var Gt,hr;return a.a.wrap(function(Vr){for(;;)switch(Vr.prev=Vr.next){case 0:return Vr.next=2,Object(be.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ir.current}});case 2:hr=Vr.sent,hr!=null&&(Gt=hr.attachments)!==null&&Gt!==void 0&&Gt.length&&(console.log("cm:",de,dn),hr.attachments.map(function(vr){vr.content_type.indexOf("image")>-1?de.replaceSelection("![,](/api/attachments/".concat(vr.id,"?type=").concat(vr.content_type,")")):vr.content_type.indexOf("video")>-1?de.replaceSelection('')):vr.content_type.indexOf("pdf")>-1?de.replaceSelection('
    ').concat(vr.name,"")):de.replaceSelection("[".concat(vr.name,"](").concat(T.a.API_SERVER,"/api/attachments/").concat(vr.id,"?type=").concat(vr.content_type,")"))}));case 4:case"end":return Vr.stop()}},Jt)}));return function(){return Ft.apply(this,arguments)}}();Object(r.useEffect)(function(){Pt(z),de==null||de.setValue(z)},[z]),Object(r.useEffect)(function(){zr==null||zr(Qt)},[Qt]),Object(r.useEffect)(function(){if(dn.current){var Ft=p.a.fromTextArea(dn.current,{mode:Ct,lineNumbers:!sr,lineWrapping:!0,value:gt,autoCloseTags:!0,autoCloseBrackets:!0});cr&&Ft.focus();function Jt(Gt,hr){if(xn){hr.preventDefault();return}var xr=hr.clipboardData;if(xr){var Vr=xr.types.toString(),vr=xr.items;if(Vr==="Files"||xr.types.indexOf("Files")>-1){if(hr.preventDefault(),Ct=="stex")return;try{var _n,zn=vr[1];((_n=vr[0])===null||_n===void 0?void 0:_n.kind)==="file"&&(zn=vr[0]);var mr=zn.getAsFile(),ji=mr.name.split(".").pop();Se(mr,function(Rr){if(Rr.id){var Mn,mi,qn;(mr==null||((Mn=mr.type)===null||Mn===void 0)?void 0:Mn.indexOf("image"))>-1?Ft.replaceSelection("![,](/api/attachments/".concat(Rr.id,"?type=").concat(Rr.content_type,")")):(mr==null||((mi=mr.type)===null||mi===void 0)?void 0:mi.indexOf("video"))>-1?Ft.replaceSelection('')):(mr==null||((qn=mr.type)===null||qn===void 0)?void 0:qn.indexOf("pdf"))>-1?Ft.replaceSelection('').concat(mr.name,"")):Te.includes(ji)?Ft.replaceSelection('').concat(mr.name,"")):Ft.replaceSelection("[".concat(mr.name,"](").concat(T.a.API_SERVER,"/api/attachments/").concat(Rr.id,"?type=").concat(Rr.content_type,")"))}else(Rr==null?void 0:Rr.status)===401&&(document.location.href="/user/login")})}catch(Rr){f.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Ft.on("paste",Jt),Ft.on("dragleave",function(Gt,hr){_r.current.classList.remove("mouse-hover-md")}),Ft.on("dragover",function(Gt,hr){_r.current.classList.add("mouse-hover-md")}),Ft.on("drop",function(Gt,hr){_r.current.classList.add("mouse-hover-md");var xr;if(xr=hr.dataTransfer.files,xr.length>0){hr.preventDefault(),hr.stopPropagation();for(var Vr=function(zn){var mr=xr[zn],ji=mr.name.split(".").pop();Se(mr,function(Rr){if(Rr.id){var Mn,mi,qn;(mr==null||((Mn=mr.type)===null||Mn===void 0)?void 0:Mn.indexOf("image"))>-1?Ft.replaceSelection("![,](/api/attachments/".concat(Rr.id,"?type=").concat(Rr.content_type,")")):(mr==null||((mi=mr.type)===null||mi===void 0)?void 0:mi.indexOf("video"))>-1?Ft.replaceSelection('')):(mr==null||((qn=mr.type)===null||qn===void 0)?void 0:qn.indexOf("pdf"))>-1?Ft.replaceSelection('').concat(mr.name,"")):Te.includes(ji)?Ft.replaceSelection('').concat(mr.name,"")):Ft.replaceSelection("[".concat(mr.name,"](").concat(T.a.API_SERVER,"/api/attachments/").concat(Rr.id,"?type=").concat(Rr.content_type,")"))}else(Rr==null?void 0:Rr.status)===401&&(document.location.href="/user/login")})},vr=0;vr0||vr.target.offsetWidth>0)&&(Di(),de.setSize("100%","100%"),de.refresh())}}catch(_n){xr.e(_n)}finally{xr.f()}});return Gt.observe(dn.current.parentElement),Gt}if(de){var Jt=Ft();return function(){Jt.unobserve(dn.current.parentElement)}}},[de,Di]),Object(r.useEffect)(function(){if(de){for(var Ft=[],Jt=function(){var vr=hr[Gt];xr=Object(C.a)(vr,2);var _n=xr[0],zn=xr[1],mr=Object(v.a)({},_n,function(){yi(zn)});Ft.push(mr),de.addKeyMap(mr)},Gt=0,hr=Object.entries(Ae);Gt0){var Ft=new Date().getTime(),Jt=window.sessionStorage.getItem(Fr);Ft>=En+Je&&(!Jt||Jt!==St)&&(window.sessionStorage.setItem(Fr,St),Gr(!0))}},Je),Object(r.useEffect)(function(){Mr(Wt)},[de,Wt]),Object(r.useEffect)(function(){de&&(cr&&de.focus())},[de,cr]),Object(r.useEffect)(function(){if(zt&&de){var Ft=de.getScrollerElement();function Jt(Gt){var hr=Gt.target;if(hn.current){var xr=hr.scrollTop/hr.scrollHeight;hn.current.scrollTop=hn.current.scrollHeight*xr}}return Ft.addEventListener("scroll",Jt),function(){Ft.removeEventListener("scroll",Jt)}}},[de,zt]),Object(r.useEffect)(function(){if(de&&bn){function Ft(Jt,Gt){bn(Jt,Gt)}return de.on("beforeChange",Ft),function(){de.off("beforeChange",Ft)}}},[de,bn]),Object(r.useEffect)(function(){if(de&&jr){function Ft(){jr(de.getValue())}return de.on("blur",Ft),function(){de.off("blur",Ft)}}},[de,jr]),Object(r.useEffect)(function(){if(de){function Ft(Jt){var Gt=Jt.getValue();Pt(Gt),wi(new Date().getTime()),Jt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),wt&&wt(Gt)}return de.on("change",Ft),function(){de.off("change",Ft)}}},[de,wt]),Object(r.useEffect)(function(){de&&(gt==null?(de.setValue(""),Pt("")):gt!==de.getValue()&&(de.setValue(gt),Pt(gt),de.setCursor(de.lineCount(),0)))},[de,gt]);var yi=Object(r.useCallback)(function(Ft){var Jt=de.getCursor(),Gt=de.getSelection(),hr=Gt.split(` `);switch(Ft){case"bold":return de.replaceSelection("**"+Gt+"**"),Gt===""&&de.setCursor(Jt.line,Jt.ch+2),de.focus();case"italic":return de.replaceSelection("*"+Gt+"*"),Gt===""&&de.setCursor(Jt.line,Jt.ch+1),de.focus();case"code":return de.replaceSelection("`"+Gt+"`"),Gt===""&&de.setCursor(Jt.line,Jt.ch+1),de.focus();case"inline-latex":return de.replaceSelection("`$$"+Gt+"$$`"),Gt===""&&de.setCursor(Jt.line,Jt.ch+3),de.focus();case"latex":return de.replaceSelection("```latex\n"+Gt+"\n```"),de.setCursor(Jt.line+1,Gt.length+1),de.focus();case"line-break":return de.replaceSelection(`
    `),de.focus();case"list-ul":return Gt===""?de.replaceSelection("- "+Gt):de.replaceSelection(hr.map(function(xr){return xr===""?"":"- ".concat(xr)}).join(` `)),de.focus();case"list-ol":return Gt===""?de.replaceSelection("1. "+Gt):de.replaceSelection(hr.map(function(xr,Vr){return xr===""?"":"".concat(Vr+1,". ").concat(xr)}).join(` `)),de.focus();case"add-null-ch":return Gt===""&&de.setCursor(Jt.line,Jt.ch+1),de.replaceSelection(tt),de.focus();case"inster-template-1":return Gt===""&&de.setCursor(Jt.line,Jt.ch),de.replaceSelection(Ue),de.focus();case"eraser":return de.setValue(""),de.focus();case"trigger-watch":return Mr(!zt),de.focus();case"trigger-full-screen":return Kr(!Qt),de.focus();case Re:dr(Re);return;case qe:dr(qe);return;case Ze:dr(Ze);return;case et:dr(et);return;default:throw new Error}},[de,zt,Qt]),Zn=Object(r.useCallback)(function(Ft){dr("");switch(nr){case Re:var Jt=Ft.title,Gt=Ft.link;return de.replaceSelection("[".concat(Jt,"](").concat(Gt,")")),de.focus();case qe:var hr=Ft.language,xr=Ft.content;return de.replaceSelection(["```"+hr,xr,"```"].join(` `)),de.focus();case Ze:var Vr=Ft.src,vr=Ft.alt,_n=Ft.name;return Vr.indexOf("type=image")>-1?de.replaceSelection("![ ".concat(vr||""," ]( ").concat(Vr,' "').concat(vr||"",'" )')):Vr.indexOf("type=application/pdf")>-1?de.replaceSelection('').concat(_n,"")):de.replaceSelection('').concat(_n,"")),de.focus();case et:for(var zn=Ft.row,mr=Ft.col,ji=Ft.align,Rr=` `,Mn=0;Mn300&&(_n=300);var zn=_t+_n+"px";rn(zn)}}return Ft.addEventListener("mousedown",hr),document.addEventListener("mousemove",Vr),document.addEventListener("mouseup",xr),function(){Ft.removeEventListener("mousedown",hr),document.removeEventListener("mousemove",Vr),document.removeEventListener("mouseup",xr)}}},[de,fi]),Object(r.useEffect)(function(){rn(_t)},[_t]);var Ni=ke(It),si=ke(Qn),pi={width:Ni,height:si},Bi=Object(r.useMemo)(function(){if(En){var Ft=new Date(En),Jt=Ft.getHours(),Gt=Ft.getMinutes(),hr=Ft.getSeconds();return Jt=Jt<10?"0"+Jt:Jt,Gt=Gt<10?"0"+Gt:Gt,hr=hr<10?"0"+hr:hr,"".concat(Jt,":").concat(Gt,":").concat(hr)}return 0},[En]);function li(){window.sessionStorage.removeItem(Fr),Gr(!1),wi(0)}function en(){Gr(!1),wi(0),de.setValue(window.sessionStorage.getItem(Fr))}function Qi(Ft,Jt){var Gt=de.getValue();Gt=Gt.replace(Ft,Jt),Pt(Gt),de==null||de.setValue(Gt)}return h.a.createElement(r.Fragment,null,h.a.createElement("div",{className:"markdown-editor-wrapper",ref:_r},h.a.createElement("div",{className:"markdown-editor-container ".concat(Ut," ").concat(zt?"on-preview":""," ").concat(sr?"mini":""," ").concat(Qt?"full-screen":""),style:pi},h.a.createElement(L,{insertTemp:Lr,watch:zt,fullScreen:Qt,showNullButton:Et,onActionCallback:yi,hidetoolBar:Br,uuid:ir.current,setOpenPhones:function(){qr.current=!0}}),h.a.createElement("div",{className:"markdown-editor-body"},h.a.createElement("div",{className:"codemirror-container"},h.a.createElement("textarea",{ref:dn,placeholder:An})),zt?h.a.createElement("div",{ref:hn,className:"preview-container"},Ct==="stex"&&h.a.createElement(k,{value:St}),Ct!=="stex"&&h.a.createElement(i.a,{edit:!0,value:St,replaces:Qi})):null))),Hr?h.a.createElement("a",{ref:fi,className:"editor-resize"}):null,h.a.createElement(V.a,null,Pe[nr]?h.a.createElement(u.a,{centered:!0,title:Pe[nr],visible:!0,onCancel:jn,footer:null},Si):null))}},PD8m:function(I,J){I.exports={name:"memoryStorage",read:M,write:u,each:_,remove:D,clearAll:f};var P={};function M(l){return P[l]}function u(l,C){P[l]=C}function _(l){for(var C in P)P.hasOwnProperty(C)&&l(P[C],C)}function D(l){delete P[l]}function f(l){P={}}},PVpz:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("ETIr"),P("cv67"),P("K3mO"),P("OLod"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.StreamCipher,f=u.algo,l=[],C=[],v=[],o=f.RabbitLegacy=D.extend({_doReset:function(){var r=this._key.words,h=this.cfg.iv,m=this._X=[r[0],r[3]<<16|r[2]>>>16,r[1],r[0]<<16|r[3]>>>16,r[2],r[1]<<16|r[0]>>>16,r[3],r[2]<<16|r[1]>>>16],p=this._C=[r[2]<<16|r[2]>>>16,r[0]&4294901760|r[1]&65535,r[3]<<16|r[3]>>>16,r[1]&4294901760|r[2]&65535,r[0]<<16|r[0]>>>16,r[2]&4294901760|r[3]&65535,r[1]<<16|r[1]>>>16,r[3]&4294901760|r[0]&65535];this._b=0;for(var w=0;w<4;w++)a.call(this);for(var w=0;w<8;w++)p[w]^=m[w+4&7];if(h){var g=h.words,c=g[0],n=g[1],s=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,d=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,S=s>>>16|d&4294901760,y=d<<16|s&65535;p[0]^=s,p[1]^=S,p[2]^=d,p[3]^=y,p[4]^=s,p[5]^=S,p[6]^=d,p[7]^=y;for(var w=0;w<4;w++)a.call(this)}},_doProcessBlock:function(r,h){var m=this._X;a.call(this),l[0]=m[0]^m[5]>>>16^m[3]<<16,l[1]=m[2]^m[7]>>>16^m[5]<<16,l[2]=m[4]^m[1]>>>16^m[7]<<16,l[3]=m[6]^m[3]>>>16^m[1]<<16;for(var p=0;p<4;p++)l[p]=(l[p]<<8|l[p]>>>24)&16711935|(l[p]<<24|l[p]>>>8)&4278255360,r[h+p]^=l[p]},blockSize:128/32,ivSize:64/32});function a(){for(var r=this._X,h=this._C,m=0;m<8;m++)C[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var p=r[m]+h[m],w=p&65535,g=p>>>16,c=((w*w>>>17)+w*g>>>15)+g*g,n=((p&4294901760)*p|0)+((p&65535)*p|0);v[m]=c^n}r[0]=v[0]+(v[7]<<16|v[7]>>>16)+(v[6]<<16|v[6]>>>16)|0,r[1]=v[1]+(v[0]<<8|v[0]>>>24)+v[7]|0,r[2]=v[2]+(v[1]<<16|v[1]>>>16)+(v[0]<<16|v[0]>>>16)|0,r[3]=v[3]+(v[2]<<8|v[2]>>>24)+v[1]|0,r[4]=v[4]+(v[3]<<16|v[3]>>>16)+(v[2]<<16|v[2]>>>16)|0,r[5]=v[5]+(v[4]<<8|v[4]>>>24)+v[3]|0,r[6]=v[6]+(v[5]<<16|v[5]>>>16)+(v[4]<<16|v[4]>>>16)|0,r[7]=v[7]+(v[6]<<8|v[6]>>>24)+v[5]|0}u.RabbitLegacy=D._createHelper(o)}(),M.RabbitLegacy})},RELg:function(I,J,P){var M=P("MFOe"),u=M.Global;I.exports={name:"oldIE-userDataStorage",write:C,read:v,each:o,remove:a,clearAll:r};var _="storejs",D=u.document,f=p(),l=(u.navigator?u.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function C(w,g){if(l)return;var c=m(w);f(function(n){n.setAttribute(c,g),n.save(_)})}function v(w){if(l)return;var g=m(w),c=null;return f(function(n){c=n.getAttribute(g)}),c}function o(w){f(function(g){for(var c=g.XMLDocument.documentElement.attributes,n=c.length-1;n>=0;n--){var s=c[n];w(g.getAttribute(s.name),s.name)}})}function a(w){var g=m(w);f(function(c){c.removeAttribute(g),c.save(_)})}function r(){f(function(w){var g=w.XMLDocument.documentElement.attributes;w.load(_);for(var c=g.length-1;c>=0;c--)w.removeAttribute(g[c].name);w.save(_)})}var h=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function m(w){return w.replace(/^\d/,"___$&").replace(h,"___")}function p(){if(!D||!D.documentElement||!D.documentElement.addBehavior)return null;var w="script",g,c,n;try{c=new ActiveXObject("htmlfile"),c.open(),c.write("<"+w+">document.w=window'),c.close(),g=c.w.frames[0].document,n=g.createElement("div")}catch(s){n=D.createElement("div"),g=D.body}return function(s){var d=[].slice.call(arguments,0);d.unshift(n),g.appendChild(n),n.addBehavior("#default#userData"),n.load(_),s.apply(this,d),g.removeChild(n);return}}},S6kV:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(M){return M.mode.OFB=function(){var u=M.lib.BlockCipherMode.extend(),_=u.Encryptor=u.extend({processBlock:function(D,f){var l=this._cipher,C=l.blockSize,v=this._iv,o=this._keystream;v&&(o=this._keystream=v.slice(0),this._iv=void 0),l.encryptBlock(o,0);for(var a=0;a|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function F(le){for(var Q=0,Y=!1,Z=!1,be=0,ge=le.length;be122||(ye<65||Ie>90||rt.push([Math.max(65,Ie)|32,Math.min(ye,90)|32]),ye<97||Ie>122||rt.push([Math.max(97,Ie)&~32,Math.min(ye,122)&~32]))}}rt.sort(function($e,Ke){return $e[0]-Ke[0]||Ke[1]-$e[1]});for(var Te=[],Ae=[],tt=0;ttPe[0]&&(Pe[1]+1>Pe[0]&&Je.push("-"),Je.push(et(Pe[1])))}return Je.push("]"),Je.join("")}function ut(je){for(var De=je.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")),rt=De.length,lt=[],Je=0,tt=0;Je=2&&Ie==="["?De[Je]=nt(Ue):Ie!=="\\"&&(De[Je]=Ue.replace(/[a-zA-Z]/g,function(Ae){var Pe=Ae.charCodeAt(0);return"["+String.fromCharCode(Pe&~32,Pe|32)+"]"}))}return De.join("")}for(var ot=[],be=0,ge=le.length;be=0;)Y[ot.charAt(je)]=ut;var De=ut[1],rt=""+De;qe.hasOwnProperty(rt)||(Ze.push(De),qe[rt]=null)}Ze.push(/[\0-\uffff]/),Z=F(Ze)})();var be=Q.length,ge=function(Re){for(var Ze=Re.sourceCode,qe=Re.basePos,et=Re.sourceNode,nt=[qe,T],ut=0,ot=Ze.match(Z)||[],je={},De=0,rt=ot.length;De=5&&Je.substring(0,5)==="lang-",Ue&&!(tt&&typeof tt[1]=="string")&&(Ue=!1,Je=L),Ue||(je[lt]=Je)}var ye=ut;if(ut+=lt.length,!Ue)nt.push(qe+ye,Je);else{var Te=tt[1],Ae=lt.indexOf(Te),Pe=Ae+Te.length;tt[2]&&(Pe=lt.length-tt[2].length,Ae=Pe-Te.length);var $e=Je.substring(5);H(et,qe+ye,lt.substring(0,Ae),ge,nt),H(et,qe+ye+Ae,Te,ce($e,Te),nt),H(et,qe+ye+Pe,lt.substring(Pe),ge,nt)}}Re.decorations=nt};return ge}function Ce(le){var Q=[],Y=[];le.tripleQuotedStrings?Q.push([i,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):le.multiLineStrings?Q.push([i,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Q.push([i,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),le.verbatimStrings&&Y.push([i,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Z=le.hashComments;Z&&(le.cStyleComments?(Z>1?Q.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Q.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Y.push([i,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Q.push([O,/^#[^\r\n]*/,null,"#"])),le.cStyleComments&&(Y.push([O,/^\/\/[^\r\n]*/,null]),Y.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var be=le.regexLiterals;if(be){var ge=be>1?"":` \r`,Re=ge?".":"[\\S\\s]",Ze="/(?=[^/*"+ge+"])(?:[^/\\x5B\\x5C"+ge+"]|\\x5C"+Re+"|\\x5B(?:[^\\x5C\\x5D"+ge+"]|\\x5C"+Re+")*(?:\\x5D|$))+/";Y.push(["lang-regex",RegExp("^"+G+"("+Ze+")")])}var qe=le.types;qe&&Y.push([b,qe]);var et=(""+le.keywords).replace(/^ | $/g,"");et.length&&Y.push([k,new RegExp("^(?:"+et.replace(/[\s,]+/g,"|")+")\\b"),null]),Q.push([T,/^\s+/,null,` \r \xA0`]);var nt="^.[^\\s\\w.$@'\"`/\\\\]*";return le.regexLiterals&&(nt+="(?!s*/)"),Y.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[T,/^[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"],[T,/^\\[\s\S]?/,null],[x,new RegExp(nt),null]),ee(Q,Y)}var Ee=Ce({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function pe(le,Q,Y){for(var Z=/(?:^|\s)nocode(?:\s|$)/,be=/\r\n?|\n/,ge=le.ownerDocument,Re=ge.createElement("li");le.firstChild;)Re.appendChild(le.firstChild);var Ze=[Re];function qe(De){var rt=De.nodeType;if(rt==1&&!Z.test(De.className))if(De.nodeName==="br")et(De),De.parentNode&&De.parentNode.removeChild(De);else for(var lt=De.firstChild;lt;lt=lt.nextSibling)qe(lt);else if((rt==3||rt==4)&&Y){var Je=De.nodeValue,tt=Je.match(be);if(tt){var Ue=Je.substring(0,tt.index);De.nodeValue=Ue;var ke=Je.substring(tt.index+tt[0].length);if(ke){var Ie=De.parentNode;Ie.insertBefore(ge.createTextNode(ke),De.nextSibling)}et(De),Ue||De.parentNode.removeChild(De)}}}function et(De){for(;!De.nextSibling;)if(De=De.parentNode,!De)return;function rt(tt,Ue){var ke=Ue?tt.cloneNode(!1):tt,Ie=tt.parentNode;if(Ie){var ye=rt(Ie,1),Te=tt.nextSibling;ye.appendChild(ke);for(var Ae=Te;Ae;Ae=Te)Te=Ae.nextSibling,ye.appendChild(Ae)}return ke}for(var lt=rt(De.nextSibling,0),Je;(Je=lt.parentNode)&&Je.nodeType===1;)lt=Je;Ze.push(lt)}for(var nt=0;nt=Ie&&(qe+=2),ge>=ye&&(ut+=2)}}finally{Je&&(Je.style.display=tt)}}var _e={};function he(le,Q){for(var Y=Q.length;--Y>=0;){var Z=Q[Y];_e.hasOwnProperty(Z)?v.console&&console.warn("cannot override language handler %s",Z):_e[Z]=le}}function ce(le,Q){return le&&_e.hasOwnProperty(le)||(le=/^\s*]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),he(ee([[T,/^[\s]+/,null,` \r `],[K,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[N,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[V,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[x,/^[=<>\/]+/],["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"]),he(ee([],[[K,/^[\s\S]+/]]),["uq.val"]),he(Ce({keywords:h,hashComments:!0,cStyleComments:!0,types:y}),["c","cc","cpp","cxx","cyc","m"]),he(Ce({keywords:"null,true,false"}),["json"]),he(Ce({keywords:p,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:y}),["cs"]),he(Ce({keywords:m,cStyleComments:!0}),["java"]),he(Ce({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),he(Ce({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),he(Ce({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),he(Ce({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),he(Ce({keywords:g,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),he(Ce({keywords:w,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),he(ee([],[[i,/^[\s\S]+/]]),["regex"]);function oe(le){var Q=le.langExtension;try{var Y=B(le.sourceNode,le.pre),Z=Y.sourceCode;le.sourceCode=Z,le.spans=Y.spans,le.basePos=0,ce(Q,Z)(le),Me(le)}catch(be){v.console&&console.log(be&&be.stack||be)}}function Se(le,Q,Y){var Z=Y||!1,be=Q||null,ge=document.createElement("div");ge.innerHTML="
    "+le+"
    ",ge=ge.firstChild,Z&&pe(ge,Z,!0);var Re={langExtension:be,numberLines:Z,sourceNode:ge,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return oe(Re),ge.innerHTML}function te(le,Q){var Y=Q||document.body,Z=Y.ownerDocument||document;function be(ke){return Y.getElementsByTagName(ke)}for(var ge=[be("pre"),be("code"),be("xmp")],Re=[],Ze=0;Ze=15&&(h=!1,o=!0);var i=s&&(a||h&&(y==null||y<12.11)),k=_||C&&v>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var b=function(e,t){var R=e.className,A=O(t).exec(R);if(A){var U=R.slice(A.index+A[0].length);e.className=R.slice(0,A.index)+(U?A[1]+U:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return E(e).appendChild(t)}function T(e,t,R,A){var U=document.createElement(e);if(R&&(U.className=R),A&&(U.style.cssText=A),typeof t=="string")U.appendChild(document.createTextNode(t));else if(t)for(var $=0;$=t)return ae+(t-$);ae+=fe-$,ae+=R-ae%R,$=fe+1}}var q=function(){this.id=null,this.f=null,this.time=0,this.handler=F(this.onTimeout,this)};q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},q.prototype.set=function(e,t){this.f=t;var R=+new Date+e;(!this.id||R=t)return A+Math.min(ae,t-U);if(U+=$-A,U+=R-U%R,A=$+1,U>=t)return A}}var he=[""];function ce(e){for(;he.length<=e;)he.push(oe(he)+" ");return he[e]}function oe(e){return e[e.length-1]}function Se(e,t){for(var R=[],A=0;A"\x80"&&(e.toUpperCase()!=e.toLowerCase()||le.test(e))}function Y(e,t){return t?t.source.indexOf("\\w")>-1&&Q(e)?!0:t.test(e):Q(e)}function Z(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var be=/[\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 ge(e){return e.charCodeAt(0)>=768&&be.test(e)}function Re(e,t,R){for(;(R<0?t>0:tR?-1:1;;){if(t==R)return t;var U=(t+R)/2,$=A<0?Math.ceil(U):Math.floor(U);if($==t)return e($)?t:R;e($)?R=$:t=$+A}}function qe(e,t,R,A){if(!e)return A(t,R,"ltr",0);for(var U=!1,$=0;$t||t==R&&ae.to==t)&&(A(Math.max(ae.from,t),Math.min(ae.to,R),ae.level==1?"rtl":"ltr",$),U=!0)}U||A(t,R,"ltr")}var et=null;function nt(e,t,R){var A;et=null;for(var U=0;Ut)return U;$.to==t&&($.from!=$.to&&R=="before"?A=U:et=U),$.from==t&&($.from!=$.to&&R!="before"?A=U:et=U)}return A!=null?A:et}var ut=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function R(xe){return xe<=247?e.charAt(xe):1424<=xe&&xe<=1524?"R":1536<=xe&&xe<=1785?t.charAt(xe-1536):1774<=xe&&xe<=2220?"r":8192<=xe&&xe<=8203?"w":xe==8204?"b":"L"}var A=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,U=/[stwN]/,$=/[LRr]/,ae=/[Lb1n]/,fe=/[1n]/;function me(xe,We,Ge){this.level=xe,this.from=We,this.to=Ge}return function(xe,We){var Ge=We=="ltr"?"L":"R";if(xe.length==0||We=="ltr"&&!A.test(xe))return!1;for(var st=xe.length,at=[],ft=0;ft-1&&(A[t]=U.slice(0,$).concat(U.slice($+1)))}}}function Je(e,t){var R=rt(e,t);if(!R.length)return;for(var A=Array.prototype.slice.call(arguments,2),U=0;U0}function Ie(e){e.prototype.on=function(t,R){De(this,t,R)},e.prototype.off=function(t,R){lt(this,t,R)}}function ye(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Te(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ae(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Pe(e){ye(e),Te(e)}function $e(e){return e.target||e.srcElement}function Ke(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var ct=function(){if(C&&v<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}(),gt;function wt(e){if(gt==null){var t=T("span","\u200B");x(e,T("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(gt=t.offsetWidth<=1&&t.offsetHeight>2&&!(C&&v<8))}var R=gt?T("span","\u200B"):T("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return R.setAttribute("cm-text",""),R}var vt;function It(e){if(vt!=null)return vt;var t=x(e,document.createTextNode("A\u062EA")),R=j(t,0,1).getBoundingClientRect(),A=j(t,1,2).getBoundingClientRect();return E(e),!R||R.left==R.right?!1:vt=A.right-R.right<3}var Lt=` b`.split(/\n/).length!=3?function(e){for(var t=0,R=[],A=e.length;t<=A;){var U=e.indexOf(` `,t);U==-1&&(U=e.length);var $=e.slice(t,e.charAt(U-1)=="\r"?U-1:U),ae=$.indexOf("\r");ae!=-1?(R.push($.slice(0,ae)),t+=ae+1):(R.push($),t=U+1)}return R}:function(e){return e.split(/\r\n?|\n/)},_t=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(R){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},rr=function(){var e=T("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),sr=null;function $t(e){if(sr!=null)return sr;var t=x(e,T("span","x")),R=t.getBoundingClientRect(),A=j(t,0,1).getBoundingClientRect();return sr=Math.abs(R.left-A.left)>1}var cr={},Wt={};function Lr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),cr[e]=t}function Cr(e,t){Wt[e]=t}function Ct(e){if(typeof e=="string"&&Wt.hasOwnProperty(e))e=Wt[e];else if(e&&typeof e.name=="string"&&Wt.hasOwnProperty(e.name)){var t=Wt[e.name];typeof t=="string"&&(t={name:t}),e=Oe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ct("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ct("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function lr(e,t){t=Ct(t);var R=cr[t.name];if(!R)return lr(e,"text/plain");var A=R(e,t);if(Fr.hasOwnProperty(t.name)){var U=Fr[t.name];for(var $ in U){if(!U.hasOwnProperty($))continue;A.hasOwnProperty($)&&(A["_"+$]=A[$]),A[$]=U[$]}}if(A.name=t.name,t.helperType&&(A.helperType=t.helperType),t.modeProps)for(var ae in t.modeProps)A[ae]=t.modeProps[ae];return A}var Fr={};function $r(e,t){var R=Fr.hasOwnProperty(e)?Fr[e]:Fr[e]={};B(t,R)}function Hr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var R={};for(var A in t){var U=t[A];U instanceof Array&&(U=U.concat([])),R[A]=U}return R}function oi(e,t){for(var R;e.innerMode&&!(R=e.innerMode(t),!R||R.mode==e);)t=R.state,e=R.mode;return R||{mode:e,state:t}}function Tt(e,t,R){return e.startState?e.startState(t,R):!0}var Rt=function(e,t,R){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=R};Rt.prototype.eol=function(){return this.pos>=this.string.length},Rt.prototype.sol=function(){return this.pos==this.lineStart},Rt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Rt.prototype.next=function(){if(this.post},Rt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Rt.prototype.skipToEnd=function(){this.pos=this.string.length},Rt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Rt.prototype.backUp=function(e){this.pos-=e},Rt.prototype.column=function(){return this.lastColumnPos0?null:($&&t!==!1&&(this.pos+=$[0].length),$)}},Rt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Rt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Rt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Rt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Et(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 R=e;!R.lines;)for(var A=0;;++A){var U=R.children[A],$=U.chunkSize();if(t<$){R=U;break}t-=$}return R.lines[t]}function Ar(e,t,R){var A=[],U=t.line;return e.iter(t.line,R.line+1,function($){var ae=$.text;U==R.line&&(ae=ae.slice(0,R.ch)),U==t.line&&(ae=ae.slice(t.ch)),A.push(ae),++U}),A}function Br(e,t,R){var A=[];return e.iter(t,R,function(U){A.push(U.text)}),A}function Xt(e,t){var R=t-e.height;if(R)for(var A=e;A;A=A.parent)A.height+=R}function Nt(e){if(e.parent==null)return null;for(var t=e.parent,R=re(t.lines,e),A=t.parent;A;t=A,A=A.parent)for(var U=0;!(A.children[U]==t);++U)R+=A.children[U].chunkSize();return R+t.first}function jr(e,t){var R=e.first;e:do{for(var A=0;A=e.first&&tR?mt(R,Et(e,R).text.length):X(t,Et(e,t.line).text.length)}function X(e,t){var R=e.ch;return R==null||R>t?mt(e.line,t):R<0?mt(e.line,0):e}function ne(e,t){for(var R=[],A=0;Athis.maxLookAhead&&(this.maxLookAhead=e),t},ie.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}},ie.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ie.fromSaved=function(e,t,R){return t instanceof de?new ie(e,Hr(e.mode,t.state),R,t.lookAhead):new ie(e,Hr(e.mode,t),R)},ie.prototype.save=function(e){var t=e!==!1?Hr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new de(t,this.maxLookAhead):t};function ze(e,t,R,A){var U=[e.state.modeGen],$={};Zr(e,t.text,e.doc.mode,R,function(xe,We){return U.push(xe,We)},$,A);for(var ae=R.state,fe=function(xe){R.baseTokens=U;var We=e.state.overlays[xe],Ge=1,st=0;R.state=!0,Zr(e,t.text,We.mode,R,function(at,ft){for(var yt=Ge;stat&&U.splice(Ge,1,at,U[Ge+1],Ot),Ge+=2,st=Math.min(at,Ot)}if(!ft)return;if(We.opaque)U.splice(yt,Ge-yt,at,"overlay "+ft),Ge=yt+2;else for(;yte.options.maxHighlightLength&&Hr(e.doc.mode,A.state),$=ze(e,t,A);U&&(A.state=U),t.stateAfter=A.save(!U),t.styles=$.styles,$.classes?t.styleClasses=$.classes:t.styleClasses&&(t.styleClasses=null),R===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function St(e,t,R){var A=e.doc,U=e.display;if(!A.mode.startState)return new ie(A,!0,t);var $=Qt(e,t,R),ae=$>A.first&&Et(A,$-1).stateAfter,fe=ae?ie.fromSaved(A,ae,$):new ie(A,Tt(A.mode),$);return A.iter($,t,function(me){Pt(e,me.text,fe);var xe=fe.line;me.stateAfter=xe==t-1||xe%5==0||xe>=U.viewFrom&&xet.start)return $}throw new Error("Mode "+e.name+" failed to advance stream.")}var zt=function(e,t,R){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=R};function Mr(e,t,R,A){var U=e.doc,$=U.mode,ae;t=z(U,t);var fe=Et(U,t.line),me=St(e,t.line,R),xe=new Rt(fe.text,e.options.tabSize,me),We;for(A&&(We=[]);(A||xe.pose.options.maxHighlightLength?(fe=!1,ae&&Pt(e,t,A,We.pos),We.pos=t.length,Ge=null):Ge=on(Ht(R,We,A.state,st),$),st){var at=st[0].name;at&&(Ge="m-"+(Ge?at+" "+Ge:at))}if(!fe||xe!=Ge){for(;meae;--fe){if(fe<=$.first)return $.first;var me=Et($,fe-1),xe=me.stateAfter;if(xe&&(!R||fe+(xe instanceof de?xe.lookAhead:0)<=$.modeFrontier))return fe;var We=H(me.text,null,e.options.tabSize);(U==null||A>We)&&(U=fe-1,A=We)}return U}function Kr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontierR;A--){var U=Et(e,A).stateAfter;if(U&&(!(U instanceof de)||A+U.lookAhead=t:$.to>t);(A||(A=[])).push(new Jr(ae,$.from,me?null:$.to))}}return A}function Fi(e,t,R){var A;if(e)for(var U=0;U=t:$.to>t);if(fe||$.from==t&&ae.type=="bookmark"&&(!R||$.marker.insertLeft)){var me=$.from==null||(ae.inclusiveLeft?$.from<=t:$.from0&&fe)for(var Bt=0;Bt0)continue;var We=[me,1],Ge=Ut(xe.from,fe.from),st=Ut(xe.to,fe.to);(Ge<0||!ae.inclusiveLeft&&!Ge)&&We.push({from:xe.from,to:fe.from}),(st>0||!ae.inclusiveRight&&!st)&&We.push({from:fe.to,to:xe.to}),U.splice.apply(U,We),me+=We.length-3}return U}function sn(e){var t=e.markedSpans;if(!t)return;for(var R=0;Rt)&&(!A||qr(A,$.marker)<0)&&(A=$.marker)}return A}function hn(e,t,R,A,U){var $=Et(e,t),ae=Yt&&$.markedSpans;if(ae)for(var fe=0;fe=0&&Ge<=0||We<=0&&Ge>=0)continue;if(We<=0&&(me.marker.inclusiveRight&&U.inclusiveLeft?Ut(xe.to,R)>=0:Ut(xe.to,R)>0)||We>=0&&(me.marker.inclusiveRight&&U.inclusiveLeft?Ut(xe.from,A)<=0:Ut(xe.from,A)<0))return!0}}function Hn(e){for(var t;t=dn(e);)e=t.find(-1,!0).line;return e}function Di(e){for(var t;t=_r(e);)e=t.find(1,!0).line;return e}function yi(e){for(var t,R;t=_r(e);)e=t.find(1,!0).line,(R||(R=[])).push(e);return R}function Zn(e,t){var R=Et(e,t),A=Hn(R);return R==A?t:Nt(A)}function Si(e,t){if(t>e.lastLine())return t;var R=Et(e,t),A;if(!jn(e,R))return t;for(;A=_r(R);)R=A.find(1,!0).line;return Nt(R)+1}function jn(e,t){var R=Yt&&t.markedSpans;if(R)for(var A=void 0,U=0;Ut.maxLineLength&&(t.maxLineLength=U,t.maxLine=A)})}var li=function(e,t,R){this.text=e,hi(this,t),this.height=R?R(this):1};li.prototype.lineNo=function(){return Nt(this)},Ie(li);function en(e,t,R,A){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),sn(e),hi(e,R);var U=A?A(e):1;U!=e.height&&Xt(e,U)}function Qi(e){e.parent=null,sn(e)}var Ft={},Jt={};function Gt(e,t){if(!e||/^\s*$/.test(e))return null;var R=t.addModeClass?Jt:Ft;return R[e]||(R[e]=e.replace(/\S+/g,"cm-$&"))}function hr(e,t){var R=N("span",null,null,o?"padding-right: .1px":null),A={pre:N("pre",[R],"CodeMirror-line"),content:R,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var U=0;U<=(t.rest?t.rest.length:0);U++){var $=U?t.rest[U-1]:t.line,ae=void 0;A.pos=0,A.addToken=Vr,It(e.display.measure)&&(ae=ot($,e.doc.direction))&&(A.addToken=_n(A.addToken,ae)),A.map=[];var fe=t!=e.display.externalMeasured&&Nt($);mr($,A,ht(e,$,fe)),$.styleClasses&&($.styleClasses.bgClass&&(A.bgClass=W($.styleClasses.bgClass,A.bgClass||"")),$.styleClasses.textClass&&(A.textClass=W($.styleClasses.textClass,A.textClass||""))),A.map.length==0&&A.map.push(0,0,A.content.appendChild(wt(e.display.measure))),U==0?(t.measure.map=A.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(A.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(o){var me=A.content.lastChild;(/\bcm-tab\b/.test(me.className)||me.querySelector&&me.querySelector(".cm-tab"))&&(A.content.className="cm-tab-wrap-hack")}return Je(e,"renderLine",e,t.line,A.pre),A.pre.className&&(A.textClass=W(A.pre.className,A.textClass||"")),A}function xr(e){var t=T("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Vr(e,t,R,A,U,$,ae){if(!t)return;var fe=e.splitSpaces?vr(t,e.trailingSpace):t,me=e.cm.state.specialChars,xe=!1,We;if(!me.test(t))e.col+=t.length,We=document.createTextNode(fe),e.map.push(e.pos,e.pos+t.length,We),C&&v<9&&(xe=!0),e.pos+=t.length;else{We=document.createDocumentFragment();for(var Ge=0;;){me.lastIndex=Ge;var st=me.exec(t),at=st?st.index-Ge:t.length-Ge;if(at){var ft=document.createTextNode(fe.slice(Ge,Ge+at));C&&v<9?We.appendChild(T("span",[ft])):We.appendChild(ft),e.map.push(e.pos,e.pos+at,ft),e.col+=at,e.pos+=at}if(!st)break;Ge+=at+1;var yt=void 0;if(st[0]==" "){var Ot=e.cm.options.tabSize,Dt=Ot-e.col%Ot;yt=We.appendChild(T("span",ce(Dt),"cm-tab")),yt.setAttribute("role","presentation"),yt.setAttribute("cm-text"," "),e.col+=Dt}else st[0]=="\r"||st[0]==` `?(yt=We.appendChild(T("span",st[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),yt.setAttribute("cm-text",st[0]),e.col+=1):(yt=e.cm.options.specialCharPlaceholder(st[0]),yt.setAttribute("cm-text",st[0]),C&&v<9?We.appendChild(T("span",[yt])):We.appendChild(yt),e.col+=1);e.map.push(e.pos,e.pos+1,yt),e.pos++}}if(e.trailingSpace=fe.charCodeAt(t.length-1)==32,R||A||U||xe||$||ae){var jt=R||"";A&&(jt+=A),U&&(jt+=U);var kt=T("span",[We],jt,$);if(ae)for(var Bt in ae)ae.hasOwnProperty(Bt)&&Bt!="style"&&Bt!="class"&&kt.setAttribute(Bt,ae[Bt]);return e.content.appendChild(kt)}e.content.appendChild(We)}function vr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var R=t,A="",U=0;Uxe&&Ge.from<=xe);st++);if(Ge.to>=We)return e(R,A,U,$,ae,fe,me);e(R,A.slice(0,Ge.to-xe),U,$,null,fe,me),$=null,A=A.slice(Ge.to-xe),xe=Ge.to}}}function zn(e,t,R,A){var U=!A&&R.widgetNode;U&&e.map.push(e.pos,e.pos+t,U),!A&&e.cm.display.input.needsContentAttribute&&(U||(U=e.content.appendChild(document.createElement("span"))),U.setAttribute("cm-marker",R.id)),U&&(e.cm.display.input.setUneditable(U),e.content.appendChild(U)),e.pos+=t,e.trailingSpace=!1}function mr(e,t,R){var A=e.markedSpans,U=e.text,$=0;if(!A){for(var ae=1;aeme||kr.collapsed&&qt.to==me&&qt.from==me)){if(qt.to!=null&&qt.to!=me&&at>qt.to&&(at=qt.to,yt=""),kr.className&&(ft+=" "+kr.className),kr.css&&(st=(st?st+";":"")+kr.css),kr.startStyle&&qt.from==me&&(Ot+=" "+kr.startStyle),kr.endStyle&&qt.to==at&&(Bt||(Bt=[])).push(kr.endStyle,qt.to),kr.title&&((jt||(jt={})).title=kr.title),kr.attributes)for(var Tn in kr.attributes)(jt||(jt={}))[Tn]=kr.attributes[Tn];kr.collapsed&&(!Dt||qr(Dt.marker,kr)<0)&&(Dt=qt)}else qt.from>me&&at>qt.from&&(at=qt.from)}if(Bt)for(var ci=0;ci=fe)break;for(var Ui=Math.min(fe,at);;){if(We){var Mi=me+We.length;if(!Dt){var $n=Mi>Ui?We.slice(0,Ui-me):We;t.addToken(t,$n,Ge?Ge+ft:ft,Ot,me+$n.length==at?yt:"",st,jt)}if(Mi>=Ui){We=We.slice(Ui-me),me=Ui;break}me=Mi,Ot=""}We=U.slice($,$=R[xe++]),Ge=Gt(R[xe++],t.cm.options)}}}function ji(e,t,R){this.line=t,this.rest=yi(t),this.size=this.rest?Nt(oe(this.rest))-R+1:1,this.node=this.text=null,this.hidden=jn(e,t)}function Rr(e,t,R){for(var A=[],U,$=t;$2&&$.push((me.bottom+xe.top)/2-R.top)}}$.push(R.bottom-R.top)}}function we(e,t,R){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var A=0;AR)return{map:e.measure.maps[U],cache:e.measure.caches[U],before:!0}}function Be(e,t){t=Hn(t);var R=Nt(t),A=e.display.externalMeasured=new ji(e.doc,t,R);A.lineN=R;var U=A.built=hr(e,A);return A.text=U.pre,x(e.display.lineMeasure,U.pre),A}function He(e,t,R,A){return it(e,Xe(e,t),R,A)}function Ye(e,t){if(t>=e.display.viewFrom&&t=R.lineN&&tt)&&($=me-fe,U=$-1,t>=me&&(ae="right")),U!=null){if(A=e[xe+2],fe==me&&R==(A.insertLeft?"left":"right")&&(ae=R),R=="left"&&U==0)for(;xe&&e[xe-2]==e[xe-3]&&e[xe-1].insertLeft;)A=e[(xe-=3)+2],ae="left";if(R=="right"&&U==me-fe)for(;xe=0&&!((R=e[U]).left!=R.right);U--);return R}function At(e,t,R,A){var U=xt(t.map,R,A),$=U.node,ae=U.start,fe=U.end,me=U.collapse,xe;if($.nodeType==3){for(var We=0;We<4;We++){for(;ae&&ge(t.line.text.charAt(U.coverStart+ae));)--ae;for(;U.coverStart+fe0&&(me=A="right");var Ge;e.options.lineWrapping&&(Ge=$.getClientRects()).length>1?xe=Ge[A=="right"?Ge.length-1:0]:xe=$.getBoundingClientRect()}if(C&&v<9&&!ae&&(!xe||!xe.left&&!xe.right)){var st=$.parentNode.getClientRects()[0];st?xe={left:st.left,right:st.left+ei(e.display),top:st.top,bottom:st.bottom}:xe=dt}for(var at=xe.top-t.rect.top,ft=xe.bottom-t.rect.top,yt=(at+ft)/2,Ot=t.view.measure.heights,Dt=0;Dt=A.text.length?(me=A.text.length,xe="before"):me<=0&&(me=0,xe="after"),!fe)return ae(xe=="before"?me-1:me,xe=="before");function We(ft,yt,Ot){var Dt=fe[yt],jt=Dt.level==1;return ae(Ot?ft-1:ft,jt!=Ot)}var Ge=nt(fe,me,xe),st=et,at=We(me,Ge,xe=="before");return st!=null&&(at.other=We(me,st,xe!="before")),at}function tr(e,t){var R=0;t=z(e.doc,t),e.options.lineWrapping||(R=ei(e.display)*t.ch);var A=Et(e.doc,t.line),U=si(A)+$i(e.display);return{left:R,right:R,top:U,bottom:U+A.height}}function Zt(e,t,R,A,U){var $=mt(e,t,R);return $.xRel=U,A&&($.outside=A),$}function Ur(e,t,R){var A=e.doc;if(R+=e.display.viewOffset,R<0)return Zt(A.first,0,null,-1,-1);var U=jr(A,R),$=A.first+A.size-1;if(U>$)return Zt(A.first+A.size-1,Et(A,$).text.length,null,1,1);t<0&&(t=0);for(var ae=Et(A,U);;){var fe=kn(e,ae,U,t,R),me=fi(ae,fe.ch+(fe.xRel>0||fe.outside>0?1:0));if(!me)return fe;var xe=me.find(1);if(xe.line==U)return xe;ae=Et(A,U=xe.line)}}function Yr(e,t,R,A){A-=br(t);var U=t.text.length,$=Ze(function(ae){return it(e,R,ae-1).bottom<=A},U,0);return U=Ze(function(ae){return it(e,R,ae).top>A},$,U),{begin:$,end:U}}function Kt(e,t,R,A){R||(R=Xe(e,t));var U=Xr(e,t,it(e,R,A),"line").top;return Yr(e,t,R,U)}function Qr(e,t,R,A){return e.bottom<=R?!1:e.top>R?!0:(A?e.left:e.right)>t}function kn(e,t,R,A,U){U-=si(t);var $=Xe(e,t),ae=br(t),fe=0,me=t.text.length,xe=!0,We=ot(t,e.doc.direction);if(We){var Ge=(e.options.lineWrapping?gn:nn)(e,t,R,$,We,A,U);xe=Ge.level!=1,fe=xe?Ge.from:Ge.to-1,me=xe?Ge.to:Ge.from-1}var st=null,at=null,ft=Ze(function(ar){var qt=it(e,$,ar);return qt.top+=ae,qt.bottom+=ae,Qr(qt,A,U,!1)?(qt.top<=U&&qt.left<=A&&(st=ar,at=qt),!0):!1},fe,me),yt,Ot,Dt=!1;if(at){var jt=A-at.left=Bt.bottom?1:0}return ft=Re(t.text,ft,1),Zt(R,ft,Ot,Dt,A-yt)}function nn(e,t,R,A,U,$,ae){var fe=Ze(function(Ge){var st=U[Ge],at=st.level!=1;return Qr(Nr(e,mt(R,at?st.to:st.from,at?"before":"after"),"line",t,A),$,ae,!0)},0,U.length-1),me=U[fe];if(fe>0){var xe=me.level!=1,We=Nr(e,mt(R,xe?me.from:me.to,xe?"after":"before"),"line",t,A);Qr(We,$,ae,!0)&&We.top>ae&&(me=U[fe-1])}return me}function gn(e,t,R,A,U,$,ae){var fe=Yr(e,t,A,ae),me=fe.begin,xe=fe.end;/\s/.test(t.text.charAt(xe-1))&&xe--;for(var We=null,Ge=null,st=0;st=xe||at.to<=me)continue;var ft=at.level!=1,yt=it(e,A,ft?Math.min(xe,at.to)-1:Math.max(me,at.from)).right,Ot=yt<$?$-yt+1e9:yt-$;(!We||Ge>Ot)&&(We=at,Ge=Ot)}return We||(We=U[U.length-1]),We.fromxe&&(We={from:We.from,to:xe,level:We.level}),We}var pn;function Bn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(pn==null){pn=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)pn.appendChild(document.createTextNode("x")),pn.appendChild(T("br"));pn.appendChild(document.createTextNode("x"))}x(e.measure,pn);var R=pn.offsetHeight/50;return R>3&&(e.cachedTextHeight=R),E(e.measure),R||1}function ei(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),R=T("pre",[t],"CodeMirror-line-like");x(e.measure,R);var A=t.getBoundingClientRect(),U=(A.right-A.left)/10;return U>2&&(e.cachedCharWidth=U),U||10}function Pn(e){for(var t=e.display,R={},A={},U=t.gutters.clientLeft,$=t.gutters.firstChild,ae=0;$;$=$.nextSibling,++ae){var fe=e.display.gutterSpecs[ae].className;R[fe]=$.offsetLeft+$.clientLeft+U,A[fe]=$.clientWidth}return{fixedPos:bi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:R,gutterWidth:A,wrapperWidth:t.wrapper.clientWidth}}function bi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Wi(e){var t=Bn(e.display),R=e.options.lineWrapping,A=R&&Math.max(5,e.display.scroller.clientWidth/ei(e.display)-3);return function(U){if(jn(e.doc,U))return 0;var $=0;if(U.widgets)for(var ae=0;ae0&&(xe=Et(e.doc,me.line).text).length==me.ch){var We=H(xe,xe.length,e.options.tabSize)-xe.length;me=mt(me.line,Math.max(0,Math.round(($-Ve(e.display).left)/ei(e.display))-We))}return me}function Cn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var R=e.display.view,A=0;At)&&(U.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=U.viewTo)Yt&&Zn(e.doc,t)U.viewFrom?Ln(e):(U.viewFrom+=A,U.viewTo+=A);else if(t<=U.viewFrom&&R>=U.viewTo)Ln(e);else if(t<=U.viewFrom){var $=Hi(e,R,R+A,1);$?(U.view=U.view.slice($.index),U.viewFrom=$.lineN,U.viewTo+=A):Ln(e)}else if(R>=U.viewTo){var ae=Hi(e,t,t,-1);ae?(U.view=U.view.slice(0,ae.index),U.viewTo=ae.lineN):Ln(e)}else{var fe=Hi(e,t,t,-1),me=Hi(e,R,R+A,1);fe&&me?(U.view=U.view.slice(0,fe.index).concat(Rr(e,fe.lineN,me.lineN)).concat(U.view.slice(me.index)),U.viewTo+=A):Ln(e)}var xe=U.externalMeasured;xe&&(R=U.lineN&&t=A.viewTo)return;var $=A.view[Cn(e,t)];if($.node==null)return;var ae=$.changes||($.changes=[]);re(ae,R)==-1&&ae.push(R)}function Ln(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Hi(e,t,R,A){var U=Cn(e,t),$,ae=e.display.view;if(!Yt||R==e.doc.first+e.doc.size)return{index:U,lineN:R};for(var fe=e.display.viewFrom,me=0;me0){if(U==ae.length-1)return null;$=fe+ae[U].size-t,U++}else $=fe-t;t+=$,R+=$}for(;Zn(e.doc,R)!=R;){if(U==(A<0?0:ae.length-1))return null;R+=A*ae[U-(A<0?1:0)].size,U+=A}return{index:U,lineN:R}}function ra(e,t,R){var A=e.display,U=A.view;U.length==0||t>=A.viewTo||R<=A.viewFrom?(A.view=Rr(e,t,R),A.viewFrom=t):(A.viewFrom>t?A.view=Rr(e,t,A.viewFrom).concat(A.view):A.viewFromR&&(A.view=A.view.slice(0,Cn(e,R)))),A.viewTo=R}function na(e){for(var t=e.display.view,R=0,A=0;A=e.display.viewTo||fe.to().line0?t.blinker=setInterval(function(){e.hasFocus()||va(e),t.cursorDiv.style.visibility=(R=!R)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function To(e){e.state.focused||(e.display.input.focus(),aa(e))}function eo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,va(e))},100)}function aa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Je(e,"focus",e,t),e.state.focused=!0,K(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),o&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ri(e)}function va(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Je(e,"blur",e,t),e.state.focused=!1,b(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Pa(e){for(var t=e.display,R=t.lineDiv.offsetTop,A=0;A.005||We<-.005)&&(Xt(U.line,ae),to(U.line),U.rest))for(var Ge=0;Gee.display.sizerWidth){var st=Math.ceil(fe/ei(e.display));st>e.display.maxLineLength&&(e.display.maxLineLength=st,e.display.maxLine=U.line,e.display.maxLineChanged=!0)}}}function to(e){if(e.widgets)for(var t=0;t=ae&&($=jr(t,si(Et(t,me))-e.wrapper.clientHeight),ae=me)}return{from:$,to:Math.max(ae,$+1)}}function Xo(e,t){if(tt(e,"scrollCursorIntoView"))return;var R=e.display,A=R.sizer.getBoundingClientRect(),U=null;if(t.top+A.top<0?U=!0:t.bottom+A.top>(window.innerHeight||document.documentElement.clientHeight)&&(U=!1),U!=null&&!w){var $=T("div","\u200B",null,`position: absolute; top: `+(t.top-R.viewOffset-$i(e.display))+`px; height: `+(t.bottom-t.top+Qe(e)+R.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild($),$.scrollIntoView(U),e.display.lineSpace.removeChild($)}}function Yo(e,t,R,A){A==null&&(A=0);var U;!e.options.lineWrapping&&t==R&&(t=t.ch?mt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,R=t.sticky=="before"?mt(t.line,t.ch+1,"before"):t);for(var $=0;$<5;$++){var ae=!1,fe=Nr(e,t),me=!R||R==t?fe:Nr(e,R);U={left:Math.min(fe.left,me.left),top:Math.min(fe.top,me.top)-A,right:Math.max(fe.left,me.left),bottom:Math.max(fe.bottom,me.bottom)+A};var xe=ro(e,U),We=e.doc.scrollTop,Ge=e.doc.scrollLeft;if(xe.scrollTop!=null&&(xa(e,xe.scrollTop),Math.abs(e.doc.scrollTop-We)>1&&(ae=!0)),xe.scrollLeft!=null&&(zi(e,xe.scrollLeft),Math.abs(e.doc.scrollLeft-Ge)>1&&(ae=!0)),!ae)break}return U}function _o(e,t){var R=ro(e,t);R.scrollTop!=null&&xa(e,R.scrollTop),R.scrollLeft!=null&&zi(e,R.scrollLeft)}function ro(e,t){var R=e.display,A=Bn(e.display);t.top<0&&(t.top=0);var U=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:R.scroller.scrollTop,$=ve(e),ae={};t.bottom-t.top>$&&(t.bottom=t.top+$);var fe=e.doc.height+Ne(R),me=t.topfe-A;if(t.topU+$){var We=Math.min(t.top,(xe?fe:t.bottom)-$);We!=U&&(ae.scrollTop=We)}var Ge=e.options.fixedGutter?0:R.gutters.offsetWidth,st=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:R.scroller.scrollLeft-Ge,at=Fe(e)-R.gutters.offsetWidth,ft=t.right-t.left>at;return ft&&(t.right=t.left+at),t.left<10?ae.scrollLeft=0:t.leftat+st-3&&(ae.scrollLeft=t.right+(ft?0:10)-at),ae}function no(e,t){if(t==null)return;Na(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ya(e){Na(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ba(e,t,R){(t!=null||R!=null)&&Na(e),t!=null&&(e.curOp.scrollLeft=t),R!=null&&(e.curOp.scrollTop=R)}function $o(e,t){Na(e),e.curOp.scrollToPos=t}function Na(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var R=tr(e,t.from),A=tr(e,t.to);Oa(e,R,A,t.margin)}}function Oa(e,t,R,A){var U=ro(e,{left:Math.min(t.left,R.left),top:Math.min(t.top,R.top)-A,right:Math.max(t.right,R.right),bottom:Math.max(t.bottom,R.bottom)+A});ba(e,U.scrollLeft,U.scrollTop)}function xa(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;_||Da(e,{top:t}),Ea(e,t,!0),_&&Da(e),Ra(e,100)}function Ea(e,t,R){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!R)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function zi(e,t,R,A){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(R?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!A)return;e.doc.scrollLeft=t,Wr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ca(e){var t=e.display,R=t.gutters.offsetWidth,A=Math.round(e.doc.height+Ne(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?R:0,docHeight:A,scrollHeight:A+Qe(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:R}}var oa=function(e,t,R){this.cm=R;var A=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),U=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");A.tabIndex=U.tabIndex=-1,e(A),e(U),De(A,"scroll",function(){A.clientHeight&&t(A.scrollTop,"vertical")}),De(U,"scroll",function(){U.clientWidth&&t(U.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,C&&v<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};oa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,R=e.scrollHeight>e.clientHeight+1,A=e.nativeBarWidth;if(R){this.vert.style.display="block",this.vert.style.bottom=t?A+"px":"0";var U=e.viewHeight-(t?A:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+U)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=R?A+"px":"0",this.horiz.style.left=e.barLeft+"px";var $=e.viewWidth-e.barLeft-(R?A:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+$)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(A==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:R?A:0,bottom:t?A:0}},oa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},oa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},oa.prototype.zeroWidthHack=function(){var e=s&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new q,this.disableVert=new q},oa.prototype.enableZeroWidthBar=function(e,t,R){e.style.pointerEvents="auto";function A(){var U=e.getBoundingClientRect(),$=R=="vert"?document.elementFromPoint(U.right-1,(U.top+U.bottom)/2):document.elementFromPoint((U.right+U.left)/2,U.bottom-1);$!=e?e.style.pointerEvents="none":t.set(1e3,A)}t.set(1e3,A)},oa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Aa=function(){};Aa.prototype.update=function(){return{bottom:0,right:0}},Aa.prototype.setScrollLeft=function(){},Aa.prototype.setScrollTop=function(){},Aa.prototype.clear=function(){};function da(e,t){t||(t=ca(e));var R=e.display.barWidth,A=e.display.barHeight;ja(e,t);for(var U=0;U<4&&R!=e.display.barWidth||A!=e.display.barHeight;U++)R!=e.display.barWidth&&e.options.lineWrapping&&Pa(e),ja(e,ca(e)),R=e.display.barWidth,A=e.display.barHeight}function ja(e,t){var R=e.display,A=R.scrollbars.update(t);R.sizer.style.paddingRight=(R.barWidth=A.right)+"px",R.sizer.style.paddingBottom=(R.barHeight=A.bottom)+"px",R.heightForcer.style.borderBottom=A.bottom+"px solid transparent",A.right&&A.bottom?(R.scrollbarFiller.style.display="block",R.scrollbarFiller.style.height=A.bottom+"px",R.scrollbarFiller.style.width=A.right+"px"):R.scrollbarFiller.style.display="",A.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(R.gutterFiller.style.display="block",R.gutterFiller.style.height=A.bottom+"px",R.gutterFiller.style.width=t.gutterWidth+"px"):R.gutterFiller.style.display=""}var io={native:oa,null:Aa};function Ua(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&b(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new io[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),De(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,R){R=="horizontal"?zi(e,t):xa(e,t)},e),e.display.scrollbars.addClass&&K(e.display.wrapper,e.display.scrollbars.addClass)}var ao=0;function sa(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:++ao},mi(e.curOp)}function ha(e){var t=e.curOp;t&&Pr(t,function(R){for(var A=0;A=R.viewTo)||R.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ki(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qo(e){e.updatedDisplay=e.mustUpdate&&fa(e.cm,e.update)}function Zo(e){var t=e.cm,R=t.display;e.updatedDisplay&&Pa(t),e.barMeasure=ca(t),R.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=He(t,R.maxLine,R.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(R.scroller.clientWidth,R.sizer.offsetLeft+e.adjustWidthTo+Qe(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,R.sizer.offsetLeft+e.adjustWidthTo-Fe(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=R.input.prepareSelection())}function oo(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var R=+new Date+e.options.workTime,A=St(e,t.highlightFrontier),U=[];t.iter(A.line,Math.min(t.first+t.size,e.display.viewTo+500),function($){if(A.line>=e.display.viewFrom){var ae=$.styles,fe=$.text.length>e.options.maxHighlightLength?Hr(t.mode,A.state):null,me=ze(e,$,A,!0);fe&&(A.state=fe),$.styles=me.styles;var xe=$.styleClasses,We=me.classes;We?$.styleClasses=We:xe&&($.styleClasses=null);for(var Ge=!ae||ae.length!=$.styles.length||xe!=We&&(!xe||!We||xe.bgClass!=We.bgClass||xe.textClass!=We.textClass),st=0;!Ge&&stR)return Ra(e,e.options.workDelay),!0}),t.highlightFrontier=A.line,t.modeFrontier=Math.max(t.modeFrontier,A.line),U.length&&Ti(e,function(){for(var $=0;$=R.viewFrom&&t.visible.to<=R.viewTo&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo)&&R.renderedView==R.view&&na(e)==0)return!1;ni(e)&&(Ln(e),t.dims=Pn(e));var U=A.first+A.size,$=Math.max(t.visible.from-e.options.viewportMargin,A.first),ae=Math.min(U,t.visible.to+e.options.viewportMargin);R.viewFrom<$&&$-R.viewFrom<20&&($=Math.max(A.first,R.viewFrom)),R.viewTo>ae&&R.viewTo-ae<20&&(ae=Math.min(U,R.viewTo)),Yt&&($=Zn(e.doc,$),ae=Si(e.doc,ae));var fe=$!=R.viewFrom||ae!=R.viewTo||R.lastWrapHeight!=t.wrapperHeight||R.lastWrapWidth!=t.wrapperWidth;ra(e,$,ae),R.viewOffset=si(Et(e.doc,R.viewFrom)),e.display.mover.style.top=R.viewOffset+"px";var me=na(e);if(!fe&&me==0&&!t.force&&R.renderedView==R.view&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo))return!1;var xe=Ro(e);return me>4&&(R.lineDiv.style.display="none"),ko(e,R.updateLineNumbers,t.dims),me>4&&(R.lineDiv.style.display=""),R.renderedView=R.view,Do(xe),E(R.cursorDiv),E(R.selectionDiv),R.gutters.style.height=R.sizer.style.minHeight=0,fe&&(R.lastWrapHeight=t.wrapperHeight,R.lastWrapWidth=t.wrapperWidth,Ra(e,400)),R.updateLineNumbers=null,!0}function Fa(e,t){for(var R=t.viewport,A=!0;;A=!1){if(!A||!e.options.lineWrapping||t.oldDisplayWidth==Fe(e)){if(R&&R.top!=null&&(R={top:Math.min(e.doc.height+Ne(e.display)-ve(e),R.top)}),t.visible=Ia(e.display,e.doc,R),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else A&&(t.visible=Ia(e.display,e.doc,R));if(!fa(e,t))break;Pa(e);var U=ca(e);mn(e),da(e,U),cn(e,U),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 Da(e,t){var R=new Ki(e,t);if(fa(e,R)){Pa(e),Fa(e,R);var A=ca(e);mn(e),da(e,A),cn(e,A),R.finish()}}function ko(e,t,R){var A=e.display,U=e.options.lineNumbers,$=A.lineDiv,ae=$.firstChild;function fe(ft){var yt=ft.nextSibling;return o&&s&&e.display.currentWheelTarget==ft?ft.style.display="none":ft.parentNode.removeChild(ft),yt}for(var me=A.view,xe=A.viewFrom,We=0;We-1&&(at=!1),Xi(e,Ge,xe,R)),at&&(E(Ge.lineNumber),Ge.lineNumber.appendChild(document.createTextNode(zr(e.options,xe)))),ae=Ge.node.nextSibling}xe+=Ge.size}for(;ae;)ae=fe(ae)}function Ba(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function cn(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+Qe(e)+"px"}function Wr(e){var t=e.display,R=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var A=bi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,U=t.gutters.offsetWidth,$=A+"px",ae=0;aeae.clientWidth,me=ae.scrollHeight>ae.clientHeight;if(!(A&&fe||U&&me))return;if(U&&s&&o){e:for(var xe=t.target,We=$.view;xe!=ae;xe=xe.parentNode)for(var Ge=0;Ge=0&&Ut(e,A.to())<=0)return R}return-1};var ln=function(e,t){this.anchor=e,this.head=t};ln.prototype.from=function(){return An(this.anchor,this.head)},ln.prototype.to=function(){return On(this.anchor,this.head)},ln.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Gi(e,t,R){var A=e&&e.options.selectionsMayTouch,U=t[R];t.sort(function(st,at){return Ut(st.from(),at.from())}),R=re(t,U);for(var $=1;$0:me>=0){var xe=An(fe.from(),ae.from()),We=On(fe.to(),ae.to()),Ge=fe.empty()?ae.from()==ae.head:fe.from()==fe.head;$<=R&&--R,t.splice(--$,2,new ln(Ge?We:xe,Ge?xe:We))}}return new Oi(t,R)}function qi(e,t){return new Oi([new ln(e,t||e)],0)}function ea(e){return e.text?mt(e.from.line+e.text.length-1,oe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function uo(e,t){if(Ut(e,t.from)<0)return e;if(Ut(e,t.to)<=0)return ea(t);var R=e.line+t.text.length-(t.to.line-t.from.line)-1,A=e.ch;return e.line==t.to.line&&(A+=ea(t).ch-t.to.ch),mt(R,A)}function Ha(e,t){for(var R=[],A=0;A1&&e.remove(fe.line+1,ft-1),e.insert(fe.line+1,Dt)}Er(e,"change",e,t)}function Sa(e,t,R){function A(U,$,ae){if(U.linked)for(var fe=0;fe1&&!e.done[e.done.length-2].ranges)return e.done.pop(),oe(e.done)}function xs(e,t,R,A){var U=e.history;U.undone.length=0;var $=+new Date,ae,fe;if((U.lastOp==A||U.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&U.lastModTime>$-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(ae=ml(U,U.lastOp==A)))fe=oe(ae.changes),Ut(t.from,t.to)==0&&Ut(t.from,fe.to)==0?fe.to=ea(t):ae.changes.push(rs(e,t));else{var me=oe(U.done);for((!me||!me.ranges)&&Io(e.sel,U.done),ae={changes:[rs(e,t)],generation:U.generation},U.done.push(ae);U.done.length>U.undoDepth;)U.done.shift(),U.done[0].ranges||U.done.shift()}U.done.push(R),U.generation=++U.maxGeneration,U.lastModTime=U.lastSelTime=$,U.lastOp=U.lastSelOp=A,U.lastOrigin=U.lastSelOrigin=t.origin,fe||Je(e,"historyAdded")}function gl(e,t,R,A){var U=t.charAt(0);return U=="*"||U=="+"&&R.ranges.length==A.ranges.length&&R.somethingSelected()==A.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,t,R,A){var U=e.history,$=A&&A.origin;R==U.lastSelOp||$&&U.lastSelOrigin==$&&(U.lastModTime==U.lastSelTime&&U.lastOrigin==$||gl(e,$,oe(U.done),t))?U.done[U.done.length-1]=t:Io(t,U.done),U.lastSelTime=+new Date,U.lastSelOrigin=$,U.lastSelOp=R,A&&A.clearRedo!==!1&&bs(U.undone)}function Io(e,t){var R=oe(t);R&&R.ranges&&R.equals(e)||t.push(e)}function Es(e,t,R,A){var U=t["spans_"+e.id],$=0;e.iter(Math.max(e.first,R),Math.min(e.first+e.size,A),function(ae){ae.markedSpans&&((U||(U=t["spans_"+e.id]={}))[$]=ae.markedSpans),++$})}function yl(e){if(!e)return null;for(var t,R=0;R-1&&(oe(fe)[Ge]=xe[Ge],delete xe[Ge]))}}return A}function ns(e,t,R,A){if(A){var U=e.anchor;if(R){var $=Ut(t,U)<0;$!=Ut(R,U)<0?(U=t,t=R):$!=Ut(t,R)<0&&(t=R)}return new ln(U,t)}else return new ln(R||t,t)}function No(e,t,R,A,U){U==null&&(U=e.cm&&(e.cm.display.shift||e.extend)),xi(e,new Oi([ns(e.sel.primary(),t,R,U)],0),A)}function Ss(e,t,R){for(var A=[],U=e.cm&&(e.cm.display.shift||e.extend),$=0;$=t.ch:fe.to>t.ch))){if(U&&(Je(me,"beforeCursorEnter"),me.explicitlyCleared))if($.markedSpans){--ae;continue}else break;if(!me.atomic)continue;if(R){var Ge=me.find(A<0?1:-1),st=void 0;if((A<0?We:xe)&&(Ge=Rs(e,Ge,-A,Ge&&Ge.line==t.line?$:null)),Ge&&Ge.line==t.line&&(st=Ut(Ge,R))&&(A<0?st<0:st>0))return Ka(e,Ge,t,A,U)}var at=me.find(A<0?-1:1);return(A<0?xe:We)&&(at=Rs(e,at,A,at.line==t.line?$:null)),at?Ka(e,at,t,A,U):null}}return t}function Uo(e,t,R,A,U){var $=A||1,ae=Ka(e,t,R,$,U)||!U&&Ka(e,t,R,$,!0)||Ka(e,t,R,-$,U)||!U&&Ka(e,t,R,-$,!0);return ae||(e.cantEdit=!0,mt(e.first,0))}function Rs(e,t,R,A){return R<0&&t.ch==0?t.line>e.first?z(e,mt(t.line-1)):null:R>0&&t.ch==(A||Et(e,t.line)).text.length?t.line=0;--U)Ls(e,{from:A[U].from,to:A[U].to,text:U?[""]:t.text,origin:t.origin});else Ls(e,t)}function Ls(e,t){if(t.text.length==1&&t.text[0]==""&&Ut(t.from,t.to)==0)return;var R=Ha(e,t);xs(e,t,R,e.cm?e.cm.curOp.id:NaN),ho(e,t,R,Qn(e,t));var A=[];Sa(e,function(U,$){!$&&re(A,U.history)==-1&&(Ns(U.history,t),A.push(U.history)),ho(U,t,null,Qn(U,t))})}function Fo(e,t,R){var A=e.cm&&e.cm.state.suppressEdits;if(A&&!R)return;for(var U=e.history,$,ae=e.sel,fe=t=="undo"?U.done:U.undone,me=t=="undo"?U.undone:U.done,xe=0;xe=0;--at){var ft=st(at);if(ft)return ft.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new Oi(Se(e.sel.ranges,function(U){return new ln(mt(U.anchor.line+t,U.anchor.ch),mt(U.head.line+t,U.head.ch))}),e.sel.primIndex),e.cm){vn(e.cm,e.first,e.first-t,t);for(var R=e.cm.display,A=R.viewFrom;Ae.lastLine())return;if(t.from.line$&&(t={from:t.from,to:mt($,Et(e,$).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ar(e,t.from,t.to),R||(R=Ha(e,t)),e.cm?El(e.cm,t,A):ts(e,t,A),jo(e,R,Ee),e.cantEdit&&Uo(e,mt(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,R){var A=e.doc,U=e.display,$=t.from,ae=t.to,fe=!1,me=$.line;e.options.lineWrapping||(me=Nt(Hn(Et(A,$.line))),A.iter(me,ae.line+1,function(at){if(at==U.maxLine)return fe=!0,!0})),A.sel.contains(t.from,t.to)>-1&&Ue(e),ts(A,t,R,Wi(e)),e.options.lineWrapping||(A.iter(me,$.line+t.text.length,function(at){var ft=pi(at);ft>U.maxLineLength&&(U.maxLine=at,U.maxLineLength=ft,U.maxLineChanged=!0,fe=!1)}),fe&&(e.curOp.updateMaxLine=!0)),Kr(A,$.line),Ra(e,400);var xe=t.text.length-(ae.line-$.line)-1;t.full?vn(e):$.line==ae.line&&t.text.length==1&&!gs(e.doc,t)?In(e,$.line,"text"):vn(e,$.line,ae.line+1,xe);var We=ke(e,"changes"),Ge=ke(e,"change");if(Ge||We){var st={from:$,to:ae,text:t.text,removed:t.removed,origin:t.origin};Ge&&Er(e,"change",e,st),We&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(st)}e.display.selForContextMenu=null}function Va(e,t,R,A,U){var $;A||(A=R),Ut(A,R)<0&&($=[A,R],R=$[0],A=$[1]),typeof t=="string"&&(t=e.splitLines(t)),Ga(e,{from:R,to:A,text:t,origin:U})}function Ps(e,t,R,A){R1||!(this.children[0]instanceof po))){var fe=[];this.collapse(fe),this.children=[new po(fe)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var ae=U.lines.length%25+25,fe=ae;fe10);e.parent.maybeSpill()},iterN:function(e,t,R){for(var A=0;Ae.display.maxLineLength&&(e.display.maxLine=xe,e.display.maxLineLength=We,e.display.maxLineChanged=!0)}A!=null&&e&&this.collapsed&&vn(e,A,U+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Er(e,"markerCleared",e,this,A,U),t&&ha(e),this.parent&&this.parent.clear()},Ca.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var R,A,U=0;U0||ae==0&&$.clearWhenEmpty!==!1)return $;if($.replacedWith&&($.collapsed=!0,$.widgetNode=N("span",[$.replacedWith],"CodeMirror-widget"),A.handleMouseEvents||$.widgetNode.setAttribute("cm-ignore-events","true"),A.insertLeft&&($.widgetNode.insertLeft=!0)),$.collapsed){if(hn(e,t.line,t,R,$)||t.line!=R.line&&hn(e,R.line,t,R,$))throw new Error("Inserting collapsed marker partially overlapping an existing one");dr()}$.addToHistory&&xs(e,{from:t,to:R,origin:"markText"},e.sel,NaN);var fe=t.line,me=e.cm,xe;if(e.iter(fe,R.line+1,function(Ge){me&&$.collapsed&&!me.options.lineWrapping&&Hn(Ge)==me.display.maxLine&&(xe=!0),$.collapsed&&fe!=t.line&&Xt(Ge,0),wi(Ge,new Jr($,fe==t.line?t.ch:null,fe==R.line?R.ch:null)),++fe}),$.collapsed&&e.iter(t.line,R.line+1,function(Ge){jn(e,Ge)&&Xt(Ge,0)}),$.clearOnEnter&&De($,"beforeCursorEnter",function(){return $.clear()}),$.readOnly&&(nr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),$.collapsed&&($.id=++Us,$.atomic=!0),me){if(xe&&(me.curOp.updateMaxLine=!0),$.collapsed)vn(me,t.line,R.line+1);else if($.className||$.startStyle||$.endStyle||$.css||$.attributes||$.title)for(var We=t.line;We<=R.line;We++)In(me,We,"text");$.atomic&&Os(me.doc),Er(me,"markerAdded",me,$)}return $}var vo=function(e,t){this.markers=e,this.primary=t;for(var R=0;R=0;me--)Ga(this,A[me]);fe?Ts(this,fe):this.cm&&ya(this.cm)}),undo:Vn(function(){Fo(this,"undo")}),redo:Vn(function(){Fo(this,"redo")}),undoSelection:Vn(function(){Fo(this,"undo",!0)}),redoSelection:Vn(function(){Fo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,R=0,A=0;A=e.ch)&&t.push(U.marker.parent||U.marker)}return t},findMarks:function(e,t,R){e=z(this,e),t=z(this,t);var A=[],U=e.line;return this.iter(e.line,t.line+1,function($){var ae=$.markedSpans;if(ae)for(var fe=0;fe=me.to||me.from==null&&U!=e.line||me.from!=null&&U==t.line&&me.from>=t.ch)&&(!R||R(me.marker))&&A.push(me.marker.parent||me.marker)}++U}),A},getAllMarks:function(){var e=[];return this.iter(function(t){var R=t.markedSpans;if(R)for(var A=0;Ae)return t=e,!0;e-=$,++R}),z(this,mt(R,t))},indexFromPos:function(e){e=z(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var We=e.dataTransfer.getData("Text");if(We){var Ge;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ge=t.listSelections()),jo(t.doc,qi(R,R)),Ge)for(var st=0;st=0;fe--)Va(e.doc,"",A[fe].from,A[fe].to,"+delete");ya(e)})}function as(e,t,R){var A=Re(e.text,t+R,R);return A<0||A>e.text.length?null:A}function os(e,t,R){var A=as(e,t.ch,R);return A==null?null:new mt(t.line,A,R<0?"after":"before")}function ss(e,t,R,A,U){if(e){t.doc.direction=="rtl"&&(U=-U);var $=ot(R,t.doc.direction);if($){var ae=U<0?oe($):$[0],fe=U<0==(ae.level==1),me=fe?"after":"before",xe;if(ae.level>0||t.doc.direction=="rtl"){var We=Xe(t,R);xe=U<0?R.text.length-1:0;var Ge=it(t,We,xe).top;xe=Ze(function(st){return it(t,We,st).top==Ge},U<0==(ae.level==1)?ae.from:ae.to-1,xe),me=="before"&&(xe=as(R,xe,1))}else xe=U<0?ae.to:ae.from;return new mt(A,xe,me)}}return new mt(A,U<0?R.text.length:0,U<0?"before":"after")}function Il(e,t,R,A){var U=ot(t,e.doc.direction);if(!U)return os(t,R,A);R.ch>=t.text.length?(R.ch=t.text.length,R.sticky="before"):R.ch<=0&&(R.ch=0,R.sticky="after");var $=nt(U,R.ch,R.sticky),ae=U[$];if(e.doc.direction=="ltr"&&ae.level%2==0&&(A>0?ae.to>R.ch:ae.from=ae.from&&st>=We.begin)){var at=Ge?"before":"after";return new mt(R.line,st,at)}}var ft=function(Dt,jt,kt){for(var Bt=function(Tn,ci){return ci?new mt(R.line,fe(Tn,1),"before"):new mt(R.line,Tn,"after")};Dt>=0&&Dt0==(ar.level!=1),kr=qt?kt.begin:fe(kt.end,-1);if(ar.from<=kr&&kr0?We.end:fe(We.begin,-1);return Ot!=null&&!(A>0&&Ot==t.text.length)&&(yt=ft(A>0?0:U.length-1,A,xe(Ot)),yt)?yt:null}var xo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ee)},killLine:function(e){return $a(e,function(t){if(t.empty()){var R=Et(e.doc,t.head.line).text.length;return t.head.ch==R&&t.head.line0)U=new mt(U.line,U.ch+1),e.replaceRange($.charAt(U.ch-1)+$.charAt(U.ch-2),mt(U.line,U.ch-2),U,"+transpose");else if(U.line>e.doc.first){var ae=Et(e.doc,U.line-1).text;ae&&(U=new mt(U.line,1),e.replaceRange($.charAt(0)+e.doc.lineSeparator()+ae.charAt(ae.length-1),mt(U.line-1,ae.length-1),U,"+transpose"))}}R.push(new ln(U,U))}e.setSelections(R)})},newlineAndIndent:function(e){return Ti(e,function(){for(var t=e.listSelections(),R=t.length-1;R>=0;R--)e.replaceRange(e.doc.lineSeparator(),t[R].anchor,t[R].head,"+input");t=e.listSelections();for(var A=0;Ae&&Ut(t,this.pos)==0&&R==this.button};var wo,So;function Hl(e,t){var R=+new Date;return So&&So.compare(R,e,t)?(wo=So=null,"triple"):wo&&wo.compare(R,e,t)?(So=new us(R,e,t),wo=null,"double"):(wo=new us(R,e,t),So=null,"single")}function tl(e){var t=this,R=t.display;if(tt(t,e)||R.activeTouch&&R.input.supportsTouch())return;if(R.input.ensurePolled(),R.shift=e.shiftKey,Yn(R,e)){o||(R.scroller.draggable=!1,setTimeout(function(){return R.scroller.draggable=!0},100));return}if(cs(t,e))return;var A=ti(t,e),U=Ke(e),$=A?Hl(A,U):"single";if(window.focus(),U==1&&t.state.selectingText&&t.state.selectingText(e),A&&zl(t,U,A,$,e))return;U==1?A?Gl(t,A,$,e):$e(e)==R.scroller&&ye(e):U==2?(A&&No(t.doc,A),setTimeout(function(){return R.input.focus()},20)):U==3&&(k?t.display.input.onContextMenu(e):eo(t))}function zl(e,t,R,A,U){var $="Click";return A=="double"?$="Double"+$:A=="triple"&&($="Triple"+$),$=(t==1?"Left":t==2?"Middle":"Right")+$,Eo(e,Gs($,U),U,function(ae){if(typeof ae=="string"&&(ae=xo[ae]),!ae)return!1;var fe=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),fe=ae(e,R)!=Ce}finally{e.state.suppressEdits=!1}return fe})}function Kl(e,t,R){var A=e.getOption("configureMouse"),U=A?A(e,t,R):{};if(U.unit==null){var $=d?R.shiftKey&&R.metaKey:R.altKey;U.unit=$?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(U.extend==null||e.doc.extend)&&(U.extend=e.doc.extend||R.shiftKey),U.addNew==null&&(U.addNew=s?R.metaKey:R.ctrlKey),U.moveOnDrag==null&&(U.moveOnDrag=!(s?R.altKey:R.ctrlKey)),U}function Gl(e,t,R,A){C?setTimeout(F(To,e),0):e.curOp.focus=V();var U=Kl(e,R,A),$=e.doc.sel,ae;e.options.dragDrop&&ct&&!e.isReadOnly()&&R=="single"&&(ae=$.contains(t))>-1&&(Ut((ae=$.ranges[ae]).from(),t)<0||t.xRel>0)&&(Ut(ae.to(),t)>0||t.xRel<0)?Vl(e,A,t,U):Xl(e,A,t,U)}function Vl(e,t,R,A){var U=e.display,$=!1,ae=Gn(e,function(xe){o&&(U.scroller.draggable=!1),e.state.draggingText=!1,lt(U.wrapper.ownerDocument,"mouseup",ae),lt(U.wrapper.ownerDocument,"mousemove",fe),lt(U.scroller,"dragstart",me),lt(U.scroller,"drop",ae),$||(ye(xe),A.addNew||No(e.doc,R,null,null,A.extend),o&&!m||C&&v==9?setTimeout(function(){U.wrapper.ownerDocument.body.focus({preventScroll:!0}),U.input.focus()},20):U.input.focus())}),fe=function(xe){$=$||Math.abs(t.clientX-xe.clientX)+Math.abs(t.clientY-xe.clientY)>=10},me=function(){return $=!0};o&&(U.scroller.draggable=!0),e.state.draggingText=ae,ae.copy=!A.moveOnDrag,U.scroller.dragDrop&&U.scroller.dragDrop(),De(U.wrapper.ownerDocument,"mouseup",ae),De(U.wrapper.ownerDocument,"mousemove",fe),De(U.scroller,"dragstart",me),De(U.scroller,"drop",ae),eo(e),setTimeout(function(){return U.input.focus()},20)}function rl(e,t,R){if(R=="char")return new ln(t,t);if(R=="word")return e.findWordAt(t);if(R=="line")return new ln(mt(t.line,0),z(e.doc,mt(t.line+1,0)));var A=R(e,t);return new ln(A.from,A.to)}function Xl(e,t,R,A){var U=e.display,$=e.doc;ye(t);var ae,fe,me=$.sel,xe=me.ranges;if(A.addNew&&!A.extend?(fe=$.sel.contains(R),fe>-1?ae=xe[fe]:ae=new ln(R,R)):(ae=$.sel.primary(),fe=$.sel.primIndex),A.unit=="rectangle")A.addNew||(ae=new ln(R,R)),R=ti(e,t,!0,!0),fe=-1;else{var We=rl(e,R,A.unit);A.extend?ae=ns(ae,We.anchor,We.head,A.extend):ae=We}A.addNew?fe==-1?(fe=xe.length,xi($,Gi(e,xe.concat([ae]),fe),{scroll:!1,origin:"*mouse"})):xe.length>1&&xe[fe].empty()&&A.unit=="char"&&!A.extend?(xi($,Gi(e,xe.slice(0,fe).concat(xe.slice(fe+1)),0),{scroll:!1,origin:"*mouse"}),me=$.sel):is($,fe,ae,pe):(fe=0,xi($,new Oi([ae],0),pe),me=$.sel);var Ge=R;function st(kt){if(Ut(Ge,kt)==0)return;if(Ge=kt,A.unit=="rectangle"){for(var Bt=[],ar=e.options.tabSize,qt=H(Et($,R.line).text,R.ch,ar),kr=H(Et($,kt.line).text,kt.ch,ar),Tn=Math.min(qt,kr),ci=Math.max(qt,kr),Un=Math.min(R.line,kt.line),Ui=Math.min(e.lastLine(),Math.max(R.line,kt.line));Un<=Ui;Un++){var Mi=Et($,Un).text,$n=_e(Mi,Tn,ar);Tn==ci?Bt.push(new ln(mt(Un,$n),mt(Un,$n))):Mi.length>$n&&Bt.push(new ln(mt(Un,$n),mt(Un,_e(Mi,ci,ar))))}Bt.length||Bt.push(new ln(R,R)),xi($,Gi(e,me.ranges.slice(0,fe).concat(Bt),fe),{origin:"*mouse",scroll:!1}),e.scrollIntoView(kt)}else{var Pi=ae,vi=rl(e,kt,A.unit),ai=Pi.anchor,Jn;Ut(vi.anchor,ai)>0?(Jn=vi.head,ai=An(Pi.from(),vi.anchor)):(Jn=vi.anchor,ai=On(Pi.to(),vi.head));var Wn=me.ranges.slice(0);Wn[fe]=Yl(e,new ln(z($,ai),Jn)),xi($,Gi(e,Wn,fe),pe)}}var at=U.wrapper.getBoundingClientRect(),ft=0;function yt(kt){var Bt=++ft,ar=ti(e,kt,!0,A.unit=="rectangle");if(!ar)return;if(Ut(ar,Ge)!=0){e.curOp.focus=V(),st(ar);var qt=Ia(U,$);(ar.line>=qt.to||ar.lineat.bottom?20:0;kr&&setTimeout(Gn(e,function(){if(ft!=Bt)return;U.scroller.scrollTop+=kr,yt(kt)}),50)}}function Ot(kt){e.state.selectingText=!1,ft=Infinity,kt&&(ye(kt),U.input.focus()),lt(U.wrapper.ownerDocument,"mousemove",Dt),lt(U.wrapper.ownerDocument,"mouseup",jt),$.history.lastSelOrigin=null}var Dt=Gn(e,function(kt){kt.buttons===0||!Ke(kt)?Ot(kt):yt(kt)}),jt=Gn(e,Ot);e.state.selectingText=jt,De(U.wrapper.ownerDocument,"mousemove",Dt),De(U.wrapper.ownerDocument,"mouseup",jt)}function Yl(e,t){var R=t.anchor,A=t.head,U=Et(e.doc,R.line);if(Ut(R,A)==0&&R.sticky==A.sticky)return t;var $=ot(U);if(!$)return t;var ae=nt($,R.ch,R.sticky),fe=$[ae];if(fe.from!=R.ch&&fe.to!=R.ch)return t;var me=ae+(fe.from==R.ch==(fe.level!=1)?0:1);if(me==0||me==$.length)return t;var xe;if(A.line!=R.line)xe=(A.line-R.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var We=nt($,A.ch,A.sticky),Ge=We-ae||(A.ch-R.ch)*(fe.level==1?-1:1);We==me-1||We==me?xe=Ge<0:xe=Ge>0}var st=$[me+(xe?-1:0)],at=xe==(st.level==1),ft=at?st.from:st.to,yt=at?"after":"before";return R.ch==ft&&R.sticky==yt?t:new ln(new mt(R.line,ft,yt),A)}function nl(e,t,R,A){var U,$;if(t.touches)U=t.touches[0].clientX,$=t.touches[0].clientY;else try{U=t.clientX,$=t.clientY}catch(st){return!1}if(U>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;A&&ye(t);var ae=e.display,fe=ae.lineDiv.getBoundingClientRect();if($>fe.bottom||!ke(e,R))return Ae(t);$-=fe.top-ae.viewOffset;for(var me=0;me=U){var We=jr(e.doc,$),Ge=e.display.gutterSpecs[me];return Je(e,R,e,We,Ge.className,t),Ae(t)}}}function cs(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){if(Yn(e.display,t)||$l(e,t))return;if(tt(e,t,"contextmenu"))return;k||e.display.input.onContextMenu(t)}function $l(e,t){return ke(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yr(e)}var Ja={toString:function(){return"CodeMirror.Init"}},ol={},zo={};function Jl(e){var t=e.optionHandlers;function R(A,U,$,ae){e.defaults[A]=U,$&&(t[A]=ae?function(fe,me,xe){xe!=Ja&&$(fe,me,xe)}:$)}e.defineOption=R,e.Init=Ja,R("value","",function(A,U){return A.setValue(U)},!0),R("mode",null,function(A,U){A.doc.modeOption=U,pa(A)},!0),R("indentUnit",2,pa,!0),R("indentWithTabs",!1),R("smartIndent",!0),R("tabSize",4,function(A){co(A),yr(A),vn(A)},!0),R("lineSeparator",null,function(A,U){if(A.doc.lineSep=U,!U)return;var $=[],ae=A.doc.first;A.doc.iter(function(me){for(var xe=0;;){var We=me.text.indexOf(U,xe);if(We==-1)break;xe=We+U.length,$.push(mt(ae,We))}ae++});for(var fe=$.length-1;fe>=0;fe--)Va(A.doc,U,$[fe],mt($[fe].line,$[fe].ch+U.length))}),R("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(A,U,$){A.state.specialChars=new RegExp(U.source+(U.test(" ")?"":"| "),"g"),$!=Ja&&A.refresh()}),R("specialCharPlaceholder",xr,function(A){return A.refresh()},!0),R("electricChars",!0),R("inputStyle",n?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),R("spellcheck",!1,function(A,U){return A.getInputField().spellcheck=U},!0),R("autocorrect",!1,function(A,U){return A.getInputField().autocorrect=U},!0),R("autocapitalize",!1,function(A,U){return A.getInputField().autocapitalize=U},!0),R("rtlMoveVisually",!S),R("wholeLineUpdateBefore",!0),R("theme","default",function(A){al(A),Zi(A)},!0),R("keyMap","default",function(A,U,$){var ae=Wo(U),fe=$!=Ja&&Wo($);fe&&fe.detach&&fe.detach(A,ae),ae.attach&&ae.attach(A,fe||null)}),R("extraKeys",null),R("configureMouse",null),R("lineWrapping",!1,Zl,!0),R("gutters",[],function(A,U){A.display.gutterSpecs=_i(U,A.options.lineNumbers),Zi(A)},!0),R("fixedGutter",!0,function(A,U){A.display.gutters.style.left=U?bi(A.display)+"px":"0",A.refresh()},!0),R("coverGutterNextToScrollbar",!1,function(A){return da(A)},!0),R("scrollbarStyle","native",function(A){Ua(A),da(A),A.display.scrollbars.setScrollTop(A.doc.scrollTop),A.display.scrollbars.setScrollLeft(A.doc.scrollLeft)},!0),R("lineNumbers",!1,function(A,U){A.display.gutterSpecs=_i(A.options.gutters,U),Zi(A)},!0),R("firstLineNumber",1,Zi,!0),R("lineNumberFormatter",function(A){return A},Zi,!0),R("showCursorWhenSelecting",!1,mn,!0),R("resetSelectionOnContextMenu",!0),R("lineWiseCopyCut",!0),R("pasteLinesPerSelection",!0),R("selectionsMayTouch",!1),R("readOnly",!1,function(A,U){U=="nocursor"&&(va(A),A.display.input.blur()),A.display.input.readOnlyChanged(U)}),R("screenReaderLabel",null,function(A,U){U=U===""?null:U,A.display.input.screenReaderLabelChanged(U)}),R("disableInput",!1,function(A,U){U||A.display.input.reset()},!0),R("dragDrop",!0,Ql),R("allowDropFileTypes",null),R("cursorBlinkRate",530),R("cursorScrollMargin",0),R("cursorHeight",1,mn,!0),R("singleCursorHeightPerLine",!0,mn,!0),R("workTime",100),R("workDelay",100),R("flattenSpans",!0,co,!0),R("addModeClass",!1,co,!0),R("pollInterval",100),R("undoDepth",200,function(A,U){return A.doc.history.undoDepth=U}),R("historyEventDelay",1250),R("viewportMargin",10,function(A){return A.refresh()},!0),R("maxHighlightLength",1e4,co,!0),R("moveInputWithCursor",!0,function(A,U){U||A.display.input.resetPosition()}),R("tabindex",null,function(A,U){return A.display.input.getField().tabIndex=U||""}),R("autofocus",null),R("direction","ltr",function(A,U){return A.doc.setDirection(U)},!0),R("phrases",null)}function Ql(e,t,R){var A=R&&R!=Ja;if(!t!=!A){var U=e.display.dragFunctions,$=t?De:lt;$(e.display.scroller,"dragstart",U.start),$(e.display.scroller,"dragenter",U.enter),$(e.display.scroller,"dragover",U.over),$(e.display.scroller,"dragleave",U.leave),$(e.display.scroller,"drop",U.drop)}}function Zl(e){e.options.lineWrapping?(K(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(b(e.display.wrapper,"CodeMirror-wrap"),Bi(e)),Ci(e),vn(e),yr(e),setTimeout(function(){return da(e)},100)}function Nn(e,t){var R=this;if(!(this instanceof Nn))return new Nn(e,t);this.options=t=t?B(t):{},B(ol,t,!1);var A=t.value;typeof A=="string"?A=new Li(A,t.mode,null,t.lineSeparator,t.direction):t.mode&&(A.modeOption=t.mode),this.doc=A;var U=new Nn.inputStyles[t.inputStyle](this),$=this.display=new ka(e,A,U,t);$.wrapper.CodeMirror=this,al(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ua(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new q,keySeq:null,specialChars:null},t.autofocus&&!n&&$.input.focus(),C&&v<11&&setTimeout(function(){return R.display.input.reset(!0)},20),ql(this),Dl(),sa(this),this.curOp.forceUpdate=!0,vs(this,A),t.autofocus&&!n||this.hasFocus()?setTimeout(function(){R.hasFocus()&&!R.state.focused&&aa(R)},20):va(this);for(var ae in zo)zo.hasOwnProperty(ae)&&zo[ae](this,t[ae],Ja);ni(this),t.finishInit&&t.finishInit(this);for(var fe=0;fe20*20}De(t.scroller,"touchstart",function(me){if(!tt(e,me)&&!$(me)&&!cs(e,me)){t.input.ensurePolled(),clearTimeout(R);var xe=+new Date;t.activeTouch={start:xe,moved:!1,prev:xe-A.end<=300?A:null},me.touches.length==1&&(t.activeTouch.left=me.touches[0].pageX,t.activeTouch.top=me.touches[0].pageY)}}),De(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),De(t.scroller,"touchend",function(me){var xe=t.activeTouch;if(xe&&!Yn(t,me)&&xe.left!=null&&!xe.moved&&new Date-xe.start<300){var We=e.coordsChar(t.activeTouch,"page"),Ge;!xe.prev||ae(xe,xe.prev)?Ge=new ln(We,We):!xe.prev.prev||ae(xe,xe.prev.prev)?Ge=e.findWordAt(We):Ge=new ln(mt(We.line,0),z(e.doc,mt(We.line+1,0))),e.setSelection(Ge.anchor,Ge.head),e.focus(),ye(me)}U()}),De(t.scroller,"touchcancel",U),De(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xa(e,t.scroller.scrollTop),zi(e,t.scroller.scrollLeft,!0),Je(e,"scroll",e))}),De(t.scroller,"mousewheel",function(me){return lo(e,me)}),De(t.scroller,"DOMMouseScroll",function(me){return lo(e,me)}),De(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(me){tt(e,me)||Pe(me)},over:function(me){tt(e,me)||(Rl(e,me),Pe(me))},start:function(me){return Al(e,me)},drop:Gn(e,Ol),leave:function(me){tt(e,me)||Ws(e)}};var fe=t.input.getField();De(fe,"keyup",function(me){return Zs.call(e,me)}),De(fe,"keydown",Gn(e,Qs)),De(fe,"keypress",Gn(e,el)),De(fe,"focus",function(me){return aa(e,me)}),De(fe,"blur",function(me){return va(e,me)})}var ds=[];Nn.defineInitHook=function(e){return ds.push(e)};function Co(e,t,R,A){var U=e.doc,$;R==null&&(R="add"),R=="smart"&&(U.mode.indent?$=St(e,t).state:R="prev");var ae=e.options.tabSize,fe=Et(U,t),me=H(fe.text,null,ae);fe.stateAfter&&(fe.stateAfter=null);var xe=fe.text.match(/^\s*/)[0],We;if(!A&&!/\S/.test(fe.text))We=0,R="not";else if(R=="smart"&&(We=U.mode.indent($,fe.text.slice(xe.length),fe.text),We==Ce||We>150)){if(!A)return;R="prev"}R=="prev"?t>U.first?We=H(Et(U,t-1).text,null,ae):We=0:R=="add"?We=me+e.options.indentUnit:R=="subtract"?We=me-e.options.indentUnit:typeof R=="number"&&(We=me+R),We=Math.max(0,We);var Ge="",st=0;if(e.options.indentWithTabs)for(var at=Math.floor(We/ae);at;--at)st+=ae,Ge+=" ";if(stae,me=Lt(t),xe=null;if(fe&&A.ranges.length>1)if(ta&&ta.text.join(` `)==t){if(A.ranges.length%ta.text.length==0){xe=[];for(var We=0;We=0;st--){var at=A.ranges[st],ft=at.from(),yt=at.to();at.empty()&&(R&&R>0?ft=mt(ft.line,ft.ch-R):e.state.overwrite&&!fe?yt=mt(yt.line,Math.min(Et($,yt.line).text.length,yt.ch+oe(me).length)):fe&&ta&&ta.lineWise&&ta.text.join(` `)==me.join(` `)&&(ft=yt=mt(ft.line,0)));var Ot={from:ft,to:yt,text:xe?xe[st%xe.length]:me,origin:U||(fe?"paste":e.state.cutIncoming>ae?"cut":"+input")};Ga(e.doc,Ot),Er(e,"inputRead",e,Ot)}t&&!fe&&ll(e,t),ya(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ge),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var R=e.clipboardData&&e.clipboardData.getData("Text");if(R)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ti(t,function(){return hs(t,R,0,null,"paste")}),!0}function ll(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var R=e.doc.sel,A=R.ranges.length-1;A>=0;A--){var U=R.ranges[A];if(U.head.ch>100||A&&R.ranges[A-1].head.line==U.head.line)continue;var $=e.getModeAt(U.head),ae=!1;if($.electricChars){for(var fe=0;fe<$.electricChars.length;fe++)if(t.indexOf($.electricChars.charAt(fe))>-1){ae=Co(e,U.head.line,"smart");break}}else $.electricInput&&($.electricInput.test(Et(e.doc,U.head.line).text.slice(0,U.head.ch))&&(ae=Co(e,U.head.line,"smart")));ae&&Er(e,"electricInput",e,U.head.line)}}function ul(e){for(var t=[],R=[],A=0;A$&&(Co(this,fe.head.line,A,!0),$=fe.head.line,ae==this.doc.sel.primIndex&&ya(this));else{var me=fe.from(),xe=fe.to(),We=Math.max($,me.line);$=Math.min(this.lastLine(),xe.line-(xe.ch?0:1))+1;for(var Ge=We;Ge<$;++Ge)Co(this,Ge,A);var st=this.doc.sel.ranges;me.ch==0&&U.length==st.length&&st[ae].from().ch>0&&is(this.doc,ae,new ln(me,st[ae].to()),Ee)}}}),getTokenAt:function(A,U){return Mr(this,A,U)},getLineTokens:function(A,U){return Mr(this,mt(A),U,!0)},getTokenTypeAt:function(A){A=z(this.doc,A);var U=ht(this,Et(this.doc,A.line)),$=0,ae=(U.length-1)/2,fe=A.ch,me;if(fe==0)me=U[2];else for(;;){var xe=$+ae>>1;if((xe?U[xe*2-1]:0)>=fe)ae=xe;else if(U[xe*2+1]me&&(A=me,ae=!0),fe=Et(this.doc,A)}else fe=A;return Xr(this,fe,{top:0,left:0},U||"page",$||ae).top+(ae?this.doc.height-si(fe):0)},defaultTextHeight:function(){return Bn(this.display)},defaultCharWidth:function(){return ei(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(A,U,$,ae,fe){var me=this.display;A=Nr(this,z(this.doc,A));var xe=A.bottom,We=A.left;if(U.style.position="absolute",U.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(U),me.sizer.appendChild(U),ae=="over")xe=A.top;else if(ae=="above"||ae=="near"){var Ge=Math.max(me.wrapper.clientHeight,this.doc.height),st=Math.max(me.sizer.clientWidth,me.lineSpace.clientWidth);(ae=="above"||A.bottom+U.offsetHeight>Ge)&&A.top>U.offsetHeight?xe=A.top-U.offsetHeight:A.bottom+U.offsetHeight<=Ge&&(xe=A.bottom),We+U.offsetWidth>st&&(We=st-U.offsetWidth)}U.style.top=xe+"px",U.style.left=U.style.right="",fe=="right"?(We=me.sizer.clientWidth-U.offsetWidth,U.style.right="0px"):(fe=="left"?We=0:fe=="middle"&&(We=(me.sizer.clientWidth-U.offsetWidth)/2),U.style.left=We+"px"),$&&_o(this,{left:We,top:xe,right:We+U.offsetWidth,bottom:xe+U.offsetHeight})},triggerOnKeyDown:gi(Qs),triggerOnKeyPress:gi(el),triggerOnKeyUp:Zs,triggerOnMouseDown:gi(tl),execCommand:function(A){if(xo.hasOwnProperty(A))return xo[A].call(null,this)},triggerElectric:gi(function(A){ll(this,A)}),findPosH:function(A,U,$,ae){var fe=1;U<0&&(fe=-1,U=-U);for(var me=z(this.doc,A),xe=0;xe0&&We($.charAt(ae-1));)--ae;for(;fe<$.length&&We($.charAt(fe));)++fe}return new ln(mt(A.line,ae),mt(A.line,fe))},toggleOverwrite:function(A){if(A!=null&&A==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?K(this.display.cursorDiv,"CodeMirror-overwrite"):b(this.display.cursorDiv,"CodeMirror-overwrite"),Je(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==V()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:gi(function(A,U){ba(this,A,U)}),getScrollInfo:function(){var A=this.display.scroller;return{left:A.scrollLeft,top:A.scrollTop,height:A.scrollHeight-Qe(this)-this.display.barHeight,width:A.scrollWidth-Qe(this)-this.display.barWidth,clientHeight:ve(this),clientWidth:Fe(this)}},scrollIntoView:gi(function(A,U){A==null?(A={from:this.doc.sel.primary().head,to:null},U==null&&(U=this.options.cursorScrollMargin)):typeof A=="number"?A={from:mt(A,0),to:null}:A.from==null&&(A={from:A,to:null}),A.to||(A.to=A.from),A.margin=U||0,A.from.line!=null?$o(this,A):Oa(this,A.from,A.to,A.margin)}),setSize:gi(function(A,U){var $=this,ae=function(me){return typeof me=="number"||/^\d+$/.test(String(me))?me+"px":me};A!=null&&(this.display.wrapper.style.width=ae(A)),U!=null&&(this.display.wrapper.style.height=ae(U)),this.options.lineWrapping&&gr(this);var fe=this.display.viewFrom;this.doc.iter(fe,this.display.viewTo,function(me){if(me.widgets){for(var xe=0;xe.5||this.options.lineWrapping)&&Ci(this),Je(this,"refresh",this)}),swapDoc:gi(function(A){var U=this.doc;return U.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,A),yr(this),this.display.input.reset(),ba(this,A.scrollLeft,A.scrollTop),this.curOp.forceScroll=!0,Er(this,"swapDoc",this,U),U}),phrase:function(A){var U=this.options.phrases;return U&&Object.prototype.hasOwnProperty.call(U,A)?U[A]:A},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}},Ie(e),e.registerHelper=function(A,U,$){R.hasOwnProperty(A)||(R[A]=e[A]={_global:[]}),R[A][U]=$},e.registerGlobalHelper=function(A,U,$,ae){e.registerHelper(A,U,ae),R[A]._global.push({pred:$,val:ae})}}function fs(e,t,R,A,U){var $=t,ae=R,fe=Et(e,t.line),me=U&&e.direction=="rtl"?-R:R;function xe(){var jt=t.line+me;return jt=e.first+e.size?!1:(t=new mt(jt,t.ch,t.sticky),fe=Et(e,jt))}function We(jt){var kt;if(A=="codepoint"){var Bt=fe.text.charCodeAt(t.ch+(A>0?0:-1));isNaN(Bt)?kt=null:kt=new mt(t.line,Math.max(0,Math.min(fe.text.length,t.ch+R*(Bt>=55296&&Bt<56320?2:1))),-R)}else U?kt=Il(e.cm,fe,t,R):kt=os(fe,t,R);if(kt==null)if(!jt&&xe())t=ss(U,e.cm,fe,t.line,me);else return!1;else t=kt;return!0}if(A=="char"||A=="codepoint")We();else if(A=="column")We(!0);else if(A=="word"||A=="group")for(var Ge=null,st=A=="group",at=e.cm&&e.cm.getHelper(t,"wordChars"),ft=!0;!(R<0&&!We(!ft));ft=!1){var yt=fe.text.charAt(t.ch)||` `,Ot=Y(yt,at)?"w":st&&yt==` `?"n":!st||/\s/.test(yt)?null:"p";if(st&&!ft&&!Ot&&(Ot="s"),Ge&&Ge!=Ot){R<0&&(R=1,We(),t.sticky="after");break}if(Ot&&(Ge=Ot),R>0&&!We(!ft))break}var Dt=Uo(e,t,$,ae,!0);return an($,Dt)&&(Dt.hitSide=!0),Dt}function hl(e,t,R,A){var U=e.doc,$=t.left,ae;if(A=="page"){var fe=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),me=Math.max(fe-.5*Bn(e.display),3);ae=(R>0?t.bottom:t.top)+R*me}else A=="line"&&(ae=R>0?t.bottom+3:t.top-3);for(var xe;!(xe=Ur(e,$,ae),!xe.outside);){if(R<0?ae<=0:ae>=U.height){xe.hitSide=!0;break}ae+=R*5}return xe}var yn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};yn.prototype.init=function(e){var t=this,R=this,A=R.cm,U=R.div=e.lineDiv;cl(U,A.options.spellcheck,A.options.autocorrect,A.options.autocapitalize);function $(fe){for(var me=fe.target;me;me=me.parentNode){if(me==U)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(me.className))break}return!1}De(U,"paste",function(fe){if(!$(fe)||tt(A,fe)||sl(fe,A))return;v<=11&&setTimeout(Gn(A,function(){return t.updateFromDOM()}),20)}),De(U,"compositionstart",function(fe){t.composing={data:fe.data,done:!1}}),De(U,"compositionupdate",function(fe){t.composing||(t.composing={data:fe.data,done:!1})}),De(U,"compositionend",function(fe){t.composing&&(fe.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),De(U,"touchstart",function(){return R.forceCompositionEnd()}),De(U,"input",function(){t.composing||t.readFromDOMSoon()});function ae(fe){if(!$(fe)||tt(A,fe))return;if(A.somethingSelected())Ko({lineWise:!1,text:A.getSelections()}),fe.type=="cut"&&A.replaceSelection("",null,"cut");else if(A.options.lineWiseCopyCut){var me=ul(A);Ko({lineWise:!0,text:me.text}),fe.type=="cut"&&A.operation(function(){A.setSelections(me.ranges,0,Ee),A.replaceSelection("",null,"cut")})}else return;if(fe.clipboardData){fe.clipboardData.clearData();var xe=ta.text.join(` `);if(fe.clipboardData.setData("Text",xe),fe.clipboardData.getData("Text")==xe){fe.preventDefault();return}}var We=dl(),Ge=We.firstChild;A.display.lineSpace.insertBefore(We,A.display.lineSpace.firstChild),Ge.value=ta.text.join(` `);var st=document.activeElement;G(Ge),setTimeout(function(){A.display.lineSpace.removeChild(We),st.focus(),st==U&&R.showPrimarySelection()},50)}De(U,"copy",ae),De(U,"cut",ae)},yn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},yn.prototype.prepareSelection=function(){var e=Ji(this.cm,!1);return e.focus=document.activeElement==this.div,e},yn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},yn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},yn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,R=t.doc.sel.primary(),A=R.from(),U=R.to();if(t.display.viewTo==t.display.viewFrom||A.line>=t.display.viewTo||U.line=t.display.viewFrom&&fl(t,A)||{node:fe[0].measure.map[2],offset:0},xe=U.linee.firstLine()&&(A=mt(A.line-1,Et(e.doc,A.line-1).length)),U.ch==Et(e.doc,U.line).text.length&&U.linet.viewTo-1)return!1;var $,ae,fe;A.line==t.viewFrom||($=Cn(e,A.line))==0?(ae=Nt(t.view[0].line),fe=t.view[0].node):(ae=Nt(t.view[$].line),fe=t.view[$-1].node.nextSibling);var me=Cn(e,U.line),xe,We;if(me==t.view.length-1?(xe=t.viewTo-1,We=t.lineDiv.lastChild):(xe=Nt(t.view[me+1].line)-1,We=t.view[me+1].node.previousSibling),!fe)return!1;for(var Ge=e.doc.splitLines(ru(e,fe,We,ae,xe)),st=Ar(e.doc,mt(ae,0),mt(xe,Et(e.doc,xe).text.length));Ge.length>1&&st.length>1;)if(oe(Ge)==oe(st))Ge.pop(),st.pop(),xe--;else if(Ge[0]==st[0])Ge.shift(),st.shift(),ae++;else break;for(var at=0,ft=0,yt=Ge[0],Ot=st[0],Dt=Math.min(yt.length,Ot.length);atA.ch&&jt.charCodeAt(jt.length-ft-1)==kt.charCodeAt(kt.length-ft-1);)at--,ft++;Ge[Ge.length-1]=jt.slice(0,jt.length-ft).replace(/^\u200b+/,""),Ge[0]=Ge[0].slice(at).replace(/\u200b+$/,"");var ar=mt(ae,at),qt=mt(xe,st.length?oe(st).length-ft:0);if(Ge.length>1||Ge[0]||Ut(ar,qt))return Va(e.doc,Ge,ar,qt,"+input"),!0},yn.prototype.ensurePolled=function(){this.forceCompositionEnd()},yn.prototype.reset=function(){this.forceCompositionEnd()},yn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},yn.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)},yn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ti(this.cm,function(){return vn(e.cm)})},yn.prototype.setUneditable=function(e){e.contentEditable="false"},yn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Gn(this.cm,hs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},yn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},yn.prototype.onContextMenu=function(){},yn.prototype.resetPosition=function(){},yn.prototype.needsContentAttribute=!0;function fl(e,t){var R=Ye(e,t.line);if(!R||R.hidden)return null;var A=Et(e.doc,t.line),U=we(R,A,t.line),$=ot(A,e.doc.direction),ae="left";if($){var fe=nt($,t.ch);ae=fe%2?"right":"left"}var me=xt(U.map,t.ch,ae);return me.offset=me.collapse=="right"?me.end:me.start,me}function tu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Qa(e,t){return t&&(e.bad=!0),e}function ru(e,t,R,A,U){var $="",ae=!1,fe=e.doc.lineSeparator(),me=!1;function xe(at){return function(ft){return ft.id==at}}function We(){ae&&($+=fe,me&&($+=fe),ae=me=!1)}function Ge(at){at&&(We(),$+=at)}function st(at){if(at.nodeType==1){var ft=at.getAttribute("cm-text");if(ft){Ge(ft);return}var yt=at.getAttribute("cm-marker"),Ot;if(yt){var Dt=e.findMarks(mt(A,0),mt(U+1,0),xe(+yt));Dt.length&&(Ot=Dt[0].find(0))&&Ge(Ar(e.doc,Ot.from,Ot.to).join(fe));return}if(at.getAttribute("contenteditable")=="false")return;var jt=/^(pre|div|p|li|table|br)$/i.test(at.nodeName);if(!/^br$/i.test(at.nodeName)&&at.textContent.length==0)return;jt&&We();for(var kt=0;kt=9&&t.hasSelection&&(t.hasSelection=null),R.poll()}),De(U,"paste",function(ae){if(tt(A,ae)||sl(ae,A))return;A.state.pasteIncoming=+new Date,R.fastPoll()});function $(ae){if(tt(A,ae))return;if(A.somethingSelected())Ko({lineWise:!1,text:A.getSelections()});else if(A.options.lineWiseCopyCut){var fe=ul(A);Ko({lineWise:!0,text:fe.text}),ae.type=="cut"?A.setSelections(fe.ranges,null,Ee):(R.prevInput="",U.value=fe.text.join(` `),G(U))}else return;ae.type=="cut"&&(A.state.cutIncoming=+new Date)}De(U,"cut",$),De(U,"copy",$),De(e.scroller,"paste",function(ae){if(Yn(e,ae)||tt(A,ae))return;if(!U.dispatchEvent){A.state.pasteIncoming=+new Date,R.focus();return}var fe=new Event("paste");fe.clipboardData=ae.clipboardData,U.dispatchEvent(fe)}),De(e.lineSpace,"selectstart",function(ae){Yn(e,ae)||ye(ae)}),De(U,"compositionstart",function(){var ae=A.getCursor("from");R.composing&&R.composing.range.clear(),R.composing={start:ae,range:A.markText(ae,A.getCursor("to"),{className:"CodeMirror-composing"})}}),De(U,"compositionend",function(){R.composing&&(R.poll(),R.composing.range.clear(),R.composing=null)})},Xn.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},Xn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Xn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,R=e.doc,A=Ji(e);if(e.options.moveInputWithCursor){var U=Nr(e,R.sel.primary().head,"div"),$=t.wrapper.getBoundingClientRect(),ae=t.lineDiv.getBoundingClientRect();A.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,U.top+ae.top-$.top)),A.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,U.left+ae.left-$.left))}return A},Xn.prototype.showSelection=function(e){var t=this.cm,R=t.display;x(R.cursorDiv,e.cursors),x(R.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Xn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var R=t.getSelection();this.textarea.value=R,t.state.focused&&G(this.textarea),C&&v>=9&&(this.hasSelection=R)}else e||(this.prevInput=this.textarea.value="",C&&v>=9&&(this.hasSelection=null))},Xn.prototype.getField=function(){return this.textarea},Xn.prototype.supportsTouch=function(){return!1},Xn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!n||V()!=this.textarea))try{this.textarea.focus()}catch(e){}},Xn.prototype.blur=function(){this.textarea.blur()},Xn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Xn.prototype.receivedFocus=function(){this.slowPoll()},Xn.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()})},Xn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function R(){var A=t.poll();!A&&!e?(e=!0,t.polling.set(60,R)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,R)},Xn.prototype.poll=function(){var e=this,t=this.cm,R=this.textarea,A=this.prevInput;if(this.contextMenuPending||!t.state.focused||_t(R)&&!A&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var U=R.value;if(U==A&&!t.somethingSelected())return!1;if(C&&v>=9&&this.hasSelection===U||s&&/[\uf700-\uf7ff]/.test(U))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var $=U.charCodeAt(0);if($==8203&&!A&&(A="\u200B"),$==8666)return this.reset(),this.cm.execCommand("undo")}for(var ae=0,fe=Math.min(A.length,U.length);ae1e3||U.indexOf(` `)>-1?R.value=e.prevInput="":e.prevInput=U,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Xn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Xn.prototype.onKeyPress=function(){C&&v>=9&&(this.hasSelection=null),this.fastPoll()},Xn.prototype.onContextMenu=function(e){var t=this,R=t.cm,A=R.display,U=t.textarea;t.contextMenuPending&&t.contextMenuPending();var $=ti(R,e),ae=A.scroller.scrollTop;if(!$||h)return;var fe=R.options.resetSelectionOnContextMenu;fe&&R.doc.sel.contains($)==-1&&Gn(R,xi)(R.doc,qi($),Ee);var me=U.style.cssText,xe=t.wrapper.style.cssText,We=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",U.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-We.top-5)+"px; left: "+(e.clientX-We.left-5)+`px; z-index: 1000; background: `+(C?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ge;o&&(Ge=window.scrollY),A.input.focus(),o&&window.scrollTo(null,Ge),A.input.reset(),R.somethingSelected()||(U.value=t.prevInput=" "),t.contextMenuPending=at,A.selForContextMenu=R.doc.sel,clearTimeout(A.detectingSelectAll);function st(){if(U.selectionStart!=null){var yt=R.somethingSelected(),Ot="\u200B"+(yt?U.value:"");U.value="\u21DA",U.value=Ot,t.prevInput=yt?"":"\u200B",U.selectionStart=1,U.selectionEnd=Ot.length,A.selForContextMenu=R.doc.sel}}function at(){if(t.contextMenuPending!=at)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=xe,U.style.cssText=me,C&&v<9&&A.scrollbars.setScrollTop(A.scroller.scrollTop=ae),U.selectionStart!=null){(!C||C&&v<9)&&st();var yt=0,Ot=function(){A.selForContextMenu==R.doc.sel&&U.selectionStart==0&&U.selectionEnd>0&&t.prevInput=="\u200B"?Gn(R,Ds)(R):yt++<10?A.detectingSelectAll=setTimeout(Ot,500):(A.selForContextMenu=null,A.input.reset())};A.detectingSelectAll=setTimeout(Ot,200)}}if(C&&v>=9&&st(),k){Pe(e);var ft=function(){lt(window,"mouseup",ft),setTimeout(at,20)};De(window,"mouseup",ft)}else setTimeout(at,50)},Xn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Xn.prototype.setUneditable=function(){},Xn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?B(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var R=V();t.autofocus=R==e||e.getAttribute("autofocus")!=null&&R==document.body}function A(){e.value=fe.getValue()}var U;if(e.form&&(De(e.form,"submit",A),!t.leaveSubmitMethodAlone)){var $=e.form;U=$.submit;try{var ae=$.submit=function(){A(),$.submit=U,$.submit(),$.submit=ae}}catch(me){}}t.finishInit=function(me){me.save=A,me.getTextArea=function(){return e},me.toTextArea=function(){me.toTextArea=isNaN,A(),e.parentNode.removeChild(me.getWrapperElement()),e.style.display="",e.form&&(lt(e.form,"submit",A),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=U))}},e.style.display="none";var fe=Nn(function(me){return e.parentNode.insertBefore(me,e.nextSibling)},t);return fe}function au(e){e.off=lt,e.on=De,e.wheelEventPixels=so,e.Doc=Li,e.splitLines=Lt,e.countColumn=H,e.findColumn=_e,e.isWordChar=Q,e.Pass=Ce,e.signal=Je,e.Line=li,e.changeEnd=ea,e.scrollbarModel=io,e.Pos=mt,e.cmpPos=Ut,e.modes=cr,e.mimeModes=Wt,e.resolveMode=Ct,e.getMode=lr,e.modeExtensions=Fr,e.extendMode=$r,e.copyState=Hr,e.startState=Tt,e.innerMode=oi,e.commands=xo,e.keyMap=ma,e.keyName=Vs,e.isModifierKey=Ks,e.lookupKey=Ya,e.normalizeKeyMap=Pl,e.StringStream=Rt,e.SharedTextMarker=vo,e.TextMarker=Ca,e.LineWidget=go,e.e_preventDefault=ye,e.e_stopPropagation=Te,e.e_stop=Pe,e.addClass=K,e.contains=L,e.rmClass=b,e.keyNames=Ta}Jl(Nn),eu(Nn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Vo in Li.prototype)Li.prototype.hasOwnProperty(Vo)&&re(ou,Vo)<0&&(Nn.prototype[Vo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Li.prototype[Vo]));return Ie(Li),Nn.inputStyles={textarea:Xn,contenteditable:yn},Nn.defineMode=function(e){!Nn.defaults.mode&&e!="null"&&(Nn.defaults.mode=e),Lr.apply(this,arguments)},Nn.defineMIME=Cr,Nn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Nn.defineMIME("text/plain","null"),Nn.defineExtension=function(e,t){Nn.prototype[e]=t},Nn.defineDocExtension=function(e,t){Li.prototype[e]=t},Nn.fromTextArea=iu,au(Nn),Nn.version="5.58.2",Nn})},WYAk:function(I,J,P){(function(M,u){I.exports=J=u(P("Ib8C"))})(this,function(M){(function(){var u=M,_=u.lib,D=_.Base,f=u.enc,l=f.Utf8,C=u.algo,v=C.HMAC=D.extend({init:function(o,a){o=this._hasher=new o.init,typeof a=="string"&&(a=l.parse(a));var r=o.blockSize,h=r*4;a.sigBytes>h&&(a=o.finalize(a)),a.clamp();for(var m=this._oKey=a.clone(),p=this._iKey=a.clone(),w=m.words,g=p.words,c=0;c1&&arguments[1]!==void 0?arguments[1]:!1,Me=Ee.getAttribute("id")||Ee.getAttribute("data-reactid")||Ee.getAttribute("name");if(pe&&V[Me])return V[Me];var _e=window.getComputedStyle(Ee),he=_e.getPropertyValue("box-sizing")||_e.getPropertyValue("-moz-box-sizing")||_e.getPropertyValue("-webkit-box-sizing"),ce=parseFloat(_e.getPropertyValue("padding-bottom"))+parseFloat(_e.getPropertyValue("padding-top")),oe=parseFloat(_e.getPropertyValue("border-bottom-width"))+parseFloat(_e.getPropertyValue("border-top-width")),Se=L.map(function(ue){return"".concat(ue,":").concat(_e.getPropertyValue(ue))}).join(";"),te={sizingStyle:Se,paddingSize:ce,borderSize:oe,boxSizing:he};return pe&&Me&&(V[Me]=te),te}function G(Ee){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;K||(K=document.createElement("textarea"),K.setAttribute("tab-index","-1"),K.setAttribute("aria-hidden","true"),document.body.appendChild(K)),Ee.getAttribute("wrap")?K.setAttribute("wrap",Ee.getAttribute("wrap")):K.removeAttribute("wrap");var he=W(Ee,pe),ce=he.paddingSize,oe=he.borderSize,Se=he.boxSizing,te=he.sizingStyle;K.setAttribute("style","".concat(te,";").concat(j)),K.value=Ee.value||Ee.placeholder||"";var ue=Number.MIN_SAFE_INTEGER,Oe=Number.MAX_SAFE_INTEGER,le=K.scrollHeight,Q;if(Se==="border-box"?le+=oe:Se==="content-box"&&(le-=ce),Me!==null||_e!==null){K.value=" ";var Y=K.scrollHeight-ce;Me!==null&&(ue=Y*Me,Se==="border-box"&&(ue=ue+ce+oe),le=Math.max(ue,le)),_e!==null&&(Oe=Y*_e,Se==="border-box"&&(Oe=Oe+ce+oe),Q=le>Oe?"":"hidden",le=Math.min(Oe,le))}return{height:le,minHeight:ue,maxHeight:Oe,overflowY:Q,resize:"none"}}var F=P("Gytx"),B=P.n(F),H;(function(Ee){Ee[Ee.NONE=0]="NONE",Ee[Ee.RESIZING=1]="RESIZING",Ee[Ee.RESIZED=2]="RESIZED"})(H||(H={}));var q=function(Ee){Object(D.a)(Me,Ee);var pe=Object(f.a)(Me);function Me(_e){var he;return Object(u.a)(this,Me),he=pe.call(this,_e),he.nextFrameActionId=void 0,he.resizeFrameId=void 0,he.textArea=void 0,he.saveTextArea=function(ce){he.textArea=ce},he.handleResize=function(ce){var oe=he.state.resizeStatus,Se=he.props,te=Se.autoSize,ue=Se.onResize;if(oe!==H.NONE)return;typeof ue=="function"&&ue(ce),te&&he.resizeOnNextFrame()},he.resizeOnNextFrame=function(){cancelAnimationFrame(he.nextFrameActionId),he.nextFrameActionId=requestAnimationFrame(he.resizeTextarea)},he.resizeTextarea=function(){var ce=he.props.autoSize;if(!ce||!he.textArea)return;var oe=ce.minRows,Se=ce.maxRows,te=G(he.textArea,!1,oe,Se);he.setState({textareaStyles:te,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(he.resizeFrameId),he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.RESIZED},function(){he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.NONE}),he.fixFirefoxAutoScroll()})})})})},he.renderTextArea=function(){var ce=he.props,oe=ce.prefixCls,Se=oe===void 0?"rc-textarea":oe,te=ce.autoSize,ue=ce.onResize,Oe=ce.className,le=ce.disabled,Q=he.state,Y=Q.textareaStyles,Z=Q.resizeStatus,be=Object(x.a)(he.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ge=N()(Se,Oe,Object(v.a)({},"".concat(Se,"-disabled"),le));"value"in be&&(be.value=be.value||"");var Re=Object(C.a)(Object(C.a)(Object(C.a)({},he.props.style),Y),Z===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return l.createElement(E,{onResize:he.handleResize,disabled:!(te||ue)},l.createElement("textarea",Object(M.a)({},be,{className:ge,style:Re,ref:he.saveTextArea})))},he.state={textareaStyles:{},resizeStatus:H.NONE},he}return Object(_.a)(Me,[{key:"componentDidUpdate",value:function(he){(he.value!==this.props.value||!B()(he.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 he=this.textArea.selectionStart,ce=this.textArea.selectionEnd;this.textArea.setSelectionRange(he,ce)}}catch(oe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Me}(l.Component),re=q,ee=function(Ee){Object(D.a)(Me,Ee);var pe=Object(f.a)(Me);function Me(_e){var he;Object(u.a)(this,Me),he=pe.call(this,_e),he.resizableTextArea=void 0,he.focus=function(){he.resizableTextArea.textArea.focus()},he.saveTextArea=function(oe){he.resizableTextArea=oe},he.handleChange=function(oe){var Se=he.props.onChange;he.setValue(oe.target.value,function(){he.resizableTextArea.resizeTextarea()}),Se&&Se(oe)},he.handleKeyDown=function(oe){var Se=he.props,te=Se.onPressEnter,ue=Se.onKeyDown;oe.keyCode===13&&te&&te(oe),ue&&ue(oe)};var ce=typeof _e.value=="undefined"||_e.value===null?_e.defaultValue:_e.value;return he.state={value:ce},he}return Object(_.a)(Me,[{key:"setValue",value:function(he,ce){"value"in this.props||this.setState({value:he},ce)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return l.createElement(re,Object(M.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(he){return"value"in he?{value:he.value}:null}}]),Me}(l.Component),Ce=J.default=ee},ZD9Y:function(I,J,P){"use strict";var M=P("BoS7"),u=P("Sdc0"),_=P("OaEy"),D=P("2fM7"),f=P("q1tI"),l=P.n(f),C=P("lOMy"),v=P.n(C),o=D.a.Option;J.a=function(a){var r=a.onFontSizeChange,h=a.cmFontSize,m=a.cmCodeMode,p=a.onCodeModeChange,w=a.onTabToSpace,g=a.className,c=g===void 0?"":g,n=a.tabToSpace,s=a.children;return l.a.createElement("div",{className:"tpi-code-setting ".concat(c)},l.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),l.a.createElement("section",null,l.a.createElement("div",{className:"file-item"},l.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),l.a.createElement(D.a,{bordered:!1,size:"small",value:m,onChange:p},l.a.createElement(o,{value:"vs"},"\u767D\u8272\u80CC\u666F"),l.a.createElement(o,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),l.a.createElement("div",{className:"file-item"},l.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),l.a.createElement(D.a,{bordered:!1,size:"small",value:h,onChange:r},l.a.createElement(o,{value:12},"12px"),l.a.createElement(o,{value:14},"14px"),l.a.createElement(o,{value:16},"16px"),l.a.createElement(o,{value:18},"18px"),l.a.createElement(o,{value:20},"20px"),l.a.createElement(o,{value:22},"22px"))),l.a.createElement("div",{className:"file-item"},l.a.createElement("b",null,"Tab\u8F6C\u6362"),l.a.createElement(u.a,{checked:n,onChange:w}))),l.a.createElement("h3",null,"\u5FEB\u6377\u952E"),l.a.createElement("section",null,l.a.createElement("div",{className:"file-item"},l.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),l.a.createElement("span",null,"Ctrl + S")),l.a.createElement("div",{className:"file-item"},l.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),l.a.createElement("span",null,"F1 / Alt + F1")),l.a.createElement("div",{className:"file-item"},l.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),l.a.createElement("span",null,"Ctrl + ]/[")),l.a.createElement("div",{className:"file-item"},l.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),l.a.createElement("span",null,"Ctrl + Shift + \\")),l.a.createElement("div",{className:"file-item"},l.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),l.a.createElement("span",null,"Home")),l.a.createElement("div",{className:"file-item"},l.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),l.a.createElement("span",null,"End"))),s)}},ZW9T:function(I,J,P){"use strict";P.d(J,"a",function(){return S});var M=P("k1fw"),u=P("miYZ"),_=P("tsqr"),D=P("rAM+"),f=P("tJVT"),l=P("PpiC"),C=P("q1tI"),v=P.n(C),o=P("bdgK");function a(y,i,k,O,b){var E=i.getWordUntilPosition(k),x={startLineNumber:k.lineNumber,endLineNumber:k.lineNumber,startColumn:E.startColumn,endColumn:E.endColumn},T=O.map(function(N){return{label:N,kind:y.languages.CompletionItemKind.Keyword,insertText:N,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:x}});return b.map(function(N){T.push(Object(M.a)(Object(M.a)({},N),{},{range:x}))}),T}var r=function(y){var i={label:"ifelse",kind:y.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `),insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet},k=["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","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];y.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(x,T){var N=a(y,x,T,k,[i]);return{suggestions:N}}});var O=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];y.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(x,T){var N=[{label:"print",kind:y.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` `),insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}],j=a(y,x,T,O,N);return{suggestions:j}}});var b=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];y.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(x,T){var N=[i,{label:"main",kind:y.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` `),insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:y.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` `),insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}],j=a(y,x,T,b,N);return{suggestions:j}}})},h="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",m=P("LvDl");function p(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}function w(){}var g=!1,c={"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 n(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=y;if(Array.isArray(y)){for(var k=0;k0||ct.target.offsetWidth>0)&&Oe.current.instance.layout()}}catch(gt){$e.e(gt)}finally{$e.f()}}),Ae.observe(ue.current)),Ae}function qe(){_.b.warn(decodeURIComponent(h))}var et=function(){var Pe=Oe.current.instance;if(E!=null&&Pe&&ge){var $e=Pe.getModel();$e&&E!==$e.getValue()&&(g=!0,$e.setValue(E),Pe.layout(),g=!1)}};Object(C.useEffect)(function(){le.current&&clearTimeout(le.current),le.current=setTimeout(function(){et()},500)},[E,ge,Oe.current]);function nt(){var Ae=Oe.current.instance;if(Ae){var Pe=Ae.getSelection(),$e=Oe.current.pastePos||{},Ke=new s.Range($e.startLineNumber||Pe.endLineNumber,$e.startColumn||Pe.endColumn,$e.endLineNumber||Pe.endLineNumber,$e.endColumn||Pe.endColumn);setTimeout(function(){Ae.executeEdits("",[{range:Ke,text:""}])},300)}}function ut(Ae){(window.navigator.platform.match("Mac")?Ae.metaKey:Ae.ctrlKey)&&Ae.keyCode==83&&(Ae.preventDefault(),H())}var ot=function(){if(re&&Oe.current.instance){var Pe=Oe.current.instance.getContentHeight();ye(Pe0||Me.target.offsetWidth>0)&&re.layout()}}catch(_e){Ee.e(_e)}finally{Ee.f()}}),ee.observe(L.current)),ee}Object(C.useEffect)(function(){L.current&&P.e(27).then(P.t.bind(null,"M/lh",7)).then(function(re){s=re;var ee=s.editor.createDiffEditor(L.current,Object(M.a)(Object(M.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},j),{},{wordWrap:!0}));G(ee);var Ce=F(ee);return function(){ee.dispose();var Ee=ee.getModel();Ee&&Ee.dispose(),Ce.unobserve(L.current)}})},[]),Object(C.useEffect)(function(){W&&W.setModel({original:s.editor.createModel(E,T),modified:s.editor.createModel(x,T)})},[E,x,T,W]);var B=p(k),H=p(b),q={width:B,height:H};return v.a.createElement("div",{className:"my-diff-editor",ref:L,style:q})}},ZpRC:function(I,J,P){"use strict";function M(r){return typeof r=="object"&&r!=null&&r.nodeType===1}function u(r,h){return(!h||r!=="hidden")&&r!=="visible"&&r!=="clip"}function _(r,h){if(r.clientHeighth||g>r&&c=h&&n>=m?g-r-p:c>h&&nm?c-h+w:0}var f=function(r,h){var m=window,p=h.scrollMode,w=h.block,g=h.inline,c=h.boundary,n=h.skipOverflowHiddenElements,s=typeof c=="function"?c:function(Y){return Y!==c};if(!M(r))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,S=[],y=r;M(y)&&s(y);){if((y=y.parentElement)===d){S.push(y);break}y!=null&&y===document.body&&_(y)&&!_(document.documentElement)||y!=null&&_(y,n)&&S.push(y)}for(var i=m.visualViewport?m.visualViewport.width:innerWidth,k=m.visualViewport?m.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,E=r.getBoundingClientRect(),x=E.height,T=E.width,N=E.top,j=E.right,L=E.bottom,V=E.left,K=w==="start"||w==="nearest"?N:w==="end"?L:N+x/2,W=g==="center"?V+T/2:g==="end"?j:V,G=[],F=0;F=0&&V>=0&&L<=k&&j<=i&&N>=ee&&L<=Ee&&V>=pe&&j<=Ce)return G;var Me=getComputedStyle(B),_e=parseInt(Me.borderLeftWidth,10),he=parseInt(Me.borderTopWidth,10),ce=parseInt(Me.borderRightWidth,10),oe=parseInt(Me.borderBottomWidth,10),Se=0,te=0,ue="offsetWidth"in B?B.offsetWidth-B.clientWidth-_e-ce:0,Oe="offsetHeight"in B?B.offsetHeight-B.clientHeight-he-oe:0;if(d===B)Se=w==="start"?K:w==="end"?K-k:w==="nearest"?D(b,b+k,k,he,oe,b+K,b+K+x,x):K-k/2,te=g==="start"?W:g==="center"?W-i/2:g==="end"?W-i:D(O,O+i,i,_e,ce,O+W,O+W+T,T),Se=Math.max(0,Se+b),te=Math.max(0,te+O);else{Se=w==="start"?K-ee-he:w==="end"?K-Ee+oe+Oe:w==="nearest"?D(ee,Ee,q,he,oe+Oe,K,K+x,x):K-(ee+q/2)+Oe/2,te=g==="start"?W-pe-_e:g==="center"?W-(pe+re/2)+ue/2:g==="end"?W-Ce+ce+ue:D(pe,Ce,re,_e,ce+ue,W,W+T,T);var le=B.scrollLeft,Q=B.scrollTop;K+=Q-(Se=Math.max(0,Math.min(Q+Se,B.scrollHeight-q+Oe))),W+=le-(te=Math.max(0,Math.min(le+te,B.scrollWidth-re+ue)))}G.push({el:B,top:Se,left:te})}return G};function l(r){return r===Object(r)&&Object.keys(r).length!==0}function C(r,h){h===void 0&&(h="auto");var m="scrollBehavior"in document.body.style;r.forEach(function(p){var w=p.el,g=p.top,c=p.left;w.scroll&&m?w.scroll({top:g,left:c,behavior:h}):(w.scrollTop=g,w.scrollLeft=c)})}function v(r){return r===!1?{block:"end",inline:"nearest"}:l(r)?r:{block:"start",inline:"nearest"}}function o(r,h){var m=!r.ownerDocument.documentElement.contains(r);if(l(h)&&typeof h.behavior=="function")return h.behavior(m?[]:f(r,h));if(m)return;var p=v(h);return C(f(r,p),p.behavior)}var a=J.a=o},Zss7:function(I,J,P){var M;(function(u){var _=/^\s+/,D=/\s+$/,f=0,l=u.round,C=u.min,v=u.max,o=u.random;function a(oe,Se){if(oe=oe||"",Se=Se||{},oe instanceof a)return oe;if(!(this instanceof a))return new a(oe,Se);var te=r(oe);this._originalInput=oe,this._r=te.r,this._g=te.g,this._b=te.b,this._a=te.a,this._roundA=l(100*this._a)/100,this._format=Se.format||te.format,this._gradientType=Se.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=te.ok,this._tc_id=f++}a.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var oe=this.toRgb();return(oe.r*299+oe.g*587+oe.b*114)/1e3},getLuminance:function(){var oe=this.toRgb(),Se,te,ue,Oe,le,Q;return Se=oe.r/255,te=oe.g/255,ue=oe.b/255,Se<=.03928?Oe=Se/12.92:Oe=u.pow((Se+.055)/1.055,2.4),te<=.03928?le=te/12.92:le=u.pow((te+.055)/1.055,2.4),ue<=.03928?Q=ue/12.92:Q=u.pow((ue+.055)/1.055,2.4),.2126*Oe+.7152*le+.0722*Q},setAlpha:function(oe){return this._a=G(oe),this._roundA=l(100*this._a)/100,this},toHsv:function(){var oe=w(this._r,this._g,this._b);return{h:oe.h*360,s:oe.s,v:oe.v,a:this._a}},toHsvString:function(){var oe=w(this._r,this._g,this._b),Se=l(oe.h*360),te=l(oe.s*100),ue=l(oe.v*100);return this._a==1?"hsv("+Se+", "+te+"%, "+ue+"%)":"hsva("+Se+", "+te+"%, "+ue+"%, "+this._roundA+")"},toHsl:function(){var oe=m(this._r,this._g,this._b);return{h:oe.h*360,s:oe.s,l:oe.l,a:this._a}},toHslString:function(){var oe=m(this._r,this._g,this._b),Se=l(oe.h*360),te=l(oe.s*100),ue=l(oe.l*100);return this._a==1?"hsl("+Se+", "+te+"%, "+ue+"%)":"hsla("+Se+", "+te+"%, "+ue+"%, "+this._roundA+")"},toHex:function(oe){return c(this._r,this._g,this._b,oe)},toHexString:function(oe){return"#"+this.toHex(oe)},toHex8:function(oe){return n(this._r,this._g,this._b,this._a,oe)},toHex8String:function(oe){return"#"+this.toHex8(oe)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(F(this._r,255)*100)+"%",g:l(F(this._g,255)*100)+"%",b:l(F(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+l(F(this._r,255)*100)+"%, "+l(F(this._g,255)*100)+"%, "+l(F(this._b,255)*100)+"%)":"rgba("+l(F(this._r,255)*100)+"%, "+l(F(this._g,255)*100)+"%, "+l(F(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:K[c(this._r,this._g,this._b,!0)]||!1},toFilter:function(oe){var Se="#"+s(this._r,this._g,this._b,this._a),te=Se,ue=this._gradientType?"GradientType = 1, ":"";if(oe){var Oe=a(oe);te="#"+s(Oe._r,Oe._g,Oe._b,Oe._a)}return"progid:DXImageTransform.Microsoft.gradient("+ue+"startColorstr="+Se+",endColorstr="+te+")"},toString:function(oe){var Se=!!oe;oe=oe||this._format;var te=!1,ue=this._a<1&&this._a>=0,Oe=!Se&&ue&&(oe==="hex"||oe==="hex6"||oe==="hex3"||oe==="hex4"||oe==="hex8"||oe==="name");return Oe?oe==="name"&&this._a===0?this.toName():this.toRgbString():(oe==="rgb"&&(te=this.toRgbString()),oe==="prgb"&&(te=this.toPercentageRgbString()),(oe==="hex"||oe==="hex6")&&(te=this.toHexString()),oe==="hex3"&&(te=this.toHexString(!0)),oe==="hex4"&&(te=this.toHex8String(!0)),oe==="hex8"&&(te=this.toHex8String()),oe==="name"&&(te=this.toName()),oe==="hsl"&&(te=this.toHslString()),oe==="hsv"&&(te=this.toHsvString()),te||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(oe,Se){var te=oe.apply(null,[this].concat([].slice.call(Se)));return this._r=te._r,this._g=te._g,this._b=te._b,this.setAlpha(te._a),this},lighten:function(){return this._applyModification(i,arguments)},brighten:function(){return this._applyModification(k,arguments)},darken:function(){return this._applyModification(O,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(S,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(oe,Se){return oe.apply(null,[this].concat([].slice.call(Se)))},analogous:function(){return this._applyCombination(j,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(L,arguments)},splitcomplement:function(){return this._applyCombination(N,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},a.fromRatio=function(oe,Se){if(typeof oe=="object"){var te={};for(var ue in oe)oe.hasOwnProperty(ue)&&(ue==="a"?te[ue]=oe[ue]:te[ue]=Ce(oe[ue]));oe=te}return a(oe,Se)};function r(oe){var Se={r:0,g:0,b:0},te=1,ue=null,Oe=null,le=null,Q=!1,Y=!1;return typeof oe=="string"&&(oe=he(oe)),typeof oe=="object"&&(_e(oe.r)&&_e(oe.g)&&_e(oe.b)?(Se=h(oe.r,oe.g,oe.b),Q=!0,Y=String(oe.r).substr(-1)==="%"?"prgb":"rgb"):_e(oe.h)&&_e(oe.s)&&_e(oe.v)?(ue=Ce(oe.s),Oe=Ce(oe.v),Se=g(oe.h,ue,Oe),Q=!0,Y="hsv"):_e(oe.h)&&_e(oe.s)&&_e(oe.l)&&(ue=Ce(oe.s),le=Ce(oe.l),Se=p(oe.h,ue,le),Q=!0,Y="hsl"),oe.hasOwnProperty("a")&&(te=oe.a)),te=G(te),{ok:Q,format:oe.format||Y,r:C(255,v(Se.r,0)),g:C(255,v(Se.g,0)),b:C(255,v(Se.b,0)),a:te}}function h(oe,Se,te){return{r:F(oe,255)*255,g:F(Se,255)*255,b:F(te,255)*255}}function m(oe,Se,te){oe=F(oe,255),Se=F(Se,255),te=F(te,255);var ue=v(oe,Se,te),Oe=C(oe,Se,te),le,Q,Y=(ue+Oe)/2;if(ue==Oe)le=Q=0;else{var Z=ue-Oe;Q=Y>.5?Z/(2-ue-Oe):Z/(ue+Oe);switch(ue){case oe:le=(Se-te)/Z+(Se1&&(Re-=1),Re<1/6?be+(ge-be)*6*Re:Re<1/2?ge:Re<2/3?be+(ge-be)*(2/3-Re)*6:be}if(Se===0)ue=Oe=le=te;else{var Y=te<.5?te*(1+Se):te+Se-te*Se,Z=2*te-Y;ue=Q(Z,Y,oe+1/3),Oe=Q(Z,Y,oe),le=Q(Z,Y,oe-1/3)}return{r:ue*255,g:Oe*255,b:le*255}}function w(oe,Se,te){oe=F(oe,255),Se=F(Se,255),te=F(te,255);var ue=v(oe,Se,te),Oe=C(oe,Se,te),le,Q,Y=ue,Z=ue-Oe;if(Q=ue===0?0:Z/ue,ue==Oe)le=0;else{switch(ue){case oe:le=(Se-te)/Z+(Se>1)+720)%360;--Se;)ue.h=(ue.h+Oe)%360,le.push(a(ue));return le}function L(oe,Se){Se=Se||6;for(var te=a(oe).toHsv(),ue=te.h,Oe=te.s,le=te.v,Q=[],Y=1/Se;Se--;)Q.push(a({h:ue,s:Oe,v:le})),le=(le+Y)%1;return Q}a.mix=function(oe,Se,te){te=te===0?0:te||50;var ue=a(oe).toRgb(),Oe=a(Se).toRgb(),le=te/100,Q={r:(Oe.r-ue.r)*le+ue.r,g:(Oe.g-ue.g)*le+ue.g,b:(Oe.b-ue.b)*le+ue.b,a:(Oe.a-ue.a)*le+ue.a};return a(Q)},a.readability=function(oe,Se){var te=a(oe),ue=a(Se);return(u.max(te.getLuminance(),ue.getLuminance())+.05)/(u.min(te.getLuminance(),ue.getLuminance())+.05)},a.isReadable=function(oe,Se,te){var ue=a.readability(oe,Se),Oe,le;le=!1,Oe=ce(te);switch(Oe.level+Oe.size){case"AAsmall":case"AAAlarge":le=ue>=4.5;break;case"AAlarge":le=ue>=3;break;case"AAAsmall":le=ue>=7;break}return le},a.mostReadable=function(oe,Se,te){var ue=null,Oe=0,le,Q,Y,Z;te=te||{},Q=te.includeFallbackColors,Y=te.level,Z=te.size;for(var be=0;beOe&&(Oe=le,ue=a(Se[be]));return a.isReadable(oe,ue,{level:Y,size:Z})||!Q?ue:(te.includeFallbackColors=!1,a.mostReadable(oe,["#fff","#000"],te))};var V=a.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},K=a.hexNames=W(V);function W(oe){var Se={};for(var te in oe)oe.hasOwnProperty(te)&&(Se[oe[te]]=te);return Se}function G(oe){return oe=parseFloat(oe),(isNaN(oe)||oe<0||oe>1)&&(oe=1),oe}function F(oe,Se){q(oe)&&(oe="100%");var te=re(oe);return oe=C(Se,v(0,parseFloat(oe))),te&&(oe=parseInt(oe*Se,10)/100),u.abs(oe-Se)<1e-6?1:oe%Se/parseFloat(Se)}function B(oe){return C(1,v(0,oe))}function H(oe){return parseInt(oe,16)}function q(oe){return typeof oe=="string"&&oe.indexOf(".")!=-1&&parseFloat(oe)===1}function re(oe){return typeof oe=="string"&&oe.indexOf("%")!=-1}function ee(oe){return oe.length==1?"0"+oe:""+oe}function Ce(oe){return oe<=1&&(oe=oe*100+"%"),oe}function Ee(oe){return u.round(parseFloat(oe)*255).toString(16)}function pe(oe){return H(oe)/255}var Me=function(){var oe="[-\\+]?\\d+%?",Se="[-\\+]?\\d*\\.\\d+%?",te="(?:"+Se+")|(?:"+oe+")",ue="[\\s|\\(]+("+te+")[,|\\s]+("+te+")[,|\\s]+("+te+")\\s*\\)?",Oe="[\\s|\\(]+("+te+")[,|\\s]+("+te+")[,|\\s]+("+te+")[,|\\s]+("+te+")\\s*\\)?";return{CSS_UNIT:new RegExp(te),rgb:new RegExp("rgb"+ue),rgba:new RegExp("rgba"+Oe),hsl:new RegExp("hsl"+ue),hsla:new RegExp("hsla"+Oe),hsv:new RegExp("hsv"+ue),hsva:new RegExp("hsva"+Oe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function _e(oe){return!!Me.CSS_UNIT.exec(oe)}function he(oe){oe=oe.replace(_,"").replace(D,"").toLowerCase();var Se=!1;if(V[oe])oe=V[oe],Se=!0;else if(oe=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var te;return(te=Me.rgb.exec(oe))?{r:te[1],g:te[2],b:te[3]}:(te=Me.rgba.exec(oe))?{r:te[1],g:te[2],b:te[3],a:te[4]}:(te=Me.hsl.exec(oe))?{h:te[1],s:te[2],l:te[3]}:(te=Me.hsla.exec(oe))?{h:te[1],s:te[2],l:te[3],a:te[4]}:(te=Me.hsv.exec(oe))?{h:te[1],s:te[2],v:te[3]}:(te=Me.hsva.exec(oe))?{h:te[1],s:te[2],v:te[3],a:te[4]}:(te=Me.hex8.exec(oe))?{r:H(te[1]),g:H(te[2]),b:H(te[3]),a:pe(te[4]),format:Se?"name":"hex8"}:(te=Me.hex6.exec(oe))?{r:H(te[1]),g:H(te[2]),b:H(te[3]),format:Se?"name":"hex"}:(te=Me.hex4.exec(oe))?{r:H(te[1]+""+te[1]),g:H(te[2]+""+te[2]),b:H(te[3]+""+te[3]),a:pe(te[4]+""+te[4]),format:Se?"name":"hex8"}:(te=Me.hex3.exec(oe))?{r:H(te[1]+""+te[1]),g:H(te[2]+""+te[2]),b:H(te[3]+""+te[3]),format:Se?"name":"hex"}:!1}function ce(oe){var Se,te;return oe=oe||{level:"AA",size:"small"},Se=(oe.level||"AA").toUpperCase(),te=(oe.size||"small").toLowerCase(),Se!=="AA"&&Se!=="AAA"&&(Se="AA"),te!=="small"&&te!=="large"&&(te="small"),{level:Se,size:te}}I.exports?I.exports=a:!(M=function(){return a}.call(J,P,J,I),M!==void 0&&(I.exports=M))})(Math)},bCnd:function(I,J,P){"use strict";P.d(J,"b",function(){return D}),P.d(J,"a",function(){return f});var M=P("je13"),u=P.n(M),_=!1;function D(l,C){var v=u.a.get("__ec");v||(v={}),v[l]=C,u.a.set("__ec",v)}function f(l,C){var v=u.a.get("__ec");return v?v[l]===void 0?C:v[l]:C}},bQjk:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(M){return function(u){var _=M,D=_.lib,f=D.CipherParams,l=_.enc,C=l.Hex,v=_.format,o=v.Hex={stringify:function(a){return a.ciphertext.toString(C)},parse:function(a){var r=C.parse(a);return f.create({ciphertext:r})}}}(),M.format.Hex})},bT9E:function(I,J,P){"use strict";P.d(J,"a",function(){return u});var M=P("VTBJ");function u(_,D){var f=Object(M.a)({},_);return Array.isArray(D)&&D.forEach(function(l){delete f[l]}),f}},biw7:function(I,J,P){"use strict";var M=P("q1tI"),u=P.n(M),_=M.createContext(null);J.a=_},c5Ni:function(I,J,P){},cDPC:function(I,J,P){"use strict";var M=P("tJVT"),u=P("q1tI"),_=P.n(u),D=P("i3hx"),f=P.n(D);J.a=function(l){var C=l.defaultX,v=C===void 0?"40%":C,o=l.leftChild,a=l.rightChild,r=l.className,h=l.hideResize,m=h===void 0?!1:h,p=Object(u.useState)(v),w=Object(M.a)(p,2),g=w[0],c=w[1],n=Object(u.useRef)();function s(){n.current=!0}Object(u.useEffect)(function(){function y(k){n.current&&c(k.pageX)}function i(){n.current=!1}return window.addEventListener("mousemove",y),window.addEventListener("mouseup",i),function(){window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",i)}},[]);var d=typeof g=="number"&&g!==.01?"".concat(g,"px"):v,S="calc(100% - ".concat(m?"0px":"4px"," - ").concat(d,")");return _.a.createElement("div",{className:"split-panel-container ".concat(r)},_.a.createElement("section",{style:{width:d,display:g===.01?"none":""}},o),_.a.createElement("section",{className:"resize-x-bar",onMouseDown:s},_.a.createElement("a",{className:"btn-resize"},_.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},_.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),_.a.createElement("section",{style:{width:S}},a))}},cv67:function(I,J,P){(function(M,u){I.exports=J=u(P("Ib8C"))})(this,function(M){return function(u){var _=M,D=_.lib,f=D.WordArray,l=D.Hasher,C=_.algo,v=[];(function(){for(var p=0;p<64;p++)v[p]=u.abs(u.sin(p+1))*4294967296|0})();var o=C.MD5=l.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(p,w){for(var g=0;g<16;g++){var c=w+g,n=p[c];p[c]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360}var s=this._hash.words,d=p[w+0],S=p[w+1],y=p[w+2],i=p[w+3],k=p[w+4],O=p[w+5],b=p[w+6],E=p[w+7],x=p[w+8],T=p[w+9],N=p[w+10],j=p[w+11],L=p[w+12],V=p[w+13],K=p[w+14],W=p[w+15],G=s[0],F=s[1],B=s[2],H=s[3];G=a(G,F,B,H,d,7,v[0]),H=a(H,G,F,B,S,12,v[1]),B=a(B,H,G,F,y,17,v[2]),F=a(F,B,H,G,i,22,v[3]),G=a(G,F,B,H,k,7,v[4]),H=a(H,G,F,B,O,12,v[5]),B=a(B,H,G,F,b,17,v[6]),F=a(F,B,H,G,E,22,v[7]),G=a(G,F,B,H,x,7,v[8]),H=a(H,G,F,B,T,12,v[9]),B=a(B,H,G,F,N,17,v[10]),F=a(F,B,H,G,j,22,v[11]),G=a(G,F,B,H,L,7,v[12]),H=a(H,G,F,B,V,12,v[13]),B=a(B,H,G,F,K,17,v[14]),F=a(F,B,H,G,W,22,v[15]),G=r(G,F,B,H,S,5,v[16]),H=r(H,G,F,B,b,9,v[17]),B=r(B,H,G,F,j,14,v[18]),F=r(F,B,H,G,d,20,v[19]),G=r(G,F,B,H,O,5,v[20]),H=r(H,G,F,B,N,9,v[21]),B=r(B,H,G,F,W,14,v[22]),F=r(F,B,H,G,k,20,v[23]),G=r(G,F,B,H,T,5,v[24]),H=r(H,G,F,B,K,9,v[25]),B=r(B,H,G,F,i,14,v[26]),F=r(F,B,H,G,x,20,v[27]),G=r(G,F,B,H,V,5,v[28]),H=r(H,G,F,B,y,9,v[29]),B=r(B,H,G,F,E,14,v[30]),F=r(F,B,H,G,L,20,v[31]),G=h(G,F,B,H,O,4,v[32]),H=h(H,G,F,B,x,11,v[33]),B=h(B,H,G,F,j,16,v[34]),F=h(F,B,H,G,K,23,v[35]),G=h(G,F,B,H,S,4,v[36]),H=h(H,G,F,B,k,11,v[37]),B=h(B,H,G,F,E,16,v[38]),F=h(F,B,H,G,N,23,v[39]),G=h(G,F,B,H,V,4,v[40]),H=h(H,G,F,B,d,11,v[41]),B=h(B,H,G,F,i,16,v[42]),F=h(F,B,H,G,b,23,v[43]),G=h(G,F,B,H,T,4,v[44]),H=h(H,G,F,B,L,11,v[45]),B=h(B,H,G,F,W,16,v[46]),F=h(F,B,H,G,y,23,v[47]),G=m(G,F,B,H,d,6,v[48]),H=m(H,G,F,B,E,10,v[49]),B=m(B,H,G,F,K,15,v[50]),F=m(F,B,H,G,O,21,v[51]),G=m(G,F,B,H,L,6,v[52]),H=m(H,G,F,B,i,10,v[53]),B=m(B,H,G,F,N,15,v[54]),F=m(F,B,H,G,S,21,v[55]),G=m(G,F,B,H,x,6,v[56]),H=m(H,G,F,B,W,10,v[57]),B=m(B,H,G,F,b,15,v[58]),F=m(F,B,H,G,V,21,v[59]),G=m(G,F,B,H,k,6,v[60]),H=m(H,G,F,B,j,10,v[61]),B=m(B,H,G,F,y,15,v[62]),F=m(F,B,H,G,T,21,v[63]),s[0]=s[0]+G|0,s[1]=s[1]+F|0,s[2]=s[2]+B|0,s[3]=s[3]+H|0},_doFinalize:function(){var p=this._data,w=p.words,g=this._nDataBytes*8,c=p.sigBytes*8;w[c>>>5]|=128<<24-c%32;var n=u.floor(g/4294967296),s=g;w[(c+64>>>9<<4)+15]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,w[(c+64>>>9<<4)+14]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,p.sigBytes=(w.length+1)*4,this._process();for(var d=this._hash,S=d.words,y=0;y<4;y++){var i=S[y];S[y]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}return d},clone:function(){var p=l.clone.call(this);return p._hash=this._hash.clone(),p}});function a(p,w,g,c,n,s,d){var S=p+(w&g|~w&c)+n+d;return(S<>>32-s)+w}function r(p,w,g,c,n,s,d){var S=p+(w&c|g&~c)+n+d;return(S<>>32-s)+w}function h(p,w,g,c,n,s,d){var S=p+(w^g^c)+n+d;return(S<>>32-s)+w}function m(p,w,g,c,n,s,d){var S=p+(g^(w|~c))+n+d;return(S<>>32-s)+w}_.MD5=l._createHelper(o),_.HmacMD5=l._createHmacHelper(o)}(Math),M.MD5})},dejd:function(I,J,P){},dmUQ:function(I,J,P){"use strict";var M=P("Ff2n"),u=P("rePB"),_=P("1OyB"),D=P("vuIU"),f=P("Ji7U"),l=P("md7G"),C=P("foSv"),v=P("q1tI"),o=P.n(v),a=P("TSYQ"),r=P.n(a),h=P("4IlW");function m(x,T){var N=Object.keys(x);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(x);T&&(j=j.filter(function(L){return Object.getOwnPropertyDescriptor(x,L).enumerable})),N.push.apply(N,j)}return N}function p(x){for(var T=1;T1?re-1:0),Ce=1;Ce1?F-1:0),H=1;H=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var F=0;return G.indexOf(".")>=0&&(F=G.length-G.indexOf(".")-1),F},L.getInputDisplayValue=function(W){var G=W||L.state,F=G.focused,B=G.inputValue,H=G.value,q;F?q=B:q=L.toPrecisionAsStep(H),q==null&&(q="");var re=L.formatWrapper(q);return i(L.props.decimalSeparator)&&(re=re.toString().replace(".",L.props.decimalSeparator)),re},L.recordCursorPosition=function(){try{L.cursorStart=L.input.selectionStart,L.cursorEnd=L.input.selectionEnd,L.currentValue=L.input.value,L.cursorBefore=L.input.value.substring(0,L.cursorStart),L.cursorAfter=L.input.value.substring(L.cursorEnd)}catch(W){}},L.restoreByAfter=function(W){if(W===void 0)return!1;var G=L.input.value,F=G.lastIndexOf(W);if(F===-1)return!1;var B=L.cursorBefore.length;return L.lastKeyCode===h.a.DELETE&&L.cursorBefore.charAt(B-1)===W[0]?(L.fixCaret(B,B),!0):F+W.length===G.length?(L.fixCaret(F,F),!0):!1},L.partRestoreByAfter=function(W){return W===void 0?!1:Array.prototype.some.call(W,function(G,F){var B=W.substring(F);return L.restoreByAfter(B)})},L.isNotCompleteNumber=function(W){return isNaN(W)||W===""||W===null||W&&W.toString().indexOf(".")===W.toString().length-1},L.stop=function(){L.autoStepTimer&&clearTimeout(L.autoStepTimer)},L.down=function(W,G,F){L.pressingUpOrDown=!0,L.step("down",W,G,F)},L.up=function(W,G,F){L.pressingUpOrDown=!0,L.step("up",W,G,F)},L.saveInput=function(W){L.input=W};var V=j.value;V===void 0&&(V=j.defaultValue),L.state={focused:j.autoFocus};var K=L.getValidValue(L.toNumber(V));return L.state=p(p({},L.state),{},{inputValue:L.toPrecisionAsStep(K),value:K}),L}return Object(D.a)(N,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(L){var V=this.props,K=V.value,W=V.onChange,G=V.max,F=V.min,B=this.state.focused;if(L){if(!k(L.value,K)||!k(L.max,G)||!k(L.min,F)){var H=B?K:this.getValidValue(K),q;this.pressingUpOrDown?q=H:this.inputting?q=this.rawInput:q=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:q})}var re="value"in this.props?K:this.state.value;"max"in this.props&&L.max!==G&&typeof re=="number"&&re>G&&W&&W(G),"min"in this.props&&L.min!==F&&typeof re=="number"&&re1&&arguments[1]!==void 0?arguments[1]:this.props.min,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,W=parseFloat(L);return isNaN(W)?L:(WK&&(W=K),W)}},{key:"setValue",value:function(L,V){var K=this.props.precision,W=this.isNotCompleteNumber(parseFloat(L))?null:parseFloat(L),G=this.state.value,F=G===void 0?null:G,B=this.state.inputValue,H=B===void 0?null:B,q=typeof W=="number"?W.toFixed(K):"".concat(W),re=W!==F||q!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},V)):this.setState({value:W,inputValue:this.toPrecisionAsStep(L)},V),re&&this.props.onChange(W),W}},{key:"getMaxPrecision",value:function(L){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,K=this.props,W=K.precision,G=K.step;if(i(W))return W;var F=this.getPrecision(V),B=this.getPrecision(G),H=this.getPrecision(L);return L?Math.max(H,F+B):F+B}},{key:"getPrecisionFactor",value:function(L){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,K=this.getMaxPrecision(L,V);return Math.pow(10,K)}},{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(L){return this.props.formatter?this.props.formatter(L):L}},{key:"toPrecisionAsStep",value:function(L){if(this.isNotCompleteNumber(L)||L==="")return L;var V=Math.abs(this.getMaxPrecision(L));return isNaN(V)?L.toString():Number(L).toFixed(V)}},{key:"toNumber",value:function(L){var V=this.props.precision,K=this.state.focused,W=L&&L.length>16&&K;return this.isNotCompleteNumber(L)||W?L:i(V)?Math.round(L*Math.pow(10,V))/Math.pow(10,V):Number(L)}},{key:"upStep",value:function(L,V){var K=this.props.step,W=this.getPrecisionFactor(L,V),G=Math.abs(this.getMaxPrecision(L,V)),F=((W*L+W*K*V)/W).toFixed(G);return this.toNumber(F)}},{key:"downStep",value:function(L,V){var K=this.props.step,W=this.getPrecisionFactor(L,V),G=Math.abs(this.getMaxPrecision(L,V)),F=((W*L-W*K*V)/W).toFixed(G);return this.toNumber(F)}},{key:"step",value:function(L,V){var K=this,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),V&&(V.persist(),V.preventDefault());var F=this.props;if(F.disabled)return;var B=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(B))return;var H=this["".concat(L,"Step")](B,W),q=H>F.max||HF.max?H=F.max:H=ee),tt=(ut||ut===0)&&(isNaN(ut)||Number(ut)<=Ce),Ue=Je||W||G,ke=tt||W||G,Ie=r()("".concat(K,"-handler"),"".concat(K,"-handler-up"),Object(u.a)({},"".concat(K,"-handler-up-disabled"),Ue)),ye=r()("".concat(K,"-handler"),"".concat(K,"-handler-down"),Object(u.a)({},"".concat(K,"-handler-down-disabled"),ke)),Te=F?{onTouchStart:Ue?c:this.up,onTouchEnd:this.stop}:{onMouseDown:Ue?c:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Ae=F?{onTouchStart:ke?c:this.down,onTouchEnd:this.stop}:{onMouseDown:ke?c:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return o.a.createElement("div",{className:je,style:Ee,title:pe,onMouseEnter:Me,onMouseLeave:_e,onMouseOver:he,onMouseOut:ce,onFocus:function(){return null},onBlur:function(){return null}},o.a.createElement("div",{className:"".concat(K,"-handler-wrap")},o.a.createElement("span",Object.assign({unselectable:"on"},Te,{role:"button","aria-label":"Increase Value","aria-disabled":Ue,className:Ie}),H||o.a.createElement("span",{unselectable:"on",className:"".concat(K,"-handler-up-inner"),onClick:n})),o.a.createElement("span",Object.assign({unselectable:"on"},Ae,{role:"button","aria-label":"Decrease Value","aria-disabled":ke,className:ye}),q||o.a.createElement("span",{unselectable:"on",className:"".concat(K,"-handler-down-inner"),onClick:n}))),o.a.createElement("div",{className:"".concat(K,"-input-wrap")},o.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ce,"aria-valuemax":ee,"aria-valuenow":ut,required:oe,type:ue,placeholder:Oe,onPaste:Ze,onClick:Se,onMouseUp:this.onMouseUp,className:"".concat(K,"-input"),tabIndex:te,autoComplete:B,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:rt?this.onKeyDown:c,onKeyUp:rt?this.onKeyUp:c,autoFocus:ge,maxLength:be,readOnly:G,disabled:W,max:ee,min:Ce,step:Z,name:Re,title:pe,id:le,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(lt),pattern:Y,inputMode:Q,onInput:qe},De))))}}]),N}(o.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:y,min:-y,step:1,style:{},onChange:c,onKeyDown:c,onPressEnter:c,onFocus:c,onBlur:c,parser:s,required:!1,autoComplete:"off"};var b=O,E=J.a=b},e7zE:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("3y9D"),P("WYAk"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.Base,f=_.WordArray,l=u.algo,C=l.SHA1,v=l.HMAC,o=l.PBKDF2=D.extend({cfg:D.extend({keySize:128/32,hasher:C,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,r){for(var h=this.cfg,m=v.create(h.hasher,a),p=f.create(),w=f.create([1]),g=p.words,c=w.words,n=h.keySize,s=h.iterations;g.length=ee&&H<0||F.scrollTop<=0&&H>0))||re&&(!he||he&&(F.scrollLeft>=Ce&&B<0||F.scrollLeft<=0&&B>0))?W(G,F.parentNode,B,H):!1};function O(W){var G=b();return function(){var B=Object(l.a)(W),H;if(G){var q=Object(l.a)(this).constructor;H=Reflect.construct(B,arguments,q)}else H=B.apply(this,arguments);return Object(f.a)(this,H)}}function b(){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(W){return!1}}var E={},x=function(W){Object(D.a)(F,W);var G=O(F);function F(B){var H;return Object(u.a)(this,F),H=G.call(this,B),H.domFocus=function(){H.dom&&H.dom.focus()},H.removeStartHandler=function(q){if(q.touches.length>1)return;H.startPos={x:q.touches[0].clientX,y:q.touches[0].clientY}},H.removeMoveHandler=function(q){if(q.changedTouches.length>1)return;var re=q.currentTarget,ee=q.changedTouches[0].clientX-H.startPos.x,Ce=q.changedTouches[0].clientY-H.startPos.y;(re===H.maskDom||re===H.handlerDom||re===H.contentDom&&k(re,q.target,ee,Ce))&&q.cancelable&&q.preventDefault()},H.transitionEnd=function(q){var re=q.target;d(re,n,H.transitionEnd),re.style.transition=""},H.onKeyDown=function(q){if(q.keyCode===p.a.ESC){var re=H.props.onClose;q.stopPropagation(),re&&re(q)}},H.onWrapperTransitionEnd=function(q){var re=H.props,ee=re.open,Ce=re.afterVisibleChange;q.target===H.contentWrapper&&q.propertyName.match(/transform$/)&&(H.dom.style.transition="",!ee&&H.getCurrentDrawerSome()&&(document.body.style.overflowX="",H.maskDom&&(H.maskDom.style.left="",H.maskDom.style.width="")),Ce&&Ce(!!ee))},H.openLevelTransition=function(){var q=H.props,re=q.open,ee=q.width,Ce=q.height,Ee=H.getHorizontalBoolAndPlacementName(),pe=Ee.isHorizontal,Me=Ee.placementName,_e=H.contentDom?H.contentDom.getBoundingClientRect()[pe?"width":"height"]:0,he=(pe?ee:Ce)||_e;H.setLevelAndScrolling(re,Me,he)},H.setLevelTransform=function(q,re,ee,Ce){var Ee=H.props,pe=Ee.placement,Me=Ee.levelMove,_e=Ee.duration,he=Ee.ease,ce=Ee.showMask;H.levelDom.forEach(function(oe){oe.style.transition="transform ".concat(_e," ").concat(he),s(oe,n,H.transitionEnd);var Se=q?ee:0;if(Me){var te=S(Me,{target:oe,open:q});Se=q?te[0]:te[1]||0}var ue=typeof Se=="number"?"".concat(Se,"px"):Se,Oe=pe==="left"||pe==="top"?ue:"-".concat(ue);Oe=ce&&pe==="right"&&Ce?"calc(".concat(Oe," + ").concat(Ce,"px)"):Oe,oe.style.transform=Se?"".concat(re,"(").concat(Oe,")"):""})},H.setLevelAndScrolling=function(q,re,ee){var Ce=H.props.onChange;if(!i){var Ee=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(m.a)(!0):0;H.setLevelTransform(q,re,ee,Ee),H.toggleScrollingToDrawerAndBody(Ee)}Ce&&Ce(q)},H.toggleScrollingToDrawerAndBody=function(q){var re=H.props,ee=re.getOpenCount,Ce=re.getContainer,Ee=re.showMask,pe=re.open,Me=Ce&&Ce(),_e=ee&&ee();if(Me&&Me.parentNode===document.body&&Ee){var he=["touchstart"],ce=[document.body,H.maskDom,H.handlerDom,H.contentDom];pe&&document.body.style.overflow!=="hidden"?(q&&H.addScrollingEffect(q),_e===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ce.forEach(function(oe,Se){if(!oe)return;s(oe,he[Se]||"touchmove",Se?H.removeMoveHandler:H.removeStartHandler,H.passive)})):H.getCurrentDrawerSome()&&(_e||(document.body.style.overflow=""),document.body.style.touchAction="",q&&H.remScrollingEffect(q),ce.forEach(function(oe,Se){if(!oe)return;d(oe,he[Se]||"touchmove",Se?H.removeMoveHandler:H.removeStartHandler,H.passive)}))}},H.addScrollingEffect=function(q){var re=H.props,ee=re.placement,Ce=re.duration,Ee=re.ease,pe=re.getOpenCount,Me=re.switchScrollingEffect,_e=pe&&pe();_e===1&&Me();var he="width ".concat(Ce," ").concat(Ee),ce="transform ".concat(Ce," ").concat(Ee);H.dom.style.transition="none";switch(ee){case"right":H.dom.style.transform="translateX(-".concat(q,"px)");break;case"top":case"bottom":H.dom.style.width="calc(100% - ".concat(q,"px)"),H.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(ce,",").concat(he),H.dom.style.width="",H.dom.style.transform="")})},H.remScrollingEffect=function(q){var re=H.props,ee=re.placement,Ce=re.duration,Ee=re.ease,pe=re.getOpenCount,Me=re.switchScrollingEffect,_e=pe&&pe();_e||Me(!0),c&&(document.body.style.overflowX="hidden"),H.dom.style.transition="none";var he,ce="width ".concat(Ce," ").concat(Ee),oe="transform ".concat(Ce," ").concat(Ee);switch(ee){case"left":{H.dom.style.width="100%",ce="width 0s ".concat(Ee," ").concat(Ce);break}case"right":{H.dom.style.transform="translateX(".concat(q,"px)"),H.dom.style.width="100%",ce="width 0s ".concat(Ee," ").concat(Ce),H.maskDom&&(H.maskDom.style.left="-".concat(q,"px"),H.maskDom.style.width="calc(100% + ".concat(q,"px)"));break}case"top":case"bottom":{H.dom.style.width="calc(100% + ".concat(q,"px)"),H.dom.style.height="100%",H.dom.style.transform="translateZ(0)",he="height 0s ".concat(Ee," ").concat(Ce);break}default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(oe,",").concat(he?"".concat(he,","):"").concat(ce),H.dom.style.transform="",H.dom.style.width="",H.dom.style.height="")})},H.getCurrentDrawerSome=function(){return!Object.keys(E).some(function(q){return E[q]})},H.getLevelDom=function(q){var re=q.level,ee=q.getContainer;if(i)return;var Ce=ee&&ee(),Ee=Ce?Ce.parentNode:null;if(H.levelDom=[],re==="all"){var pe=Ee?Array.prototype.slice.call(Ee.children):[];pe.forEach(function(Me){Me.nodeName!=="SCRIPT"&&Me.nodeName!=="STYLE"&&Me.nodeName!=="LINK"&&Me!==Ce&&H.levelDom.push(Me)})}else re&&w(re).forEach(function(Me){document.querySelectorAll(Me).forEach(function(_e){H.levelDom.push(_e)})})},H.getHorizontalBoolAndPlacementName=function(){var q=H.props.placement,re=q==="left"||q==="right",ee="translate".concat(re?"X":"Y");return{isHorizontal:re,placementName:ee}},H.state={_self:Object(a.a)(H)},H}return Object(_.a)(F,[{key:"componentDidMount",value:function(){var H=this;if(!i){var q=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return q=!0,null}}))}catch(pe){}this.passive=q?{passive:!1}:!1}var re=this.props,ee=re.open,Ce=re.getContainer,Ee=Ce&&Ce();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ee&&(Ee&&Ee.parentNode===document.body&&(E[this.drawerId]=ee),this.openLevelTransition(),this.forceUpdate(function(){H.domFocus()}))}},{key:"componentDidUpdate",value:function(H){var q=this.props,re=q.open,ee=q.getContainer,Ce=ee&&ee();re!==H.open&&(re&&this.domFocus(),Ce&&Ce.parentNode===document.body&&(E[this.drawerId]=!!re),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var H=this.props,q=H.getOpenCount,re=H.open,ee=H.switchScrollingEffect,Ce=typeof q=="function"&&q();delete E[this.drawerId],re&&(this.setLevelTransform(!1),document.body.style.touchAction=""),Ce||(document.body.style.overflow="",ee(!0))}},{key:"render",value:function(){var H,q=this,re=this.props,ee=re.className,Ce=re.children,Ee=re.style,pe=re.width,Me=re.height,_e=re.defaultOpen,he=re.open,ce=re.prefixCls,oe=re.placement,Se=re.level,te=re.levelMove,ue=re.ease,Oe=re.duration,le=re.getContainer,Q=re.handler,Y=re.onChange,Z=re.afterVisibleChange,be=re.showMask,ge=re.maskClosable,Re=re.maskStyle,Ze=re.onClose,qe=re.onHandleClick,et=re.keyboard,nt=re.getOpenCount,ut=re.switchScrollingEffect,ot=Object(M.a)(re,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),je=this.dom?he:!1,De=h()(ce,(H={},Object(o.a)(H,"".concat(ce,"-").concat(oe),!0),Object(o.a)(H,"".concat(ce,"-open"),je),Object(o.a)(H,ee||"",!!ee),Object(o.a)(H,"no-mask",!be),H)),rt=this.getHorizontalBoolAndPlacementName(),lt=rt.placementName,Je=oe==="left"||oe==="top"?"-100%":"100%",tt=je?"":"".concat(lt,"(").concat(Je,")"),Ue=Q&&v.cloneElement(Q,{onClick:function(Ie){Q.props.onClick&&Q.props.onClick(),qe&&qe(Ie)},ref:function(Ie){q.handlerDom=Ie}});return v.createElement("div",Object.assign({},ot,{tabIndex:-1,className:De,style:Ee,ref:function(Ie){q.dom=Ie},onKeyDown:je&&et?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),be&&v.createElement("div",{className:"".concat(ce,"-mask"),onClick:ge?Ze:void 0,style:Re,ref:function(Ie){q.maskDom=Ie}}),v.createElement("div",{className:"".concat(ce,"-content-wrapper"),style:{transform:tt,msTransform:tt,width:y(pe)?"".concat(pe,"px"):pe,height:y(Me)?"".concat(Me,"px"):Me},ref:function(Ie){q.contentWrapper=Ie}},v.createElement("div",{className:"".concat(ce,"-content"),ref:function(Ie){q.contentDom=Ie},onTouchStart:je&&be?this.removeStartHandler:void 0,onTouchMove:je&&be?this.removeMoveHandler:void 0},Ce),Ue))}}],[{key:"getDerivedStateFromProps",value:function(H,q){var re=q.prevProps,ee=q._self,Ce={prevProps:H};if(re!==void 0){var Ee=H.placement,pe=H.level;Ee!==re.placement&&(ee.contentDom=null),pe!==re.level&&ee.getLevelDom(H)}return Ce}}]),F}(v.Component);x.defaultProps={switchScrollingEffect:function(){}};var T=x;function N(W){var G=j();return function(){var B=Object(l.a)(W),H;if(G){var q=Object(l.a)(this).constructor;H=Reflect.construct(B,arguments,q)}else H=B.apply(this,arguments);return Object(f.a)(this,H)}}function j(){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(W){return!1}}var L=function(W){Object(D.a)(F,W);var G=N(F);function F(B){var H;Object(u.a)(this,F),H=G.call(this,B),H.onHandleClick=function(re){var ee=H.props,Ce=ee.onHandleClick,Ee=ee.open;if(Ce&&Ce(re),typeof Ee=="undefined"){var pe=H.state.open;H.setState({open:!pe})}},H.onClose=function(re){var ee=H.props,Ce=ee.onClose,Ee=ee.open;Ce&&Ce(re),typeof Ee=="undefined"&&H.setState({open:!1})};var q=typeof B.open!="undefined"?B.open:!!B.defaultOpen;return H.state={open:q},"onMaskClick"in B&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),H}return Object(_.a)(F,[{key:"render",value:function(){var H=this,q=this.props,re=q.defaultOpen,ee=q.getContainer,Ce=q.wrapperClassName,Ee=q.forceRender,pe=q.handler,Me=Object(M.a)(q,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),_e=this.state.open;if(!ee)return v.createElement("div",{className:Ce,ref:function(oe){H.dom=oe}},v.createElement(T,Object.assign({},Me,{open:_e,handler:pe,getContainer:function(){return H.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var he=!!pe||Ee;return v.createElement(C.a,{visible:_e,forceRender:he,getContainer:ee,wrapperClassName:Ce},function(ce){var oe=ce.visible,Se=ce.afterClose,te=Object(M.a)(ce,["visible","afterClose"]);return v.createElement(T,Object.assign({},Me,te,{open:oe!==void 0?oe:_e,afterVisibleChange:Se!==void 0?Se:Me.afterVisibleChange,handler:pe,onClose:H.onClose,onHandleClick:H.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(H,q){var re=q.prevProps,ee={prevProps:H};return typeof re!="undefined"&&H.open!==re.open&&(ee.open=H.open),ee}}]),F}(v.Component);L.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:v.createElement("div",{className:"drawer-handle"},v.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var V=L,K=J.a=V},fyJ8:function(I,J,P){"use strict";var M=P("rePB"),u=P("VTBJ"),_=P("Ff2n"),D=P("U8pU"),f=P("q1tI"),l=P.n(f),C=P("TSYQ"),v=P.n(C),o=P("c+Xe"),a=P("sR1s");function r(g){return g&&Object(D.a)(g)==="object"&&!Array.isArray(g)&&!f.isValidElement(g)}function h(g){return typeof g=="string"?!0:Object(o.c)(g)}function m(g,c){var n,s=g.prefixCls,d=g.className,S=g.record,y=g.index,i=g.dataIndex,k=g.render,O=g.children,b=g.component,E=b===void 0?"td":b,x=g.colSpan,T=g.rowSpan,N=g.fixLeft,j=g.fixRight,L=g.firstFixLeft,V=g.lastFixLeft,K=g.firstFixRight,W=g.lastFixRight,G=g.appendNode,F=g.additionalProps,B=F===void 0?{}:F,H=g.ellipsis,q=g.align,re=g.rowType,ee=g.isSticky,Ce="".concat(s,"-cell"),Ee,pe;if(O)pe=O;else{var Me=Object(a.b)(S,i);if(pe=Me,k){var _e=k(Me,S,y);r(_e)?(pe=_e.children,Ee=_e.props):pe=_e}}Object(D.a)(pe)==="object"&&!Array.isArray(pe)&&!f.isValidElement(pe)&&(pe=null),H&&(V||K)&&(pe=f.createElement("span",{className:"".concat(Ce,"-content")},pe));var he=Ee||{},ce=he.colSpan,oe=he.rowSpan,Se=he.style,te=he.className,ue=Object(_.a)(he,["colSpan","rowSpan","style","className"]),Oe=ce!==void 0?ce:x,le=oe!==void 0?oe:T;if(Oe===0||le===0)return null;var Q={},Y=typeof N=="number",Z=typeof j=="number";Y&&(Q.position="sticky",Q.left=N),Z&&(Q.position="sticky",Q.right=j);var be={};q&&(be.textAlign=q);var ge,Re=H===!0?{showTitle:!0}:H;Re&&(Re.showTitle||re==="header")&&(typeof pe=="string"||typeof pe=="number"?ge=pe.toString():f.isValidElement(pe)&&typeof pe.props.children=="string"&&(ge=pe.props.children));var Ze=Object(u.a)(Object(u.a)(Object(u.a)({title:ge},ue),B),{},{colSpan:Oe&&Oe!==1?Oe:null,rowSpan:le&&le!==1?le:null,className:v()(Ce,d,(n={},Object(M.a)(n,"".concat(Ce,"-fix-left"),Y),Object(M.a)(n,"".concat(Ce,"-fix-left-first"),L),Object(M.a)(n,"".concat(Ce,"-fix-left-last"),V),Object(M.a)(n,"".concat(Ce,"-fix-right"),Z),Object(M.a)(n,"".concat(Ce,"-fix-right-first"),K),Object(M.a)(n,"".concat(Ce,"-fix-right-last"),W),Object(M.a)(n,"".concat(Ce,"-ellipsis"),H),Object(M.a)(n,"".concat(Ce,"-with-append"),G),Object(M.a)(n,"".concat(Ce,"-fix-sticky"),(Y||Z)&&ee),n),B.className,te),style:Object(u.a)(Object(u.a)(Object(u.a)(Object(u.a)({},B.style),be),Q),Se),ref:h(E)?c:null});return f.createElement(E,Object.assign({},Ze),G,pe)}var p=f.forwardRef(m);p.displayName="Cell";var w=f.memo(p,function(g,c){return c.shouldCellUpdate?!c.shouldCellUpdate(c.record,g.record):!1});J.a=w},gRFJ:function(I,J,P){I.exports=[P("rdUC"),P("ynwM"),P("RELg"),P("DlR+"),P("CrYA"),P("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(I){return I<10?"0"+I:I}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(I){return rx_escapable.lastIndex=0,rx_escapable.test(I)?'"'+I.replace(rx_escapable,function(J){var P=meta[J];return typeof P=="string"?P:"\\u"+("0000"+J.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+I+'"'}function str(I,J){var P,M,u,_,D=gap,f,l=J[I];l&&typeof l=="object"&&typeof l.toJSON=="function"&&(l=l.toJSON(I)),typeof rep=="function"&&(l=rep.call(J,I,l));switch(typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,f=[],Object.prototype.toString.apply(l)==="[object Array]"){for(_=l.length,P=0;P<_;P+=1)f[P]=str(P,l)||"null";return u=f.length===0?"[]":gap?`[ `+gap+f.join(`, `+gap)+` `+D+"]":"["+f.join(",")+"]",gap=D,u}if(rep&&typeof rep=="object")for(_=rep.length,P=0;P<_;P+=1)typeof rep[P]=="string"&&(M=rep[P],u=str(M,l),u&&f.push(quote(M)+(gap?": ":":")+u));else for(M in l)Object.prototype.hasOwnProperty.call(l,M)&&(u=str(M,l),u&&f.push(quote(M)+(gap?": ":":")+u));return u=f.length===0?"{}":gap?`{ `+gap+f.join(`, `+gap)+` `+D+"}":"{"+f.join(",")+"}",gap=D,u}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(I,J,P){var M;if(gap="",indent="",typeof P=="number")for(M=0;MK.length)&&(W=K.length);for(var G=0,F=new Array(W);G=0)continue;if(!Object.prototype.propertyIsEnumerable.call(K,F))continue;G[F]=K[F]}}return G}function w(K,W){if(K==null)return{};var G={},F=Object.keys(K),B,H;for(H=0;H=0)continue;G[B]=K[B]}return G}var g=function(W){var G=W.className,F=W.percent,B=W.prefixCls,H=W.strokeColor,q=W.strokeLinecap,re=W.strokeWidth,ee=W.style,Ce=W.trailColor,Ee=W.trailWidth,pe=W.transition,Me=p(W,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Me.gapPosition;var _e=Array.isArray(F)?F:[F],he=Array.isArray(H)?H:[H],ce=l(_e),oe=v(ce,1),Se=oe[0],te=re/2,ue=100-re/2,Oe="M ".concat(q==="round"?te:0,",").concat(te,` L `).concat(q==="round"?ue:100,",").concat(te),le="0 0 100 ".concat(re),Q=0;return u.a.createElement("svg",C({className:D()("".concat(B,"-line"),G),viewBox:le,preserveAspectRatio:"none",style:ee},Me),u.a.createElement("path",{className:"".concat(B,"-line-trail"),d:Oe,strokeLinecap:q,stroke:Ce,strokeWidth:Ee||re,fillOpacity:"0"}),_e.map(function(Y,Z){var be={strokeDasharray:"".concat(Y,"px, 100px"),strokeDashoffset:"-".concat(Q,"px"),transition:pe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},ge=he[Z]||he[he.length-1];return Q+=Y,u.a.createElement("path",{key:Z,className:"".concat(B,"-line-path"),d:Oe,strokeLinecap:q,stroke:ge,strokeWidth:re,fillOpacity:"0",ref:Se[Z],style:be})}))};g.defaultProps=f;var c=g;function n(){return n=Object.assign||function(K){for(var W=1;WK.length)&&(W=K.length);for(var G=0,F=new Array(W);G=0)continue;if(!Object.prototype.propertyIsEnumerable.call(K,F))continue;G[F]=K[F]}}return G}function b(K,W){if(K==null)return{};var G={},F=Object.keys(K),B,H;for(H=0;H=0)continue;G[B]=K[B]}return G}var E=0;function x(K){return+K.replace("%","")}function T(K){return Array.isArray(K)?K:[K]}function N(K,W,G,F){var B=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,H=arguments.length>5?arguments[5]:void 0,q=50-F/2,re=0,ee=-q,Ce=0,Ee=-2*q;switch(H){case"left":re=-q,ee=0,Ce=2*q,Ee=0;break;case"right":re=q,ee=0,Ce=-2*q,Ee=0;break;case"bottom":ee=q,Ee=2*q;break;default:}var pe="M 50,50 m ".concat(re,",").concat(ee,` a `).concat(q,",").concat(q," 0 1 1 ").concat(Ce,",").concat(-Ee,` a `).concat(q,",").concat(q," 0 1 1 ").concat(-Ce,",").concat(Ee),Me=Math.PI*2*q,_e={stroke:G,strokeDasharray:"".concat(W/100*(Me-B),"px ").concat(Me,"px"),strokeDashoffset:"-".concat(B/2+K/100*(Me-B),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:pe,pathStyle:_e}}var j=function(W){var G=W.prefixCls,F=W.strokeWidth,B=W.trailWidth,H=W.gapDegree,q=W.gapPosition,re=W.trailColor,ee=W.strokeLinecap,Ce=W.style,Ee=W.className,pe=W.strokeColor,Me=W.percent,_e=O(W,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),he=Object(M.useMemo)(function(){return E+=1,E},[]),ce=N(0,100,re,F,H,q),oe=ce.pathString,Se=ce.pathStyle,te=T(Me),ue=T(pe),Oe=ue.find(function(be){return Object.prototype.toString.call(be)==="[object Object]"}),le=l(te),Q=s(le,1),Y=Q[0],Z=function(){var ge=0;return te.map(function(Re,Ze){var qe=ue[Ze]||ue[ue.length-1],et=Object.prototype.toString.call(qe)==="[object Object]"?"url(#".concat(G,"-gradient-").concat(he,")"):"",nt=N(ge,Re,qe,F,H,q);return ge+=Re,u.a.createElement("path",{key:Ze,className:"".concat(G,"-circle-path"),d:nt.pathString,stroke:et,strokeLinecap:ee,strokeWidth:F,opacity:Re===0?0:1,fillOpacity:"0",style:nt.pathStyle,ref:Y[Ze]})})};return u.a.createElement("svg",n({className:D()("".concat(G,"-circle"),Ee),viewBox:"0 0 100 100",style:Ce},_e),Oe&&u.a.createElement("defs",null,u.a.createElement("linearGradient",{id:"".concat(G,"-gradient-").concat(he),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Oe).sort(function(be,ge){return x(be)-x(ge)}).map(function(be,ge){return u.a.createElement("stop",{key:ge,offset:be,stopColor:Oe[be]})}))),u.a.createElement("path",{className:"".concat(G,"-circle-trail"),d:oe,stroke:re,strokeLinecap:ee,strokeWidth:B||F,fillOpacity:"0",style:Se}),Z().reverse())};j.defaultProps=f;var L=j,V={Line:c,Circle:L}},hW8S:function(I,J,P){"use strict";P.d(J,"a",function(){return D}),P.d(J,"c",function(){return f}),P.d(J,"b",function(){return l});var M=P("VTBJ"),u=P("Ff2n"),_=P("Kwbf"),D="RC_TABLE_INTERNAL_COL_DEFINE";function f(C){var v=C.expandable,o=Object(u.a)(C,["expandable"]);return"expandable"in C?Object(M.a)(Object(M.a)({},o),v):o}function l(C){return Object.keys(C).reduce(function(v,o){return(o.substr(0,5)==="data-"||o.substr(0,5)==="aria-")&&(v[o]=C[o]),v},{})}},i3hx:function(I,J,P){},jO9C:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(M){return M.pad.Iso97971={pad:function(u,_){u.concat(M.lib.WordArray.create([2147483648],1)),M.pad.ZeroPadding.pad(u,_)},unpad:function(u){M.pad.ZeroPadding.unpad(u),u.sigBytes--}},M.pad.Iso97971})},je13:function(I,J,P){var M=P("5nXd"),u=P("gRFJ"),_=[P("uQRt")];I.exports=M.createStore(u,_)},k3GJ:function(I,J,P){"use strict";P.d(J,"a",function(){return Rn});var M=P("rePB"),u=P("ODXe"),_=P("Ff2n"),D=P("VTBJ"),f=P("q1tI"),l=P("TSYQ"),C=P.n(l),v=P("Zm9Q"),o=P("6cGi"),a=P("KQm4"),r=P("xEkU"),h=P.n(r),m=P("t23M");function p(Ne){var Ve=Object(f.useRef)(),Qe=Object(f.useRef)(!1);function Fe(){for(var ve=arguments.length,Le=new Array(ve),we=0;weit&&(bt=it-xt),Object(f.useMemo)(function(){if(!Le.length)return[0,0];for(var At=Le.length,Vt=At,pr=0;prXe+bt){Vt=pr-1;break}}for(var yr=0,Or=At-1;Or>=0;Or-=1){var Sr=Ne.get(Le[Or].key)||S;if(Sr[Ye]1&&arguments[1]!==void 0?arguments[1]:!1,Fe=Ve&&typeof Ve.getBoundingClientRect=="function"&&Ve.getBoundingClientRect().width;if(Fe){if(Qe){var ve=getComputedStyle(Ve),Le=ve.marginLeft,we=ve.marginRight;Fe+=+Le.replace("px","")+ +we.replace("px","")}Fe=+Fe.toFixed(6)}return Fe||0},ge=function(Ve,Qe,Fe){Ve&&Object(K.a)(Ve.style)==="object"&&(Ve.style[Qe]=Fe)},Re=function(){return te.any},Ze=P("bdgK"),qe=P("i8i4"),et=P.n(qe),nt=P("wgJM"),ut=P("l4aY"),ot=P("m+aA"),je=P("c+Xe"),De=P("zT1h"),rt=P("QC+M");function lt(Ne,Ve,Qe){return Qe?Ne[0]===Ve[0]:Ne[0]===Ve[0]&&Ne[1]===Ve[1]}function Je(Ne,Ve,Qe){var Fe=Ne[Ve]||{};return Object(D.a)(Object(D.a)({},Fe),Qe)}function tt(Ne,Ve,Qe,Fe){for(var ve=Qe.points,Le=Object.keys(Ne),we=0;we1&&arguments[1]!==void 0?arguments[1]:2;Ve();var Le=Object(nt.a)(function(){ve<=1?Fe({isCanceled:function(){return Le!==Ne.current}}):Qe(Fe,ve-1)});Ne.current=Le}return f.useEffect(function(){return function(){Ve()}},[]),[Qe,Ve]},oi=[Wt,Lr,Cr,Ct],Tt=!1,Rt=!0;function Et(Ne){return Ne===Cr||Ne===Ct}var Ar=function(Ne,Ve){var Qe=f.useState(cr),Fe=Object(u.a)(Qe,2),ve=Fe[0],Le=Fe[1],we=Hr(),Be=Object(u.a)(we,2),He=Be[0],Ye=Be[1];function Xe(){Le(Wt)}return $r(function(){if(ve!==cr&&ve!==Ct){var it=oi.indexOf(ve),dt=oi[it+1],xt=Ve(ve);xt===Tt?Le(dt):He(function(bt){function At(){if(bt.isCanceled())return;Le(dt)}xt===!0?At():Promise.resolve(xt).then(At)})}},[Ne,ve]),f.useEffect(function(){return function(){Ye()}},[]),[Xe,ve]},Br=function(Ne){var Ve=Object(f.useRef)(),Qe=Object(f.useRef)(Ne);Qe.current=Ne;var Fe=f.useCallback(function(we){Qe.current(we)},[]);function ve(we){we&&(we.removeEventListener(It,Fe),we.removeEventListener(vt,Fe))}function Le(we){Ve.current&&Ve.current!==we&&ve(Ve.current),we&&we!==Ve.current&&(we.addEventListener(It,Fe),we.addEventListener(vt,Fe),Ve.current=we)}return f.useEffect(function(){return function(){ve(Ve.current)}},[]),[Le,ve]};function Xt(Ne,Ve,Qe,Fe){var ve=Fe.motionEnter,Le=ve===void 0?!0:ve,we=Fe.motionAppear,Be=we===void 0?!0:we,He=Fe.motionLeave,Ye=He===void 0?!0:He,Xe=Fe.motionDeadline,it=Fe.motionLeaveImmediately,dt=Fe.onAppearPrepare,xt=Fe.onEnterPrepare,bt=Fe.onLeavePrepare,At=Fe.onAppearStart,Vt=Fe.onEnterStart,pr=Fe.onLeaveStart,gr=Fe.onAppearActive,yr=Fe.onEnterActive,Or=Fe.onLeaveActive,Sr=Fe.onAppearEnd,br=Fe.onEnterEnd,Xr=Fe.onLeaveEnd,Ir=Fe.onVisibleChanged,Dn=lr(),Nr=Object(u.a)(Dn,2),tr=Nr[0],Zt=Nr[1],Ur=lr(_t),Yr=Object(u.a)(Ur,2),Kt=Yr[0],Qr=Yr[1],kn=lr(null),nn=Object(u.a)(kn,2),gn=nn[0],pn=nn[1],Bn=Object(f.useRef)(!1),ei=Object(f.useRef)(null),Pn=Object(f.useRef)(!1),bi=Object(f.useRef)(null);function Wi(){var Sn=Qe();return Sn||bi.current}var Ci=Object(f.useRef)(!1);function ti(Sn){var fn=Wi();if(Sn&&!Sn.deadline&&Sn.target!==fn)return;var ri;Kt===rr&&Ci.current?ri=Sr==null?void 0:Sr(fn,Sn):Kt===sr&&Ci.current?ri=br==null?void 0:br(fn,Sn):Kt===$t&&Ci.current&&(ri=Xr==null?void 0:Xr(fn,Sn)),ri!==!1&&!Pn.current&&(Qr(_t),pn(null))}var Cn=Br(ti),vn=Object(u.a)(Cn,1),In=vn[0],Ln=f.useMemo(function(){var Sn,fn,ri;switch(Kt){case"appear":return Sn={},Object(M.a)(Sn,Wt,dt),Object(M.a)(Sn,Lr,At),Object(M.a)(Sn,Cr,gr),Sn;case"enter":return fn={},Object(M.a)(fn,Wt,xt),Object(M.a)(fn,Lr,Vt),Object(M.a)(fn,Cr,yr),fn;case"leave":return ri={},Object(M.a)(ri,Wt,bt),Object(M.a)(ri,Lr,pr),Object(M.a)(ri,Cr,Or),ri;default:return{}}},[Kt]),Hi=Ar(Kt,function(Sn){if(Sn===Wt){var fn=Ln[Wt];return fn?fn(Wi()):Tt}if(mn in Ln){var ri;pn(((ri=Ln[mn])===null||ri===void 0?void 0:ri.call(Ln,Wi(),null))||null)}return mn===Cr&&(In(Wi()),Xe>0&&(clearTimeout(ei.current),ei.current=setTimeout(function(){ti({deadline:!0})},Xe))),Rt}),ra=Object(u.a)(Hi,2),na=ra[0],mn=ra[1],Ji=Et(mn);Ci.current=Ji,$r(function(){Zt(Ve);var Sn=Bn.current;if(Bn.current=!0,!Ne)return;var fn;!Sn&&Ve&&Be&&(fn=rr),Sn&&Ve&&Le&&(fn=sr),(Sn&&!Ve&&Ye||!Sn&&it&&!Ve&&Ye)&&(fn=$t),fn&&(Qr(fn),na())},[Ve]),Object(f.useEffect)(function(){(Kt===rr&&!Be||Kt===sr&&!Le||Kt===$t&&!Ye)&&Qr(_t)},[Be,Le,Ye]),Object(f.useEffect)(function(){return function(){clearTimeout(ei.current),Pn.current=!0}},[]),Object(f.useEffect)(function(){tr!==void 0&&Kt===_t&&(Ir==null||Ir(tr))},[tr,Kt]);var ia=gn;return Ln[Wt]&&mn===Lr&&(ia=Object(D.a)({transition:"none"},ia)),[Kt,mn,ia,tr!=null?tr:Ve]}var Nt=function(Ne){Object(E.a)(Qe,Ne);var Ve=Object(x.a)(Qe);function Qe(){return Object(k.a)(this,Qe),Ve.apply(this,arguments)}return Object(O.a)(Qe,[{key:"render",value:function(){return this.props.children}}]),Qe}(f.Component),jr=Nt;function bn(Ne){var Ve=Ne;Object(K.a)(Ne)==="object"&&(Ve=Ne.transitionSupport);function Qe(ve){return!!(ve.motionName&&Ve)}var Fe=f.forwardRef(function(ve,Le){var we=ve.visible,Be=we===void 0?!0:we,He=ve.removeOnLeave,Ye=He===void 0?!0:He,Xe=ve.forceRender,it=ve.children,dt=ve.motionName,xt=ve.leavedClassName,bt=ve.eventProps,At=Qe(ve),Vt=Object(f.useRef)(),pr=Object(f.useRef)();function gr(){try{return Object(ot.a)(Vt.current||pr.current)}catch(Qr){return null}}var yr=Xt(At,Be,gr,ve),Or=Object(u.a)(yr,4),Sr=Or[0],br=Or[1],Xr=Or[2],Ir=Or[3],Dn=f.useRef(Ir);Ir&&(Dn.current=!0);var Nr=Object(f.useRef)(Le);Nr.current=Le;var tr=f.useCallback(function(Qr){Vt.current=Qr,Object(je.b)(Nr.current,Qr)},[]),Zt,Ur=Object(D.a)(Object(D.a)({},bt),{},{visible:Be});if(!it)Zt=null;else if(Sr===_t||!Qe(ve))Ir?Zt=it(Object(D.a)({},Ur),tr):!Ye&&Dn.current?Zt=it(Object(D.a)(Object(D.a)({},Ur),{},{className:xt}),tr):Xe?Zt=it(Object(D.a)(Object(D.a)({},Ur),{},{style:{display:"none"}}),tr):Zt=null;else{var Yr,Kt;br===Wt?Kt="prepare":Et(br)?Kt="active":br===Lr&&(Kt="start"),Zt=it(Object(D.a)(Object(D.a)({},Ur),{},{className:C()(Lt(dt,Sr),(Yr={},Object(M.a)(Yr,Lt(dt,"".concat(Sr,"-").concat(Kt)),Kt),Object(M.a)(Yr,dt,typeof dt=="string"),Yr)),style:Xr}),tr)}return f.createElement(jr,{ref:pr},Zt)});return Fe.displayName="CSSMotion",Fe}var zr=bn(wt),mt="add",Ut="keep",an="remove",xn="removed";function On(Ne){var Ve;return Ne&&Object(K.a)(Ne)==="object"&&"key"in Ne?Ve=Ne:Ve={key:Ne},Object(D.a)(Object(D.a)({},Ve),{},{key:String(Ve.key)})}function An(){var Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Ne.map(On)}function se(){var Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Qe=[],Fe=0,ve=Ve.length,Le=An(Ne),we=An(Ve);Le.forEach(function(Ye){for(var Xe=!1,it=Fe;it1});return He.forEach(function(Ye){Qe=Qe.filter(function(Xe){var it=Xe.key,dt=Xe.status;return it!==Ye||dt!==an}),Qe.forEach(function(Xe){Xe.key===Ye&&(Xe.status=Ut)})}),Qe}var z=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function X(Ne){var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zr,Qe=function(Fe){Object(E.a)(Le,Fe);var ve=Object(x.a)(Le);function Le(){var we;return Object(k.a)(this,Le),we=ve.apply(this,arguments),we.state={keyEntities:[]},we.removeKey=function(Be){we.setState(function(He){var Ye=He.keyEntities;return{keyEntities:Ye.map(function(Xe){return Xe.key!==Be?Xe:Object(D.a)(Object(D.a)({},Xe),{},{status:xn})})}})},we}return Object(O.a)(Le,[{key:"render",value:function(){var Be=this,He=this.state.keyEntities,Ye=this.props,Xe=Ye.component,it=Ye.children,dt=Ye.onVisibleChanged,xt=Object(_.a)(Ye,["component","children","onVisibleChanged"]),bt=Xe||f.Fragment,At={};return z.forEach(function(Vt){At[Vt]=xt[Vt],delete xt[Vt]}),delete xt.keys,f.createElement(bt,xt,He.map(function(Vt){var pr=Vt.status,gr=Object(_.a)(Vt,["status"]),yr=pr===mt||pr===Ut;return f.createElement(Ve,Object(i.a)({},At,{key:gr.key,visible:yr,eventProps:gr,onVisibleChanged:function(Sr){dt==null||dt(Sr,{key:gr.key}),Sr||Be.removeKey(gr.key)}}),it)}))}}],[{key:"getDerivedStateFromProps",value:function(Be,He){var Ye=Be.keys,Xe=He.keyEntities,it=An(Ye),dt=se(Xe,it);return{keyEntities:dt.filter(function(xt){var bt=Xe.find(function(At){var Vt=At.key;return xt.key===Vt});return!(bt&&bt.status===xn&&xt.status===an)})}}}]),Le}(f.Component);return Qe.defaultProps={component:"div"},Qe}var ne=X(wt),de=zr;function ie(Ne){var Ve=Ne.prefixCls,Qe=Ne.motion,Fe=Ne.animation,ve=Ne.transitionName;return Qe||(Fe?{motionName:"".concat(Ve,"-").concat(Fe)}:ve?{motionName:ve}:null)}function ze(Ne){var Ve=Ne.prefixCls,Qe=Ne.visible,Fe=Ne.zIndex,ve=Ne.mask,Le=Ne.maskMotion,we=Ne.maskAnimation,Be=Ne.maskTransitionName;if(!ve)return null;var He={};return(Le||Be||we)&&(He=Object(D.a)({motionAppear:!0},ie({motion:Le,prefixCls:Ve,transitionName:Be,animation:we}))),f.createElement(de,Object(i.a)({},He,{visible:Qe,removeOnLeave:!0}),function(Ye){var Xe=Ye.className;return f.createElement("div",{style:{zIndex:Fe},className:C()("".concat(Ve,"-mask"),Xe)})})}var ht=P("9mu1"),St=P("o0o1"),Pt=P.n(St),pt=P("HaE+"),Ht=["measure","align",null,"motion"],zt=function(Ne,Ve){var Qe=Object(f.useState)(null),Fe=Object(u.a)(Qe,2),ve=Fe[0],Le=Fe[1],we=Object(f.useRef)(),Be=Object(f.useRef)(!1);function He(it){Be.current||Le(it)}function Ye(){nt.a.cancel(we.current)}function Xe(it){Ye(),we.current=Object(nt.a)(function(){He(function(dt){switch(ve){case"align":return"motion";case"motion":return"stable";default:}return dt}),it==null||it()})}return Object(f.useEffect)(function(){He("measure")},[Ne]),Object(f.useEffect)(function(){switch(ve){case"measure":Ve();break;default:}ve&&(we.current=Object(nt.a)(Object(pt.a)(Pt.a.mark(function it(){var dt,xt;return Pt.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:dt=Ht.indexOf(ve),xt=Ht[dt+1],xt&&dt!==-1&&He(xt);case 3:case"end":return At.stop()}},it)}))))},[ve]),Object(f.useEffect)(function(){return function(){Be.current=!0,Ye()}},[]),[ve,Xe]},Mr=function(Ne){var Ve=f.useState({width:0,height:0}),Qe=Object(u.a)(Ve,2),Fe=Qe[0],ve=Qe[1];function Le(Be){ve({width:Be.offsetWidth,height:Be.offsetHeight})}var we=f.useMemo(function(){var Be={};if(Ne){var He=Fe.width,Ye=Fe.height;Ne.indexOf("height")!==-1&&Ye?Be.height=Ye:Ne.indexOf("minHeight")!==-1&&Ye&&(Be.minHeight=Ye),Ne.indexOf("width")!==-1&&He?Be.width=He:Ne.indexOf("minWidth")!==-1&&He&&(Be.minWidth=He)}return Be},[Ne,Fe]);return[we,Le]},on=f.forwardRef(function(Ne,Ve){var Qe=Ne.visible,Fe=Ne.prefixCls,ve=Ne.className,Le=Ne.style,we=Ne.children,Be=Ne.zIndex,He=Ne.stretch,Ye=Ne.destroyPopupOnHide,Xe=Ne.forceRender,it=Ne.align,dt=Ne.point,xt=Ne.getRootDomNode,bt=Ne.getClassNameFromAlign,At=Ne.onAlign,Vt=Ne.onMouseEnter,pr=Ne.onMouseLeave,gr=Ne.onMouseDown,yr=Ne.onTouchStart,Or=Object(f.useRef)(),Sr=Object(f.useRef)(),br=Object(f.useState)(),Xr=Object(u.a)(br,2),Ir=Xr[0],Dn=Xr[1],Nr=Mr(He),tr=Object(u.a)(Nr,2),Zt=tr[0],Ur=tr[1];function Yr(){He&&Ur(xt())}var Kt=zt(Qe,Yr),Qr=Object(u.a)(Kt,2),kn=Qr[0],nn=Qr[1],gn=Object(f.useRef)();function pn(){return dt||xt}function Bn(){var Cn;(Cn=Or.current)===null||Cn===void 0||Cn.forceAlign()}function ei(Cn,vn){var In=bt(vn);Ir!==In&&Dn(In),kn==="align"&&(Ir!==In?Promise.resolve().then(function(){Bn()}):nn(function(){var Ln;(Ln=gn.current)===null||Ln===void 0||Ln.call(gn)}),At==null||At(Cn,vn))}var Pn=Object(D.a)({},ie(Ne));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Cn){var vn=Pn[Cn];Pn[Cn]=function(In,Ln){return nn(),vn==null?void 0:vn(In,Ln)}});function bi(){return new Promise(function(Cn){gn.current=Cn})}f.useEffect(function(){!Pn.motionName&&kn==="motion"&&nn()},[Pn.motionName,kn]),f.useImperativeHandle(Ve,function(){return{forceAlign:Bn,getElement:function(){return Sr.current}}});var Wi=Object(D.a)(Object(D.a)({},Zt),{},{zIndex:Be,opacity:kn==="motion"||kn==="stable"||!Qe?void 0:0,pointerEvents:kn==="stable"?void 0:"none"},Le),Ci=!0;(it==null?void 0:it.points)&&(kn==="align"||kn==="stable")&&(Ci=!1);var ti=we;return f.Children.count(we)>1&&(ti=f.createElement("div",{className:"".concat(Fe,"-content")},we)),f.createElement(de,Object(i.a)({visible:Qe,ref:Sr,leavedClassName:"".concat(Fe,"-hidden")},Pn,{onAppearPrepare:bi,onEnterPrepare:bi,removeOnLeave:Ye,forceRender:Xe}),function(Cn,vn){var In=Cn.className,Ln=Cn.style,Hi=C()(Fe,ve,Ir,In);return f.createElement(ht.a,{target:pn(),key:"popup",ref:Or,monitorWindowResize:!0,disabled:Ci,align:it,onAlign:ei},f.createElement("div",{ref:vn,className:Hi,onMouseEnter:Vt,onMouseLeave:pr,onMouseDownCapture:gr,onTouchStartCapture:yr,style:Object(D.a)(Object(D.a)({},Ln),Wi)},ti))})});on.displayName="PopupInner";var Zr=on,Qt=f.forwardRef(function(Ne,Ve){var Qe=Ne.prefixCls,Fe=Ne.visible,ve=Ne.zIndex,Le=Ne.children,we=Ne.mobile;we=we===void 0?{}:we;var Be=we.popupClassName,He=we.popupStyle,Ye=we.popupMotion,Xe=Ye===void 0?{}:Ye,it=we.popupRender,dt=f.useRef();f.useImperativeHandle(Ve,function(){return{forceAlign:function(){},getElement:function(){return dt.current}}});var xt=Object(D.a)({zIndex:ve},He),bt=Le;return f.Children.count(Le)>1&&(bt=f.createElement("div",{className:"".concat(Qe,"-content")},Le)),it&&(bt=it(bt)),f.createElement(de,Object(i.a)({visible:Fe,ref:dt,removeOnLeave:!0},Xe),function(At,Vt){var pr=At.className,gr=At.style,yr=C()(Qe,Be,pr);return f.createElement("div",{ref:Vt,className:yr,style:Object(D.a)(Object(D.a)({},gr),xt)},bt)})});Qt.displayName="MobilePopupInner";var Kr=Qt,or=["visible","mobile"],Yt=f.forwardRef(function(Ne,Ve){var Qe=Ne.visible,Fe=Ne.mobile,ve=Object(_.a)(Ne,or),Le=Object(f.useState)(Qe),we=Object(u.a)(Le,2),Be=we[0],He=we[1],Ye=Object(f.useState)(!1),Xe=Object(u.a)(Ye,2),it=Xe[0],dt=Xe[1],xt=Object(D.a)(Object(D.a)({},ve),{},{visible:Be});Object(f.useEffect)(function(){He(Qe),Qe&&Fe&&dt(Ue())},[Qe,Fe]);var bt=it?f.createElement(Kr,Object(i.a)({},xt,{mobile:Fe,ref:Ve})):f.createElement(Zr,Object(i.a)({},xt,{ref:Ve}));return f.createElement("div",null,f.createElement(ze,xt),bt)});Yt.displayName="Popup";var nr=Yt,dr=f.createContext(null),Jr=dr;function un(){}function En(){return""}function wi(Ne){return Ne?Ne.ownerDocument:window.document}var Vi=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Fi(Ne){var Ve=function(Qe){Object(E.a)(ve,Qe);var Fe=Object(x.a)(ve);function ve(Le){var we;Object(k.a)(this,ve),we=Fe.call(this,Le),we.popupRef=f.createRef(),we.triggerRef=f.createRef(),we.attachId=void 0,we.clickOutsideHandler=void 0,we.touchOutsideHandler=void 0,we.contextMenuOutsideHandler1=void 0,we.contextMenuOutsideHandler2=void 0,we.mouseDownTimeout=void 0,we.focusTime=void 0,we.preClickTime=void 0,we.preTouchTime=void 0,we.delayTimer=void 0,we.hasPopupMouseDown=void 0,we.onMouseEnter=function(He){var Ye=we.props.mouseEnterDelay;we.fireEvents("onMouseEnter",He),we.delaySetPopupVisible(!0,Ye,Ye?null:He)},we.onMouseMove=function(He){we.fireEvents("onMouseMove",He),we.setPoint(He)},we.onMouseLeave=function(He){we.fireEvents("onMouseLeave",He),we.delaySetPopupVisible(!1,we.props.mouseLeaveDelay)},we.onPopupMouseEnter=function(){we.clearDelayTimer()},we.onPopupMouseLeave=function(He){var Ye;if(He.relatedTarget&&!He.relatedTarget.setTimeout&&Object(ut.a)((Ye=we.popupRef.current)===null||Ye===void 0?void 0:Ye.getElement(),He.relatedTarget))return;we.delaySetPopupVisible(!1,we.props.mouseLeaveDelay)},we.onFocus=function(He){we.fireEvents("onFocus",He),we.clearDelayTimer(),we.isFocusToShow()&&(we.focusTime=Date.now(),we.delaySetPopupVisible(!0,we.props.focusDelay))},we.onMouseDown=function(He){we.fireEvents("onMouseDown",He),we.preClickTime=Date.now()},we.onTouchStart=function(He){we.fireEvents("onTouchStart",He),we.preTouchTime=Date.now()},we.onBlur=function(He){we.fireEvents("onBlur",He),we.clearDelayTimer(),we.isBlurToHide()&&we.delaySetPopupVisible(!1,we.props.blurDelay)},we.onContextMenu=function(He){He.preventDefault(),we.fireEvents("onContextMenu",He),we.setPopupVisible(!0,He)},we.onContextMenuClose=function(){we.isContextMenuToShow()&&we.close()},we.onClick=function(He){if(we.fireEvents("onClick",He),we.focusTime){var Ye;if(we.preClickTime&&we.preTouchTime?Ye=Math.min(we.preClickTime,we.preTouchTime):we.preClickTime?Ye=we.preClickTime:we.preTouchTime&&(Ye=we.preTouchTime),Math.abs(Ye-we.focusTime)<20)return;we.focusTime=0}we.preClickTime=0,we.preTouchTime=0,we.isClickToShow()&&(we.isClickToHide()||we.isBlurToHide())&&He&&He.preventDefault&&He.preventDefault();var Xe=!we.state.popupVisible;(we.isClickToHide()&&!Xe||Xe&&we.isClickToShow())&&we.setPopupVisible(!we.state.popupVisible,He)},we.onPopupMouseDown=function(){if(we.hasPopupMouseDown=!0,clearTimeout(we.mouseDownTimeout),we.mouseDownTimeout=window.setTimeout(function(){we.hasPopupMouseDown=!1},0),we.context){var He;(He=we.context).onPopupMouseDown.apply(He,arguments)}},we.onDocumentClick=function(He){if(we.props.mask&&!we.props.maskClosable)return;var Ye=He.target,Xe=we.getRootDomNode(),it=we.getPopupDomNode();(!Object(ut.a)(Xe,Ye)||we.isContextMenuOnly())&&!Object(ut.a)(it,Ye)&&!we.hasPopupMouseDown&&we.close()},we.getRootDomNode=function(){var He=we.props.getTriggerDOMNode;if(He)return He(we.triggerRef.current);try{var Ye=Object(ot.a)(we.triggerRef.current);if(Ye)return Ye}catch(Xe){}return et.a.findDOMNode(Object(b.a)(we))},we.getPopupClassNameFromAlign=function(He){var Ye=[],Xe=we.props,it=Xe.popupPlacement,dt=Xe.builtinPlacements,xt=Xe.prefixCls,bt=Xe.alignPoint,At=Xe.getPopupClassNameFromAlign;return it&&dt&&Ye.push(tt(dt,xt,He,bt)),At&&Ye.push(At(He)),Ye.join(" ")},we.getComponent=function(){var He=we.props,Ye=He.prefixCls,Xe=He.destroyPopupOnHide,it=He.popupClassName,dt=He.onPopupAlign,xt=He.popupMotion,bt=He.popupAnimation,At=He.popupTransitionName,Vt=He.popupStyle,pr=He.mask,gr=He.maskAnimation,yr=He.maskTransitionName,Or=He.maskMotion,Sr=He.zIndex,br=He.popup,Xr=He.stretch,Ir=He.alignPoint,Dn=He.mobile,Nr=He.forceRender,tr=we.state,Zt=tr.popupVisible,Ur=tr.point,Yr=we.getPopupAlign(),Kt={};return we.isMouseEnterToShow()&&(Kt.onMouseEnter=we.onPopupMouseEnter),we.isMouseLeaveToHide()&&(Kt.onMouseLeave=we.onPopupMouseLeave),Kt.onMouseDown=we.onPopupMouseDown,Kt.onTouchStart=we.onPopupMouseDown,f.createElement(nr,Object(i.a)({prefixCls:Ye,destroyPopupOnHide:Xe,visible:Zt,point:Ir&&Ur,className:it,align:Yr,onAlign:dt,animation:bt,getClassNameFromAlign:we.getPopupClassNameFromAlign},Kt,{stretch:Xr,getRootDomNode:we.getRootDomNode,style:Vt,mask:pr,zIndex:Sr,transitionName:At,maskAnimation:gr,maskTransitionName:yr,maskMotion:Or,ref:we.popupRef,motion:xt,mobile:Dn,forceRender:Nr}),typeof br=="function"?br():br)},we.attachParent=function(He){nt.a.cancel(we.attachId);var Ye=we.props,Xe=Ye.getPopupContainer,it=Ye.getDocument,dt=we.getRootDomNode(),xt;Xe?(dt||Xe.length===0)&&(xt=Xe(dt)):xt=it(we.getRootDomNode()).body,xt?xt.appendChild(He):we.attachId=Object(nt.a)(function(){we.attachParent(He)})},we.getContainer=function(){var He=we.props.getDocument,Ye=He(we.getRootDomNode()).createElement("div");return Ye.style.position="absolute",Ye.style.top="0",Ye.style.left="0",Ye.style.width="100%",we.attachParent(Ye),Ye},we.setPoint=function(He){var Ye=we.props.alignPoint;if(!Ye||!He)return;we.setState({point:{pageX:He.pageX,pageY:He.pageY}})},we.handlePortalUpdate=function(){we.state.prevPopupVisible!==we.state.popupVisible&&we.props.afterPopupVisibleChange(we.state.popupVisible)},we.triggerContextValue={onPopupMouseDown:we.onPopupMouseDown};var Be;return"popupVisible"in Le?Be=!!Le.popupVisible:Be=!!Le.defaultPopupVisible,we.state={prevPopupVisible:Be,popupVisible:Be},Vi.forEach(function(He){we["fire".concat(He)]=function(Ye){we.fireEvents(He,Ye)}}),we}return Object(O.a)(ve,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var we=this.props,Be=this.state;if(Be.popupVisible){var He;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(He=we.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(De.a)(He,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(He=He||we.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(De.a)(He,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(He=He||we.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(De.a)(He,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(De.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),nt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var we;return((we=this.popupRef.current)===null||we===void 0?void 0:we.getElement())||null}},{key:"getPopupAlign",value:function(){var we=this.props,Be=we.popupPlacement,He=we.popupAlign,Ye=we.builtinPlacements;return Be&&Ye?Je(Ye,Be,He):He}},{key:"setPopupVisible",value:function(we,Be){var He=this.props.alignPoint,Ye=this.state.popupVisible;this.clearDelayTimer(),Ye!==we&&("popupVisible"in this.props||this.setState({popupVisible:we,prevPopupVisible:Ye}),this.props.onPopupVisibleChange(we)),He&&Be&&we&&this.setPoint(Be)}},{key:"delaySetPopupVisible",value:function(we,Be,He){var Ye=this,Xe=Be*1e3;if(this.clearDelayTimer(),Xe){var it=He?{pageX:He.pageX,pageY:He.pageY}:null;this.delayTimer=window.setTimeout(function(){Ye.setPopupVisible(we,it),Ye.clearDelayTimer()},Xe)}else this.setPopupVisible(we,He)}},{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(we){var Be=this.props.children.props,He=this.props;return Be[we]&&He[we]?this["fire".concat(we)]:Be[we]||He[we]}},{key:"isClickToShow",value:function(){var we=this.props,Be=we.action,He=we.showAction;return Be.indexOf("click")!==-1||He.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var we=this.props.action;return we==="contextMenu"||we.length===1&&we[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var we=this.props,Be=we.action,He=we.showAction;return Be.indexOf("contextMenu")!==-1||He.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var we=this.props,Be=we.action,He=we.hideAction;return Be.indexOf("click")!==-1||He.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var we=this.props,Be=we.action,He=we.showAction;return Be.indexOf("hover")!==-1||He.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var we=this.props,Be=we.action,He=we.hideAction;return Be.indexOf("hover")!==-1||He.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var we=this.props,Be=we.action,He=we.showAction;return Be.indexOf("focus")!==-1||He.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var we=this.props,Be=we.action,He=we.hideAction;return Be.indexOf("focus")!==-1||He.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var we;(we=this.popupRef.current)===null||we===void 0||we.forceAlign()}}},{key:"fireEvents",value:function(we,Be){var He=this.props.children.props[we];He&&He(Be);var Ye=this.props[we];Ye&&Ye(Be)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var we=this.state.popupVisible,Be=this.props,He=Be.children,Ye=Be.forceRender,Xe=Be.alignPoint,it=Be.className,dt=Be.autoDestroy,xt=f.Children.only(He),bt={key:"trigger"};this.isContextMenuToShow()?bt.onContextMenu=this.onContextMenu:bt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(bt.onClick=this.onClick,bt.onMouseDown=this.onMouseDown,bt.onTouchStart=this.onTouchStart):(bt.onClick=this.createTwoChains("onClick"),bt.onMouseDown=this.createTwoChains("onMouseDown"),bt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(bt.onMouseEnter=this.onMouseEnter,Xe&&(bt.onMouseMove=this.onMouseMove)):bt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?bt.onMouseLeave=this.onMouseLeave:bt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(bt.onFocus=this.onFocus,bt.onBlur=this.onBlur):(bt.onFocus=this.createTwoChains("onFocus"),bt.onBlur=this.createTwoChains("onBlur"));var At=C()(xt&&xt.props&&xt.props.className,it);At&&(bt.className=At);var Vt=Object(D.a)({},bt);Object(je.c)(xt)&&(Vt.ref=Object(je.a)(this.triggerRef,xt.ref));var pr=f.cloneElement(xt,Vt),gr;return(we||this.popupRef.current||Ye)&&(gr=f.createElement(Ne,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!we&&dt&&(gr=null),f.createElement(Jr.Provider,{value:this.triggerContextValue},pr,gr)}}],[{key:"getDerivedStateFromProps",value:function(we,Be){var He=we.popupVisible,Ye={};return He!==void 0&&Be.popupVisible!==He&&(Ye.popupVisible=He,Ye.prevPopupVisible=Be.popupVisible),Ye}}]),ve}(f.Component);return Ve.contextType=Jr,Ve.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:En,getDocument:wi,onPopupVisibleChange:un,afterPopupVisibleChange:un,onPopupAlign:un,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Ve}var Qn=Fi(rt.a),rn={adjustX:1,adjustY:1},Ri={topLeft:{points:["bl","tl"],overflow:rn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:rn,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:rn,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:rn,offset:[4,0]}},sn={topLeft:{points:["bl","tl"],overflow:rn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:rn,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:rn,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:rn,offset:[4,0]}},hi=Ri,Gr=0,ir={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},qr=function(Ve,Qe,Fe){var ve=le(Qe),Le=Ve.getState();Ve.setState({defaultActiveFirst:Object(D.a)(Object(D.a)({},Le.defaultActiveFirst),{},Object(M.a)({},ve,Fe))})},Tr=function(Ne){Object(E.a)(Qe,Ne);var Ve=Object(x.a)(Qe);function Qe(Fe){var ve;Object(k.a)(this,Qe),ve=Ve.call(this,Fe),ve.onDestroy=function(Xe){ve.props.onDestroy(Xe)},ve.onKeyDown=function(Xe){var it=Xe.keyCode,dt=ve.menuInstance,xt=ve.props.store,bt=ve.getVisible();if(it===g.a.ENTER)return ve.onTitleClick(Xe),qr(xt,ve.props.eventKey,!0),!0;if(it===g.a.RIGHT)return bt?dt.onKeyDown(Xe):(ve.triggerOpenChange(!0),qr(xt,ve.props.eventKey,!0)),!0;if(it===g.a.LEFT){var At;if(bt)At=dt.onKeyDown(Xe);else return;return At||(ve.triggerOpenChange(!1),At=!0),At}return bt&&(it===g.a.UP||it===g.a.DOWN)?dt.onKeyDown(Xe):void 0},ve.onOpenChange=function(Xe){ve.props.onOpenChange(Xe)},ve.onPopupVisibleChange=function(Xe){ve.triggerOpenChange(Xe,Xe?"mouseenter":"mouseleave")},ve.onMouseEnter=function(Xe){var it=ve.props,dt=it.eventKey,xt=it.onMouseEnter,bt=it.store;qr(bt,ve.props.eventKey,!1),xt({key:dt,domEvent:Xe})},ve.onMouseLeave=function(Xe){var it=ve.props,dt=it.parentMenu,xt=it.eventKey,bt=it.onMouseLeave;dt.subMenuInstance=Object(b.a)(ve),bt({key:xt,domEvent:Xe})},ve.onTitleMouseEnter=function(Xe){var it=ve.props,dt=it.eventKey,xt=it.onItemHover,bt=it.onTitleMouseEnter;xt({key:dt,hover:!0}),bt({key:dt,domEvent:Xe})},ve.onTitleMouseLeave=function(Xe){var it=ve.props,dt=it.parentMenu,xt=it.eventKey,bt=it.onItemHover,At=it.onTitleMouseLeave;dt.subMenuInstance=Object(b.a)(ve),bt({key:xt,hover:!1}),At({key:xt,domEvent:Xe})},ve.onTitleClick=function(Xe){var it=Object(b.a)(ve),dt=it.props;if(dt.onTitleClick({key:dt.eventKey,domEvent:Xe}),dt.triggerSubMenuAction==="hover")return;ve.triggerOpenChange(!ve.getVisible(),"click"),qr(dt.store,ve.props.eventKey,!1)},ve.onSubMenuClick=function(Xe){typeof ve.props.onClick=="function"&&ve.props.onClick(ve.addKeyPath(Xe))},ve.onSelect=function(Xe){ve.props.onSelect(Xe)},ve.onDeselect=function(Xe){ve.props.onDeselect(Xe)},ve.getPrefixCls=function(){return"".concat(ve.props.rootPrefixCls,"-submenu")},ve.getActiveClassName=function(){return"".concat(ve.getPrefixCls(),"-active")},ve.getDisabledClassName=function(){return"".concat(ve.getPrefixCls(),"-disabled")},ve.getSelectedClassName=function(){return"".concat(ve.getPrefixCls(),"-selected")},ve.getOpenClassName=function(){return"".concat(ve.props.rootPrefixCls,"-submenu-open")},ve.getVisible=function(){return ve.state.isOpen},ve.getMode=function(){return ve.state.mode},ve.saveMenuInstance=function(Xe){ve.menuInstance=Xe},ve.addKeyPath=function(Xe){return Object(D.a)(Object(D.a)({},Xe),{},{keyPath:(Xe.keyPath||[]).concat(ve.props.eventKey)})},ve.triggerOpenChange=function(Xe,it){var dt=ve.props.eventKey,xt=function(){ve.onOpenChange({key:dt,item:Object(b.a)(ve),trigger:it,open:Xe})};it==="mouseenter"?ve.mouseenterTimeout=setTimeout(function(){xt()},0):xt()},ve.isChildrenSelected=function(){var Xe={find:!1};return Y(ve.props.children,ve.props.selectedKeys,Xe),Xe.find},ve.isInlineMode=function(){return ve.getMode()==="inline"},ve.adjustWidth=function(){if(!ve.subMenuTitle||!ve.menuInstance)return;var Xe=qe.findDOMNode(ve.menuInstance);if(Xe.offsetWidth>=ve.subMenuTitle.offsetWidth)return;Xe.style.minWidth="".concat(ve.subMenuTitle.offsetWidth,"px")},ve.saveSubMenuTitle=function(Xe){ve.subMenuTitle=Xe},ve.getBaseProps=function(){var Xe=Object(b.a)(ve),it=Xe.props,dt=ve.getMode();return{mode:dt==="horizontal"?"vertical":dt,visible:ve.getVisible(),level:it.level+1,inlineIndent:it.inlineIndent,focusable:!1,onClick:ve.onSubMenuClick,onSelect:ve.onSelect,onDeselect:ve.onDeselect,onDestroy:ve.onDestroy,selectedKeys:it.selectedKeys,eventKey:"".concat(it.eventKey,"-menu-"),openKeys:it.openKeys,motion:it.motion,onOpenChange:ve.onOpenChange,subMenuOpenDelay:it.subMenuOpenDelay,parentMenu:Object(b.a)(ve),subMenuCloseDelay:it.subMenuCloseDelay,forceSubMenuRender:it.forceSubMenuRender,triggerSubMenuAction:it.triggerSubMenuAction,builtinPlacements:it.builtinPlacements,defaultActiveFirst:it.store.getState().defaultActiveFirst[le(it.eventKey)],multiple:it.multiple,prefixCls:it.rootPrefixCls,id:ve.internalMenuId,manualRef:ve.saveMenuInstance,itemIcon:it.itemIcon,expandIcon:it.expandIcon,direction:it.direction}},ve.getMotion=function(Xe,it){var dt=Object(b.a)(ve),xt=dt.haveRendered,bt=ve.props,At=bt.motion,Vt=bt.rootPrefixCls,pr=Object(D.a)(Object(D.a)({},At),{},{leavedClassName:"".concat(Vt,"-hidden"),removeOnLeave:!1,motionAppear:xt||!it||Xe!=="inline"});return pr};var Le=Fe.store,we=Fe.eventKey,Be=Le.getState(),He=Be.defaultActiveFirst;ve.isRootMenu=!1;var Ye=!1;return He&&(Ye=He[we]),qr(Le,we,Ye),ve.state={mode:Fe.mode,isOpen:Fe.isOpen},ve}return Object(O.a)(Qe,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ve=this,Le=this.props,we=Le.mode,Be=Le.parentMenu,He=Le.manualRef,Ye=Le.isOpen,Xe=function(){ve.setState({mode:we,isOpen:Ye})},it=Ye!==this.state.isOpen,dt=we!==this.state.mode;if((dt||it)&&(nt.a.cancel(this.updateStateRaf),dt?this.updateStateRaf=Object(nt.a)(Xe):Xe()),He&&He(this),we!=="horizontal"||!(Be==null?void 0:Be.isRootMenu)||!Ye)return;this.minWidthTimeout=setTimeout(function(){return ve.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ve=this.props,Le=ve.onDestroy,we=ve.eventKey;Le&&Le(we),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),nt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(ve,Le){var we=this.getBaseProps();return f.createElement(Bi,Object(i.a)({},we,{id:this.internalMenuId,className:ve,style:Le}),this.props.children)}},{key:"renderChildren",value:function(){var ve=this,Le=this.getBaseProps(),we=Le.mode,Be=Le.visible,He=Le.forceSubMenuRender,Ye=Le.direction,Xe=this.getMotion(we,Be);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Be||He,!this.haveOpened)return f.createElement("div",null);var it=C()("".concat(Le.prefixCls,"-sub"),Object(M.a)({},"".concat(Le.prefixCls,"-rtl"),Ye==="rtl"));return this.isInlineMode()?f.createElement(de,Object(i.a)({visible:Le.visible,forceRender:He},Xe),function(dt){var xt=dt.className,bt=dt.style,At=C()(it,xt);return ve.renderPopupMenu(At,bt)}):this.renderPopupMenu(it)}},{key:"render",value:function(){var ve,Le,we,Be=Object(D.a)({},this.props),He=this.getVisible(),Ye=this.getPrefixCls(),Xe=this.isInlineMode(),it=this.getMode(),dt=C()(Ye,"".concat(Ye,"-").concat(it),(ve={},Object(M.a)(ve,Be.className,!!Be.className),Object(M.a)(ve,this.getOpenClassName(),He),Object(M.a)(ve,this.getActiveClassName(),Be.active||He&&!Xe),Object(M.a)(ve,this.getDisabledClassName(),Be.disabled),Object(M.a)(ve,this.getSelectedClassName(),this.isChildrenSelected()),ve));this.internalMenuId||(Be.eventKey?this.internalMenuId="".concat(Be.eventKey,"$Menu"):(Gr+=1,this.internalMenuId="$__$".concat(Gr,"$Menu")));var xt={},bt={},At={};Be.disabled||(xt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},bt={onClick:this.onTitleClick},At={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Vt={},pr=Be.direction,gr=pr==="rtl";Xe&&(gr?Vt.paddingRight=Be.inlineIndent*Be.level:Vt.paddingLeft=Be.inlineIndent*Be.level);var yr={};this.getVisible()&&(yr={"aria-owns":this.internalMenuId});var Or=null;it!=="horizontal"&&(Or=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Or=f.createElement(this.props.expandIcon,Object(D.a)({},this.props))));var Sr=f.createElement("div",Object(i.a)({ref:this.saveSubMenuTitle,style:Vt,className:"".concat(Ye,"-title"),role:"button"},At,bt,{"aria-expanded":He},yr,{"aria-haspopup":"true",title:typeof Be.title=="string"?Be.title:void 0}),Be.title,Or||f.createElement("i",{className:"".concat(Ye,"-arrow")})),br=this.renderChildren(),Xr=((Le=Be.parentMenu)===null||Le===void 0?void 0:Le.isRootMenu)?Be.parentMenu.props.getPopupContainer:function(pn){return pn.parentNode},Ir=ir[it],Dn=Be.popupOffset?{offset:Be.popupOffset}:{},Nr=C()((we={},Object(M.a)(we,Be.popupClassName,Be.popupClassName&&!Xe),Object(M.a)(we,"".concat(Ye,"-rtl"),gr),we)),tr=Be.disabled,Zt=Be.triggerSubMenuAction,Ur=Be.subMenuOpenDelay,Yr=Be.forceSubMenuRender,Kt=Be.subMenuCloseDelay,Qr=Be.builtinPlacements;Z.forEach(function(pn){return delete Be[pn]}),delete Be.onClick;var kn=gr?Object(D.a)(Object(D.a)({},sn),Qr):Object(D.a)(Object(D.a)({},Ri),Qr);delete Be.direction;var nn=this.getBaseProps(),gn=Xe?null:this.getMotion(nn.mode,nn.visible);return f.createElement("li",Object(i.a)({},Be,xt,{className:dt,role:"menuitem"}),f.createElement(Qn,{prefixCls:Ye,popupClassName:C()("".concat(Ye,"-popup"),Nr),getPopupContainer:Xr,builtinPlacements:kn,popupPlacement:Ir,popupVisible:Xe?!1:He,popupAlign:Dn,popup:Xe?null:br,action:tr||Xe?[]:[Zt],mouseEnterDelay:Ur,mouseLeaveDelay:Kt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Yr,popupMotion:gn},Sr),Xe?br:null)}}]),Qe}(f.Component);Tr.defaultProps={onMouseEnter:ue,onMouseLeave:ue,onTitleMouseEnter:ue,onTitleMouseLeave:ue,onTitleClick:ue,manualRef:ue,mode:"vertical",title:""};var dn=Object(T.b)(function(Ne,Ve){var Qe=Ne.openKeys,Fe=Ne.activeKey,ve=Ne.selectedKeys,Le=Ve.eventKey,we=Ve.subMenuKey;return{isOpen:Qe.indexOf(Le)>-1,active:Fe[we]===Le,selectedKeys:ve}})(Tr);dn.isSubMenu=!0;var _r=dn,fi="menuitem-overflowed",hn=.5,Hn=function(Ne){Object(E.a)(Qe,Ne);var Ve=Object(x.a)(Qe);function Qe(){var Fe;return Object(k.a)(this,Qe),Fe=Ve.apply(this,arguments),Fe.resizeObserver=null,Fe.mutationObserver=null,Fe.originalTotalWidth=0,Fe.overflowedItems=[],Fe.menuItemSizes=[],Fe.cancelFrameId=null,Fe.state={lastVisibleIndex:void 0},Fe.childRef=f.createRef(),Fe.getMenuItemNodes=function(){var ve=Fe.props.prefixCls,Le=Fe.childRef.current;return Le?[].slice.call(Le.children).filter(function(we){return we.className.split(" ").indexOf("".concat(ve,"-overflowed-submenu"))<0}):[]},Fe.getOverflowedSubMenuItem=function(ve,Le,we){var Be=Fe.props,He=Be.overflowedIndicator,Ye=Be.level,Xe=Be.mode,it=Be.prefixCls,dt=Be.theme;if(Ye!==1||Xe!=="horizontal")return null;var xt=Fe.props.children[0],bt=xt.props,At=bt.children,Vt=bt.title,pr=bt.style,gr=Object(_.a)(bt,["children","title","style"]),yr=Object(D.a)({},pr),Or="".concat(ve,"-overflowed-indicator"),Sr="".concat(ve,"-overflowed-indicator");Le.length===0&&we!==!0?yr=Object(D.a)(Object(D.a)({},yr),{},{display:"none"}):we&&(yr=Object(D.a)(Object(D.a)({},yr),{},{visibility:"hidden",position:"absolute"}),Or="".concat(Or,"-placeholder"),Sr="".concat(Sr,"-placeholder"));var br=dt?"".concat(it,"-").concat(dt):"",Xr={};return Z.forEach(function(Ir){gr[Ir]!==void 0&&(Xr[Ir]=gr[Ir])}),f.createElement(_r,Object(i.a)({title:He,className:"".concat(it,"-overflowed-submenu"),popupClassName:br},Xr,{key:Or,eventKey:Sr,disabled:!1,style:yr}),Le)},Fe.setChildrenWidthAndResize=function(){if(Fe.props.mode!=="horizontal")return;var ve=Fe.childRef.current;if(!ve)return;var Le=ve.children;if(!Le||Le.length===0)return;var we=ve.children[Le.length-1];ge(we,"display","inline-block");var Be=Fe.getMenuItemNodes(),He=Be.filter(function(Ye){return Ye.className.split(" ").indexOf(fi)>=0});He.forEach(function(Ye){ge(Ye,"display","inline-block")}),Fe.menuItemSizes=Be.map(function(Ye){return be(Ye,!0)}),He.forEach(function(Ye){ge(Ye,"display","none")}),Fe.overflowedIndicatorWidth=be(ve.children[ve.children.length-1],!0),Fe.originalTotalWidth=Fe.menuItemSizes.reduce(function(Ye,Xe){return Ye+Xe},0),Fe.handleResize(),ge(we,"display","none")},Fe.handleResize=function(){if(Fe.props.mode!=="horizontal")return;var ve=Fe.childRef.current;if(!ve)return;var Le=be(ve);Fe.overflowedItems=[];var we=0,Be;Fe.originalTotalWidth>Le+hn&&(Be=-1,Fe.menuItemSizes.forEach(function(He){we+=He,we+Fe.overflowedIndicatorWidth<=Le&&(Be+=1)})),Fe.setState({lastVisibleIndex:Be})},Fe}return Object(O.a)(Qe,[{key:"componentDidMount",value:function(){var ve=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Le=this.childRef.current;if(!Le)return;this.resizeObserver=new Ze.default(function(we){we.forEach(function(){var Be=ve.cancelFrameId;cancelAnimationFrame(Be),ve.cancelFrameId=requestAnimationFrame(ve.setChildrenWidthAndResize)})}),[].slice.call(Le.children).concat(Le).forEach(function(we){ve.resizeObserver.observe(we)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ve.resizeObserver.disconnect(),[].slice.call(Le.children).concat(Le).forEach(function(we){ve.resizeObserver.observe(we)}),ve.setChildrenWidthAndResize()}),this.mutationObserver.observe(Le,{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(ve){var Le=this,we=this.state.lastVisibleIndex;return(ve||[]).reduce(function(Be,He,Ye){var Xe=He;if(Le.props.mode==="horizontal"){var it=Le.getOverflowedSubMenuItem(He.props.eventKey,[]);we!==void 0&&Le.props.className.indexOf("".concat(Le.props.prefixCls,"-root"))!==-1&&(Ye>we&&(Xe=f.cloneElement(He,{style:{display:"none"},eventKey:"".concat(He.props.eventKey,"-hidden"),className:"".concat(fi)})),Ye===we+1&&(Le.overflowedItems=ve.slice(we+1).map(function(xt){return f.cloneElement(xt,{key:xt.props.eventKey,mode:"vertical-left"})}),it=Le.getOverflowedSubMenuItem(He.props.eventKey,Le.overflowedItems)));var dt=[].concat(Object(a.a)(Be),[it,Xe]);return Ye===ve.length-1&&dt.push(Le.getOverflowedSubMenuItem(He.props.eventKey,[],!0)),dt}return[].concat(Object(a.a)(Be),[Xe])},[])}},{key:"render",value:function(){var ve=this.props,Le=ve.visible,we=ve.prefixCls,Be=ve.overflowedIndicator,He=ve.mode,Ye=ve.level,Xe=ve.tag,it=ve.children,dt=ve.theme,xt=Object(_.a)(ve,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),bt=Xe;return f.createElement(bt,Object(i.a)({ref:this.childRef},xt),this.renderChildren(it))}}]),Qe}(f.Component);Hn.defaultProps={tag:"div",className:""};var Di=Hn;function yi(Ne){return Ne.length?Ne.every(function(Ve){return!!Ve.props.disabled}):!0}function Zn(Ne,Ve,Qe){var Fe=Ne.getState();Ne.setState({activeKey:Object(D.a)(Object(D.a)({},Fe.activeKey),{},Object(M.a)({},Ve,Qe))})}function Si(Ne){return Ne.eventKey||"0-menu-"}function jn(Ne,Ve){var Qe=Ve,Fe=Ne.children,ve=Ne.eventKey;if(Qe){var Le;if(Q(Fe,function(we,Be){we&&we.props&&!we.props.disabled&&Qe===Oe(we,ve,Be)&&(Le=!0)}),Le)return Qe}return Qe=null,Ne.defaultActiveFirst&&Q(Fe,function(we,Be){!Qe&&we&&!we.props.disabled&&(Qe=Oe(we,ve,Be))}),Qe}function Ni(Ne){if(!Ne)return;var Ve=this.instanceArray.indexOf(Ne);Ve!==-1?this.instanceArray[Ve]=Ne:this.instanceArray.push(Ne)}var si=function(Ne){Object(E.a)(Qe,Ne);var Ve=Object(x.a)(Qe);function Qe(Fe){var ve;return Object(k.a)(this,Qe),ve=Ve.call(this,Fe),ve.onKeyDown=function(Le,we){var Be=Le.keyCode,He;if(ve.getFlatInstanceArray().forEach(function(Xe){Xe&&Xe.props.active&&Xe.onKeyDown&&(He=Xe.onKeyDown(Le))}),He)return 1;var Ye=null;return(Be===g.a.UP||Be===g.a.DOWN)&&(Ye=ve.step(Be===g.a.UP?-1:1)),Ye?(Le.preventDefault(),Zn(ve.props.store,Si(ve.props),Ye.props.eventKey),typeof we=="function"&&we(Ye),1):void 0},ve.onItemHover=function(Le){var we=Le.key,Be=Le.hover;Zn(ve.props.store,Si(ve.props),Be?we:null)},ve.onDeselect=function(Le){ve.props.onDeselect(Le)},ve.onSelect=function(Le){ve.props.onSelect(Le)},ve.onClick=function(Le){ve.props.onClick(Le)},ve.onOpenChange=function(Le){ve.props.onOpenChange(Le)},ve.onDestroy=function(Le){ve.props.onDestroy(Le)},ve.getFlatInstanceArray=function(){return ve.instanceArray},ve.step=function(Le){var we=ve.getFlatInstanceArray(),Be=ve.props.store.getState().activeKey[Si(ve.props)],He=we.length;if(!He)return null;Le<0&&(we=we.concat().reverse());var Ye=-1;if(we.every(function(xt,bt){return xt&&xt.props.eventKey===Be?(Ye=bt,!1):!0}),!ve.props.defaultActiveFirst&&Ye!==-1&&yi(we.slice(Ye,He-1)))return;var Xe=(Ye+1)%He,it=Xe;do{var dt=we[it];if(!dt||dt.props.disabled)it=(it+1)%He;else return dt}while(it!==Xe);return null},ve.renderCommonMenuItem=function(Le,we,Be){var He=ve.props.store.getState(),Ye=Object(b.a)(ve),Xe=Ye.props,it=Oe(Le,Xe.eventKey,we),dt=Le.props;if(!dt||typeof Le.type=="string")return Le;var xt=it===He.activeKey,bt=Object(D.a)(Object(D.a)({mode:dt.mode||Xe.mode,level:Xe.level,inlineIndent:Xe.inlineIndent,renderMenuItem:ve.renderMenuItem,rootPrefixCls:Xe.prefixCls,index:we,parentMenu:Xe.parentMenu,manualRef:dt.disabled?void 0:Object(j.a)(Le.ref,Ni.bind(Object(b.a)(ve))),eventKey:it,active:!dt.disabled&&xt,multiple:Xe.multiple,onClick:function(Vt){(dt.onClick||ue)(Vt),ve.onClick(Vt)},onItemHover:ve.onItemHover,motion:Xe.motion,subMenuOpenDelay:Xe.subMenuOpenDelay,subMenuCloseDelay:Xe.subMenuCloseDelay,forceSubMenuRender:Xe.forceSubMenuRender,onOpenChange:ve.onOpenChange,onDeselect:ve.onDeselect,onSelect:ve.onSelect,builtinPlacements:Xe.builtinPlacements,itemIcon:dt.itemIcon||ve.props.itemIcon,expandIcon:dt.expandIcon||ve.props.expandIcon},Be),{},{direction:Xe.direction});return(Xe.mode==="inline"||Re())&&(bt.triggerSubMenuAction="click"),f.cloneElement(Le,Object(D.a)(Object(D.a)({},bt),{},{key:it||we}))},ve.renderMenuItem=function(Le,we,Be){if(!Le)return null;var He=ve.props.store.getState(),Ye={openKeys:He.openKeys,selectedKeys:He.selectedKeys,triggerSubMenuAction:ve.props.triggerSubMenuAction,subMenuKey:Be};return ve.renderCommonMenuItem(Le,we,Ye)},Fe.store.setState({activeKey:Object(D.a)(Object(D.a)({},Fe.store.getState().activeKey),{},Object(M.a)({},Fe.eventKey,jn(Fe,Fe.activeKey)))}),ve.instanceArray=[],ve}return Object(O.a)(Qe,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ve){return this.props.visible||ve.visible||this.props.className!==ve.className||!V()(this.props.style,ve.style)}},{key:"componentDidUpdate",value:function(ve){var Le=this.props,we="activeKey"in Le?Le.activeKey:Le.store.getState().activeKey[Si(Le)],Be=jn(Le,we);if(Be!==we)Zn(Le.store,Si(Le),Be);else if("activeKey"in ve){var He=jn(ve,ve.activeKey);Be!==He&&Zn(Le.store,Si(Le),Be)}}},{key:"render",value:function(){var ve=this,Le=Object(i.a)({},this.props);this.instanceArray=[];var we=C()(Le.prefixCls,Le.className,"".concat(Le.prefixCls,"-").concat(Le.mode)),Be={className:we,role:Le.role||"menu"};Le.id&&(Be.id=Le.id),Le.focusable&&(Be.tabIndex=0,Be.onKeyDown=this.onKeyDown);var He=Le.prefixCls,Ye=Le.eventKey,Xe=Le.visible,it=Le.level,dt=Le.mode,xt=Le.overflowedIndicator,bt=Le.theme;return Z.forEach(function(At){return delete Le[At]}),delete Le.onClick,f.createElement(Di,Object(i.a)({},Le,{prefixCls:He,mode:dt,tag:"ul",level:it,theme:bt,visible:Xe,overflowedIndicator:xt},Be),Object(v.a)(Le.children).map(function(At,Vt){return ve.renderMenuItem(At,Vt,Ye||"0-menu-")}))}}]),Qe}(f.Component);si.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:ue};var pi=Object(T.b)()(si),Bi=pi,li=P("Kwbf");function en(Ne,Ve,Qe){var Fe=Ne.prefixCls,ve=Ne.motion,Le=Ne.defaultMotions,we=Le===void 0?{}:Le,Be=Ne.openAnimation,He=Ne.openTransitionName,Ye=Ve.switchingModeFromInline;if(ve)return ve;if(Object(K.a)(Be)==="object"&&Be)Object(li.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Be=="string")return{motionName:"".concat(Fe,"-open-").concat(Be)};if(He)return{motionName:He};var Xe=we[Qe];return Xe||(Ye?null:we.other)}var Qi=function(Ne){Object(E.a)(Qe,Ne);var Ve=Object(x.a)(Qe);function Qe(Fe){var ve;Object(k.a)(this,Qe),ve=Ve.call(this,Fe),ve.onSelect=function(Be){var He=Object(b.a)(ve),Ye=He.props;if(Ye.selectable){var Xe=ve.store.getState(),it=Xe.selectedKeys,dt=Be.key;Ye.multiple?it=it.concat([dt]):it=[dt],"selectedKeys"in Ye||ve.store.setState({selectedKeys:it}),Ye.onSelect(Object(D.a)(Object(D.a)({},Be),{},{selectedKeys:it}))}},ve.onClick=function(Be){var He=ve.getRealMenuMode(),Ye=Object(b.a)(ve),Xe=Ye.store,it=Ye.props.onOpenChange;He!=="inline"&&!("openKeys"in ve.props)&&(Xe.setState({openKeys:[]}),it([])),ve.props.onClick(Be)},ve.onKeyDown=function(Be,He){ve.innerMenu.getWrappedInstance().onKeyDown(Be,He)},ve.onOpenChange=function(Be){var He=Object(b.a)(ve),Ye=He.props,Xe=ve.store.getState().openKeys.concat(),it=!1,dt=function(bt){var At=!1;if(bt.open)At=Xe.indexOf(bt.key)===-1,At&&Xe.push(bt.key);else{var Vt=Xe.indexOf(bt.key);At=Vt!==-1,At&&Xe.splice(Vt,1)}it=it||At};Array.isArray(Be)?Be.forEach(dt):dt(Be),it&&("openKeys"in ve.props||ve.store.setState({openKeys:Xe}),Ye.onOpenChange(Xe))},ve.onDeselect=function(Be){var He=Object(b.a)(ve),Ye=He.props;if(Ye.selectable){var Xe=ve.store.getState().selectedKeys.concat(),it=Be.key,dt=Xe.indexOf(it);dt!==-1&&Xe.splice(dt,1),"selectedKeys"in Ye||ve.store.setState({selectedKeys:Xe}),Ye.onDeselect(Object(D.a)(Object(D.a)({},Be),{},{selectedKeys:Xe}))}},ve.onMouseEnter=function(Be){ve.restoreModeVerticalFromInline();var He=ve.props.onMouseEnter;He&&He(Be)},ve.onTransitionEnd=function(Be){var He=Be.propertyName==="width"&&Be.target===Be.currentTarget,Ye=Be.target.className,Xe=Object.prototype.toString.call(Ye)==="[object SVGAnimatedString]"?Ye.animVal:Ye,it=Be.propertyName==="font-size"&&Xe.indexOf("anticon")>=0;(He||it)&&ve.restoreModeVerticalFromInline()},ve.setInnerMenu=function(Be){ve.innerMenu=Be},ve.isRootMenu=!0;var Le=Fe.defaultSelectedKeys,we=Fe.defaultOpenKeys;return"selectedKeys"in Fe&&(Le=Fe.selectedKeys||[]),"openKeys"in Fe&&(we=Fe.openKeys||[]),ve.store=Object(T.c)({selectedKeys:Le,openKeys:we,activeKey:{"0-menu-":jn(Fe,Fe.activeKey)}}),ve.state={switchingModeFromInline:!1,prevProps:Fe,inlineOpenKeys:[],store:ve.store},ve}return Object(O.a)(Qe,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ve){var Le=this.props,we=Le.siderCollapsed,Be=Le.inlineCollapsed,He=Le.onOpenChange;(!ve.inlineCollapsed&&Be||!ve.siderCollapsed&&we)&&He([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ve=this.props.collapsedWidth,Le=this.store,we=this.prevOpenKeys,Be=this.getInlineCollapsed()&&(ve===0||ve==="0"||ve==="0px");Be?(this.prevOpenKeys=Le.getState().openKeys.concat(),this.store.setState({openKeys:[]})):we&&(this.store.setState({openKeys:we}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ve=this.props.mode,Le=this.state.switchingModeFromInline,we=this.getInlineCollapsed();return Le&&we?"inline":we?"vertical":ve}},{key:"getInlineCollapsed",value:function(){var ve=this.props,Le=ve.inlineCollapsed,we=ve.siderCollapsed;return we!==void 0?we:Le}},{key:"restoreModeVerticalFromInline",value:function(){var ve=this.state.switchingModeFromInline;ve&&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 ve=Object(D.a)({},Object(N.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Le=this.getRealMenuMode();return ve.className+=" ".concat(ve.prefixCls,"-root"),ve.direction==="rtl"&&(ve.className+=" ".concat(ve.prefixCls,"-rtl")),ve=Object(D.a)(Object(D.a)({},ve),{},{mode:Le,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:en(this.props,this.state,Le)}),delete ve.openAnimation,delete ve.openTransitionName,f.createElement(T.a,{store:this.store},f.createElement(Bi,Object(i.a)({},ve,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(ve,Le){var we=Le.prevProps,Be=Le.store,He=Be.getState(),Ye={},Xe={prevProps:ve};return we.mode==="inline"&&ve.mode!=="inline"&&(Xe.switchingModeFromInline=!0),"openKeys"in ve?Ye.openKeys=ve.openKeys||[]:((ve.inlineCollapsed&&!we.inlineCollapsed||ve.siderCollapsed&&!we.siderCollapsed)&&(Xe.switchingModeFromInline=!0,Xe.inlineOpenKeys=He.openKeys,Ye.openKeys=[]),(!ve.inlineCollapsed&&we.inlineCollapsed||!ve.siderCollapsed&&we.siderCollapsed)&&(Ye.openKeys=Le.inlineOpenKeys,Xe.inlineOpenKeys=[])),Object.keys(Ye).length&&Be.setState(Ye),Xe}}]),Qe}(f.Component);Qi.defaultProps={selectable:!0,onClick:ue,onSelect:ue,onOpenChange:ue,onDeselect:ue,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:f.createElement("span",null,"\xB7\xB7\xB7")};var Ft=Qi,Jt=function(Ne){Object(E.a)(Qe,Ne);var Ve=Object(x.a)(Qe);function Qe(){var Fe;return Object(k.a)(this,Qe),Fe=Ve.apply(this,arguments),Fe.onKeyDown=function(ve){var Le=ve.keyCode;return Le===g.a.ENTER?(Fe.onClick(ve),!0):void 0},Fe.onMouseLeave=function(ve){var Le=Fe.props,we=Le.eventKey,Be=Le.onItemHover,He=Le.onMouseLeave;Be({key:we,hover:!1}),He({key:we,domEvent:ve})},Fe.onMouseEnter=function(ve){var Le=Fe.props,we=Le.eventKey,Be=Le.onItemHover,He=Le.onMouseEnter;Be({key:we,hover:!0}),He({key:we,domEvent:ve})},Fe.onClick=function(ve){var Le=Fe.props,we=Le.eventKey,Be=Le.multiple,He=Le.onClick,Ye=Le.onSelect,Xe=Le.onDeselect,it=Le.isSelected,dt={key:we,keyPath:[we],item:Object(b.a)(Fe),domEvent:ve};He(dt),Be?it?Xe(dt):Ye(dt):it||Ye(dt)},Fe.saveNode=function(ve){Fe.node=ve},Fe}return Object(O.a)(Qe,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ve=this.props;ve.onDestroy&&ve.onDestroy(ve.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 ve,Le=Object(D.a)({},this.props),we=C()(this.getPrefixCls(),Le.className,(ve={},Object(M.a)(ve,this.getActiveClassName(),!Le.disabled&&Le.active),Object(M.a)(ve,this.getSelectedClassName(),Le.isSelected),Object(M.a)(ve,this.getDisabledClassName(),Le.disabled),ve)),Be=Object(D.a)(Object(D.a)({},Le.attribute),{},{title:typeof Le.title=="string"?Le.title:void 0,className:we,role:Le.role||"menuitem","aria-disabled":Le.disabled});Le.role==="option"?Be=Object(D.a)(Object(D.a)({},Be),{},{role:"option","aria-selected":Le.isSelected}):(Le.role===null||Le.role==="none")&&(Be.role="none");var He={onClick:Le.disabled?null:this.onClick,onMouseLeave:Le.disabled?null:this.onMouseLeave,onMouseEnter:Le.disabled?null:this.onMouseEnter},Ye=Object(D.a)({},Le.style);Le.mode==="inline"&&(Le.direction==="rtl"?Ye.paddingRight=Le.inlineIndent*Le.level:Ye.paddingLeft=Le.inlineIndent*Le.level),Z.forEach(function(it){return delete Le[it]}),delete Le.direction;var Xe=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Xe=f.createElement(this.props.itemIcon,this.props)),f.createElement("li",Object(i.a)({},Object(N.a)(Le,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Be,He,{style:Ye,ref:this.saveNode}),Le.children,Xe)}}]),Qe}(f.Component);Jt.isMenuItem=!0,Jt.defaultProps={onSelect:ue,onMouseEnter:ue,onMouseLeave:ue,manualRef:ue};var Gt=Object(T.b)(function(Ne,Ve){var Qe=Ne.activeKey,Fe=Ne.selectedKeys,ve=Ve.eventKey,Le=Ve.subMenuKey;return{active:Qe[Le]===ve,isSelected:Array.isArray(Fe)?Fe.indexOf(ve)!==-1:Fe===ve}})(Jt),hr=Gt,xr=function(Ne){Object(E.a)(Qe,Ne);var Ve=Object(x.a)(Qe);function Qe(){var Fe;return Object(k.a)(this,Qe),Fe=Ve.apply(this,arguments),Fe.renderInnerMenuItem=function(ve){var Le=Fe.props,we=Le.renderMenuItem,Be=Le.index;return we(ve,Be,Fe.props.subMenuKey)},Fe}return Object(O.a)(Qe,[{key:"render",value:function(){var ve=Object(i.a)({},this.props),Le=ve.className,we=Le===void 0?"":Le,Be=ve.rootPrefixCls,He="".concat(Be,"-item-group-title"),Ye="".concat(Be,"-item-group-list"),Xe=ve.title,it=ve.children;return Z.forEach(function(dt){return delete ve[dt]}),delete ve.direction,f.createElement("li",Object(i.a)({},ve,{onClick:function(xt){return xt.stopPropagation()},className:"".concat(we," ").concat(Be,"-item-group")}),f.createElement("div",{className:He,title:typeof Xe=="string"?Xe:void 0},Xe),f.createElement("ul",{className:Ye},f.Children.map(it,this.renderInnerMenuItem)))}}]),Qe}(f.Component);xr.isMenuItemGroup=!0,xr.defaultProps={disabled:!0};var Vr=xr,vr=function(Ve){var Qe=Ve.className,Fe=Ve.rootPrefixCls,ve=Ve.style;return f.createElement("li",{className:"".concat(Qe," ").concat(Fe,"-item-divider"),style:ve})};vr.defaultProps={disabled:!0,className:"",style:{}};var _n=vr,zn=Ft,mr=P("eDIo");function ji(Ne,Ve){var Qe=Ne.prefixCls,Fe=Ne.editable,ve=Ne.locale,Le=Ne.style;return!Fe||Fe.showAdd===!1?null:f.createElement("button",{ref:Ve,type:"button",className:"".concat(Qe,"-nav-add"),style:Le,"aria-label":(ve==null?void 0:ve.addAriaLabel)||"Add tab",onClick:function(Be){Fe.onEdit("add",{event:Be})}},Fe.addIcon||"+")}var Rr=f.forwardRef(ji);function Mn(Ne,Ve){var Qe=Ne.prefixCls,Fe=Ne.id,ve=Ne.tabs,Le=Ne.locale,we=Ne.mobile,Be=Ne.moreIcon,He=Be===void 0?"More":Be,Ye=Ne.moreTransitionName,Xe=Ne.style,it=Ne.className,dt=Ne.editable,xt=Ne.tabBarGutter,bt=Ne.rtl,At=Ne.onTabClick,Vt=Object(f.useState)(!1),pr=Object(u.a)(Vt,2),gr=pr[0],yr=pr[1],Or=Object(f.useState)(null),Sr=Object(u.a)(Or,2),br=Sr[0],Xr=Sr[1],Ir="".concat(Fe,"-more-popup"),Dn="".concat(Qe,"-dropdown"),Nr=br!==null?"".concat(Ir,"-").concat(br):null,tr=Le==null?void 0:Le.dropdownAriaLabel,Zt=f.createElement(zn,{onClick:function(gn){var pn=gn.key,Bn=gn.domEvent;At(pn,Bn),yr(!1)},id:Ir,tabIndex:-1,role:"listbox","aria-activedescendant":Nr,selectedKeys:[br],"aria-label":tr!==void 0?tr:"expanded dropdown"},ve.map(function(nn){return f.createElement(hr,{key:nn.key,id:"".concat(Ir,"-").concat(nn.key),role:"option","aria-controls":Fe&&"".concat(Fe,"-panel-").concat(nn.key),disabled:nn.disabled},nn.tab)}));function Ur(nn){for(var gn=ve.filter(function(bi){return!bi.disabled}),pn=gn.findIndex(function(bi){return bi.key===br})||0,Bn=gn.length,ei=0;eiQr?(Yr=Zt,Ir.current="x"):(Yr=Ur,Ir.current="y");var kn=Date.now();kn-br.current>100&&(Xr.current=!1),(Ve(-Yr,-Yr)||Xr.current)&&(tr.preventDefault(),Xr.current=!0),br.current=kn}var Nr=Object(f.useRef)(null);Nr.current={onTouchStart:yr,onTouchMove:Or,onTouchEnd:Sr,onWheel:Dn},f.useEffect(function(){function tr(Kt){Nr.current.onTouchStart(Kt)}function Zt(Kt){Nr.current.onTouchMove(Kt)}function Ur(Kt){Nr.current.onTouchEnd(Kt)}function Yr(Kt){Nr.current.onWheel(Kt)}return document.addEventListener("touchmove",Zt,{passive:!1}),document.addEventListener("touchend",Ur,{passive:!1}),Ne.current.addEventListener("touchstart",tr,{passive:!1}),Ne.current.addEventListener("wheel",Yr),function(){document.removeEventListener("touchmove",Zt),document.removeEventListener("touchend",Ur)}},[])}function er(){var Ne=Object(f.useRef)(new Map);function Ve(Fe){return Ne.current.has(Fe)||Ne.current.set(Fe,f.createRef()),Ne.current.get(Fe)}function Qe(Fe){Ne.current.delete(Fe)}return[Ve,Qe]}function Mt(Ne,Ve){var Qe=f.useRef(Ne),Fe=f.useState({}),ve=Object(u.a)(Fe,2),Le=ve[1];function we(Be){var He=typeof Be=="function"?Be(Qe.current):Be;He!==Qe.current&&Ve(He,Qe.current),Qe.current=He,Le({})}return[Qe.current,we]}var ur=function(Ve){var Qe=Ve.position,Fe=Ve.prefixCls,ve=Ve.extra;if(!ve)return null;var Le,we=ve;return Qe==="right"&&(Le=we.right||!we.left&&we||null),Qe==="left"&&(Le=we.left||null),Le?f.createElement("div",{className:"".concat(Fe,"-extra-content")},Le):null};function fr(Ne,Ve){var Qe,Fe=f.useContext(qn),ve=Fe.prefixCls,Le=Fe.tabs,we=Ne.className,Be=Ne.style,He=Ne.id,Ye=Ne.animated,Xe=Ne.activeKey,it=Ne.rtl,dt=Ne.extra,xt=Ne.editable,bt=Ne.locale,At=Ne.tabPosition,Vt=Ne.tabBarGutter,pr=Ne.children,gr=Ne.onTabClick,yr=Ne.onTabScroll,Or=Object(f.useRef)(),Sr=Object(f.useRef)(),br=Object(f.useRef)(),Xr=Object(f.useRef)(),Ir=er(),Dn=Object(u.a)(Ir,2),Nr=Dn[0],tr=Dn[1],Zt=At==="top"||At==="bottom",Ur=Mt(0,function(cn,Wr){Zt&&yr&&yr({direction:cn>Wr?"left":"right"})}),Yr=Object(u.a)(Ur,2),Kt=Yr[0],Qr=Yr[1],kn=Mt(0,function(cn,Wr){!Zt&&yr&&yr({direction:cn>Wr?"top":"bottom"})}),nn=Object(u.a)(kn,2),gn=nn[0],pn=nn[1],Bn=Object(f.useState)(0),ei=Object(u.a)(Bn,2),Pn=ei[0],bi=ei[1],Wi=Object(f.useState)(0),Ci=Object(u.a)(Wi,2),ti=Ci[0],Cn=Ci[1],vn=Object(f.useState)(0),In=Object(u.a)(vn,2),Ln=In[0],Hi=In[1],ra=Object(f.useState)(0),na=Object(u.a)(ra,2),mn=na[0],Ji=na[1],ia=Object(f.useState)(null),Sn=Object(u.a)(ia,2),fn=Sn[0],ri=Sn[1],To=Object(f.useState)(null),eo=Object(u.a)(To,2),aa=eo[0],va=eo[1],Pa=Object(f.useState)(0),to=Object(u.a)(Pa,2),Ia=to[0],Xo=to[1],Yo=Object(f.useState)(0),_o=Object(u.a)(Yo,2),ro=_o[0],no=_o[1],ya=w(new Map),ba=Object(u.a)(ya,2),$o=ba[0],Na=ba[1],Oa=d(Le,$o,Pn),xa="".concat(ve,"-nav-operations-hidden"),Ea=0,zi=0;Zt?it?(Ea=0,zi=Math.max(0,Pn-fn)):(Ea=Math.min(0,fn-Pn),zi=0):(Ea=Math.min(0,aa-ti),zi=0);function ca(cn){return cnzi?[zi,!1]:[cn,!0]}var oa=Object(f.useRef)(),Aa=Object(f.useState)(),da=Object(u.a)(Aa,2),ja=da[0],io=da[1];function Ua(){io(Date.now())}function ao(){window.clearTimeout(oa.current)}Yi(Or,function(cn,Wr){var ni=!1;function _i(wa,Zi){wa(function(ka){var la=ca(ka+Zi),ii=Object(u.a)(la,2),Wa=ii[0],so=ii[1];return ni=so,Wa})}if(Zt){if(fn>=Pn)return ni;_i(Qr,cn)}else{if(aa>=ti)return ni;_i(pn,Wr)}return ao(),Ua(),ni}),Object(f.useEffect)(function(){return ao(),ja&&(oa.current=window.setTimeout(function(){io(0)},100)),ao},[ja]);function sa(){var cn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Xe,Wr=Oa.get(cn);if(!Wr)return;if(Zt){var ni=Kt;it?Wr.rightKt+fn&&(ni=Wr.right+Wr.width-fn):Wr.left<-Kt?ni=-Wr.left:Wr.left+Wr.width>-Kt+fn&&(ni=-(Wr.left+Wr.width-fn)),pn(0),Qr(ca(ni)[0])}else{var _i=gn;Wr.top<-gn?_i=-Wr.top:Wr.top+Wr.height>-gn+aa&&(_i=-(Wr.top+Wr.height-aa)),Qr(0),pn(ca(_i)[0])}}var ha=y(Oa,{width:fn,height:aa,left:Kt,top:gn},{width:Ln,height:mn},{width:Ia,height:ro},Object(D.a)(Object(D.a)({},Ne),{},{tabs:Le})),Oo=Object(u.a)(ha,2),Jo=Oo[0],Qo=Oo[1],Zo=Le.map(function(cn){var Wr=cn.key;return f.createElement(n,{id:He,prefixCls:ve,key:Wr,rtl:it,tab:cn,closable:cn.closable,editable:xt,active:Wr===Xe,tabPosition:At,tabBarGutter:Vt,renderWrapper:pr,removeAriaLabel:bt==null?void 0:bt.removeAriaLabel,ref:Nr(Wr),onClick:function(_i){gr(Wr,_i)},onRemove:function(){tr(Wr)},onFocus:function(){sa(Wr),Ua(),it||(Or.current.scrollLeft=0),Or.current.scrollTop=0}})}),oo=p(function(){var cn,Wr,ni,_i,wa,Zi,ka,la,ii,Wa=((cn=Or.current)===null||cn===void 0?void 0:cn.offsetWidth)||0,so=((Wr=Or.current)===null||Wr===void 0?void 0:Wr.offsetHeight)||0,lo=((ni=Xr.current)===null||ni===void 0?void 0:ni.offsetWidth)||0,Oi=((_i=Xr.current)===null||_i===void 0?void 0:_i.offsetHeight)||0,ln=((wa=br.current)===null||wa===void 0?void 0:wa.offsetWidth)||0,Gi=((Zi=br.current)===null||Zi===void 0?void 0:Zi.offsetHeight)||0;ri(Wa),va(so),Xo(lo),no(Oi);var qi=(((ka=Sr.current)===null||ka===void 0?void 0:ka.offsetWidth)||0)-lo,ea=(((la=Sr.current)===null||la===void 0?void 0:la.offsetHeight)||0)-Oi;bi(qi),Cn(ea);var uo=(ii=br.current)===null||ii===void 0?void 0:ii.className.includes(xa);Hi(qi-(uo?0:ln)),Ji(ea-(uo?0:Gi)),Na(function(){var Ha=new Map;return Le.forEach(function(Lo){var Mo=Lo.key,pa=Nr(Mo).current;pa&&Ha.set(Mo,{width:pa.offsetWidth,height:pa.offsetHeight,left:pa.offsetLeft,top:pa.offsetTop})}),Ha})}),qo=Le.slice(0,Jo),Ti=Le.slice(Qo+1),Gn=[].concat(Object(a.a)(qo),Object(a.a)(Ti)),gi=Object(f.useState)(),Vn=Object(u.a)(gi,2),Ra=Vn[0],es=Vn[1],Ki=Oa.get(Xe),Ao=Object(f.useRef)();function Ro(){h.a.cancel(Ao.current)}Object(f.useEffect)(function(){var cn={};return Ki&&(Zt?(it?cn.right=Ki.right:cn.left=Ki.left,cn.width=Ki.width):(cn.top=Ki.top,cn.height=Ki.height)),Ro(),Ao.current=h()(function(){es(cn)}),Ro},[Ki,Zt,it]),Object(f.useEffect)(function(){sa()},[Xe,Ki,Oa,Zt]),Object(f.useEffect)(function(){oo()},[it,Vt,Xe,Le.map(function(cn){return cn.key}).join("_")]);var Do=!!Gn.length,fa="".concat(ve,"-nav-wrap"),Fa,Da,ko,Ba;return Zt?it?(Da=Kt>0,Fa=Kt+fn>>7)^(k<<14|k>>>18)^k>>>3,b=a[i-2],E=(b<<15|b>>>17)^(b<<13|b>>>19)^b>>>10;a[i]=O+a[i-7]+E+a[i-16]}var x=s&d^~s&S,T=w&g^w&c^g&c,N=(w<<30|w>>>2)^(w<<19|w>>>13)^(w<<10|w>>>22),j=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),L=y+j+x+o[i]+a[i],V=N+T;y=S,S=d,d=s,s=n+L|0,n=c,c=g,g=w,w=L+V|0}p[0]=p[0]+w|0,p[1]=p[1]+g|0,p[2]=p[2]+c|0,p[3]=p[3]+n|0,p[4]=p[4]+s|0,p[5]=p[5]+d|0,p[6]=p[6]+S|0,p[7]=p[7]+y|0},_doFinalize:function(){var h=this._data,m=h.words,p=this._nDataBytes*8,w=h.sigBytes*8;return m[w>>>5]|=128<<24-w%32,m[(w+64>>>9<<4)+14]=u.floor(p/4294967296),m[(w+64>>>9<<4)+15]=p,h.sigBytes=m.length*4,this._process(),this._hash},clone:function(){var h=l.clone.call(this);return h._hash=this._hash.clone(),h}});_.SHA256=l._createHelper(r),_.HmacSHA256=l._createHmacHelper(r)}(Math),M.SHA256})},lZu9:function(I,J,P){(function(M){M(P("VrN/"),P("1eCo"),P("8EBN"))})(function(M){"use strict";M.defineMode("markdown",function(u,_){var D=M.getMode(u,"text/html"),f=D.name=="null";function l(F){if(M.findModeByName){var B=M.findModeByName(F);B&&(F=B.mime||B.mimes[0])}var H=M.getMode(u,F);return H.name=="null"?null:H}_.highlightFormatting===void 0&&(_.highlightFormatting=!1),_.maxBlockquoteDepth===void 0&&(_.maxBlockquoteDepth=0),_.taskLists===void 0&&(_.taskLists=!1),_.strikethrough===void 0&&(_.strikethrough=!1),_.emoji===void 0&&(_.emoji=!1),_.fencedCodeBlockHighlighting===void 0&&(_.fencedCodeBlockHighlighting=!0),_.fencedCodeBlockDefaultMode===void 0&&(_.fencedCodeBlockDefaultMode="text/plain"),_.xml===void 0&&(_.xml=!0),_.tokenTypeOverrides===void 0&&(_.tokenTypeOverrides={});var C={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 v in C)C.hasOwnProperty(v)&&_.tokenTypeOverrides[v]&&(C[v]=_.tokenTypeOverrides[v]);var o=/^([*\-_])(?:\s*\1){2,}\s*$/,a=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,r=/^\[(x| )\](?=\s)/i,h=_.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,p=/^[^#!\[\]*_\\<>` "'(~:]+/,w=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,g=/^\s*\[[^\]]+?\]:.*$/,c=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,n=" ";function s(F,B,H){return B.f=B.inline=H,H(F,B)}function d(F,B,H){return B.f=B.block=H,H(F,B)}function S(F){return!F||!/\S/.test(F.string)}function y(F){if(F.linkTitle=!1,F.linkHref=!1,F.linkText=!1,F.em=!1,F.strong=!1,F.strikethrough=!1,F.quote=0,F.indentedCode=!1,F.f==k){var B=f;if(!B){var H=M.innerMode(D,F.htmlState);B=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}B&&(F.f=x,F.block=i,F.htmlState=null)}return F.trailingSpace=0,F.trailingSpaceNewLine=!1,F.prevLine=F.thisLine,F.thisLine={stream:null},null}function i(F,B){var H=F.column()===B.indentation,q=S(B.prevLine.stream),re=B.indentedCode,ee=B.prevLine.hr,Ce=B.list!==!1,Ee=(B.listStack[B.listStack.length-1]||0)+3;B.indentedCode=!1;var pe=B.indentation;if(B.indentationDiff===null&&(B.indentationDiff=B.indentation,Ce)){for(B.list=null;pe=4&&(re||B.prevLine.fencedCodeEnd||B.prevLine.header||q))return F.skipToEnd(),B.indentedCode=!0,C.code;if(F.eatSpace())return null;if(H&&B.indentation<=Ee&&(he=F.match(h))&&he[1].length<=6)return B.quote=0,B.header=he[1].length,B.thisLine.header=!0,_.highlightFormatting&&(B.formatting="header"),B.f=B.inline,b(B);if(B.indentation<=Ee&&F.eat(">"))return B.quote=H?1:B.quote+1,_.highlightFormatting&&(B.formatting="quote"),F.eatSpace(),b(B);if(!_e&&!B.setext&&H&&B.indentation<=Ee&&(he=F.match(a))){var ce=he[1]?"ol":"ul";return B.indentation=pe+F.current().length,B.list=!0,B.quote=0,B.listStack.push(B.indentation),B.em=!1,B.strong=!1,B.code=!1,B.strikethrough=!1,_.taskLists&&F.match(r,!1)&&(B.taskList=!0),B.f=B.inline,_.highlightFormatting&&(B.formatting=["list","list-"+ce]),b(B)}else{if(H&&B.indentation<=Ee&&(he=F.match(w,!0)))return B.quote=0,B.fencedEndRE=new RegExp(he[1]+"+ *$"),B.localMode=_.fencedCodeBlockHighlighting&&l(he[2]||_.fencedCodeBlockDefaultMode),B.localMode&&(B.localState=M.startState(B.localMode)),B.f=B.block=O,_.highlightFormatting&&(B.formatting="code-block"),B.code=-1,b(B);if(B.setext||(!Me||!Ce)&&!B.quote&&B.list===!1&&!B.code&&!_e&&!g.test(F.string)&&(he=F.lookAhead(1))&&(he=he.match(m)))return B.setext?(B.header=B.setext,B.setext=0,F.skipToEnd(),_.highlightFormatting&&(B.formatting="header")):(B.header=he[0].charAt(0)=="="?1:2,B.setext=B.header),B.thisLine.header=!0,B.f=B.inline,b(B);if(_e)return F.skipToEnd(),B.hr=!0,B.thisLine.hr=!0,C.hr;if(F.peek()==="[")return s(F,B,V)}return s(F,B,B.inline)}function k(F,B){var H=D.token(F,B.htmlState);if(!f){var q=M.innerMode(D,B.htmlState);(q.mode.name=="xml"&&q.state.tagStart===null&&!q.state.context&&q.state.tokenize.isInText||B.md_inside&&F.current().indexOf(">")>-1)&&(B.f=x,B.block=i,B.htmlState=null)}return H}function O(F,B){var H=B.listStack[B.listStack.length-1]||0,q=B.indentation=F.quote?B.push(C.formatting+"-"+F.formatting[H]+"-"+F.quote):B.push("error"))}if(F.taskOpen)return B.push("meta"),B.length?B.join(" "):null;if(F.taskClosed)return B.push("property"),B.length?B.join(" "):null;if(F.linkHref?B.push(C.linkHref,"url"):(F.strong&&B.push(C.strong),F.em&&B.push(C.em),F.strikethrough&&B.push(C.strikethrough),F.emoji&&B.push(C.emoji),F.linkText&&B.push(C.linkText),F.code&&B.push(C.code),F.image&&B.push(C.image),F.imageAltText&&B.push(C.imageAltText,"link"),F.imageMarker&&B.push(C.imageMarker)),F.header&&B.push(C.header,C.header+"-"+F.header),F.quote&&(B.push(C.quote),!_.maxBlockquoteDepth||_.maxBlockquoteDepth>=F.quote?B.push(C.quote+"-"+F.quote):B.push(C.quote+"-"+_.maxBlockquoteDepth)),F.list!==!1){var q=(F.listStack.length-1)%3;q?q===1?B.push(C.list2):B.push(C.list3):B.push(C.list1)}return F.trailingSpaceNewLine?B.push("trailing-space-new-line"):F.trailingSpace&&B.push("trailing-space-"+(F.trailingSpace%2?"a":"b")),B.length?B.join(" "):null}function E(F,B){return F.match(p,!0)?b(B):void 0}function x(F,B){var H=B.text(F,B);if(typeof H!="undefined")return H;if(B.list)return B.list=null,b(B);if(B.taskList){var q=F.match(r,!0)[1]===" ";return q?B.taskOpen=!0:B.taskClosed=!0,_.highlightFormatting&&(B.formatting="task"),B.taskList=!1,b(B)}if(B.taskOpen=!1,B.taskClosed=!1,B.header&&F.match(/^#+$/,!0))return _.highlightFormatting&&(B.formatting="header"),b(B);var re=F.next();if(B.linkTitle){B.linkTitle=!1;var ee=re;re==="("&&(ee=")"),ee=(ee+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ce="^\\s*(?:[^"+ee+"\\\\]+|\\\\\\\\|\\\\.)"+ee;if(F.match(new RegExp(Ce),!0))return C.linkHref}if(re==="`"){var Ee=B.formatting;_.highlightFormatting&&(B.formatting="code"),F.eatWhile("`");var pe=F.current().length;if(B.code==0&&(!B.quote||pe==1))return B.code=pe,b(B);if(pe==B.code){var Me=b(B);return B.code=0,Me}else return B.formatting=Ee,b(B)}else if(B.code)return b(B);if(re==="\\"&&(F.next(),_.highlightFormatting)){var _e=b(B),he=C.formatting+"-escape";return _e?_e+" "+he:he}if(re==="!"&&F.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return B.imageMarker=!0,B.image=!0,_.highlightFormatting&&(B.formatting="image"),b(B);if(re==="["&&B.imageMarker&&F.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return B.imageMarker=!1,B.imageAltText=!0,_.highlightFormatting&&(B.formatting="image"),b(B);if(re==="]"&&B.imageAltText){_.highlightFormatting&&(B.formatting="image");var _e=b(B);return B.imageAltText=!1,B.image=!1,B.inline=B.f=N,_e}if(re==="["&&!B.image)return B.linkText&&F.match(/^.*?\]/)||(B.linkText=!0,_.highlightFormatting&&(B.formatting="link")),b(B);if(re==="]"&&B.linkText){_.highlightFormatting&&(B.formatting="link");var _e=b(B);return B.linkText=!1,B.inline=B.f=F.match(/\(.*?\)| ?\[.*?\]/,!1)?N:x,_e}if(re==="<"&&F.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){B.f=B.inline=T,_.highlightFormatting&&(B.formatting="link");var _e=b(B);return _e?_e+=" ":_e="",_e+C.linkInline}if(re==="<"&&F.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){B.f=B.inline=T,_.highlightFormatting&&(B.formatting="link");var _e=b(B);return _e?_e+=" ":_e="",_e+C.linkEmail}if(_.xml&&re==="<"&&F.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ce=F.string.indexOf(">",F.pos);if(ce!=-1){var oe=F.string.substring(F.start,ce);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(oe)&&(B.md_inside=!0)}return F.backUp(1),B.htmlState=M.startState(D),d(F,B,k)}if(_.xml&&re==="<"&&F.match(/^\/\w*?>/))return B.md_inside=!1,"tag";if(re==="*"||re==="_"){for(var Se=1,te=F.pos==1?" ":F.string.charAt(F.pos-2);Se<3&&F.eat(re);)Se++;var ue=F.peek()||" ",Oe=!/\s/.test(ue)&&(!c.test(ue)||/\s/.test(te)||c.test(te)),le=!/\s/.test(te)&&(!c.test(te)||/\s/.test(ue)||c.test(ue)),Q=null,Y=null;if(Se%2&&(!B.em&&Oe&&(re==="*"||!le||c.test(te))?Q=!0:B.em==re&&le&&(re==="*"||!Oe||c.test(ue))&&(Q=!1)),Se>1&&(!B.strong&&Oe&&(re==="*"||!le||c.test(te))?Y=!0:B.strong==re&&le&&(re==="*"||!Oe||c.test(ue))&&(Y=!1)),Y!=null||Q!=null){_.highlightFormatting&&(B.formatting=Q==null?"strong":Y==null?"em":"strong em"),Q===!0&&(B.em=re),Y===!0&&(B.strong=re);var Me=b(B);return Q===!1&&(B.em=!1),Y===!1&&(B.strong=!1),Me}}else if(re===" "&&(F.eat("*")||F.eat("_"))){if(F.peek()===" ")return b(B);F.backUp(1)}if(_.strikethrough){if(re==="~"&&F.eatWhile(re)){if(B.strikethrough){_.highlightFormatting&&(B.formatting="strikethrough");var Me=b(B);return B.strikethrough=!1,Me}else if(F.match(/^[^\s]/,!1))return B.strikethrough=!0,_.highlightFormatting&&(B.formatting="strikethrough"),b(B)}else if(re===" "&&F.match(/^~~/,!0)){if(F.peek()===" ")return b(B);F.backUp(2)}}if(_.emoji&&re===":"&&F.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){B.emoji=!0,_.highlightFormatting&&(B.formatting="emoji");var Z=b(B);return B.emoji=!1,Z}return re===" "&&(F.match(/^ +$/,!1)?B.trailingSpace++:B.trailingSpace&&(B.trailingSpaceNewLine=!0)),b(B)}function T(F,B){var H=F.next();if(H===">"){B.f=B.inline=x,_.highlightFormatting&&(B.formatting="link");var q=b(B);return q?q+=" ":q="",q+C.linkInline}return F.match(/^[^>]+/,!0),C.linkInline}function N(F,B){if(F.eatSpace())return null;var H=F.next();return H==="("||H==="["?(B.f=B.inline=L(H==="("?")":"]"),_.highlightFormatting&&(B.formatting="link-string"),B.linkHref=!0,b(B)):"error"}var j={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function L(F){return function(B,H){var q=B.next();if(q===F){H.f=H.inline=x,_.highlightFormatting&&(H.formatting="link-string");var re=b(H);return H.linkHref=!1,re}return B.match(j[F]),H.linkHref=!0,b(H)}}function V(F,B){return F.match(/^([^\]\\]|\\.)*\]:/,!1)?(B.f=K,F.next(),_.highlightFormatting&&(B.formatting="link"),B.linkText=!0,b(B)):s(F,B,x)}function K(F,B){if(F.match(/^\]:/,!0)){B.f=B.inline=W,_.highlightFormatting&&(B.formatting="link");var H=b(B);return B.linkText=!1,H}return F.match(/^([^\]\\]|\\.)+/,!0),C.linkText}function W(F,B){return F.eatSpace()?null:(F.match(/^[^\s]+/,!0),F.peek()===void 0?B.linkTitle=!0:F.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),B.f=B.inline=x,C.linkHref+" url")}var G={startState:function(){return{f:i,prevLine:{stream:null},thisLine:{stream:null},block:i,htmlState:null,indentation:0,inline:x,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(F){return{f:F.f,prevLine:F.prevLine,thisLine:F.thisLine,block:F.block,htmlState:F.htmlState&&M.copyState(D,F.htmlState),indentation:F.indentation,localMode:F.localMode,localState:F.localMode?M.copyState(F.localMode,F.localState):null,inline:F.inline,text:F.text,formatting:!1,linkText:F.linkText,linkTitle:F.linkTitle,linkHref:F.linkHref,code:F.code,em:F.em,strong:F.strong,strikethrough:F.strikethrough,emoji:F.emoji,header:F.header,setext:F.setext,hr:F.hr,taskList:F.taskList,list:F.list,listStack:F.listStack.slice(0),quote:F.quote,indentedCode:F.indentedCode,trailingSpace:F.trailingSpace,trailingSpaceNewLine:F.trailingSpaceNewLine,md_inside:F.md_inside,fencedEndRE:F.fencedEndRE}},token:function(F,B){if(B.formatting=!1,F!=B.thisLine.stream){if(B.header=0,B.hr=!1,F.match(/^\s*$/,!0))return y(B),null;if(B.prevLine=B.thisLine,B.thisLine={stream:F},B.taskList=!1,B.trailingSpace=0,B.trailingSpaceNewLine=!1,!B.localState&&(B.f=B.block,B.f!=k)){var H=F.match(/^\s*/,!0)[0].replace(/\t/g,n).length;if(B.indentation=H,B.indentationDiff=null,H>0)return null}}return B.f(F,B)},innerMode:function(F){return F.block==k?{state:F.htmlState,mode:D}:F.localState?{state:F.localState,mode:F.localMode}:{state:F,mode:G}},indent:function(F,B,H){return F.block==k&&D.indent?D.indent(F.htmlState,B,H):F.localState&&F.localMode.indent?F.localMode.indent(F.localState,B,H):M.Pass},blankLine:y,getType:b,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),M.defineMIME("text/markdown","markdown"),M.defineMIME("text/x-markdown","markdown")})},mxV5:function(module,exports,__webpack_require__){(function(global){var require,require;(function(I){if(!0)module.exports=I();else var J})(function(){var define,module,exports;return function(){function I(J,P,M){function u(f,l){if(!P[f]){if(!J[f]){var C=typeof require=="function"&&require;if(!l&&C)return require(f,!0);if(_)return _(f,!0);var v=new Error("Cannot find module '"+f+"'");throw v.code="MODULE_NOT_FOUND",v}var o=P[f]={exports:{}};J[f][0].call(o.exports,function(a){var r=J[f][1][a];return u(r||a)},o,o.exports,I,J,P,M)}return P[f].exports}for(var _=typeof require=="function"&&require,D=0;D0&&m(N).to(L),V=this._divideParts(E,x),K=V.length,W=!1,G=function(Me,_e){var he=this;return new f.default(function(oe,Se){var te,ue,Oe,le;return C.default.async(function(Y){for(;;)switch(Y.prev=Y.next){case 0:if(Y.prev=0,Me.isCancel()){Y.next=18;break}return te=V[_e-1],ue={stream:Me._createStream(b,te.start,te.end),size:te.end-te.start},Y.next=6,C.default.awrap(Me._uploadPart(j,T,_e,ue));case 6:if(Oe=Y.sent,!(!Me.isCancel()&&!W)){Y.next=15;break}if(i.doneParts.push({number:_e,etag:Oe.res.headers.etag}),!k.progress){Y.next=12;break}return Y.next=12,C.default.awrap(k.progress(N.length/K,i,Oe.res));case 12:oe({number:_e,etag:Oe.res.headers.etag}),Y.next=16;break;case 15:oe();case 16:Y.next=19;break;case 18:oe();case 19:Y.next=30;break;case 21:Y.prev=21,Y.t0=Y.catch(0),le=new Error,le.name=Y.t0.name,le.message=Y.t0.message,le.stack=Y.t0.stack,le.partNum=_e,m(Y.t0).to(le),Se(le);case 30:case"end":return Y.stop()}},null,he,[[0,21]])})},F=(0,_.default)(new Array(K),function(pe,Me){return Me+1}),B=L.map(function(pe){return pe.number}),H=F.filter(function(pe){return B.indexOf(pe)<0}),q=5,re=k.parallel||q,Ee.next=17,C.default.awrap(this._parallel(H,re,function(pe){return new f.default(function(Me,_e){G(O,pe).then(function(he){he&&L.push(he),Me()}).catch(function(he){_e(he)})})}));case 17:if(ee=Ee.sent,W=!0,!this.isCancel()){Ee.next=22;break}throw G=null,this._makeCancelEvent();case 22:if(!(ee&&ee.length>0)){Ee.next=25;break}throw ee[0].message="Failed to upload some parts with error: "+ee[0].toString()+" part_num: "+ee[0].partNum,ee[0];case 25:return Ee.next=27,C.default.awrap(this.completeMultipartUpload(j,T,L,k));case 27:return Ee.abrupt("return",Ee.sent);case 28:case"end":return Ee.stop()}},null,this)},n._getFileSize=function(i){return C.default.async(function(O){for(;;)switch(O.prev=O.next){case 0:if(!o.buffer(i)){O.next=4;break}return O.abrupt("return",i.length);case 4:if(!(w(i)||c(i))){O.next=6;break}return O.abrupt("return",i.size);case 6:throw new Error("_getFileSize requires Buffer/File/Blob.");case 7:case"end":return O.stop()}},null,this)};var s=I("stream"),d=s.Readable;function S(y,i){if(!(this instanceof S))return new S(y,i);d.call(this,i),this.file=y,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}a.inherits(S,d),S.prototype.readFileAndPush=function(i){if(this.fileBuffer)for(var k=!0;k&&this.fileBuffer&&this.startthis.fileBuffer.length?this.fileBuffer.length:b,this.start=b,k=this.push(this.fileBuffer.slice(O,b))}},S.prototype._read=function(i){if(this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||this.start===0&&!this.file){this.finish||(this.fileBuffer=null,this.finish=!0),this.push(null);return}var k=16*1024;i=i||k;var O=this;this.reader.onload=function(E){O.fileBuffer=M.from(new Uint8Array(E.target.result)),O.file=null,O.readFileAndPush(i)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(i)},n._createStream=function(i,k,O){if(w(i)||c(i))return new S(i.slice(k,O));throw new Error("_createStream requires File/Blob.")},n._getPartSize=function(i,k){var O=10*1e3,b=1024*1024;return k?Math.max(Math.ceil(i/O),k):b},n._divideParts=function(i,k){for(var O=Math.ceil(i/k),b=[],E=0;E255)throw new Error("ID is composed of 255 bytes at most");if(i.prefix===""||i.prefix===void 0)throw new Error("Rule must includes prefix");if(!["Enabled","Disabled"].includes(i.status))throw new Error("Status must be Enabled or Disabled");if(i.transition){if(!["IA","Archive"].includes(i.transition.storageClass))throw new Error("StorageClass must be IA or Archive");d(i.transition,"Transition")}if(i.expiration){if(!i.expiration.expiredObjectDeleteMarker)d(i.expiration,"Expiration");else if(i.expiration.days||i.expiration.createdBeforeDate)throw new Error("expiredObjectDeleteMarker cannot be used with days or createdBeforeDate")}if(i.abortMultipartUpload&&d(i.abortMultipartUpload,"AbortMultipartUpload"),!i.expiration&&!i.abortMultipartUpload&&!i.transition&&!i.noncurrentVersionTransition)throw new Error("Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition");if(i.tag){if(i.abortMultipartUpload)throw new Error("Tag cannot be used with abortMultipartUpload");S(i.tag)}}},{"../utils/checkBucketName":35,"../utils/checkObjectTag":36,"../utils/deepCopy":39,"../utils/getStrBytesCount":41,"../utils/isArray":42,"../utils/isObject":46,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],12:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=_(M);function _(o){return o&&o.__esModule?o:{default:o}}var D=I("../utils/checkBucketName"),f=D.checkBucketName,l=I("../utils/obj2xml"),C=l.obj2xml,v=P;v.putBucketVersioning=function(a,r){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},m,p,w;return u.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:if(f(a),["Enabled","Suspended"].includes(r)){c.next=3;break}throw new Error("status must be Enabled or Suspended");case 3:return m=this._bucketRequestParams("PUT",a,"versioning",h),p={VersioningConfiguration:{Status:r}},m.mime="xml",m.content=C(p,{headers:!0}),c.next=9,u.default.awrap(this.request(m));case 9:return w=c.sent,c.abrupt("return",{res:w.res,status:w.status});case 11:case"end":return c.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],13:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=_(M);function _(r){return r&&r.__esModule?r:{default:r}}var D=I("../utils/checkBucketName"),f=D.checkBucketName,l=I("../utils/obj2xml"),C=l.obj2xml,v=I("../utils/isArray"),o=v.isArray,a=P;a.putBucketWebsite=function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=arguments[2],w,g,c,n,s;return u.default.async(function(S){for(;;)switch(S.prev=S.next){case 0:if(f(h),w=this._bucketRequestParams("PUT",h,"website",p),g={Suffix:m.index||"index.html"},c={IndexDocument:g},n={WebsiteConfiguration:c},m.supportSubDir&&(g.SupportSubDir=m.supportSubDir),m.type&&(g.Type=m.type),m.error&&(c.ErrorDocument={Key:m.error}),!(m.routingRules!==void 0)){S.next=12;break}if(o(m.routingRules)){S.next=11;break}throw new Error("RoutingRules must be Array");case 11:c.RoutingRules={RoutingRule:m.routingRules};case 12:return n=C(n),w.content=n,w.mime="xml",w.successStatuses=[200],S.next=18,u.default.awrap(this.request(w));case 18:return s=S.sent,S.abrupt("return",{res:s.res});case 20:case"end":return S.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/isArray":42,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],14:[function(I,J,P){(function(M){"use strict";var u=I("babel-runtime/core-js/object/keys"),_=l(u),D=I("babel-runtime/core-js/json/stringify"),f=l(D);function l(C){return C&&C.__esModule?C:{default:C}}P.encodeCallback=function(v,o){if(v.headers=v.headers||{},!Object.prototype.hasOwnProperty.call(v.headers,"x-oss-callback")&&o.callback){var a={callbackUrl:encodeURI(o.callback.url),callbackBody:o.callback.body};o.callback.host&&(a.callbackHost=o.callback.host),o.callback.contentType&&(a.callbackBodyType=o.callback.contentType);var r=M.from((0,f.default)(a)).toString("base64");if(v.headers["x-oss-callback"]=r,o.callback.customValue){var h={};(0,_.default)(o.callback.customValue).forEach(function(m){h["x:"+m]=o.callback.customValue[m]}),v.headers["x-oss-callback-var"]=M.from((0,f.default)(h)).toString("base64")}}}}).call(this,I("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/keys":60,buffer:73}],15:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/assign"),u=_(M);function _(a){return a&&a.__esModule?a:{default:a}}var D=I("humanize-ms"),f=I("url"),l=I("../utils/checkBucketName"),C=l.checkBucketName;function v(a,r){var h=f.parse(a);if(h.protocol||(h=f.parse("http"+(r?"s":"")+"://"+a)),h.protocol!=="http:"&&h.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return h}function o(a,r,h){var m=h?"https://":"http://",p=r?"-internal.aliyuncs.com":".aliyuncs.com",w="vpc100-oss-cn-";return a.substr(0,w.length)===w&&(p=".aliyuncs.com"),f.parse(m+a+p)}J.exports=function(a){if(!a||!a.accessKeyId||!a.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");a.bucket&&C(a.bucket);var r=(0,u.default)({region:"oss-cn-hangzhou",internal:!1,secure:!1,timeout:6e4,bucket:null,endpoint:null,cname:!1,isRequestPay:!1,sldEnable:!1},a);if(r.accessKeyId=r.accessKeyId.trim(),r.accessKeySecret=r.accessKeySecret.trim(),r.timeout&&(r.timeout=D(r.timeout)),r.endpoint)r.endpoint=v(r.endpoint,r.secure);else if(r.region)r.endpoint=o(r.region,r.internal,r.secure);else throw new Error("require options.endpoint or options.region");return r.inited=!0,r}},{"../utils/checkBucketName":35,"babel-runtime/core-js/object/assign":54,"humanize-ms":194,url:238}],16:[function(I,J,P){"use strict";var M=I("merge-descriptors"),u=P;M(u,I("./processObjectSave"))},{"./processObjectSave":17,"merge-descriptors":200}],17:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=_(M);function _(r){return r&&r.__esModule?r:{default:r}}var D=I("../utils/checkBucketName"),f=D.checkBucketName,l=I("querystring"),C=I("js-base64"),v=C.Base64.encode,o=P;o.processObjectSave=function(h,m,p,w){var g,c,n,s;return u.default.async(function(S){for(;;)switch(S.prev=S.next){case 0:return a(h,"sourceObject"),a(m,"targetObject"),a(p,"process"),m=this._objectName(m),w&&f(w),g=this._objectRequestParams("POST",h,{subres:"x-oss-process"}),c=w?",b_"+v(w):"",m=v(m),n={"x-oss-process":p+"|sys/saveas,o_"+m+c},g.content=l.stringify(n),S.next=12,u.default.awrap(this.request(g));case 12:return s=S.sent,S.abrupt("return",{res:s.res,status:s.res.status});case 14:case"end":return S.stop()}},null,this)};function a(r,h){if(!r)throw new Error(h+" is required");if(typeof r!="string")throw new Error(h+" must be String")}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68,"js-base64":199,querystring:212}],18:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=_(M);function _(o){return o&&o.__esModule?o:{default:o}}var D=I("copy-to"),f=I("./callback"),l=I("./utils/deepCopy"),C=l.deepCopy,v=P;v.listUploads=function(a,r){var h,m,p,w;return u.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:return r=r||{},h={},D(r).to(h),h.subres="uploads",m=this._objectRequestParams("GET","",h),m.query=a,m.xmlResponse=!0,m.successStatuses=[200],c.next=10,u.default.awrap(this.request(m));case 10:return p=c.sent,w=p.data.Upload||[],Array.isArray(w)||(w=[w]),w=w.map(function(n){return{name:n.Key,uploadId:n.UploadId,initiated:n.Initiated}}),c.abrupt("return",{res:p.res,uploads:w,bucket:p.data.Bucket,nextKeyMarker:p.data.NextKeyMarker,nextUploadIdMarker:p.data.NextUploadIdMarker,isTruncated:p.data.IsTruncated==="true"});case 15:case"end":return c.stop()}},null,this)},v.listParts=function(a,r,h,m){var p,w,g;return u.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return m=m||{},p={},D(m).to(p),p.subres={uploadId:r},w=this._objectRequestParams("GET",a,p),w.query=h,w.xmlResponse=!0,w.successStatuses=[200],n.next=10,u.default.awrap(this.request(w));case 10:return g=n.sent,n.abrupt("return",{res:g.res,uploadId:g.data.UploadId,bucket:g.data.Bucket,name:g.data.Key,partNumberMarker:g.data.PartNumberMarker,nextPartNumberMarker:g.data.NextPartNumberMarker,maxParts:g.data.MaxParts,isTruncated:g.data.IsTruncated,parts:g.data.Part||[]});case 12:case"end":return n.stop()}},null,this)},v.abortMultipartUpload=function(a,r,h){var m,p,w;return u.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:return this._stop(),h=h||{},m={},D(h).to(m),m.subres={uploadId:r},p=this._objectRequestParams("DELETE",a,m),p.successStatuses=[204],c.next=9,u.default.awrap(this.request(p));case 9:return w=c.sent,c.abrupt("return",{res:w.res});case 11:case"end":return c.stop()}},null,this)},v.initMultipartUpload=function(a,r){var h,m,p;return u.default.async(function(g){for(;;)switch(g.prev=g.next){case 0:return r=r||{},h={},D(r).to(h),h.headers=h.headers||{},this._convertMetaToHeaders(r.meta,h.headers),h.subres="uploads",m=this._objectRequestParams("POST",a,h),m.mime=r.mime,m.xmlResponse=!0,m.successStatuses=[200],g.next=12,u.default.awrap(this.request(m));case 12:return p=g.sent,g.abrupt("return",{res:p.res,bucket:p.data.Bucket,name:p.data.Key,uploadId:p.data.UploadId});case 14:case"end":return g.stop()}},null,this)},v.uploadPart=function(a,r,h,m,p,w,g){var c;return u.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return c={stream:this._createStream(m,p,w),size:w-p},s.next=3,u.default.awrap(this._uploadPart(a,r,h,c,g));case 3:return s.abrupt("return",s.sent);case 4:case"end":return s.stop()}},null,this)},v.completeMultipartUpload=function(a,r,h,m){var p,w,g,c,n,s,d,S;return u.default.async(function(i){for(;;)switch(i.prev=i.next){case 0:for(p=h.concat().sort(function(k,O){return k.number-O.number}).filter(function(k,O,b){return!O||k.number!==b[O-1].number}),w=` `,g=0;g `,w+=""+c.number+` `,w+=""+c.etag+` `,w+=` `;return w+="",m=m||{},n={},n=C(m),n.headers&&delete n.headers["x-oss-server-side-encryption"],n.subres={uploadId:r},s=this._objectRequestParams("POST",a,n),f.encodeCallback(s,n),s.mime="xml",s.content=w,s.headers&&s.headers["x-oss-callback"]||(s.xmlResponse=!0),s.successStatuses=[200],i.next=17,u.default.awrap(this.request(s));case 17:return d=i.sent,S={res:d.res,bucket:s.bucket,name:a,etag:d.res.headers.etag},s.headers&&s.headers["x-oss-callback"]&&(S.data=JSON.parse(d.data.toString())),i.abrupt("return",S);case 21:case"end":return i.stop()}},null,this)},v._uploadPart=function(a,r,h,m,p){var w,g,c;return u.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return p=p||{},w={},D(p).to(w),w.headers={"Content-Length":m.size},w.subres={partNumber:h,uploadId:r},g=this._objectRequestParams("PUT",a,w),g.mime=w.mime,g.stream=m.stream,g.successStatuses=[200],s.next=11,u.default.awrap(this.request(g));case 11:if(c=s.sent,c.res.headers.etag){s.next=14;break}throw new Error(`Please set the etag of expose-headers in OSS https://help.aliyun.com/document_detail/32069.html`);case 14:return m.stream=null,g.stream=null,s.abrupt("return",{name:a,etag:c.res.headers.etag,res:c.res});case 17:case"end":return s.stop()}},null,this)}},{"./callback":14,"./utils/deepCopy":39,"babel-runtime/regenerator":68,"copy-to":76}],19:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=C(M),_=I("babel-runtime/core-js/object/keys"),D=C(_),f=I("babel-runtime/helpers/typeof"),l=C(f);function C(r){return r&&r.__esModule?r:{default:r}}var v=I("../utils/checkBucketName"),o=v.checkBucketName,a=P;a.copy=function(h,m,p,w){var g,c,n;return u.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return(typeof p=="undefined"?"undefined":(0,l.default)(p))==="object"&&(w=p),w=w||{},w.headers=w.headers||{},(0,D.default)(w.headers).forEach(function(S){w.headers["x-oss-copy-source-"+S.toLowerCase()]=w.headers[S]}),w.meta&&(w.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(w.meta,w.headers),m=this._getSourceName(m,p),w.versionId&&(m=m+"?versionId="+w.versionId),w.headers["x-oss-copy-source"]=m,g=this._objectRequestParams("PUT",h,w),g.xmlResponse=!0,g.successStatuses=[200,304],d.next=14,u.default.awrap(this.request(g));case 14:return c=d.sent,n=c.data,n&&(n={etag:n.ETag,lastModified:n.LastModified}),d.abrupt("return",{data:n,res:c.res});case 18:case"end":return d.stop()}},null,this)},a._getSourceName=function(h,m){return typeof m=="string"?h=this._objectName(h):h[0]!=="/"?m=this.options.bucket:(m=h.replace(/\/(.+?)(\/.*)/,"$1"),h=h.replace(/(\/.+?\/)(.*)/,"$2")),o(m),h=encodeURI(h),h="/"+m+"/"+h,h}},{"../utils/checkBucketName":35,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,"babel-runtime/regenerator":68}],20:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=f(M),_=I("babel-runtime/core-js/object/assign"),D=f(_);function f(C){return C&&C.__esModule?C:{default:C}}var l=P;l.delete=function(v){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r;return u.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return o.subres=(0,D.default)({},o.subres),o.versionId&&(o.subres.versionId=o.versionId),a=this._objectRequestParams("DELETE",v,o),a.successStatuses=[204],m.next=6,u.default.awrap(this.request(a));case 6:return r=m.sent,m.abrupt("return",{res:r.res});case 8:case"end":return m.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],21:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=f(M),_=I("babel-runtime/core-js/object/assign"),D=f(_);function f(a){return a&&a.__esModule?a:{default:a}}var l=I("utility"),C=I("../utils/obj2xml"),v=C.obj2xml,o=P;o.deleteMulti=function(r){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m,p,w,g,c,n,s,d,S,y,i,k;return u.default.async(function(b){for(;;)switch(b.prev=b.next){case 0:if(m=[],!(!r||!r.length)){b.next=3;break}throw new Error("names is required");case 3:for(p=0;p1&&arguments[1]!==void 0?arguments[1]:{},a,r;return u.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return o.subres=(0,D.default)({tagging:""},o.subres),o.versionId&&(o.subres.versionId=o.versionId),v=this._objectName(v),a=this._objectRequestParams("DELETE",v,o),a.successStatuses=[204],m.next=7,u.default.awrap(this.request(a));case 7:return r=m.sent,m.abrupt("return",{status:r.status,res:r.res});case 9:case"end":return m.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],23:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=f(M),_=I("babel-runtime/core-js/object/assign"),D=f(_);function f(o){return o&&o.__esModule?o:{default:o}}var l=I("fs"),C=I("is-type-of"),v=P;v.get=function(a,r){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},m,p,w,g;return u.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return m=null,p=!1,C.writableStream(r)?m=r:C.string(r)?(m=l.createWriteStream(r),p=!0):h=r,h=h||{},h.subres=(0,D.default)({},h.subres),h.versionId&&(h.subres.versionId=h.versionId),h.process&&(h.subres["x-oss-process"]=h.process),w=void 0,n.prev=8,g=this._objectRequestParams("GET",a,h),g.writeStream=m,g.successStatuses=[200,206,304],n.next=14,u.default.awrap(this.request(g));case 14:w=n.sent,p&&m.destroy(),n.next=25;break;case 18:if(n.prev=18,n.t0=n.catch(8),!p){n.next=24;break}return m.destroy(),n.next=24,u.default.awrap(this._deleteFileSafe(r));case 24:throw n.t0;case 25:return n.abrupt("return",{res:w.res,content:w.data});case 26:case"end":return n.stop()}},null,this,[[8,18]])}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,fs:71,"is-type-of":289}],24:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=f(M),_=I("babel-runtime/core-js/object/assign"),D=f(_);function f(C){return C&&C.__esModule?C:{default:C}}var l=P;l.getACL=function(v){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r;return u.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return o.subres=(0,D.default)({acl:""},o.subres),o.versionId&&(o.subres.versionId=o.versionId),v=this._objectName(v),a=this._objectRequestParams("GET",v,o),a.successStatuses=[200],a.xmlResponse=!0,m.next=8,u.default.awrap(this.request(a));case 8:return r=m.sent,m.abrupt("return",{acl:r.data.AccessControlList.Grant,owner:{id:r.data.Owner.ID,displayName:r.data.Owner.DisplayName},res:r.res});case 10:case"end":return m.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],25:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/keys"),u=C(M),_=I("babel-runtime/regenerator"),D=C(_),f=I("babel-runtime/core-js/object/assign"),l=C(f);function C(g){return g&&g.__esModule?g:{default:g}}var v=P,o=I("../utils/isObject"),a=o.isObject,r=I("../utils/isArray"),h=r.isArray;v.getBucketVersions=m,v.listObjectVersions=m;function m(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,s,d,S,y,i;return D.default.async(function(O){for(;;)switch(O.prev=O.next){case 0:if(!(g.versionIdMarker&&g.keyMarker===void 0)){O.next=2;break}throw new Error("A version-id marker cannot be specified without a key marker");case 2:return c.subres=(0,l.default)({versions:""},c.subres),c.versionId&&(c.subres.versionId=c.versionId),n=this._objectRequestParams("GET","",c),n.xmlResponse=!0,n.successStatuses=[200],n.query=w(g),O.next=10,D.default.awrap(this.request(n));case 10:return s=O.sent,d=s.data.Version||[],S=s.data.DeleteMarker||[],y=this,d&&(Array.isArray(d)||(d=[d]),d=d.map(function(b){return{name:b.Key,url:y._objectUrl(b.Key),lastModified:b.LastModified,isLatest:b.IsLatest==="true",versionId:b.VersionId,etag:b.ETag,type:b.Type,size:Number(b.Size),storageClass:b.StorageClass,owner:{id:b.Owner.ID,displayName:b.Owner.DisplayName}}})),S&&(h(S)||(S=[S]),S=S.map(function(b){return{name:b.Key,lastModified:b.LastModified,versionId:b.VersionId,owner:{id:b.Owner.ID,displayName:b.Owner.DisplayName}}})),i=s.data.CommonPrefixes||null,i&&(h(i)||(i=[i]),i=i.map(function(b){return b.Prefix})),O.abrupt("return",{res:s.res,objects:d,deleteMarker:S,prefixes:i,nextMarker:s.data.NextMarker||null,NextVersionIdMarker:s.data.NextVersionIdMarker||null,isTruncated:s.data.IsTruncated==="true"});case 19:case"end":return O.stop()}},null,this)}function p(g){return g.replace(/([A-Z])/g,"-$1").toLowerCase()}function w(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c={};return a(g)&&(0,u.default)(g).forEach(function(n){c[p(n)]=g[n]}),c}},{"../utils/isArray":42,"../utils/isObject":46,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],26:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=f(M),_=I("babel-runtime/core-js/object/assign"),D=f(_);function f(C){return C&&C.__esModule?C:{default:C}}var l=P;l.getObjectMeta=function(v,o){var a,r;return u.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return o=o||{},v=this._objectName(v),o.subres=(0,D.default)({objectMeta:""},o.subres),o.versionId&&(o.subres.versionId=o.versionId),a=this._objectRequestParams("HEAD",v,o),a.successStatuses=[200],m.next=8,u.default.awrap(this.request(a));case 8:return r=m.sent,m.abrupt("return",{status:r.status,res:r.res});case 10:case"end":return m.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],27:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=f(M),_=I("babel-runtime/core-js/object/assign"),D=f(_);function f(o){return o&&o.__esModule?o:{default:o}}var l=P,C=I("../utils/isObject"),v=C.isObject;l.getObjectTagging=function(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h,m,p,w,g;return u.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return r.subres=(0,D.default)({tagging:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),a=this._objectName(a),h=this._objectRequestParams("GET",a,r),h.successStatuses=[200],n.next=7,u.default.awrap(this.request(h));case 7:return m=n.sent,n.next=10,u.default.awrap(this.parseXML(m.data));case 10:return p=n.sent,w=p.TagSet.Tag,w=w&&v(w)?[w]:w||[],g={},w.forEach(function(s){g[s.Key]=s.Value}),n.abrupt("return",{status:m.status,res:m.res,tag:g});case 16:case"end":return n.stop()}},null,this)}},{"../utils/isObject":46,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],28:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=f(M),_=I("babel-runtime/core-js/object/assign"),D=f(_);function f(C){return C&&C.__esModule?C:{default:C}}var l=P;l.getSymlink=function(v){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r,h;return u.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return o.subres=(0,D.default)({symlink:""},o.subres),o.versionId&&(o.subres.versionId=o.versionId),v=this._objectName(v),a=this._objectRequestParams("GET",v,o),a.successStatuses=[200],p.next=7,u.default.awrap(this.request(a));case 7:return r=p.sent,h=r.res.headers["x-oss-symlink-target"],p.abrupt("return",{targetName:decodeURIComponent(h),res:r.res});case 10:case"end":return p.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],29:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=C(M),_=I("babel-runtime/core-js/object/keys"),D=C(_),f=I("babel-runtime/core-js/object/assign"),l=C(f);function C(o){return o&&o.__esModule?o:{default:o}}var v=P;v.head=function(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h,m,p;return u.default.async(function(g){for(;;)switch(g.prev=g.next){case 0:return r.subres=(0,l.default)({},r.subres),r.versionId&&(r.subres.versionId=r.versionId),h=this._objectRequestParams("HEAD",a,r),h.successStatuses=[200,304],g.next=6,u.default.awrap(this.request(h));case 6:return m=g.sent,p={meta:null,res:m.res,status:m.status},m.status===200&&(0,D.default)(m.headers).forEach(function(c){c.indexOf("x-oss-meta-")===0&&(p.meta||(p.meta={}),p.meta[c.substring(11)]=m.headers[c])}),g.abrupt("return",p);case 10:case"end":return g.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],30:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=f(M),_=I("babel-runtime/core-js/object/assign"),D=f(_);function f(C){return C&&C.__esModule?C:{default:C}}var l=P;l.putACL=function(v,o,a){var r,h;return u.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return a=a||{},a.subres=(0,D.default)({acl:""},a.subres),a.versionId&&(a.subres.versionId=a.versionId),a.headers=a.headers||{},a.headers["x-oss-object-acl"]=o,v=this._objectName(v),r=this._objectRequestParams("PUT",v,a),r.successStatuses=[200],p.next=10,u.default.awrap(this.request(r));case 10:return h=p.sent,p.abrupt("return",{res:h.res});case 12:case"end":return p.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],31:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=C(M),_=I("babel-runtime/core-js/object/keys"),D=C(_),f=I("babel-runtime/core-js/object/assign"),l=C(f);function C(m){return m&&m.__esModule?m:{default:m}}var v=I("../utils/obj2xml"),o=v.obj2xml,a=I("../utils/checkObjectTag"),r=a.checkObjectTag,h=P;h.putObjectTagging=function(p,w){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c,n,s;return u.default.async(function(S){for(;;)switch(S.prev=S.next){case 0:return r(w),g.subres=(0,l.default)({tagging:""},g.subres),g.versionId&&(g.subres.versionId=g.versionId),p=this._objectName(p),c=this._objectRequestParams("PUT",p,g),c.successStatuses=[200],w=(0,D.default)(w).map(function(y){return{Key:y,Value:w[y]}}),n={Tagging:{TagSet:{Tag:w}}},c.mime="xml",c.content=o(n),S.next=12,u.default.awrap(this.request(c));case 12:return s=S.sent,S.abrupt("return",{res:s.res,status:s.status});case 14:case"end":return S.stop()}},null,this)}},{"../utils/checkObjectTag":36,"../utils/obj2xml":47,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],32:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=f(M),_=I("babel-runtime/core-js/object/assign"),D=f(_);function f(C){return C&&C.__esModule?C:{default:C}}var l=P;l.putSymlink=function(v,o,a){var r,h;return u.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return a=a||{},a.headers=a.headers||{},o=this._escape(this._objectName(o)),this._convertMetaToHeaders(a.meta,a.headers),a.headers["x-oss-symlink-target"]=o,a.subres=(0,D.default)({symlink:""},a.subres),a.versionId&&(a.subres.versionId=a.versionId),a.storageClass&&(a.headers["x-oss-storage-class"]=a.storageClass),v=this._objectName(v),r=this._objectRequestParams("PUT",v,a),r.successStatuses=[200],p.next=13,u.default.awrap(this.request(r));case 13:return h=p.sent,p.abrupt("return",{res:h.res});case 15:case"end":return p.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],33:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=f(M),_=I("babel-runtime/core-js/promise"),D=f(_);function f(C){return C&&C.__esModule?C:{default:C}}var l=P;l._parallelNode=function(v,o,a,r){var h,m,p,w,g,c,n,s;return u.default.async(function(S){for(;;)switch(S.prev=S.next){case 0:h=this,m=[],p=[],w=v.length/o,g=v.length%o,c=g===0?w:(v.length-g)/o+1,n=1,s=0;case 8:if(!(s0){c=!0,n<=0&&h(m);return}n+=1,S(i.value,p(d))}s=!1}y()})},l.cancel=function(v){this.options.cancelFlag=!0,v&&this.abortMultipartUpload(v.name,v.uploadId,v.options)},l.isCancel=function(){return this.options.cancelFlag},l.resetCancelFlag=function(){this.options.cancelFlag=!1},l._stop=function(){this.options.cancelFlag=!0},l._makeCancelEvent=function(){var v={status:0,name:"cancel"};return v}},{"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68}],34:[function(I,J,P){(function(M){"use strict";var u=I("babel-runtime/core-js/json/stringify"),_=l(u),D=I("babel-runtime/core-js/object/keys"),f=l(D);function l(o){return o&&o.__esModule?o:{default:o}}var C=I("./../../shims/crypto/crypto.js"),v=I("is-type-of");P.buildCanonicalizedResource=function(a,r){var h=""+a,m="?";if(v.string(r)&&r.trim()!=="")h+=m+r;else if(v.array(r))r.sort(),h+=m+r.join("&");else if(r){var p=function(c,n){return c[0]>n[0]?1:c[0]1&&arguments[1]!==void 0?arguments[1]:{},h=arguments[2],m=arguments[3],p={},w=r.subResource,g=w===void 0?{}:w;if(r.process){var c="x-oss-process";g[c]=r.process}if(r.trafficLimit){var n="x-oss-traffic-limit";g[n]=r.trafficLimit}if(r.response&&(0,f.default)(r.response).forEach(function(y){var i="response-"+y.toLowerCase();g[i]=r.response[y]}),(0,f.default)(r).forEach(function(y){var i=y.toLowerCase(),k=r[y];i.indexOf("x-oss-")===0?p[i]=k:(i.indexOf("content-md5")===0||i.indexOf("content-type")===0)&&(p[y]=k)}),Object.prototype.hasOwnProperty.call(r,"security-token")&&(g["security-token"]=r["security-token"]),Object.prototype.hasOwnProperty.call(r,"callback")){var s={callbackUrl:encodeURI(r.callback.url),callbackBody:r.callback.body};if(r.callback.host&&(s.callbackHost=r.callback.host),r.callback.contentType&&(s.callbackBodyType=r.callback.contentType),g.callback=M.from((0,_.default)(s)).toString("base64"),r.callback.customValue){var d={};(0,f.default)(r.callback.customValue).forEach(function(y){d["x:"+y]=r.callback.customValue[y]}),g["callback-var"]=M.from((0,_.default)(d)).toString("base64")}}var S=this.buildCanonicalString(r.method,h,{headers:p,parameters:g},m.toString());return{Signature:this.computeSignature(a,S),subResource:g}}}).call(this,I("buffer").Buffer)},{"./../../shims/crypto/crypto.js":284,"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/keys":60,buffer:73,"is-type-of":289}],35:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.checkBucketName=void 0,P.checkBucketName=function(M,u){var _=u?/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/:/^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/;if(!_.test(M))throw new Error("The bucket must be conform to the specifications")}},{}],36:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/entries"),u=_(M);function _(r){return r&&r.__esModule?r:{default:r}}Object.defineProperty(P,"__esModule",{value:!0}),P.checkObjectTag=void 0;var D=I("./checkValid"),f=D.checkValid,l=I("./isObject"),C=l.isObject,v=[{validator:function(h){if(typeof h!="string")throw new Error("the key and value of the tag must be String")}},{pattern:/^[a-zA-Z0-9 +-=._:/]+$/,msg:"tag can contain letters, numbers, spaces, and the following symbols: plus sign (+), hyphen (-), equal sign (=), period (.), underscore (_), colon (:), and forward slash (/)"}],o={key:[].concat(v,[{pattern:/^.{1,128}$/,msg:"tag key can be a maximum of 128 bytes in length"}]),value:[].concat(v,[{pattern:/^.{0,256}$/,msg:"tag value can be a maximum of 256 bytes in length"}])};function a(r){if(!C(r))throw new Error("tag must be Object");var h=(0,u.default)(r);if(h.length>10)throw new Error("maximum of 10 tags for a object");var m=["key","value"];h.forEach(function(p){p.forEach(function(w,g){f(w,o[m[g]])})})}P.checkObjectTag=a},{"./checkValid":37,"./isObject":46,"babel-runtime/core-js/object/entries":57}],37:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.checkValid=void 0;function M(u,_){_.forEach(function(D){if(D.validator)D.validator(u);else if(D.pattern&&!D.pattern.test(u))throw new Error(D.msg)})}P.checkValid=M},{}],38:[function(I,J,P){(function(M){"use strict";var u=I("babel-runtime/core-js/object/assign"),_=D(u);function D(p){return p&&p.__esModule?p:{default:p}}Object.defineProperty(P,"__esModule",{value:!0}),P.createRequest=void 0;var f=I("./../../../shims/crypto/crypto.js"),l=I("debug")("ali-oss"),C=I("mime"),v=I("dateformat"),o=I("copy-to"),a=I("path");function r(p,w){return p[w]||p[w.toLowerCase()]}function h(p,w){delete p[w],delete p[w.toLowerCase()]}function m(p){var w=new Date;this.options.amendTimeSkewed&&(w=+new Date+this.options.amendTimeSkewed);var g={"x-oss-date":v(w,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.userAgent.includes("nodejs")&&(g["User-Agent"]=this.userAgent),this.options.isRequestPay&&(0,_.default)(g,{"x-oss-request-payer":"requester"}),this.options.stsToken&&(g["x-oss-security-token"]=this.options.stsToken),o(p.headers).to(g),r(g,"Content-Type")||(p.mime&&p.mime.indexOf("/")>0?g["Content-Type"]=p.mime:g["Content-Type"]=C.getType(p.mime||a.extname(p.object||""))),r(g,"Content-Type")||h(g,"Content-Type"),p.content&&(g["Content-Md5"]=f.createHash("md5").update(M.from(p.content,"utf8")).digest("base64"),g["Content-Length"]||(g["Content-Length"]=p.content.length));var c=this._getResource(p);g.authorization=this.authorization(p.method,c,p.subres,g);var n=this._getReqUrl(p);l("request %s %s, with headers %j, !!stream: %s",p.method,n,g,!!p.stream);var s=p.timeout||this.options.timeout,d={method:p.method,content:p.content,stream:p.stream,headers:g,timeout:s,writeStream:p.writeStream,customResponse:p.customResponse,ctx:p.ctx||this.ctx};return this.agent&&(d.agent=this.agent),this.httpsAgent&&(d.httpsAgent=this.httpsAgent),{url:n,params:d}}P.createRequest=m}).call(this,I("buffer").Buffer)},{"./../../../shims/crypto/crypto.js":284,"babel-runtime/core-js/object/assign":54,buffer:73,"copy-to":76,dateformat:190,debug:288,mime:202,path:205}],39:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/keys"),u=f(M),_=I("babel-runtime/helpers/typeof"),D=f(_);function f(l){return l&&l.__esModule?l:{default:l}}Object.defineProperty(P,"__esModule",{value:!0}),P.deepCopy=void 0,P.deepCopy=function(l){if(l===null||(typeof l=="undefined"?"undefined":(0,D.default)(l))!=="object")return l;var C=Array.isArray(l)?[]:{};return(0,u.default)(l).forEach(function(v){C[v]=P.deepCopy(l[v])}),C}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],40:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/keys"),u=f(M),_=I("babel-runtime/helpers/typeof"),D=f(_);function f(v){return v&&v.__esModule?v:{default:v}}Object.defineProperty(P,"__esModule",{value:!0}),P.formatObjKey=void 0;function l(v,o){if(v===null||(typeof v=="undefined"?"undefined":(0,D.default)(v))!=="object")return v;var a=void 0;if(Array.isArray(v)){a=[];for(var r=0;r `),v&&v.firstUpperCase&&(C=D.formatObjKey(C,"firstUpperCase")),f(C)==="object"?(0,u.default)(C).forEach(function(a){f(C[a])==="string"||f(C[a])==="number"?o+="<"+a+">"+C[a]+"":f(C[a])==="object"?o+="<"+a+">"+l(C[a])+"":f(C[a])==="array"?o+=C[a].map(function(r){return"<"+a+">"+l(r)+""}).join(""):o+="<"+a+">"+C[a].toString()+""}):o+=C.toString(),o}P.obj2xml=l},{"./formatObjKey":40,"babel-runtime/core-js/object/keys":60}],48:[function(I,J,P){J.exports=M,J.exports.HttpsAgent=M;function M(){}},{}],49:[function(I,J,P){J.exports=I("./register")().Promise},{"./register":51}],50:[function(I,J,P){"use strict";var M="@@any-promise/REGISTRATION",u=null;J.exports=function(_,D){return function(l,C){l=l||null,C=C||{};var v=C.global!==!1;if(u===null&&v&&(u=_[M]||null),u!==null&&l!==null&&u.implementation!==l)throw new Error('any-promise already defined as "'+u.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return u===null&&(l!==null&&typeof C.Promise!="undefined"?u={Promise:C.Promise,implementation:l}:u=D(l),v&&(_[M]=u)),u}}},{}],51:[function(I,J,P){"use strict";J.exports=I("./loader")(window,M);function M(){if(typeof window.Promise=="undefined")throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}}},{"./loader":50}],52:[function(I,J,P){J.exports={default:I("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":77}],53:[function(I,J,P){J.exports={default:I("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":78}],54:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":79}],55:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":80}],56:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":81}],57:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/entries"),__esModule:!0}},{"core-js/library/fn/object/entries":82}],58:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/get-own-property-names"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-names":83}],59:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/get-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/get-prototype-of":84}],60:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":85}],61:[function(I,J,P){J.exports={default:I("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":86}],62:[function(I,J,P){J.exports={default:I("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":87}],63:[function(I,J,P){J.exports={default:I("core-js/library/fn/string/from-code-point"),__esModule:!0}},{"core-js/library/fn/string/from-code-point":88}],64:[function(I,J,P){J.exports={default:I("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":90}],65:[function(I,J,P){J.exports={default:I("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":89}],66:[function(I,J,P){J.exports={default:I("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":91}],67:[function(I,J,P){"use strict";P.__esModule=!0;var M=I("../core-js/symbol/iterator"),u=l(M),_=I("../core-js/symbol"),D=l(_),f=typeof D.default=="function"&&typeof u.default=="symbol"?function(C){return typeof C}:function(C){return C&&typeof D.default=="function"&&C.constructor===D.default&&C!==D.default.prototype?"symbol":typeof C};function l(C){return C&&C.__esModule?C:{default:C}}P.default=typeof D.default=="function"&&f(u.default)==="symbol"?function(C){return typeof C=="undefined"?"undefined":f(C)}:function(C){return C&&typeof D.default=="function"&&C.constructor===D.default&&C!==D.default.prototype?"symbol":typeof C=="undefined"?"undefined":f(C)}},{"../core-js/symbol":64,"../core-js/symbol/iterator":66}],68:[function(I,J,P){J.exports=I("regenerator-runtime")},{"regenerator-runtime":226}],69:[function(I,J,P){"use strict";P.byteLength=v,P.toByteArray=a,P.fromByteArray=m;for(var M=[],u=[],_=typeof Uint8Array!="undefined"?Uint8Array:Array,D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,l=D.length;f0)throw new Error("Invalid string. Length must be a multiple of 4");var g=p.indexOf("=");g===-1&&(g=w);var c=g===w?0:4-g%4;return[g,c]}function v(p){var w=C(p),g=w[0],c=w[1];return(g+c)*3/4-c}function o(p,w,g){return(w+g)*3/4-g}function a(p){var w,g=C(p),c=g[0],n=g[1],s=new _(o(p,c,n)),d=0,S=n>0?c-4:c,y;for(y=0;y>16&255,s[d++]=w>>8&255,s[d++]=w&255;return n===2&&(w=u[p.charCodeAt(y)]<<2|u[p.charCodeAt(y+1)]>>4,s[d++]=w&255),n===1&&(w=u[p.charCodeAt(y)]<<10|u[p.charCodeAt(y+1)]<<4|u[p.charCodeAt(y+2)]>>2,s[d++]=w>>8&255,s[d++]=w&255),s}function r(p){return M[p>>18&63]+M[p>>12&63]+M[p>>6&63]+M[p&63]}function h(p,w,g){for(var c,n=[],s=w;sS?S:d+s));return c===1?(w=p[g-1],n.push(M[w>>2]+M[w<<4&63]+"==")):c===2&&(w=(p[g-2]<<8)+p[g-1],n.push(M[w>>10]+M[w>>4&63]+M[w<<2&63]+"=")),n.join("")}},{}],70:[function(I,J,P){/*! * Bowser - a browser detector * https://github.com/ded/bowser * MIT License | (c) Dustin Diaz 2015 */!function(M,u,_){typeof J!="undefined"&&J.exports?J.exports=_():typeof define=="function"&&define.amd?define(u,_):M[u]=_()}(this,"bowser",function(){var M=!0;function u(o){function a(G){var F=o.match(G);return F&&F.length>1&&F[1]||""}function r(G){var F=o.match(G);return F&&F.length>1&&F[2]||""}var h=a(/(ipod|iphone|ipad)/i).toLowerCase(),m=/like android/i.test(o),p=!m&&/android/i.test(o),w=/nexus\s*[0-6]\s*/i.test(o),g=!w&&/nexus\s*[0-9]+/i.test(o),c=/CrOS/.test(o),n=/silk/i.test(o),s=/sailfish/i.test(o),d=/tizen/i.test(o),S=/(web|hpw)(o|0)s/i.test(o),y=/windows phone/i.test(o),i=/SamsungBrowser/i.test(o),k=!y&&/windows/i.test(o),O=!h&&!n&&/macintosh/i.test(o),b=!p&&!s&&!d&&!S&&/linux/i.test(o),E=r(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),x=a(/version\/(\d+(\.\d+)?)/i),T=/tablet/i.test(o)&&!/tablet pc/i.test(o),N=!T&&/[^-]mobi/i.test(o),j=/xbox/i.test(o),L;/opera/i.test(o)?L={name:"Opera",opera:M,version:x||a(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(o)?L={name:"Opera",opera:M,version:a(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||x}:/SamsungBrowser/i.test(o)?L={name:"Samsung Internet for Android",samsungBrowser:M,version:x||a(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(o)?L={name:"NAVER Whale browser",whale:M,version:a(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(o)?L={name:"MZ Browser",mzbrowser:M,version:a(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(o)?L={name:"Opera Coast",coast:M,version:x||a(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(o)?L={name:"Focus",focus:M,version:a(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(o)?L={name:"Yandex Browser",yandexbrowser:M,version:x||a(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(o)?L={name:"UC Browser",ucbrowser:M,version:a(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(o)?L={name:"Maxthon",maxthon:M,version:a(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(o)?L={name:"Epiphany",epiphany:M,version:a(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(o)?L={name:"Puffin",puffin:M,version:a(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(o)?L={name:"Sleipnir",sleipnir:M,version:a(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(o)?L={name:"K-Meleon",kMeleon:M,version:a(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:y?(L={name:"Windows Phone",osname:"Windows Phone",windowsphone:M},E?(L.msedge=M,L.version=E):(L.msie=M,L.version=a(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(o)?L={name:"Internet Explorer",msie:M,version:a(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:c?L={name:"Chrome",osname:"Chrome OS",chromeos:M,chromeBook:M,chrome:M,version:a(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(o)?L={name:"Microsoft Edge",msedge:M,version:E}:/vivaldi/i.test(o)?L={name:"Vivaldi",vivaldi:M,version:a(/vivaldi\/(\d+(\.\d+)?)/i)||x}:s?L={name:"Sailfish",osname:"Sailfish OS",sailfish:M,version:a(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(o)?L={name:"SeaMonkey",seamonkey:M,version:a(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(o)?(L={name:"Firefox",firefox:M,version:a(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(o)&&(L.firefoxos=M,L.osname="Firefox OS")):n?L={name:"Amazon Silk",silk:M,version:a(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(o)?L={name:"PhantomJS",phantom:M,version:a(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(o)?L={name:"SlimerJS",slimer:M,version:a(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(o)||/rim\stablet/i.test(o)?L={name:"BlackBerry",osname:"BlackBerry OS",blackberry:M,version:x||a(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:S?(L={name:"WebOS",osname:"WebOS",webos:M,version:x||a(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(o)&&(L.touchpad=M)):/bada/i.test(o)?L={name:"Bada",osname:"Bada",bada:M,version:a(/dolfin\/(\d+(\.\d+)?)/i)}:d?L={name:"Tizen",osname:"Tizen",tizen:M,version:a(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||x}:/qupzilla/i.test(o)?L={name:"QupZilla",qupzilla:M,version:a(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||x}:/chromium/i.test(o)?L={name:"Chromium",chromium:M,version:a(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||x}:/chrome|crios|crmo/i.test(o)?L={name:"Chrome",chrome:M,version:a(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:p?L={name:"Android",version:x}:/safari|applewebkit/i.test(o)?(L={name:"Safari",safari:M},x&&(L.version=x)):h?(L={name:h=="iphone"?"iPhone":h=="ipad"?"iPad":"iPod"},x&&(L.version=x)):/googlebot/i.test(o)?L={name:"Googlebot",googlebot:M,version:a(/googlebot\/(\d+(\.\d+))/i)||x}:L={name:a(/^(.*)\/(.*) /),version:r(/^(.*)\/(.*) /)},!L.msedge&&/(apple)?webkit/i.test(o)?(/(apple)?webkit\/537\.36/i.test(o)?(L.name=L.name||"Blink",L.blink=M):(L.name=L.name||"Webkit",L.webkit=M),!L.version&&x&&(L.version=x)):!L.opera&&/gecko\//i.test(o)&&(L.name=L.name||"Gecko",L.gecko=M,L.version=L.version||a(/gecko\/(\d+(\.\d+)?)/i)),!L.windowsphone&&(p||L.silk)?(L.android=M,L.osname="Android"):!L.windowsphone&&h?(L[h]=M,L.ios=M,L.osname="iOS"):O?(L.mac=M,L.osname="macOS"):j?(L.xbox=M,L.osname="Xbox"):k?(L.windows=M,L.osname="Windows"):b&&(L.linux=M,L.osname="Linux");function V(G){switch(G){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}var K="";L.windows?K=V(a(/Windows ((NT|XP)( \d\d?.\d)?)/i)):L.windowsphone?K=a(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):L.mac?(K=a(/Mac OS X (\d+([_\.\s]\d+)*)/i),K=K.replace(/[_\s]/g,".")):h?(K=a(/os (\d+([_\s]\d+)*) like mac os x/i),K=K.replace(/[_\s]/g,".")):p?K=a(/android[ \/-](\d+(\.\d+)*)/i):L.webos?K=a(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):L.blackberry?K=a(/rim\stablet\sos\s(\d+(\.\d+)*)/i):L.bada?K=a(/bada\/(\d+(\.\d+)*)/i):L.tizen&&(K=a(/tizen[\/\s](\d+(\.\d+)*)/i)),K&&(L.osversion=K);var W=!L.windows&&K.split(".")[0];return T||g||h=="ipad"||p&&(W==3||W>=4&&!N)||L.silk?L.tablet=M:(N||h=="iphone"||h=="ipod"||p||w||L.blackberry||L.webos||L.bada)&&(L.mobile=M),L.msedge||L.msie&&L.version>=10||L.yandexbrowser&&L.version>=15||L.vivaldi&&L.version>=1||L.chrome&&L.version>=20||L.samsungBrowser&&L.version>=4||L.whale&&l([L.version,"1.0"])===1||L.mzbrowser&&l([L.version,"6.0"])===1||L.focus&&l([L.version,"1.0"])===1||L.firefox&&L.version>=20||L.safari&&L.version>=6||L.opera&&L.version>=10||L.ios&&L.osversion&&L.osversion.split(".")[0]>=6||L.blackberry&&L.version>=10.1||L.chromium&&L.version>=20?L.a=M:L.msie&&L.version<10||L.chrome&&L.version<20||L.firefox&&L.version<20||L.safari&&L.version<6||L.opera&&L.version<10||L.ios&&L.osversion&&L.osversion.split(".")[0]<6||L.chromium&&L.version<20?L.c=M:L.x=M,L}var _=u(typeof navigator!="undefined"&&navigator.userAgent||"");_.test=function(o){for(var a=0;a=0;){if(r[0][a]>r[1][a])return 1;if(r[0][a]===r[1][a]){if(a===0)return 0}else return-1}}function C(o,a,r){var h=_;typeof a=="string"&&(r=a,a=void 0),a===void 0&&(a=!1),r&&(h=u(r));var m=""+h.version;for(var p in o)if(o.hasOwnProperty(p)&&h[p]){if(typeof o[p]!="string")throw new Error("Browser version in the minVersion map should be a string: "+p+": "+String(o));return l([m,o[p]])<0}return a}function v(o,a,r){return!C(o,a,r)}return _.isUnsupportedBrowser=C,_.compareVersions=l,_.check=v,_._detect=u,_.detect=u,_})},{}],71:[function(I,J,P){},{}],72:[function(I,J,P){var M=I("buffer").Buffer,u=M.isEncoding||function(v){switch(v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _(v){if(v&&!u(v))throw new Error("Unknown encoding: "+v)}var D=P.StringDecoder=function(v){this.encoding=(v||"utf8").toLowerCase().replace(/[-_]/,""),_(v);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=l;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=C;break;default:this.write=f;return}this.charBuffer=new M(6),this.charReceived=0,this.charLength=0};D.prototype.write=function(v){for(var o="";this.charLength;){var a=v.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:v.length;if(v.copy(this.charBuffer,this.charReceived,0,a),this.charReceived+=a,this.charReceived=55296&&h<=56319){this.charLength+=this.surrogateSize,o="";continue}if(this.charReceived=this.charLength=0,v.length===0)return o;break}this.detectIncompleteChar(v);var r=v.length;this.charLength&&(v.copy(this.charBuffer,0,v.length-this.charReceived,r),r-=this.charReceived),o+=v.toString(this.encoding,0,r);var r=o.length-1,h=o.charCodeAt(r);if(h>=55296&&h<=56319){var m=this.surrogateSize;return this.charLength+=m,this.charReceived+=m,this.charBuffer.copy(this.charBuffer,m,0,m),v.copy(this.charBuffer,0,0,m),o.substring(0,r)}return o},D.prototype.detectIncompleteChar=function(v){for(var o=v.length>=3?3:v.length;o>0;o--){var a=v[v.length-o];if(o==1&&a>>5==6){this.charLength=2;break}if(o<=2&&a>>4==14){this.charLength=3;break}if(o<=3&&a>>3==30){this.charLength=4;break}}this.charReceived=o},D.prototype.end=function(v){var o="";if(v&&v.length&&(o=this.write(v)),this.charReceived){var a=this.charReceived,r=this.charBuffer,h=this.encoding;o+=r.slice(0,a).toString(h)}return o};function f(v){return v.toString(this.encoding)}function l(v){this.charReceived=v.length%2,this.charLength=this.charReceived?2:0}function C(v){this.charReceived=v.length%3,this.charLength=this.charReceived?3:0}},{buffer:73}],73:[function(I,J,P){(function(M,u){/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */"use strict";var _=I("base64-js"),D=I("ieee754"),f=I("isarray");P.Buffer=u,P.SlowBuffer=n,P.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=M.TYPED_ARRAY_SUPPORT!==void 0?M.TYPED_ARRAY_SUPPORT:l(),P.kMaxLength=C();function l(){try{var le=new Uint8Array(1);return le.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},le.foo()===42&&typeof le.subarray=="function"&&le.subarray(1,1).byteLength===0}catch(Q){return!1}}function C(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function v(le,Q){if(C()=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return le|0}function n(le){return+le!=le&&(le=0),u.alloc(+le)}u.isBuffer=function(Q){return!!(Q!=null&&Q._isBuffer)},u.compare=function(Q,Y){if(!u.isBuffer(Q)||!u.isBuffer(Y))throw new TypeError("Arguments must be Buffers");if(Q===Y)return 0;for(var Z=Q.length,be=Y.length,ge=0,Re=Math.min(Z,be);ge>>1;case"base64":return te(le).length;default:if(Z)return ce(le).length;Q=(""+Q).toLowerCase(),Z=!0}}u.byteLength=s;function d(le,Q,Y){var Z=!1;if((Q===void 0||Q<0)&&(Q=0),Q>this.length)return"";if((Y===void 0||Y>this.length)&&(Y=this.length),Y<=0)return"";if(Y>>>=0,Q>>>=0,Y<=Q)return"";for(le||(le="utf8");;)switch(le){case"hex":return G(this,Q,Y);case"utf8":case"utf-8":return j(this,Q,Y);case"ascii":return K(this,Q,Y);case"latin1":case"binary":return W(this,Q,Y);case"base64":return N(this,Q,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,Q,Y);default:if(Z)throw new TypeError("Unknown encoding: "+le);le=(le+"").toLowerCase(),Z=!0}}u.prototype._isBuffer=!0;function S(le,Q,Y){var Z=le[Q];le[Q]=le[Y],le[Y]=Z}u.prototype.swap16=function(){var Q=this.length;if(Q%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Y=0;Y0&&(Q=this.toString("hex",0,Y).match(/.{2}/g).join(" "),this.length>Y&&(Q+=" ... ")),""},u.prototype.compare=function(Q,Y,Z,be,ge){if(!u.isBuffer(Q))throw new TypeError("Argument must be a Buffer");if(Y===void 0&&(Y=0),Z===void 0&&(Z=Q?Q.length:0),be===void 0&&(be=0),ge===void 0&&(ge=this.length),Y<0||Z>Q.length||be<0||ge>this.length)throw new RangeError("out of range index");if(be>=ge&&Y>=Z)return 0;if(be>=ge)return-1;if(Y>=Z)return 1;if(Y>>>=0,Z>>>=0,be>>>=0,ge>>>=0,this===Q)return 0;for(var Re=ge-be,Ze=Z-Y,qe=Math.min(Re,Ze),et=this.slice(be,ge),nt=Q.slice(Y,Z),ut=0;ut2147483647?Y=2147483647:Y<-2147483648&&(Y=-2147483648),Y=+Y,isNaN(Y)&&(Y=be?0:le.length-1),Y<0&&(Y=le.length+Y),Y>=le.length){if(be)return-1;Y=le.length-1}else if(Y<0)if(be)Y=0;else return-1;if(typeof Q=="string"&&(Q=u.from(Q,Z)),u.isBuffer(Q))return Q.length===0?-1:i(le,Q,Y,Z,be);if(typeof Q=="number")return Q=Q&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?be?Uint8Array.prototype.indexOf.call(le,Q,Y):Uint8Array.prototype.lastIndexOf.call(le,Q,Y):i(le,[Q],Y,Z,be);throw new TypeError("val must be string, number or Buffer")}function i(le,Q,Y,Z,be){var ge=1,Re=le.length,Ze=Q.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(le.length<2||Q.length<2)return-1;ge=2,Re/=2,Ze/=2,Y/=2}function qe(je,De){return ge===1?je[De]:je.readUInt16BE(De*ge)}var et;if(be){var nt=-1;for(et=Y;etRe&&(Y=Re-Ze),et=Y;et>=0;et--){for(var ut=!0,ot=0;otbe&&(Z=be)):Z=be;var ge=Q.length;if(ge%2!==0)throw new TypeError("Invalid hex string");Z>ge/2&&(Z=ge/2);for(var Re=0;Rege)&&(Z=ge),Q.length>0&&(Z<0||Y<0)||Y>this.length)throw new RangeError("Attempt to write outside buffer bounds");be||(be="utf8");for(var Re=!1;;)switch(be){case"hex":return k(this,Q,Y,Z);case"utf8":case"utf-8":return O(this,Q,Y,Z);case"ascii":return b(this,Q,Y,Z);case"latin1":case"binary":return E(this,Q,Y,Z);case"base64":return x(this,Q,Y,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,Q,Y,Z);default:if(Re)throw new TypeError("Unknown encoding: "+be);be=(""+be).toLowerCase(),Re=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(le,Q,Y){return Q===0&&Y===le.length?_.fromByteArray(le):_.fromByteArray(le.slice(Q,Y))}function j(le,Q,Y){Y=Math.min(le.length,Y);for(var Z=[],be=Q;be239?4:ge>223?3:ge>191?2:1;if(be+Ze<=Y){var qe,et,nt,ut;switch(Ze){case 1:ge<128&&(Re=ge);break;case 2:qe=le[be+1],(qe&192)===128&&(ut=(ge&31)<<6|qe&63,ut>127&&(Re=ut));break;case 3:qe=le[be+1],et=le[be+2],(qe&192)===128&&(et&192)===128&&(ut=(ge&15)<<12|(qe&63)<<6|et&63,ut>2047&&(ut<55296||ut>57343)&&(Re=ut));break;case 4:qe=le[be+1],et=le[be+2],nt=le[be+3],(qe&192)===128&&(et&192)===128&&(nt&192)===128&&(ut=(ge&15)<<18|(qe&63)<<12|(et&63)<<6|nt&63,ut>65535&&ut<1114112&&(Re=ut))}}Re===null?(Re=65533,Ze=1):Re>65535&&(Re-=65536,Z.push(Re>>>10&1023|55296),Re=56320|Re&1023),Z.push(Re),be+=Ze}return V(Z)}var L=4096;function V(le){var Q=le.length;if(Q<=L)return String.fromCharCode.apply(String,le);for(var Y="",Z=0;ZZ)&&(Y=Z);for(var be="",ge=Q;geZ&&(Q=Z),Y<0?(Y+=Z,Y<0&&(Y=0)):Y>Z&&(Y=Z),YY)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(Q,Y,Z){Q=Q|0,Y=Y|0,Z||B(Q,Y,this.length);for(var be=this[Q],ge=1,Re=0;++Re0&&(ge*=256);)be+=this[Q+--Y]*ge;return be},u.prototype.readUInt8=function(Q,Y){return Y||B(Q,1,this.length),this[Q]},u.prototype.readUInt16LE=function(Q,Y){return Y||B(Q,2,this.length),this[Q]|this[Q+1]<<8},u.prototype.readUInt16BE=function(Q,Y){return Y||B(Q,2,this.length),this[Q]<<8|this[Q+1]},u.prototype.readUInt32LE=function(Q,Y){return Y||B(Q,4,this.length),(this[Q]|this[Q+1]<<8|this[Q+2]<<16)+this[Q+3]*16777216},u.prototype.readUInt32BE=function(Q,Y){return Y||B(Q,4,this.length),this[Q]*16777216+(this[Q+1]<<16|this[Q+2]<<8|this[Q+3])},u.prototype.readIntLE=function(Q,Y,Z){Q=Q|0,Y=Y|0,Z||B(Q,Y,this.length);for(var be=this[Q],ge=1,Re=0;++Re=ge&&(be-=Math.pow(2,8*Y)),be},u.prototype.readIntBE=function(Q,Y,Z){Q=Q|0,Y=Y|0,Z||B(Q,Y,this.length);for(var be=Y,ge=1,Re=this[Q+--be];be>0&&(ge*=256);)Re+=this[Q+--be]*ge;return ge*=128,Re>=ge&&(Re-=Math.pow(2,8*Y)),Re},u.prototype.readInt8=function(Q,Y){return Y||B(Q,1,this.length),this[Q]&128?(255-this[Q]+1)*-1:this[Q]},u.prototype.readInt16LE=function(Q,Y){Y||B(Q,2,this.length);var Z=this[Q]|this[Q+1]<<8;return Z&32768?Z|4294901760:Z},u.prototype.readInt16BE=function(Q,Y){Y||B(Q,2,this.length);var Z=this[Q+1]|this[Q]<<8;return Z&32768?Z|4294901760:Z},u.prototype.readInt32LE=function(Q,Y){return Y||B(Q,4,this.length),this[Q]|this[Q+1]<<8|this[Q+2]<<16|this[Q+3]<<24},u.prototype.readInt32BE=function(Q,Y){return Y||B(Q,4,this.length),this[Q]<<24|this[Q+1]<<16|this[Q+2]<<8|this[Q+3]},u.prototype.readFloatLE=function(Q,Y){return Y||B(Q,4,this.length),D.read(this,Q,!0,23,4)},u.prototype.readFloatBE=function(Q,Y){return Y||B(Q,4,this.length),D.read(this,Q,!1,23,4)},u.prototype.readDoubleLE=function(Q,Y){return Y||B(Q,8,this.length),D.read(this,Q,!0,52,8)},u.prototype.readDoubleBE=function(Q,Y){return Y||B(Q,8,this.length),D.read(this,Q,!1,52,8)};function H(le,Q,Y,Z,be,ge){if(!u.isBuffer(le))throw new TypeError('"buffer" argument must be a Buffer instance');if(Q>be||Qle.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(Q,Y,Z,be){if(Q=+Q,Y=Y|0,Z=Z|0,!be){var ge=Math.pow(2,8*Z)-1;H(this,Q,Y,Z,ge,0)}var Re=1,Ze=0;for(this[Y]=Q&255;++Ze=0&&(Ze*=256);)this[Y+Re]=Q/Ze&255;return Y+Z},u.prototype.writeUInt8=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||H(this,Q,Y,1,255,0),u.TYPED_ARRAY_SUPPORT||(Q=Math.floor(Q)),this[Y]=Q&255,Y+1};function q(le,Q,Y,Z){Q<0&&(Q=65535+Q+1);for(var be=0,ge=Math.min(le.length-Y,2);be>>(Z?be:1-be)*8}u.prototype.writeUInt16LE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||H(this,Q,Y,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q&255,this[Y+1]=Q>>>8):q(this,Q,Y,!0),Y+2},u.prototype.writeUInt16BE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||H(this,Q,Y,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q>>>8,this[Y+1]=Q&255):q(this,Q,Y,!1),Y+2};function re(le,Q,Y,Z){Q<0&&(Q=4294967295+Q+1);for(var be=0,ge=Math.min(le.length-Y,4);be>>(Z?be:3-be)*8&255}u.prototype.writeUInt32LE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||H(this,Q,Y,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[Y+3]=Q>>>24,this[Y+2]=Q>>>16,this[Y+1]=Q>>>8,this[Y]=Q&255):re(this,Q,Y,!0),Y+4},u.prototype.writeUInt32BE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||H(this,Q,Y,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q>>>24,this[Y+1]=Q>>>16,this[Y+2]=Q>>>8,this[Y+3]=Q&255):re(this,Q,Y,!1),Y+4},u.prototype.writeIntLE=function(Q,Y,Z,be){if(Q=+Q,Y=Y|0,!be){var ge=Math.pow(2,8*Z-1);H(this,Q,Y,Z,ge-1,-ge)}var Re=0,Ze=1,qe=0;for(this[Y]=Q&255;++Re>0)-qe&255;return Y+Z},u.prototype.writeIntBE=function(Q,Y,Z,be){if(Q=+Q,Y=Y|0,!be){var ge=Math.pow(2,8*Z-1);H(this,Q,Y,Z,ge-1,-ge)}var Re=Z-1,Ze=1,qe=0;for(this[Y+Re]=Q&255;--Re>=0&&(Ze*=256);)Q<0&&qe===0&&this[Y+Re+1]!==0&&(qe=1),this[Y+Re]=(Q/Ze>>0)-qe&255;return Y+Z},u.prototype.writeInt8=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||H(this,Q,Y,1,127,-128),u.TYPED_ARRAY_SUPPORT||(Q=Math.floor(Q)),Q<0&&(Q=255+Q+1),this[Y]=Q&255,Y+1},u.prototype.writeInt16LE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||H(this,Q,Y,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q&255,this[Y+1]=Q>>>8):q(this,Q,Y,!0),Y+2},u.prototype.writeInt16BE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||H(this,Q,Y,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q>>>8,this[Y+1]=Q&255):q(this,Q,Y,!1),Y+2},u.prototype.writeInt32LE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||H(this,Q,Y,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q&255,this[Y+1]=Q>>>8,this[Y+2]=Q>>>16,this[Y+3]=Q>>>24):re(this,Q,Y,!0),Y+4},u.prototype.writeInt32BE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||H(this,Q,Y,4,2147483647,-2147483648),Q<0&&(Q=4294967295+Q+1),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q>>>24,this[Y+1]=Q>>>16,this[Y+2]=Q>>>8,this[Y+3]=Q&255):re(this,Q,Y,!1),Y+4};function ee(le,Q,Y,Z,be,ge){if(Y+Z>le.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("Index out of range")}function Ce(le,Q,Y,Z,be){return be||ee(le,Q,Y,4,34028234663852886e22,-34028234663852886e22),D.write(le,Q,Y,Z,23,4),Y+4}u.prototype.writeFloatLE=function(Q,Y,Z){return Ce(this,Q,Y,!0,Z)},u.prototype.writeFloatBE=function(Q,Y,Z){return Ce(this,Q,Y,!1,Z)};function Ee(le,Q,Y,Z,be){return be||ee(le,Q,Y,8,17976931348623157e292,-17976931348623157e292),D.write(le,Q,Y,Z,52,8),Y+8}u.prototype.writeDoubleLE=function(Q,Y,Z){return Ee(this,Q,Y,!0,Z)},u.prototype.writeDoubleBE=function(Q,Y,Z){return Ee(this,Q,Y,!1,Z)},u.prototype.copy=function(Q,Y,Z,be){if(Z||(Z=0),!be&&be!==0&&(be=this.length),Y>=Q.length&&(Y=Q.length),Y||(Y=0),be>0&&be=this.length)throw new RangeError("sourceStart out of bounds");if(be<0)throw new RangeError("sourceEnd out of bounds");be>this.length&&(be=this.length),Q.length-Y=0;--Re)Q[Re+Y]=this[Re+Z];else if(ge<1e3||!u.TYPED_ARRAY_SUPPORT)for(Re=0;Re>>0,Z=Z===void 0?this.length:Z>>>0,Q||(Q=0);var Re;if(typeof Q=="number")for(Re=Y;Re55295&&Y<57344){if(!be){if(Y>56319){(Q-=3)>-1&&ge.push(239,191,189);continue}else if(Re+1===Z){(Q-=3)>-1&&ge.push(239,191,189);continue}be=Y;continue}if(Y<56320){(Q-=3)>-1&&ge.push(239,191,189),be=Y;continue}Y=(be-55296<<10|Y-56320)+65536}else be&&((Q-=3)>-1&&ge.push(239,191,189));if(be=null,Y<128){if((Q-=1)<0)break;ge.push(Y)}else if(Y<2048){if((Q-=2)<0)break;ge.push(Y>>6|192,Y&63|128)}else if(Y<65536){if((Q-=3)<0)break;ge.push(Y>>12|224,Y>>6&63|128,Y&63|128)}else if(Y<1114112){if((Q-=4)<0)break;ge.push(Y>>18|240,Y>>12&63|128,Y>>6&63|128,Y&63|128)}else throw new Error("Invalid code point")}return ge}function oe(le){for(var Q=[],Y=0;Y>8,be=Y%256,ge.push(be),ge.push(Z);return ge}function te(le){return _.toByteArray(Me(le))}function ue(le,Q,Y,Z){for(var be=0;be=Q.length||be>=le.length);++be)Q[be+Y]=le[be];return be}function Oe(le){return le!==le}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},I("buffer").Buffer)},{"base64-js":69,buffer:73,ieee754:195,isarray:198}],74:[function(I,J,P){J.exports={"100":"Continue","101":"Switching Protocols","102":"Processing","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Unordered Collection","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}},{}],75:[function(I,J,P){J.exports={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:512,O_EXCL:2048,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_DIRECTORY:1048576,O_NOFOLLOW:256,O_SYNC:128,O_SYMLINK:2097152,O_NONBLOCK:4,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,E2BIG:7,EACCES:13,EADDRINUSE:48,EADDRNOTAVAIL:49,EAFNOSUPPORT:47,EAGAIN:35,EALREADY:37,EBADF:9,EBADMSG:94,EBUSY:16,ECANCELED:89,ECHILD:10,ECONNABORTED:53,ECONNREFUSED:61,ECONNRESET:54,EDEADLK:11,EDESTADDRREQ:39,EDOM:33,EDQUOT:69,EEXIST:17,EFAULT:14,EFBIG:27,EHOSTUNREACH:65,EIDRM:90,EILSEQ:92,EINPROGRESS:36,EINTR:4,EINVAL:22,EIO:5,EISCONN:56,EISDIR:21,ELOOP:62,EMFILE:24,EMLINK:31,EMSGSIZE:40,EMULTIHOP:95,ENAMETOOLONG:63,ENETDOWN:50,ENETRESET:52,ENETUNREACH:51,ENFILE:23,ENOBUFS:55,ENODATA:96,ENODEV:19,ENOENT:2,ENOEXEC:8,ENOLCK:77,ENOLINK:97,ENOMEM:12,ENOMSG:91,ENOPROTOOPT:42,ENOSPC:28,ENOSR:98,ENOSTR:99,ENOSYS:78,ENOTCONN:57,ENOTDIR:20,ENOTEMPTY:66,ENOTSOCK:38,ENOTSUP:45,ENOTTY:25,ENXIO:6,EOPNOTSUPP:102,EOVERFLOW:84,EPERM:1,EPIPE:32,EPROTO:100,EPROTONOSUPPORT:43,EPROTOTYPE:41,ERANGE:34,EROFS:30,ESPIPE:29,ESRCH:3,ESTALE:70,ETIME:101,ETIMEDOUT:60,ETXTBSY:26,EWOULDBLOCK:35,EXDEV:18,SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGBUS:10,SIGFPE:8,SIGKILL:9,SIGUSR1:30,SIGSEGV:11,SIGUSR2:31,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGCHLD:20,SIGCONT:19,SIGSTOP:17,SIGTSTP:18,SIGTTIN:21,SIGTTOU:22,SIGURG:16,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:23,SIGSYS:12,SSL_OP_ALL:2147486719,SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION:262144,SSL_OP_CIPHER_SERVER_PREFERENCE:4194304,SSL_OP_CISCO_ANYCONNECT:32768,SSL_OP_COOKIE_EXCHANGE:8192,SSL_OP_CRYPTOPRO_TLSEXT_BUG:2147483648,SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS:2048,SSL_OP_EPHEMERAL_RSA:0,SSL_OP_LEGACY_SERVER_CONNECT:4,SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER:32,SSL_OP_MICROSOFT_SESS_ID_BUG:1,SSL_OP_MSIE_SSLV2_RSA_PADDING:0,SSL_OP_NETSCAPE_CA_DN_BUG:536870912,SSL_OP_NETSCAPE_CHALLENGE_BUG:2,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG:1073741824,SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG:8,SSL_OP_NO_COMPRESSION:131072,SSL_OP_NO_QUERY_MTU:4096,SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION:65536,SSL_OP_NO_SSLv2:16777216,SSL_OP_NO_SSLv3:33554432,SSL_OP_NO_TICKET:16384,SSL_OP_NO_TLSv1:67108864,SSL_OP_NO_TLSv1_1:268435456,SSL_OP_NO_TLSv1_2:134217728,SSL_OP_PKCS1_CHECK_1:0,SSL_OP_PKCS1_CHECK_2:0,SSL_OP_SINGLE_DH_USE:1048576,SSL_OP_SINGLE_ECDH_USE:524288,SSL_OP_SSLEAY_080_CLIENT_DH_BUG:128,SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG:0,SSL_OP_TLS_BLOCK_PADDING_BUG:512,SSL_OP_TLS_D5_BUG:256,SSL_OP_TLS_ROLLBACK_BUG:8388608,ENGINE_METHOD_DSA:2,ENGINE_METHOD_DH:4,ENGINE_METHOD_RAND:8,ENGINE_METHOD_ECDH:16,ENGINE_METHOD_ECDSA:32,ENGINE_METHOD_CIPHERS:64,ENGINE_METHOD_DIGESTS:128,ENGINE_METHOD_STORE:256,ENGINE_METHOD_PKEY_METHS:512,ENGINE_METHOD_PKEY_ASN1_METHS:1024,ENGINE_METHOD_ALL:65535,ENGINE_METHOD_NONE:0,DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_UDP_REUSEADDR:4}},{}],76:[function(I,J,P){/*! * copy-to - index.js * Copyright(c) 2014 dead_horse * MIT Licensed */"use strict";var M=Array.prototype.slice;J.exports=u;function u(D,f){if(!(this instanceof u))return new u(D,f);this.src=D,this._withAccess=f}u.prototype.withAccess=function(D){return this._withAccess=D!==!1,this},u.prototype.pick=function(D){return Array.isArray(D)||(D=M.call(arguments)),D.length&&(this.keys=D),this},u.prototype.to=function(D){if(D=D||{},!this.src)return D;var f=this.keys||Object.keys(this.src);if(!this._withAccess){for(var l=0;la;)if(r=v[a++],r!=r)return!0}else for(;o>a;a++)if((D||a in v)&&v[a]===l)return D||a||0;return!D&&-1}}},{"./_to-absolute-index":156,"./_to-iobject":158,"./_to-length":159}],97:[function(I,J,P){var M=I("./_cof"),u=I("./_wks")("toStringTag"),_=M(function(){return arguments}())=="Arguments",D=function(f,l){try{return f[l]}catch(C){}};J.exports=function(f){var l,C,v;return f===void 0?"Undefined":f===null?"Null":typeof(C=D(l=Object(f),u))=="string"?C:_?M(l):(v=M(l))=="Object"&&typeof l.callee=="function"?"Arguments":v}},{"./_cof":98,"./_wks":166}],98:[function(I,J,P){var M={}.toString;J.exports=function(u){return M.call(u).slice(8,-1)}},{}],99:[function(I,J,P){var M=J.exports={version:"2.6.11"};typeof __e=="number"&&(__e=M)},{}],100:[function(I,J,P){"use strict";var M=I("./_object-dp"),u=I("./_property-desc");J.exports=function(_,D,f){D in _?M.f(_,D,u(0,f)):_[D]=f}},{"./_object-dp":132,"./_property-desc":146}],101:[function(I,J,P){var M=I("./_a-function");J.exports=function(u,_,D){if(M(u),_===void 0)return u;switch(D){case 1:return function(f){return u.call(_,f)};case 2:return function(f,l){return u.call(_,f,l)};case 3:return function(f,l,C){return u.call(_,f,l,C)}}return function(){return u.apply(_,arguments)}}},{"./_a-function":92}],102:[function(I,J,P){J.exports=function(M){if(M==null)throw TypeError("Can't call method on "+M);return M}},{}],103:[function(I,J,P){J.exports=!I("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":108}],104:[function(I,J,P){var M=I("./_is-object"),u=I("./_global").document,_=M(u)&&M(u.createElement);J.exports=function(D){return _?u.createElement(D):{}}},{"./_global":110,"./_is-object":119}],105:[function(I,J,P){J.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],106:[function(I,J,P){var M=I("./_object-keys"),u=I("./_object-gops"),_=I("./_object-pie");J.exports=function(D){var f=M(D),l=u.f;if(l)for(var C=l(D),v=_.f,o=0,a;C.length>o;)v.call(D,a=C[o++])&&f.push(a);return f}},{"./_object-gops":137,"./_object-keys":140,"./_object-pie":141}],107:[function(I,J,P){var M=I("./_global"),u=I("./_core"),_=I("./_ctx"),D=I("./_hide"),f=I("./_has"),l="prototype",C=function(v,o,a){var r=v&C.F,h=v&C.G,m=v&C.S,p=v&C.P,w=v&C.B,g=v&C.W,c=h?u:u[o]||(u[o]={}),n=c[l],s=h?M:m?M[o]:(M[o]||{})[l],d,S,y;h&&(a=o);for(d in a){if(S=!r&&s&&s[d]!==void 0,S&&f(c,d))continue;y=S?s[d]:a[d],c[d]=h&&typeof s[d]!="function"?a[d]:w&&S?_(y,M):g&&s[d]==y?function(i){var k=function(O,b,E){if(this instanceof i){switch(arguments.length){case 0:return new i;case 1:return new i(O);case 2:return new i(O,b)}return new i(O,b,E)}return i.apply(this,arguments)};return k[l]=i[l],k}(y):p&&typeof y=="function"?_(Function.call,y):y,p&&((c.virtual||(c.virtual={}))[d]=y,v&C.R&&n&&!n[d]&&D(n,d,y))}};C.F=1,C.G=2,C.S=4,C.P=8,C.B=16,C.W=32,C.U=64,C.R=128,J.exports=C},{"./_core":99,"./_ctx":101,"./_global":110,"./_has":111,"./_hide":112}],108:[function(I,J,P){J.exports=function(M){try{return!!M()}catch(u){return!0}}},{}],109:[function(I,J,P){var M=I("./_ctx"),u=I("./_iter-call"),_=I("./_is-array-iter"),D=I("./_an-object"),f=I("./_to-length"),l=I("./core.get-iterator-method"),C={},v={},P=J.exports=function(o,a,r,h,m){var p=m?function(){return o}:l(o),w=M(r,h,a?2:1),g=0,c,n,s,d;if(typeof p!="function")throw TypeError(o+" is not iterable!");if(_(p)){for(c=f(o.length);c>g;g++)if(d=a?w(D(n=o[g])[0],n[1]):w(o[g]),d===C||d===v)return d}else for(s=p.call(o);!(n=s.next()).done;)if(d=u(s,w,n.value,a),d===C||d===v)return d};P.BREAK=C,P.RETURN=v},{"./_an-object":95,"./_ctx":101,"./_is-array-iter":117,"./_iter-call":120,"./_to-length":159,"./core.get-iterator-method":167}],110:[function(I,J,P){var M=J.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=M)},{}],111:[function(I,J,P){var M={}.hasOwnProperty;J.exports=function(u,_){return M.call(u,_)}},{}],112:[function(I,J,P){var M=I("./_object-dp"),u=I("./_property-desc");J.exports=I("./_descriptors")?function(_,D,f){return M.f(_,D,u(1,f))}:function(_,D,f){return _[D]=f,_}},{"./_descriptors":103,"./_object-dp":132,"./_property-desc":146}],113:[function(I,J,P){var M=I("./_global").document;J.exports=M&&M.documentElement},{"./_global":110}],114:[function(I,J,P){J.exports=!I("./_descriptors")&&!I("./_fails")(function(){return Object.defineProperty(I("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":103,"./_dom-create":104,"./_fails":108}],115:[function(I,J,P){J.exports=function(M,u,_){var D=_===void 0;switch(u.length){case 0:return D?M():M.call(_);case 1:return D?M(u[0]):M.call(_,u[0]);case 2:return D?M(u[0],u[1]):M.call(_,u[0],u[1]);case 3:return D?M(u[0],u[1],u[2]):M.call(_,u[0],u[1],u[2]);case 4:return D?M(u[0],u[1],u[2],u[3]):M.call(_,u[0],u[1],u[2],u[3])}return M.apply(_,u)}},{}],116:[function(I,J,P){var M=I("./_cof");J.exports=Object("z").propertyIsEnumerable(0)?Object:function(u){return M(u)=="String"?u.split(""):Object(u)}},{"./_cof":98}],117:[function(I,J,P){var M=I("./_iterators"),u=I("./_wks")("iterator"),_=Array.prototype;J.exports=function(D){return D!==void 0&&(M.Array===D||_[u]===D)}},{"./_iterators":125,"./_wks":166}],118:[function(I,J,P){var M=I("./_cof");J.exports=Array.isArray||function(_){return M(_)=="Array"}},{"./_cof":98}],119:[function(I,J,P){J.exports=function(M){return typeof M=="object"?M!==null:typeof M=="function"}},{}],120:[function(I,J,P){var M=I("./_an-object");J.exports=function(u,_,D,f){try{return f?_(M(D)[0],D[1]):_(D)}catch(C){var l=u.return;throw l!==void 0&&M(l.call(u)),C}}},{"./_an-object":95}],121:[function(I,J,P){"use strict";var M=I("./_object-create"),u=I("./_property-desc"),_=I("./_set-to-string-tag"),D={};I("./_hide")(D,I("./_wks")("iterator"),function(){return this}),J.exports=function(f,l,C){f.prototype=M(D,{next:u(1,C)}),_(f,l+" Iterator")}},{"./_hide":112,"./_object-create":131,"./_property-desc":146,"./_set-to-string-tag":150,"./_wks":166}],122:[function(I,J,P){"use strict";var M=I("./_library"),u=I("./_export"),_=I("./_redefine"),D=I("./_hide"),f=I("./_iterators"),l=I("./_iter-create"),C=I("./_set-to-string-tag"),v=I("./_object-gpo"),o=I("./_wks")("iterator"),a=!([].keys&&"next"in[].keys()),r="@@iterator",h="keys",m="values",p=function(){return this};J.exports=function(w,g,c,n,s,d,S){l(c,g,n);var y=function(K){if(!a&&K in b)return b[K];switch(K){case h:return function(){return new c(this,K)};case m:return function(){return new c(this,K)}}return function(){return new c(this,K)}},i=g+" Iterator",k=s==m,O=!1,b=w.prototype,E=b[o]||b[r]||s&&b[s],x=E||y(s),T=s?k?y("entries"):x:void 0,N=g=="Array"&&b.entries||E,j,L,V;if(N&&(V=v(N.call(new w)),V!==Object.prototype&&V.next&&(C(V,i,!0),!M&&typeof V[o]!="function"&&D(V,o,p))),k&&E&&E.name!==m&&(O=!0,x=function(){return E.call(this)}),(!M||S)&&(a||O||!b[o])&&D(b,o,x),f[g]=x,f[i]=p,s)if(j={values:k?x:y(m),keys:d?x:y(h),entries:T},S)for(L in j)L in b||_(b,L,j[L]);else u(u.P+u.F*(a||O),g,j);return j}},{"./_export":107,"./_hide":112,"./_iter-create":121,"./_iterators":125,"./_library":126,"./_object-gpo":138,"./_redefine":148,"./_set-to-string-tag":150,"./_wks":166}],123:[function(I,J,P){var M=I("./_wks")("iterator"),u=!1;try{var _=[7][M]();_.return=function(){u=!0},Array.from(_,function(){throw 2})}catch(D){}J.exports=function(D,f){if(!f&&!u)return!1;var l=!1;try{var C=[7],v=C[M]();v.next=function(){return{done:l=!0}},C[M]=function(){return v},D(C)}catch(o){}return l}},{"./_wks":166}],124:[function(I,J,P){J.exports=function(M,u){return{value:u,done:!!M}}},{}],125:[function(I,J,P){J.exports={}},{}],126:[function(I,J,P){J.exports=!0},{}],127:[function(I,J,P){var M=I("./_uid")("meta"),u=I("./_is-object"),_=I("./_has"),D=I("./_object-dp").f,f=0,l=Object.isExtensible||function(){return!0},C=!I("./_fails")(function(){return l(Object.preventExtensions({}))}),v=function(m){D(m,M,{value:{i:"O"+ ++f,w:{}}})},o=function(m,p){if(!u(m))return typeof m=="symbol"?m:(typeof m=="string"?"S":"P")+m;if(!_(m,M)){if(!l(m))return"F";if(!p)return"E";v(m)}return m[M].i},a=function(m,p){if(!_(m,M)){if(!l(m))return!0;if(!p)return!1;v(m)}return m[M].w},r=function(m){return C&&h.NEED&&l(m)&&!_(m,M)&&v(m),m},h=J.exports={KEY:M,NEED:!1,fastKey:o,getWeak:a,onFreeze:r}},{"./_fails":108,"./_has":111,"./_is-object":119,"./_object-dp":132,"./_uid":162}],128:[function(I,J,P){var M=I("./_global"),u=I("./_task").set,_=M.MutationObserver||M.WebKitMutationObserver,D=M.process,f=M.Promise,l=I("./_cof")(D)=="process";J.exports=function(){var C,v,o,a=function(){var p,w;for(l&&(p=D.domain)&&p.exit();C;){w=C.fn,C=C.next;try{w()}catch(g){throw C?o():v=void 0,g}}v=void 0,p&&p.enter()};if(l)o=function(){D.nextTick(a)};else if(_&&!(M.navigator&&M.navigator.standalone)){var r=!0,h=document.createTextNode("");new _(a).observe(h,{characterData:!0}),o=function(){h.data=r=!r}}else if(f&&f.resolve){var m=f.resolve(void 0);o=function(){m.then(a)}}else o=function(){u.call(M,a)};return function(p){var w={fn:p,next:void 0};v&&(v.next=w),C||(C=w,o()),v=w}}},{"./_cof":98,"./_global":110,"./_task":155}],129:[function(I,J,P){"use strict";var M=I("./_a-function");function u(_){var D,f;this.promise=new _(function(l,C){if(D!==void 0||f!==void 0)throw TypeError("Bad Promise constructor");D=l,f=C}),this.resolve=M(D),this.reject=M(f)}J.exports.f=function(_){return new u(_)}},{"./_a-function":92}],130:[function(I,J,P){"use strict";var M=I("./_descriptors"),u=I("./_object-keys"),_=I("./_object-gops"),D=I("./_object-pie"),f=I("./_to-object"),l=I("./_iobject"),C=Object.assign;J.exports=!C||I("./_fails")(function(){var v={},o={},a=Symbol(),r="abcdefghijklmnopqrst";return v[a]=7,r.split("").forEach(function(h){o[h]=h}),C({},v)[a]!=7||Object.keys(C({},o)).join("")!=r})?function(o,a){for(var r=f(o),h=arguments.length,m=1,p=_.f,w=D.f;h>m;)for(var g=l(arguments[m++]),c=p?u(g).concat(p(g)):u(g),n=c.length,s=0,d;n>s;)d=c[s++],(!M||w.call(g,d))&&(r[d]=g[d]);return r}:C},{"./_descriptors":103,"./_fails":108,"./_iobject":116,"./_object-gops":137,"./_object-keys":140,"./_object-pie":141,"./_to-object":160}],131:[function(I,J,P){var M=I("./_an-object"),u=I("./_object-dps"),_=I("./_enum-bug-keys"),D=I("./_shared-key")("IE_PROTO"),f=function(){},l="prototype",C=function(){var v=I("./_dom-create")("iframe"),o=_.length,a="<",r=">",h;for(v.style.display="none",I("./_html").appendChild(v),v.src="javascript:",h=v.contentWindow.document,h.open(),h.write(a+"script"+r+"document.F=Object"+a+"/script"+r),h.close(),C=h.F;o--;)delete C[l][_[o]];return C()};J.exports=Object.create||function(o,a){var r;return o!==null?(f[l]=M(o),r=new f,f[l]=null,r[D]=o):r=C(),a===void 0?r:u(r,a)}},{"./_an-object":95,"./_dom-create":104,"./_enum-bug-keys":105,"./_html":113,"./_object-dps":133,"./_shared-key":151}],132:[function(I,J,P){var M=I("./_an-object"),u=I("./_ie8-dom-define"),_=I("./_to-primitive"),D=Object.defineProperty;P.f=I("./_descriptors")?Object.defineProperty:function(l,C,v){if(M(l),C=_(C,!0),M(v),u)try{return D(l,C,v)}catch(o){}if("get"in v||"set"in v)throw TypeError("Accessors not supported!");return"value"in v&&(l[C]=v.value),l}},{"./_an-object":95,"./_descriptors":103,"./_ie8-dom-define":114,"./_to-primitive":161}],133:[function(I,J,P){var M=I("./_object-dp"),u=I("./_an-object"),_=I("./_object-keys");J.exports=I("./_descriptors")?Object.defineProperties:function(f,l){u(f);for(var C=_(l),v=C.length,o=0,a;v>o;)M.f(f,a=C[o++],l[a]);return f}},{"./_an-object":95,"./_descriptors":103,"./_object-dp":132,"./_object-keys":140}],134:[function(I,J,P){var M=I("./_object-pie"),u=I("./_property-desc"),_=I("./_to-iobject"),D=I("./_to-primitive"),f=I("./_has"),l=I("./_ie8-dom-define"),C=Object.getOwnPropertyDescriptor;P.f=I("./_descriptors")?C:function(o,a){if(o=_(o),a=D(a,!0),l)try{return C(o,a)}catch(r){}if(f(o,a))return u(!M.f.call(o,a),o[a])}},{"./_descriptors":103,"./_has":111,"./_ie8-dom-define":114,"./_object-pie":141,"./_property-desc":146,"./_to-iobject":158,"./_to-primitive":161}],135:[function(I,J,P){var M=I("./_to-iobject"),u=I("./_object-gopn").f,_={}.toString,D=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],f=function(l){try{return u(l)}catch(C){return D.slice()}};J.exports.f=function(C){return D&&_.call(C)=="[object Window]"?f(C):u(M(C))}},{"./_object-gopn":136,"./_to-iobject":158}],136:[function(I,J,P){var M=I("./_object-keys-internal"),u=I("./_enum-bug-keys").concat("length","prototype");P.f=Object.getOwnPropertyNames||function(D){return M(D,u)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],137:[function(I,J,P){P.f=Object.getOwnPropertySymbols},{}],138:[function(I,J,P){var M=I("./_has"),u=I("./_to-object"),_=I("./_shared-key")("IE_PROTO"),D=Object.prototype;J.exports=Object.getPrototypeOf||function(f){return f=u(f),M(f,_)?f[_]:typeof f.constructor=="function"&&f instanceof f.constructor?f.constructor.prototype:f instanceof Object?D:null}},{"./_has":111,"./_shared-key":151,"./_to-object":160}],139:[function(I,J,P){var M=I("./_has"),u=I("./_to-iobject"),_=I("./_array-includes")(!1),D=I("./_shared-key")("IE_PROTO");J.exports=function(f,l){var C=u(f),v=0,o=[],a;for(a in C)a!=D&&(M(C,a)&&o.push(a));for(;l.length>v;)M(C,a=l[v++])&&(~_(o,a)||o.push(a));return o}},{"./_array-includes":96,"./_has":111,"./_shared-key":151,"./_to-iobject":158}],140:[function(I,J,P){var M=I("./_object-keys-internal"),u=I("./_enum-bug-keys");J.exports=Object.keys||function(D){return M(D,u)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],141:[function(I,J,P){P.f={}.propertyIsEnumerable},{}],142:[function(I,J,P){var M=I("./_export"),u=I("./_core"),_=I("./_fails");J.exports=function(D,f){var l=(u.Object||{})[D]||Object[D],C={};C[D]=f(l),M(M.S+M.F*_(function(){l(1)}),"Object",C)}},{"./_core":99,"./_export":107,"./_fails":108}],143:[function(I,J,P){var M=I("./_descriptors"),u=I("./_object-keys"),_=I("./_to-iobject"),D=I("./_object-pie").f;J.exports=function(f){return function(l){for(var C=_(l),v=u(C),o=v.length,a=0,r=[],h;o>a;)h=v[a++],(!M||D.call(C,h))&&r.push(f?[h,C[h]]:C[h]);return r}}},{"./_descriptors":103,"./_object-keys":140,"./_object-pie":141,"./_to-iobject":158}],144:[function(I,J,P){J.exports=function(M){try{return{e:!1,v:M()}}catch(u){return{e:!0,v:u}}}},{}],145:[function(I,J,P){var M=I("./_an-object"),u=I("./_is-object"),_=I("./_new-promise-capability");J.exports=function(D,f){if(M(D),u(f)&&f.constructor===D)return f;var l=_.f(D),C=l.resolve;return C(f),l.promise}},{"./_an-object":95,"./_is-object":119,"./_new-promise-capability":129}],146:[function(I,J,P){J.exports=function(M,u){return{enumerable:!(M&1),configurable:!(M&2),writable:!(M&4),value:u}}},{}],147:[function(I,J,P){var M=I("./_hide");J.exports=function(u,_,D){for(var f in _)D&&u[f]?u[f]=_[f]:M(u,f,_[f]);return u}},{"./_hide":112}],148:[function(I,J,P){J.exports=I("./_hide")},{"./_hide":112}],149:[function(I,J,P){"use strict";var M=I("./_global"),u=I("./_core"),_=I("./_object-dp"),D=I("./_descriptors"),f=I("./_wks")("species");J.exports=function(l){var C=typeof u[l]=="function"?u[l]:M[l];D&&C&&!C[f]&&_.f(C,f,{configurable:!0,get:function(){return this}})}},{"./_core":99,"./_descriptors":103,"./_global":110,"./_object-dp":132,"./_wks":166}],150:[function(I,J,P){var M=I("./_object-dp").f,u=I("./_has"),_=I("./_wks")("toStringTag");J.exports=function(D,f,l){D&&!u(D=l?D:D.prototype,_)&&M(D,_,{configurable:!0,value:f})}},{"./_has":111,"./_object-dp":132,"./_wks":166}],151:[function(I,J,P){var M=I("./_shared")("keys"),u=I("./_uid");J.exports=function(_){return M[_]||(M[_]=u(_))}},{"./_shared":152,"./_uid":162}],152:[function(I,J,P){var M=I("./_core"),u=I("./_global"),_="__core-js_shared__",D=u[_]||(u[_]={});(J.exports=function(f,l){return D[f]||(D[f]=l!==void 0?l:{})})("versions",[]).push({version:M.version,mode:I("./_library")?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})},{"./_core":99,"./_global":110,"./_library":126}],153:[function(I,J,P){var M=I("./_an-object"),u=I("./_a-function"),_=I("./_wks")("species");J.exports=function(D,f){var l=M(D).constructor,C;return l===void 0||(C=M(l)[_])==null?f:u(C)}},{"./_a-function":92,"./_an-object":95,"./_wks":166}],154:[function(I,J,P){var M=I("./_to-integer"),u=I("./_defined");J.exports=function(_){return function(D,f){var l=String(u(D)),C=M(f),v=l.length,o,a;return C<0||C>=v?_?"":void 0:(o=l.charCodeAt(C),o<55296||o>56319||C+1===v||(a=l.charCodeAt(C+1))<56320||a>57343?_?l.charAt(C):o:_?l.slice(C,C+2):(o-55296<<10)+(a-56320)+65536)}}},{"./_defined":102,"./_to-integer":157}],155:[function(I,J,P){var M=I("./_ctx"),u=I("./_invoke"),_=I("./_html"),D=I("./_dom-create"),f=I("./_global"),l=f.process,C=f.setImmediate,v=f.clearImmediate,o=f.MessageChannel,a=f.Dispatch,r=0,h={},m="onreadystatechange",p,w,g,c=function(){var s=+this;if(h.hasOwnProperty(s)){var d=h[s];delete h[s],d()}},n=function(s){c.call(s.data)};(!C||!v)&&(C=function(d){for(var S=[],y=1;arguments.length>y;)S.push(arguments[y++]);return h[++r]=function(){u(typeof d=="function"?d:Function(d),S)},p(r),r},v=function(d){delete h[d]},I("./_cof")(l)=="process"?p=function(s){l.nextTick(M(c,s,1))}:a&&a.now?p=function(s){a.now(M(c,s,1))}:o?(w=new o,g=w.port2,w.port1.onmessage=n,p=M(g.postMessage,g,1)):f.addEventListener&&typeof postMessage=="function"&&!f.importScripts?(p=function(s){f.postMessage(s+"","*")},f.addEventListener("message",n,!1)):m in D("script")?p=function(s){_.appendChild(D("script"))[m]=function(){_.removeChild(this),c.call(s)}}:p=function(s){setTimeout(M(c,s,1),0)}),J.exports={set:C,clear:v}},{"./_cof":98,"./_ctx":101,"./_dom-create":104,"./_global":110,"./_html":113,"./_invoke":115}],156:[function(I,J,P){var M=I("./_to-integer"),u=Math.max,_=Math.min;J.exports=function(D,f){return D=M(D),D<0?u(D+f,0):_(D,f)}},{"./_to-integer":157}],157:[function(I,J,P){var M=Math.ceil,u=Math.floor;J.exports=function(_){return isNaN(_=+_)?0:(_>0?u:M)(_)}},{}],158:[function(I,J,P){var M=I("./_iobject"),u=I("./_defined");J.exports=function(_){return M(u(_))}},{"./_defined":102,"./_iobject":116}],159:[function(I,J,P){var M=I("./_to-integer"),u=Math.min;J.exports=function(_){return _>0?u(M(_),9007199254740991):0}},{"./_to-integer":157}],160:[function(I,J,P){var M=I("./_defined");J.exports=function(u){return Object(M(u))}},{"./_defined":102}],161:[function(I,J,P){var M=I("./_is-object");J.exports=function(u,_){if(!M(u))return u;var D,f;if(_&&typeof(D=u.toString)=="function"&&!M(f=D.call(u)))return f;if(typeof(D=u.valueOf)=="function"&&!M(f=D.call(u)))return f;if(!_&&typeof(D=u.toString)=="function"&&!M(f=D.call(u)))return f;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":119}],162:[function(I,J,P){var M=0,u=Math.random();J.exports=function(_){return"Symbol(".concat(_===void 0?"":_,")_",(++M+u).toString(36))}},{}],163:[function(I,J,P){var M=I("./_global"),u=M.navigator;J.exports=u&&u.userAgent||""},{"./_global":110}],164:[function(I,J,P){var M=I("./_global"),u=I("./_core"),_=I("./_library"),D=I("./_wks-ext"),f=I("./_object-dp").f;J.exports=function(l){var C=u.Symbol||(u.Symbol=_?{}:M.Symbol||{});l.charAt(0)!="_"&&!(l in C)&&f(C,l,{value:D.f(l)})}},{"./_core":99,"./_global":110,"./_library":126,"./_object-dp":132,"./_wks-ext":165}],165:[function(I,J,P){P.f=I("./_wks")},{"./_wks":166}],166:[function(I,J,P){var M=I("./_shared")("wks"),u=I("./_uid"),_=I("./_global").Symbol,D=typeof _=="function",f=J.exports=function(l){return M[l]||(M[l]=D&&_[l]||(D?_:u)("Symbol."+l))};f.store=M},{"./_global":110,"./_shared":152,"./_uid":162}],167:[function(I,J,P){var M=I("./_classof"),u=I("./_wks")("iterator"),_=I("./_iterators");J.exports=I("./_core").getIteratorMethod=function(D){if(D!=null)return D[u]||D["@@iterator"]||_[M(D)]}},{"./_classof":97,"./_core":99,"./_iterators":125,"./_wks":166}],168:[function(I,J,P){"use strict";var M=I("./_ctx"),u=I("./_export"),_=I("./_to-object"),D=I("./_iter-call"),f=I("./_is-array-iter"),l=I("./_to-length"),C=I("./_create-property"),v=I("./core.get-iterator-method");u(u.S+u.F*!I("./_iter-detect")(function(o){Array.from(o)}),"Array",{from:function(a){var r=_(a),h=typeof this=="function"?this:Array,m=arguments.length,p=m>1?arguments[1]:void 0,w=p!==void 0,g=0,c=v(r),n,s,d,S;if(w&&(p=M(p,m>2?arguments[2]:void 0,2)),c!=null&&!(h==Array&&f(c)))for(S=c.call(r),s=new h;!(d=S.next()).done;g++)C(s,g,w?D(S,p,[d.value,g],!0):d.value);else for(n=l(r.length),s=new h(n);n>g;g++)C(s,g,w?p(r[g],g):r[g]);return s.length=g,s}})},{"./_create-property":100,"./_ctx":101,"./_export":107,"./_is-array-iter":117,"./_iter-call":120,"./_iter-detect":123,"./_to-length":159,"./_to-object":160,"./core.get-iterator-method":167}],169:[function(I,J,P){"use strict";var M=I("./_add-to-unscopables"),u=I("./_iter-step"),_=I("./_iterators"),D=I("./_to-iobject");J.exports=I("./_iter-define")(Array,"Array",function(f,l){this._t=D(f),this._i=0,this._k=l},function(){var f=this._t,l=this._k,C=this._i++;return!f||C>=f.length?(this._t=void 0,u(1)):l=="keys"?u(0,C):l=="values"?u(0,f[C]):u(0,[C,f[C]])},"values"),_.Arguments=_.Array,M("keys"),M("values"),M("entries")},{"./_add-to-unscopables":93,"./_iter-define":122,"./_iter-step":124,"./_iterators":125,"./_to-iobject":158}],170:[function(I,J,P){"use strict";var M=I("./_is-object"),u=I("./_object-gpo"),_=I("./_wks")("hasInstance"),D=Function.prototype;_ in D||I("./_object-dp").f(D,_,{value:function(f){if(typeof this!="function"||!M(f))return!1;if(!M(this.prototype))return f instanceof this;for(;f=u(f);)if(this.prototype===f)return!0;return!1}})},{"./_is-object":119,"./_object-dp":132,"./_object-gpo":138,"./_wks":166}],171:[function(I,J,P){var M=I("./_export");M(M.S+M.F,"Object",{assign:I("./_object-assign")})},{"./_export":107,"./_object-assign":130}],172:[function(I,J,P){var M=I("./_export");M(M.S,"Object",{create:I("./_object-create")})},{"./_export":107,"./_object-create":131}],173:[function(I,J,P){var M=I("./_export");M(M.S+M.F*!I("./_descriptors"),"Object",{defineProperty:I("./_object-dp").f})},{"./_descriptors":103,"./_export":107,"./_object-dp":132}],174:[function(I,J,P){I("./_object-sap")("getOwnPropertyNames",function(){return I("./_object-gopn-ext").f})},{"./_object-gopn-ext":135,"./_object-sap":142}],175:[function(I,J,P){var M=I("./_to-object"),u=I("./_object-gpo");I("./_object-sap")("getPrototypeOf",function(){return function(D){return u(M(D))}})},{"./_object-gpo":138,"./_object-sap":142,"./_to-object":160}],176:[function(I,J,P){var M=I("./_to-object"),u=I("./_object-keys");I("./_object-sap")("keys",function(){return function(D){return u(M(D))}})},{"./_object-keys":140,"./_object-sap":142,"./_to-object":160}],177:[function(I,J,P){arguments[4][71][0].apply(P,arguments)},{dup:71}],178:[function(I,J,P){"use strict";var M=I("./_library"),u=I("./_global"),_=I("./_ctx"),D=I("./_classof"),f=I("./_export"),l=I("./_is-object"),C=I("./_a-function"),v=I("./_an-instance"),o=I("./_for-of"),a=I("./_species-constructor"),r=I("./_task").set,h=I("./_microtask")(),m=I("./_new-promise-capability"),p=I("./_perform"),w=I("./_user-agent"),g=I("./_promise-resolve"),c="Promise",n=u.TypeError,s=u.process,d=s&&s.versions,S=d&&d.v8||"",y=u[c],i=D(s)=="process",k=function(){},O,b,E,x,T=b=m.f,N=!!function(){try{var B=y.resolve(1),H=(B.constructor={})[I("./_wks")("species")]=function(q){q(k,k)};return(i||typeof PromiseRejectionEvent=="function")&&B.then(k)instanceof H&&S.indexOf("6.6")!==0&&w.indexOf("Chrome/66")===-1}catch(q){}}(),j=function(B){var H;return l(B)&&typeof(H=B.then)=="function"?H:!1},L=function(B,H){if(B._n)return;B._n=!0;var q=B._c;h(function(){for(var re=B._v,ee=B._s==1,Ce=0,Ee=function(pe){var Me=ee?pe.ok:pe.fail,_e=pe.resolve,he=pe.reject,ce=pe.domain,oe,Se,te;try{Me?(ee||(B._h==2&&W(B),B._h=1),Me===!0?oe=re:(ce&&ce.enter(),oe=Me(re),ce&&(ce.exit(),te=!0)),oe===pe.promise?he(n("Promise-chain cycle")):(Se=j(oe))?Se.call(oe,_e,he):_e(oe)):he(re)}catch(ue){ce&&!te&&ce.exit(),he(ue)}};q.length>Ce;)Ee(q[Ce++]);B._c=[],B._n=!1,H&&!B._h&&V(B)})},V=function(B){r.call(u,function(){var H=B._v,q=K(B),re,ee,Ce;if(q&&(re=p(function(){i?s.emit("unhandledRejection",H,B):(ee=u.onunhandledrejection)?ee({promise:B,reason:H}):(Ce=u.console)&&Ce.error&&Ce.error("Unhandled promise rejection",H)}),B._h=i||K(B)?2:1),B._a=void 0,q&&re.e)throw re.v})},K=function(B){return B._h!==1&&(B._a||B._c).length===0},W=function(B){r.call(u,function(){var H;i?s.emit("rejectionHandled",B):(H=u.onrejectionhandled)&&H({promise:B,reason:B._v})})},G=function(B){var H=this;if(H._d)return;H._d=!0,H=H._w||H,H._v=B,H._s=2,H._a||(H._a=H._c.slice()),L(H,!0)},F=function(B){var H=this,q;if(H._d)return;H._d=!0,H=H._w||H;try{if(H===B)throw n("Promise can't be resolved itself");(q=j(B))?h(function(){var re={_w:H,_d:!1};try{q.call(B,_(F,re,1),_(G,re,1))}catch(ee){G.call(re,ee)}}):(H._v=B,H._s=1,L(H,!1))}catch(re){G.call({_w:H,_d:!1},re)}};N||(y=function(H){v(this,y,c,"_h"),C(H),O.call(this);try{H(_(F,this,1),_(G,this,1))}catch(q){G.call(this,q)}},O=function(H){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},O.prototype=I("./_redefine-all")(y.prototype,{then:function(H,q){var re=T(a(this,y));return re.ok=typeof H=="function"?H:!0,re.fail=typeof q=="function"&&q,re.domain=i?s.domain:void 0,this._c.push(re),this._a&&this._a.push(re),this._s&&L(this,!1),re.promise},catch:function(B){return this.then(void 0,B)}}),E=function(){var B=new O;this.promise=B,this.resolve=_(F,B,1),this.reject=_(G,B,1)},m.f=T=function(B){return B===y||B===x?new E(B):b(B)}),f(f.G+f.W+f.F*!N,{Promise:y}),I("./_set-to-string-tag")(y,c),I("./_set-species")(c),x=I("./_core")[c],f(f.S+f.F*!N,c,{reject:function(H){var q=T(this),re=q.reject;return re(H),q.promise}}),f(f.S+f.F*(M||!N),c,{resolve:function(H){return g(M&&this===x?y:this,H)}}),f(f.S+f.F*!(N&&I("./_iter-detect")(function(B){y.all(B).catch(k)})),c,{all:function(H){var q=this,re=T(q),ee=re.resolve,Ce=re.reject,Ee=p(function(){var pe=[],Me=0,_e=1;o(H,!1,function(he){var ce=Me++,oe=!1;pe.push(void 0),_e++,q.resolve(he).then(function(Se){if(oe)return;oe=!0,pe[ce]=Se,--_e||ee(pe)},Ce)}),--_e||ee(pe)});return Ee.e&&Ce(Ee.v),re.promise},race:function(H){var q=this,re=T(q),ee=re.reject,Ce=p(function(){o(H,!1,function(Ee){q.resolve(Ee).then(re.resolve,ee)})});return Ce.e&&ee(Ce.v),re.promise}})},{"./_a-function":92,"./_an-instance":94,"./_classof":97,"./_core":99,"./_ctx":101,"./_export":107,"./_for-of":109,"./_global":110,"./_is-object":119,"./_iter-detect":123,"./_library":126,"./_microtask":128,"./_new-promise-capability":129,"./_perform":144,"./_promise-resolve":145,"./_redefine-all":147,"./_set-species":149,"./_set-to-string-tag":150,"./_species-constructor":153,"./_task":155,"./_user-agent":163,"./_wks":166}],179:[function(I,J,P){var M=I("./_export"),u=I("./_to-absolute-index"),_=String.fromCharCode,D=String.fromCodePoint;M(M.S+M.F*(!!D&&D.length!=1),"String",{fromCodePoint:function(l){for(var C=[],v=arguments.length,o=0,a;v>o;){if(a=+arguments[o++],u(a,1114111)!==a)throw RangeError(a+" is not a valid code point");C.push(a<65536?_(a):_(((a-=65536)>>10)+55296,a%1024+56320))}return C.join("")}})},{"./_export":107,"./_to-absolute-index":156}],180:[function(I,J,P){"use strict";var M=I("./_string-at")(!0);I("./_iter-define")(String,"String",function(u){this._t=String(u),this._i=0},function(){var u=this._t,_=this._i,D;return _>=u.length?{value:void 0,done:!0}:(D=M(u,_),this._i+=D.length,{value:D,done:!1})})},{"./_iter-define":122,"./_string-at":154}],181:[function(I,J,P){"use strict";var M=I("./_global"),u=I("./_has"),_=I("./_descriptors"),D=I("./_export"),f=I("./_redefine"),l=I("./_meta").KEY,C=I("./_fails"),v=I("./_shared"),o=I("./_set-to-string-tag"),a=I("./_uid"),r=I("./_wks"),h=I("./_wks-ext"),m=I("./_wks-define"),p=I("./_enum-keys"),w=I("./_is-array"),g=I("./_an-object"),c=I("./_is-object"),n=I("./_to-object"),s=I("./_to-iobject"),d=I("./_to-primitive"),S=I("./_property-desc"),y=I("./_object-create"),i=I("./_object-gopn-ext"),k=I("./_object-gopd"),O=I("./_object-gops"),b=I("./_object-dp"),E=I("./_object-keys"),x=k.f,T=b.f,N=i.f,j=M.Symbol,L=M.JSON,V=L&&L.stringify,K="prototype",W=r("_hidden"),G=r("toPrimitive"),F={}.propertyIsEnumerable,B=v("symbol-registry"),H=v("symbols"),q=v("op-symbols"),re=Object[K],ee=typeof j=="function"&&!!O.f,Ce=M.QObject,Ee=!Ce||!Ce[K]||!Ce[K].findChild,pe=_&&C(function(){return y(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a!=7})?function(ge,Re,Ze){var qe=x(re,Re);qe&&delete re[Re],T(ge,Re,Ze),qe&&ge!==re&&T(re,Re,qe)}:T,Me=function(ge){var Re=H[ge]=y(j[K]);return Re._k=ge,Re},_e=ee&&typeof j.iterator=="symbol"?function(ge){return typeof ge=="symbol"}:function(ge){return ge instanceof j},he=function(Re,Ze,qe){return Re===re&&he(q,Ze,qe),g(Re),Ze=d(Ze,!0),g(qe),u(H,Ze)?(qe.enumerable?(u(Re,W)&&Re[W][Ze]&&(Re[W][Ze]=!1),qe=y(qe,{enumerable:S(0,!1)})):(u(Re,W)||T(Re,W,S(1,{})),Re[W][Ze]=!0),pe(Re,Ze,qe)):T(Re,Ze,qe)},ce=function(Re,Ze){g(Re);for(var qe=p(Ze=s(Ze)),et=0,nt=qe.length,ut;nt>et;)he(Re,ut=qe[et++],Ze[ut]);return Re},oe=function(Re,Ze){return Ze===void 0?y(Re):ce(y(Re),Ze)},Se=function(Re){var Ze=F.call(this,Re=d(Re,!0));return this===re&&u(H,Re)&&!u(q,Re)?!1:Ze||!u(this,Re)||!u(H,Re)||u(this,W)&&this[W][Re]?Ze:!0},te=function(Re,Ze){if(Re=s(Re),Ze=d(Ze,!0),Re===re&&u(H,Ze)&&!u(q,Ze))return;var qe=x(Re,Ze);return qe&&u(H,Ze)&&!(u(Re,W)&&Re[W][Ze])&&(qe.enumerable=!0),qe},ue=function(Re){for(var Ze=N(s(Re)),qe=[],et=0,nt;Ze.length>et;)!u(H,nt=Ze[et++])&&nt!=W&&nt!=l&&qe.push(nt);return qe},Oe=function(Re){for(var Ze=Re===re,qe=N(Ze?q:s(Re)),et=[],nt=0,ut;qe.length>nt;)u(H,ut=qe[nt++])&&(Ze?u(re,ut):!0)&&et.push(H[ut]);return et};ee||(j=function(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var Re=a(arguments.length>0?arguments[0]:void 0),Ze=function(qe){this===re&&Ze.call(q,qe),u(this,W)&&u(this[W],Re)&&(this[W][Re]=!1),pe(this,Re,S(1,qe))};return _&&Ee&&pe(re,Re,{configurable:!0,set:Ze}),Me(Re)},f(j[K],"toString",function(){return this._k}),k.f=te,b.f=he,I("./_object-gopn").f=i.f=ue,I("./_object-pie").f=Se,O.f=Oe,_&&!I("./_library")&&f(re,"propertyIsEnumerable",Se,!0),h.f=function(ge){return Me(r(ge))}),D(D.G+D.W+D.F*!ee,{Symbol:j});for(var le="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Q=0;le.length>Q;)r(le[Q++]);for(var Y=E(r.store),Z=0;Y.length>Z;)m(Y[Z++]);D(D.S+D.F*!ee,"Symbol",{for:function(ge){return u(B,ge+="")?B[ge]:B[ge]=j(ge)},keyFor:function(Re){if(!_e(Re))throw TypeError(Re+" is not a symbol!");for(var Ze in B)if(B[Ze]===Re)return Ze},useSetter:function(){Ee=!0},useSimple:function(){Ee=!1}}),D(D.S+D.F*!ee,"Object",{create:oe,defineProperty:he,defineProperties:ce,getOwnPropertyDescriptor:te,getOwnPropertyNames:ue,getOwnPropertySymbols:Oe});var be=C(function(){O.f(1)});D(D.S+D.F*be,"Object",{getOwnPropertySymbols:function(Re){return O.f(n(Re))}}),L&&D(D.S+D.F*(!ee||C(function(){var ge=j();return V([ge])!="[null]"||V({a:ge})!="{}"||V(Object(ge))!="{}"})),"JSON",{stringify:function(Re){for(var Ze=[Re],qe=1,et,nt;arguments.length>qe;)Ze.push(arguments[qe++]);return nt=et=Ze[1],!c(et)&&Re===void 0||_e(Re)?void 0:(w(et)||(et=function(ut,ot){if(typeof nt=="function"&&(ot=nt.call(this,ut,ot)),!_e(ot))return ot}),Ze[1]=et,V.apply(L,Ze))}}),j[K][G]||I("./_hide")(j[K],G,j[K].valueOf),o(j,"Symbol"),o(Math,"Math",!0),o(M.JSON,"JSON",!0)},{"./_an-object":95,"./_descriptors":103,"./_enum-keys":106,"./_export":107,"./_fails":108,"./_global":110,"./_has":111,"./_hide":112,"./_is-array":118,"./_is-object":119,"./_library":126,"./_meta":127,"./_object-create":131,"./_object-dp":132,"./_object-gopd":134,"./_object-gopn":136,"./_object-gopn-ext":135,"./_object-gops":137,"./_object-keys":140,"./_object-pie":141,"./_property-desc":146,"./_redefine":148,"./_set-to-string-tag":150,"./_shared":152,"./_to-iobject":158,"./_to-object":160,"./_to-primitive":161,"./_uid":162,"./_wks":166,"./_wks-define":164,"./_wks-ext":165}],182:[function(I,J,P){var M=I("./_export"),u=I("./_object-to-array")(!0);M(M.S,"Object",{entries:function(D){return u(D)}})},{"./_export":107,"./_object-to-array":143}],183:[function(I,J,P){"use strict";var M=I("./_export"),u=I("./_core"),_=I("./_global"),D=I("./_species-constructor"),f=I("./_promise-resolve");M(M.P+M.R,"Promise",{finally:function(l){var C=D(this,u.Promise||_.Promise),v=typeof l=="function";return this.then(v?function(o){return f(C,l()).then(function(){return o})}:l,v?function(o){return f(C,l()).then(function(){throw o})}:l)}})},{"./_core":99,"./_export":107,"./_global":110,"./_promise-resolve":145,"./_species-constructor":153}],184:[function(I,J,P){"use strict";var M=I("./_export"),u=I("./_new-promise-capability"),_=I("./_perform");M(M.S,"Promise",{try:function(D){var f=u.f(this),l=_(D);return(l.e?f.reject:f.resolve)(l.v),f.promise}})},{"./_export":107,"./_new-promise-capability":129,"./_perform":144}],185:[function(I,J,P){I("./_wks-define")("asyncIterator")},{"./_wks-define":164}],186:[function(I,J,P){I("./_wks-define")("observable")},{"./_wks-define":164}],187:[function(I,J,P){I("./es6.array.iterator");for(var M=I("./_global"),u=I("./_hide"),_=I("./_iterators"),D=I("./_wks")("toStringTag"),f="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l0?"-":"+")+l(Math.floor(Math.abs(E)/60)*100+Math.abs(E)%60,4),S:["th","st","nd","rd"][s%10>3?0:(s%100-s%10!=10)*s%10],W:x,N:T};return p.replace(a,function(j){return j in N?N[j]:j.slice(1,j.length-1)})}}();f.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},f.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};function l(a,r){for(a=String(a),r=r||2;a.length]/;J.exports=u;function u(_){var D=""+_,f=M.exec(D);if(!f)return D;var l,C="",v=0,o=0;for(v=f.index;v0&&this._events[l].length>v&&(this._events[l].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[l].length),typeof console.trace=="function"&&console.trace())),this},M.prototype.on=M.prototype.addListener,M.prototype.once=function(l,C){if(!u(C))throw TypeError("listener must be a function");var v=!1;function o(){this.removeListener(l,o),v||(v=!0,C.apply(this,arguments))}return o.listener=C,this.on(l,o),this},M.prototype.removeListener=function(l,C){var v,o,a,r;if(!u(C))throw TypeError("listener must be a function");if(!this._events||!this._events[l])return this;if(v=this._events[l],a=v.length,o=-1,v===C||u(v.listener)&&v.listener===C)delete this._events[l],this._events.removeListener&&this.emit("removeListener",l,C);else if(D(v)){for(r=a;r-- >0;)if(v[r]===C||v[r].listener&&v[r].listener===C){o=r;break}if(o<0)return this;v.length===1?(v.length=0,delete this._events[l]):v.splice(o,1),this._events.removeListener&&this.emit("removeListener",l,C)}return this},M.prototype.removeAllListeners=function(l){var C,v;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[l]&&delete this._events[l],this;if(arguments.length===0){for(C in this._events){if(C==="removeListener")continue;this.removeAllListeners(C)}return this.removeAllListeners("removeListener"),this._events={},this}if(v=this._events[l],u(v))this.removeListener(l,v);else if(v)for(;v.length;)this.removeListener(l,v[v.length-1]);return delete this._events[l],this},M.prototype.listeners=function(l){var C;return!this._events||!this._events[l]?C=[]:u(this._events[l])?C=[this._events[l]]:C=this._events[l].slice(),C},M.prototype.listenerCount=function(l){if(this._events){var C=this._events[l];if(u(C))return 1;if(C)return C.length}return 0},M.listenerCount=function(l,C){return l.listenerCount(C)};function u(l){return typeof l=="function"}function _(l){return typeof l=="number"}function D(l){return typeof l=="object"&&l!==null}function f(l){return l===void 0}},{}],193:[function(I,J,P){var M=I("http"),u=J.exports;for(var _ in M)M.hasOwnProperty(_)&&(u[_]=M[_]);u.request=function(D,f){return D||(D={}),D.scheme="https",D.protocol="https:",M.request.call(this,D,f)}},{http:231}],194:[function(I,J,P){/*! * humanize-ms - index.js * Copyright(c) 2014 dead_horse * MIT Licensed */"use strict";var M=I("util"),u=I("ms");J.exports=function(_){if(typeof _=="number")return _;var D=u(_);if(D===void 0){var f=new Error(M.format("humanize-ms(%j) result undefined",_));console.warn(f.stack)}return D}},{ms:204,util:243}],195:[function(I,J,P){P.read=function(M,u,_,D,f){var l,C,v=f*8-D-1,o=(1<>1,r=-7,h=_?f-1:0,m=_?-1:1,p=M[u+h];for(h+=m,l=p&(1<<-r)-1,p>>=-r,r+=v;r>0;l=l*256+M[u+h],h+=m,r-=8);for(C=l&(1<<-r)-1,l>>=-r,r+=D;r>0;C=C*256+M[u+h],h+=m,r-=8);if(l===0)l=1-a;else{if(l===o)return C?NaN:(p?-1:1)*Infinity;C=C+Math.pow(2,D),l=l-a}return(p?-1:1)*C*Math.pow(2,l-D)},P.write=function(M,u,_,D,f,l){var C,v,o,a=l*8-f-1,r=(1<>1,m=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=D?0:l-1,w=D?1:-1,g=u<0||u===0&&1/u<0?1:0;for(u=Math.abs(u),isNaN(u)||u===Infinity?(v=isNaN(u)?1:0,C=r):(C=Math.floor(Math.log(u)/Math.LN2),u*(o=Math.pow(2,-C))<1&&(C--,o*=2),C+h>=1?u+=m/o:u+=m*Math.pow(2,1-h),u*o>=2&&(C++,o/=2),C+h>=r?(v=0,C=r):C+h>=1?(v=(u*o-1)*Math.pow(2,f),C=C+h):(v=u*Math.pow(2,h-1)*Math.pow(2,f),C=0));f>=8;M[_+p]=v&255,p+=w,v/=256,f-=8);for(C=C<0;M[_+p]=C&255,p+=w,C/=256,a-=8);M[_+p-w]|=g*128}},{}],196:[function(I,J,P){typeof Object.create=="function"?J.exports=function(u,_){_&&(u.super_=_,u.prototype=Object.create(_.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}))}:J.exports=function(u,_){if(_){u.super_=_;var D=function(){};D.prototype=_.prototype,u.prototype=new D,u.prototype.constructor=u}}},{}],197:[function(I,J,P){/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */J.exports=function(_){return _!=null&&(M(_)||u(_)||!!_._isBuffer)};function M(_){return!!_.constructor&&typeof _.constructor.isBuffer=="function"&&_.constructor.isBuffer(_)}function u(_){return typeof _.readFloatLE=="function"&&typeof _.slice=="function"&&M(_.slice(0,0))}},{}],198:[function(I,J,P){var M={}.toString;J.exports=Array.isArray||function(u){return M.call(u)=="[object Array]"}},{}],199:[function(require,module,exports){(function(global){(function(I,J){typeof exports=="object"&&typeof module!="undefined"?module.exports=J(I):typeof define=="function"&&define.amd?define(J):J(I)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:this,function(global){"use strict";global=global||{};var _Base64=global.Base64,version="2.5.2",buffer;if(typeof module!="undefined"&&module.exports)try{buffer=eval("require('buffer').Buffer")}catch(I){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(I){for(var J={},P=0,M=I.length;P>>6)+fromCharCode(128|J&63):fromCharCode(224|J>>>12&15)+fromCharCode(128|J>>>6&63)+fromCharCode(128|J&63)}else{var J=65536+(I.charCodeAt(0)-55296)*1024+(I.charCodeAt(1)-56320);return fromCharCode(240|J>>>18&7)+fromCharCode(128|J>>>12&63)+fromCharCode(128|J>>>6&63)+fromCharCode(128|J&63)}},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(I){return I.replace(re_utob,cb_utob)},cb_encode=function(I){var J=[0,2,1][I.length%3],P=I.charCodeAt(0)<<16|(I.length>1?I.charCodeAt(1):0)<<8|(I.length>2?I.charCodeAt(2):0),M=[b64chars.charAt(P>>>18),b64chars.charAt(P>>>12&63),J>=2?"=":b64chars.charAt(P>>>6&63),J>=1?"=":b64chars.charAt(P&63)];return M.join("")},btoa=global.btoa?function(I){return global.btoa(I)}:function(I){return I.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=function(I){var J=Object.prototype.toString.call(I)==="[object Uint8Array]";return J?I.toString("base64"):btoa(utob(String(I)))},encode=function(I,J){return J?_encode(String(I)).replace(/[+\/]/g,function(P){return P=="+"?"-":"_"}).replace(/=/g,""):_encode(I)},encodeURI=function(I){return encode(I,!0)},re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=function(I){switch(I.length){case 4:var J=(7&I.charCodeAt(0))<<18|(63&I.charCodeAt(1))<<12|(63&I.charCodeAt(2))<<6|63&I.charCodeAt(3),P=J-65536;return fromCharCode((P>>>10)+55296)+fromCharCode((P&1023)+56320);case 3:return fromCharCode((15&I.charCodeAt(0))<<12|(63&I.charCodeAt(1))<<6|63&I.charCodeAt(2));default:return fromCharCode((31&I.charCodeAt(0))<<6|63&I.charCodeAt(1))}},btou=function(I){return I.replace(re_btou,cb_btou)},cb_decode=function(I){var J=I.length,P=J%4,M=(J>0?b64tab[I.charAt(0)]<<18:0)|(J>1?b64tab[I.charAt(1)]<<12:0)|(J>2?b64tab[I.charAt(2)]<<6:0)|(J>3?b64tab[I.charAt(3)]:0),u=[fromCharCode(M>>>16),fromCharCode(M>>>8&255),fromCharCode(M&255)];return u.length-=[0,0,2,1][P],u.join("")},_atob=global.atob?function(I){return global.atob(I)}:function(I){return I.replace(/\S{1,4}/g,cb_decode)},atob=function(I){return _atob(String(I).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(I){return(I.constructor===buffer.constructor?I:buffer.from(I,"base64")).toString()}:function(I){return(I.constructor===buffer.constructor?I:new buffer(I,"base64")).toString()}:function(I){return btou(_atob(I))},decode=function(I){return _decode(String(I).replace(/[-_]/g,function(J){return J=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var I=global.Base64;return global.Base64=_Base64,I};if(global.Base64={VERSION:version,atob,btoa,fromBase64:decode,toBase64:encode,utob,encode,encodeURI,btou,decode,noConflict,__buffer__:buffer},typeof Object.defineProperty=="function"){var noEnum=function(I){return{value:I,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(I){return encode(this,I)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}}return global.Meteor&&(Base64=global.Base64),typeof module!="undefined"&&module.exports?module.exports.Base64=global.Base64:typeof define=="function"&&define.amd&&define([],function(){return global.Base64}),{Base64:global.Base64}})}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],200:[function(I,J,P){/*! * merge-descriptors * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */"use strict";J.exports=u;var M=Object.prototype.hasOwnProperty;function u(_,D,f){if(!_)throw new TypeError("argument dest is required");if(!D)throw new TypeError("argument src is required");return f===void 0&&(f=!0),Object.getOwnPropertyNames(D).forEach(function(C){if(!f&&M.call(_,C))return;var v=Object.getOwnPropertyDescriptor(D,C);Object.defineProperty(_,C,v)}),_}},{}],201:[function(I,J,P){"use strict";function M(){this._types=Object.create(null),this._extensions=Object.create(null);for(var u=0;u0)return C(r);if(m==="number"&&isFinite(r))return h.long?o(r):v(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function C(r){if(r=String(r),r.length>100)return;var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(!h)return;var m=parseFloat(h[1]),p=(h[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return m*l;case"weeks":case"week":case"w":return m*f;case"days":case"day":case"d":return m*D;case"hours":case"hour":case"hrs":case"hr":case"h":return m*_;case"minutes":case"minute":case"mins":case"min":case"m":return m*u;case"seconds":case"second":case"secs":case"sec":case"s":return m*M;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}function v(r){var h=Math.abs(r);return h>=D?Math.round(r/D)+"d":h>=_?Math.round(r/_)+"h":h>=u?Math.round(r/u)+"m":h>=M?Math.round(r/M)+"s":r+"ms"}function o(r){var h=Math.abs(r);return h>=D?a(r,h,D,"day"):h>=_?a(r,h,_,"hour"):h>=u?a(r,h,u,"minute"):h>=M?a(r,h,M,"second"):r+" ms"}function a(r,h,m,p){var w=h>=m*1.5;return Math.round(r/m)+" "+p+(w?"s":"")}},{}],205:[function(I,J,P){(function(M){function u(l,C){for(var v=0,o=l.length-1;o>=0;o--){var a=l[o];a==="."?l.splice(o,1):a===".."?(l.splice(o,1),v++):v&&(l.splice(o,1),v--)}if(C)for(;v--;v)l.unshift("..");return l}P.resolve=function(){for(var l="",C=!1,v=arguments.length-1;v>=-1&&!C;v--){var o=v>=0?arguments[v]:M.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)continue;l=o+"/"+l,C=o.charAt(0)==="/"}return l=u(D(l.split("/"),function(a){return!!a}),!C).join("/"),(C?"/":"")+l||"."},P.normalize=function(l){var C=P.isAbsolute(l),v=f(l,-1)==="/";return l=u(D(l.split("/"),function(o){return!!o}),!C).join("/"),!l&&!C&&(l="."),l&&v&&(l+="/"),(C?"/":"")+l},P.isAbsolute=function(l){return l.charAt(0)==="/"},P.join=function(){var l=Array.prototype.slice.call(arguments,0);return P.normalize(D(l,function(C,v){if(typeof C!="string")throw new TypeError("Arguments to path.join must be strings");return C}).join("/"))},P.relative=function(l,C){l=P.resolve(l).substr(1),C=P.resolve(C).substr(1);function v(w){for(var g=0;g=0&&!(w[c]!=="");c--);return g>c?[]:w.slice(g,c-g+1)}for(var o=v(l.split("/")),a=v(C.split("/")),r=Math.min(o.length,a.length),h=r,m=0;m=1;--r)if(C=l.charCodeAt(r),C===47){if(!a){o=r;break}}else a=!1;return o===-1?v?"/":".":v&&o===1?"/":l.slice(0,o)};function _(l){typeof l!="string"&&(l=l+"");var C=0,v=-1,o=!0,a;for(a=l.length-1;a>=0;--a)if(l.charCodeAt(a)===47){if(!o){C=a+1;break}}else v===-1&&(o=!1,v=a+1);return v===-1?"":l.slice(C,v)}P.basename=function(l,C){var v=_(l);return C&&v.substr(-1*C.length)===C&&(v=v.substr(0,v.length-C.length)),v},P.extname=function(l){typeof l!="string"&&(l=l+"");for(var C=-1,v=0,o=-1,a=!0,r=0,h=l.length-1;h>=0;--h){var m=l.charCodeAt(h);if(m===47){if(!a){v=h+1;break}continue}o===-1&&(a=!1,o=h+1),m===46?C===-1?C=h:r!==1&&(r=1):C!==-1&&(r=-1)}return C===-1||o===-1||r===0||r===1&&C===o-1&&C===v+1?"":l.slice(C,o)};function D(l,C){if(l.filter)return l.filter(C);for(var v=[],o=0;o * Copyright 2014-2018 Benjamin Tan * Copyright 2011-2013 John-David Dalton * Available under MIT license */(function(){"use strict";var u={function:!0,object:!0},_=u[typeof window]&&window||this,D=_,f=u[typeof P]&&P,l=u[typeof J]&&J&&!J.nodeType&&J,C=f&&l&&typeof M=="object"&&M;C&&(C.global===C||C.window===C||C.self===C)&&(_=C);var v=Math.pow(2,53)-1,o=/\bOpera/,a=this,r=Object.prototype,h=r.hasOwnProperty,m=r.toString;function p(b){return b=String(b),b.charAt(0).toUpperCase()+b.slice(1)}function w(b,E,x){var T={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return E&&x&&/^Win/i.test(b)&&!/^Windows Phone /i.test(b)&&(T=T[/[\d.]+$/.exec(b)])&&(b="Windows "+T),b=String(b),E&&x&&(b=b.replace(RegExp(E,"i"),x)),b=c(b.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0]),b}function g(b,E){var x=-1,T=b?b.length:0;if(typeof T=="number"&&T>-1&&T<=v)for(;++x3&&"WebKit"||/\bOpera\b/.test(ue)&&(/\bOPR\b/.test(b)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(b)&&!/^(?:Trident|EdgeHTML)$/.test(te)&&"WebKit"||!te&&/\bMSIE\b/i.test(b)&&(Q=="Mac OS"?"Tasman":"Trident")||te=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(ue)&&"NetFront")&&(te=[pe]),ue=="IE"&&(pe=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(b)||0)[1])?(ue+=" Mobile",Q="Windows Phone "+(/\+$/.test(pe)?pe:pe+".x"),_e.unshift("desktop mode")):/\bWPDesktop\b/i.test(b)?(ue="IE Mobile",Q="Windows Phone 8.x",_e.unshift("desktop mode"),oe||(oe=(/\brv:([\d.]+)/.exec(b)||0)[1])):ue!="IE"&&te=="Trident"&&(pe=/\brv:([\d.]+)/.exec(b))&&(ue&&_e.push("identifying as "+ue+(oe?" "+oe:"")),ue="IE",oe=pe[1]),ce){if(d(E,"global"))if(B&&(pe=B.lang.System,Me=pe.getProperty("os.arch"),Q=Q||pe.getProperty("os.name")+" "+pe.getProperty("os.version")),H){try{oe=E.require("ringo/engine").version.join("."),ue="RingoJS"}catch(nt){(pe=E.system)&&pe.global.system==E.system&&(ue="Narwhal",Q||(Q=pe[0].os||null))}ue||(ue="Rhino")}else typeof E.process=="object"&&!E.process.browser&&(pe=E.process)&&(typeof pe.versions=="object"&&(typeof pe.versions.electron=="string"?(_e.push("Node "+pe.versions.node),ue="Electron",oe=pe.versions.electron):typeof pe.versions.nw=="string"&&(_e.push("Chromium "+oe,"Node "+pe.versions.node),ue="NW.js",oe=pe.versions.nw)),ue||(ue="Node.js",Me=pe.arch,Q=pe.platform,oe=/[\d.]+/.exec(pe.version),oe=oe?oe[0]:null));else s(pe=E.runtime)==K?(ue="Adobe AIR",Q=pe.flash.system.Capabilities.os):s(pe=E.phantom)==F?(ue="PhantomJS",oe=(pe=pe.version||null)&&pe.major+"."+pe.minor+"."+pe.patch):typeof ee.documentMode=="number"&&(pe=/\bTrident\/(\d+)/i.exec(b))?(oe=[oe,ee.documentMode],(pe=+pe[1]+4)!=oe[1]&&(_e.push("IE "+oe[1]+" mode"),te&&(te[1]=""),oe[1]=pe),oe=ue=="IE"?String(oe[1].toFixed(1)):oe[0]):typeof ee.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(ue)&&(_e.push("masking as "+ue+" "+oe),ue="IE",oe="11.0",te=["Trident"],Q="Windows");Q=Q&&c(Q)}if(oe&&(pe=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(oe)||/(?:alpha|beta)(?: ?\d)?/i.exec(b+";"+(ce&&T.appMinorVersion))||/\bMinefield\b/i.test(b)&&"a")&&(he=/b/i.test(pe)?"beta":"alpha",oe=oe.replace(RegExp(pe+"\\+?$"),"")+(he=="beta"?re:q)+(/\d+\+?/.exec(pe)||"")),ue=="Fennec"||ue=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(Q))ue="Firefox Mobile";else if(ue=="Maxthon"&&oe)oe=oe.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(Oe))Oe=="Xbox 360"&&(Q=null),Oe=="Xbox 360"&&/\bIEMobile\b/.test(b)&&_e.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(ue)||ue&&!Oe&&!/Browser|Mobi/.test(ue))&&(Q=="Windows CE"||/Mobi/i.test(b)))ue+=" Mobile";else if(ue=="IE"&&ce)try{E.external===null&&_e.unshift("platform preview")}catch(nt){_e.unshift("embedded")}else(/\bBlackBerry\b/.test(Oe)||/\bBB10\b/.test(b))&&(pe=(RegExp(Oe.replace(/ +/g," *")+"/([.\\d]+)","i").exec(b)||0)[1]||oe)?(pe=[pe,/BB10/.test(b)],Q=(pe[1]?(Oe=null,le="BlackBerry"):"Device Software")+" "+pe[0],oe=null):this!=n&&Oe!="Wii"&&(ce&&Ce||/Opera/.test(ue)&&/\b(?:MSIE|Firefox)\b/i.test(b)||ue=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(Q)||ue=="IE"&&(Q&&!/^Win/.test(Q)&&oe>5.5||/\bWindows XP\b/.test(Q)&&oe>8||oe==8&&!/\bTrident\b/.test(b)))&&!o.test(pe=k.call(n,b.replace(o,"")+";"))&&pe.name&&(pe="ing as "+pe.name+((pe=pe.version)?" "+pe:""),o.test(ue)?(/\bIE\b/.test(pe)&&Q=="Mac OS"&&(Q=null),pe="identify"+pe):(pe="mask"+pe,Ee?ue=c(Ee.replace(/([a-z])([A-Z])/g,"$1 $2")):ue="Opera",/\bIE\b/.test(pe)&&(Q=null),ce||(oe=null)),te=["Presto"],_e.push(pe));(pe=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(b)||0)[1])&&(pe=[parseFloat(pe.replace(/\.(\d)$/,".0$1")),pe],ue=="Safari"&&pe[1].slice(-1)=="+"?(ue="WebKit Nightly",he="alpha",oe=pe[1].slice(0,-1)):(oe==pe[1]||oe==(pe[2]=(/\bSafari\/([\d.]+\+?)/i.exec(b)||0)[1]))&&(oe=null),pe[1]=(/\bChrome\/([\d.]+)/i.exec(b)||0)[1],pe[0]==537.36&&pe[2]==537.36&&parseFloat(pe[1])>=28&&te=="WebKit"&&(te=["Blink"]),!ce||!L&&!pe[1]?(te&&(te[1]="like Safari"),pe=(pe=pe[0],pe<400?1:pe<500?2:pe<526?3:pe<533?4:pe<534?"4+":pe<535?5:pe<537?6:pe<538?7:pe<601?8:"8")):(te&&(te[1]="like Chrome"),pe=pe[1]||(pe=pe[0],pe<530?1:pe<532?2:pe<532.05?3:pe<533?4:pe<534.03?5:pe<534.07?6:pe<534.1?7:pe<534.13?8:pe<534.16?9:pe<534.24?10:pe<534.3?11:pe<535.01?12:pe<535.02?"13+":pe<535.07?15:pe<535.11?16:pe<535.19?17:pe<536.05?18:pe<536.1?19:pe<537.01?20:pe<537.11?"21+":pe<537.13?23:pe<537.18?24:pe<537.24?25:pe<537.36?26:te!="Blink"?"27":"28")),te&&(te[1]+=" "+(pe+=typeof pe=="number"?".x":/[.+]/.test(pe)?"":"+")),ue=="Safari"&&(!oe||parseInt(oe)>45)&&(oe=pe)),ue=="Opera"&&(pe=/\bzbov|zvav$/.exec(Q))?(ue+=" ",_e.unshift("desktop mode"),pe=="zvav"?(ue+="Mini",oe=null):ue+="Mobile",Q=Q.replace(RegExp(" *"+pe+"$"),"")):ue=="Safari"&&/\bChrome\b/.exec(te&&te[1])&&(_e.unshift("desktop mode"),ue="Chrome Mobile",oe=null,/\bOS X\b/.test(Q)?(le="Apple",Q="iOS 4.3+"):Q=null),oe&&oe.indexOf(pe=/[\d.]+$/.exec(Q))==0&&b.indexOf("/"+pe+"-")>-1&&(Q=i(Q.replace(pe,""))),te&&!/\b(?:Avant|Nook)\b/.test(ue)&&(/Browser|Lunascape|Maxthon/.test(ue)||ue!="Safari"&&/^iOS/.test(Q)&&/\bSafari\b/.test(te[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(ue)&&te[1])&&((pe=te[te.length-1])&&_e.push(pe)),_e.length&&(_e=["("+_e.join("; ")+")"]),le&&Oe&&Oe.indexOf(le)<0&&_e.push("on "+le),Oe&&_e.push((/^on /.test(_e[_e.length-1])?"":"on ")+Oe),Q&&(pe=/ ([\d.+]+)$/.exec(Q),Se=pe&&Q.charAt(Q.length-pe[0].length-1)=="/",Q={architecture:32,family:pe&&!Se?Q.replace(pe[0],""):Q,version:pe?pe[1]:null,toString:function(){var nt=this.version;return this.family+(nt&&!Se?" "+nt:"")+(this.architecture==64?" 64-bit":"")}}),(pe=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Me))&&!/\bi686\b/i.test(Me)?(Q&&(Q.architecture=64,Q.family=Q.family.replace(RegExp(" *"+pe),"")),ue&&(/\bWOW64\b/i.test(b)||ce&&/\w(?:86|32)$/.test(T.cpuClass||T.platform)&&!/\bWin64; x64\b/i.test(b))&&_e.unshift("32-bit")):Q&&/^OS X/.test(Q.family)&&ue=="Chrome"&&parseFloat(oe)>=39&&(Q.architecture=64),b||(b=null);var et={};return et.description=b,et.layout=te&&te[0],et.manufacturer=le,et.name=ue,et.prerelease=he,et.product=Oe,et.ua=b,et.version=ue&&oe,et.os=Q||{architecture:null,family:null,version:null,toString:function(){return"null"}},et.parse=k,et.toString=qe,et.version&&_e.unshift(oe),et.name&&_e.unshift(ue),Q&&ue&&!(Q==String(Q).split(" ")[0]&&(Q==ue.split(" ")[0]||Oe))&&_e.push(Oe?"("+Q+")":"on "+Q),_e.length&&(et.description=_e.join(" ")),et}var O=k();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(_.platform=O,define(function(){return O})):f&&l?n(O,function(b,E){f[E]=b}):_.platform=O}).call(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],207:[function(I,J,P){(function(M){"use strict";typeof M=="undefined"||!M.version||M.version.indexOf("v0.")===0||M.version.indexOf("v1.")===0&&M.version.indexOf("v1.8.")!==0?J.exports={nextTick:u}:J.exports=M;function u(_,D,f,l){if(typeof _!="function")throw new TypeError('"callback" argument must be a function');var C=arguments.length,v,o;switch(C){case 0:case 1:return M.nextTick(_);case 2:return M.nextTick(function(){_.call(null,D)});case 3:return M.nextTick(function(){_.call(null,D,f)});case 4:return M.nextTick(function(){_.call(null,D,f,l)});default:for(v=new Array(C-1),o=0;o1)for(var n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=v-o,S=Math.floor,y=String.fromCharCode,i;function k(G){throw new RangeError(s[G])}function O(G,F){for(var B=G.length,H=[];B--;)H[B]=F(G[B]);return H}function b(G,F){var B=G.split("@"),H="";B.length>1&&(H=B[0]+"@",G=B[1]),G=G.replace(n,".");var q=G.split("."),re=O(q,F).join(".");return H+re}function E(G){for(var F=[],B=0,H=G.length,q,re;B=55296&&q<=56319&&B65535&&(F-=65536,B+=y(F>>>10&1023|55296),F=56320|F&1023),B+=y(F),B}).join("")}function T(G){return G-48<10?G-22:G-65<26?G-65:G-97<26?G-97:v}function N(G,F){return G+22+75*(G<26)-((F!=0)<<5)}function j(G,F,B){var H=0;for(G=B?S(G/h):G>>1,G+=S(G/F);G>d*a>>1;H+=v)G=S(G/d);return S(H+(d+1)*G/(G+r))}function L(G){var F=[],B=G.length,H,q=0,re=p,ee=m,Ce,Ee,pe,Me,_e,he,ce,oe,Se;for(Ce=G.lastIndexOf(w),Ce<0&&(Ce=0),Ee=0;Ee=128&&k("not-basic"),F.push(G.charCodeAt(Ee));for(pe=Ce>0?Ce+1:0;pe=B&&k("invalid-input"),ce=T(G.charCodeAt(pe++)),(ce>=v||ce>S((C-q)/_e))&&k("overflow"),q+=ce*_e,oe=he<=ee?o:he>=ee+a?a:he-ee,ceS(C/Se)&&k("overflow"),_e*=Se;H=F.length+1,ee=j(q-Me,H,Me==0),S(q/H)>C-re&&k("overflow"),re+=S(q/H),q%=H,F.splice(q++,0,re)}return x(F)}function V(G){var F,B,H,q,re,ee,Ce,Ee,pe,Me,_e,he=[],ce,oe,Se,te;for(G=E(G),ce=G.length,F=p,B=0,re=m,ee=0;ee=F&&_eS((C-B)/oe)&&k("overflow"),B+=(Ce-F)*oe,F=Ce,ee=0;eeC&&k("overflow"),_e==F){for(Ee=B,pe=v;!(Me=pe<=re?o:pe>=re+a?a:pe-re,Ee0&&a>o&&(a=o);for(var r=0;r=0?(p=h.substr(0,m),w=h.substr(m+1)):(p=h,w=""),g=decodeURIComponent(p),c=decodeURIComponent(w),M(C,g)?u(C[g])?C[g].push(c):C[g]=[C[g],c]:C[g]=c}return C};var u=Array.isArray||function(_){return Object.prototype.toString.call(_)==="[object Array]"}},{}],211:[function(I,J,P){"use strict";var M=function(f){switch(typeof f){case"string":return f;case"boolean":return f?"true":"false";case"number":return isFinite(f)?f:"";default:return""}};J.exports=function(f,l,C,v){return l=l||"&",C=C||"=",f===null&&(f=void 0),typeof f=="object"?_(D(f),function(o){var a=encodeURIComponent(M(o))+C;return u(f[o])?_(f[o],function(r){return a+encodeURIComponent(M(r))}).join(l):a+encodeURIComponent(M(f[o]))}).join(l):v?encodeURIComponent(M(v))+C+encodeURIComponent(M(f)):""};var u=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"};function _(f,l){if(f.map)return f.map(l);for(var C=[],v=0;v0?(typeof ue!="string"&&!Y.objectMode&&(0,D.default)(ue)!==p.prototype&&(ue=g(ue)),le?Y.endEmitted?te.emit("error",new Error("stream.unshift() after end event")):T(te,Y,ue,!0):Y.ended?te.emit("error",new Error("stream.push() after EOF")):(Y.reading=!1,Y.decoder&&!Oe?(ue=Y.decoder.write(ue),Y.objectMode||ue.length!==0?T(te,Y,ue,!1):B(te,Y)):T(te,Y,ue,!1))):le||(Y.reading=!1)}return j(Y)}function T(te,ue,Oe,le){ue.flowing&&ue.length===0&&!ue.sync?(te.emit("data",Oe),te.read(0)):(ue.length+=ue.objectMode?1:Oe.length,le?ue.buffer.unshift(Oe):ue.buffer.push(Oe),ue.needReadable&&G(te)),B(te,ue)}function N(te,ue){var Oe;return!c(ue)&&typeof ue!="string"&&ue!==void 0&&!te.objectMode&&(Oe=new TypeError("Invalid non-string/buffer chunk")),Oe}function j(te){return!te.ended&&(te.needReadable||te.length=L?te=L:(te--,te|=te>>>1,te|=te>>>2,te|=te>>>4,te|=te>>>8,te|=te>>>16,te++),te}function K(te,ue){return te<=0||ue.length===0&&ue.ended?0:ue.objectMode?1:te!==te?ue.flowing&&ue.length?ue.buffer.head.data.length:ue.length:(te>ue.highWaterMark&&(ue.highWaterMark=V(te)),te<=ue.length?te:ue.ended?ue.length:(ue.needReadable=!0,0))}E.prototype.read=function(te){d("read",te),te=parseInt(te,10);var ue=this._readableState,Oe=te;if(te!==0&&(ue.emittedReadable=!1),te===0&&ue.needReadable&&(ue.length>=ue.highWaterMark||ue.ended))return d("read: emitReadable",ue.length,ue.ended),ue.length===0&&ue.ended?ce(this):G(this),null;if(te=K(te,ue),te===0&&ue.ended)return ue.length===0&&ce(this),null;var le=ue.needReadable;d("need readable",le),(ue.length===0||ue.length-te0?Q=pe(te,ue):Q=null,Q===null?(ue.needReadable=!0,te=0):ue.length-=te,ue.length===0&&(ue.ended||(ue.needReadable=!0),Oe!==te&&ue.ended&&ce(this)),Q!==null&&this.emit("data",Q),Q};function W(te,ue){if(ue.ended)return;if(ue.decoder){var Oe=ue.decoder.end();Oe&&Oe.length&&(ue.buffer.push(Oe),ue.length+=ue.objectMode?1:Oe.length)}ue.ended=!0,G(te)}function G(te){var ue=te._readableState;ue.needReadable=!1,ue.emittedReadable||(d("emitReadable",ue.flowing),ue.emittedReadable=!0,ue.sync?v.nextTick(F,te):F(te))}function F(te){d("emit readable"),te.emit("readable"),Ee(te)}function B(te,ue){ue.readingMore||(ue.readingMore=!0,v.nextTick(H,te,ue))}function H(te,ue){for(var Oe=ue.length;!ue.reading&&!ue.flowing&&!ue.ended&&ue.length1&&Se(le.pipes,te)!==-1)&&!Re&&(d("false write response, pause",Oe._readableState.awaitDrain),Oe._readableState.awaitDrain++,qe=!0),Oe.pause())}function nt(De){d("onerror",De),je(),te.removeListener("error",nt),h(te,"error")===0&&te.emit("error",De)}O(te,"error",nt);function ut(){te.removeListener("finish",ot),je()}te.once("close",ut);function ot(){d("onfinish"),te.removeListener("close",ut),je()}te.once("finish",ot);function je(){d("unpipe"),Oe.unpipe(te)}return te.emit("pipe",Oe),le.flowing||(d("pipe resume"),Oe.resume()),te};function q(te){return function(){var ue=te._readableState;d("pipeOnDrain",ue.awaitDrain),ue.awaitDrain&&ue.awaitDrain--,ue.awaitDrain===0&&h(te,"data")&&(ue.flowing=!0,Ee(te))}}E.prototype.unpipe=function(te){var ue=this._readableState,Oe={hasUnpiped:!1};if(ue.pipesCount===0)return this;if(ue.pipesCount===1)return te&&te!==ue.pipes?this:(te||(te=ue.pipes),ue.pipes=null,ue.pipesCount=0,ue.flowing=!1,te&&te.emit("unpipe",this,Oe),this);if(!te){var le=ue.pipes,Q=ue.pipesCount;ue.pipes=null,ue.pipesCount=0,ue.flowing=!1;for(var Y=0;Y=ue.length?(ue.decoder?Oe=ue.buffer.join(""):ue.buffer.length===1?Oe=ue.buffer.head.data:Oe=ue.buffer.concat(ue.length),ue.buffer.clear()):Oe=Me(te,ue.buffer,ue.decoder),Oe}function Me(te,ue,Oe){var le;return teY.length?Y.length:te;if(Z===Y.length?Q+=Y:Q+=Y.slice(0,te),te-=Z,te===0){Z===Y.length?(++le,Oe.next?ue.head=Oe.next:ue.head=ue.tail=null):(ue.head=Oe,Oe.data=Y.slice(Z));break}++le}return ue.length-=le,Q}function he(te,ue){var Oe=p.allocUnsafe(te),le=ue.head,Q=1;for(le.data.copy(Oe),te-=le.data.length;le=le.next;){var Y=le.data,Z=te>Y.length?Y.length:te;if(Y.copy(Oe,Oe.length-te,0,Z),te-=Z,te===0){Z===Y.length?(++Q,le.next?ue.head=le.next:ue.head=ue.tail=null):(ue.head=le,le.data=Y.slice(Z));break}++Q}return ue.length-=Q,Oe}function ce(te){var ue=te._readableState;if(ue.length>0)throw new Error('"endReadable()" called on non-empty stream');ue.endEmitted||(ue.ended=!0,v.nextTick(oe,ue,te))}function oe(te,ue){!te.endEmitted&&te.length===0&&(te.endEmitted=!0,ue.readable=!1,ue.emit("end"))}function Se(te,ue){for(var Oe=0,le=te.length;Oe-1?h.default:p.nextTick,n;N.WritableState=x;var s=(0,a.default)(I("core-util-is"));s.inherits=I("inherits");var d={deprecate:I("util-deprecate")},S=I("./internal/streams/stream"),y=I("safe-buffer").Buffer,i=u.Uint8Array||function(){};function k(he){return y.from(he)}function O(he){return y.isBuffer(he)||he instanceof i}var b=I("./internal/streams/destroy");s.inherits(N,S);function E(){}function x(he,ce){n=n||I("./_stream_duplex"),he=he||{};var oe=ce instanceof n;this.objectMode=!!he.objectMode,oe&&(this.objectMode=this.objectMode||!!he.writableObjectMode);var Se=he.highWaterMark,te=he.writableHighWaterMark,ue=this.objectMode?16:16*1024;Se||Se===0?this.highWaterMark=Se:oe&&(te||te===0)?this.highWaterMark=te:this.highWaterMark=ue,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Oe=he.decodeStrings===!1;this.decodeStrings=!Oe,this.defaultEncoding=he.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(le){B(ce,le)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new g(this)}x.prototype.getBuffer=function(){for(var ce=this.bufferedRequest,oe=[];ce;)oe.push(ce),ce=ce.next;return oe},function(){try{Object.defineProperty(x.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(he){}}();var T;typeof v.default=="function"&&l.default&&typeof Function.prototype[l.default]=="function"?(T=Function.prototype[l.default],(0,D.default)(N,l.default,{value:function(ce){return T.call(this,ce)?!0:this!==N?!1:ce&&ce._writableState instanceof x}})):T=function(ce){return ce instanceof this};function N(he){if(n=n||I("./_stream_duplex"),!T.call(N,this)&&!(this instanceof n))return new N(he);this._writableState=new x(he,this),this.writable=!0,he&&(typeof he.write=="function"&&(this._write=he.write),typeof he.writev=="function"&&(this._writev=he.writev),typeof he.destroy=="function"&&(this._destroy=he.destroy),typeof he.final=="function"&&(this._final=he.final)),S.call(this)}N.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function j(he,ce){var oe=new Error("write after end");he.emit("error",oe),p.nextTick(ce,oe)}function L(he,ce,oe,Se){var te=!0,ue=!1;return oe===null?ue=new TypeError("May not write null values to stream"):typeof oe!="string"&&oe!==void 0&&!ce.objectMode&&(ue=new TypeError("Invalid non-string/buffer chunk")),ue&&(he.emit("error",ue),p.nextTick(Se,ue),te=!1),te}N.prototype.write=function(he,ce,oe){var Se=this._writableState,te=!1,ue=!Se.objectMode&&O(he);return ue&&!y.isBuffer(he)&&(he=k(he)),typeof ce=="function"&&(oe=ce,ce=null),ue?ce="buffer":ce||(ce=Se.defaultEncoding),typeof oe!="function"&&(oe=E),Se.ended?j(this,oe):(ue||L(this,Se,he,oe))&&(Se.pendingcb++,te=K(this,Se,ue,he,ce,oe)),te},N.prototype.cork=function(){var he=this._writableState;he.corked++},N.prototype.uncork=function(){var he=this._writableState;he.corked&&(he.corked--,!he.writing&&!he.corked&&!he.finished&&!he.bufferProcessing&&he.bufferedRequest&&re(this,he))},N.prototype.setDefaultEncoding=function(ce){if(typeof ce=="string"&&(ce=ce.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ce+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+ce);return this._writableState.defaultEncoding=ce,this};function V(he,ce,oe){return!he.objectMode&&he.decodeStrings!==!1&&typeof ce=="string"&&(ce=y.from(ce,oe)),ce}Object.defineProperty(N.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function K(he,ce,oe,Se,te,ue){if(!oe){var Oe=V(ce,Se,te);Se!==Oe&&(oe=!0,te="buffer",Se=Oe)}var le=ce.objectMode?1:Se.length;ce.length+=le;var Q=ce.length0?this.tail.next=v:this.head=v,this.tail=v,++this.length},f.prototype.unshift=function(C){var v={data:C,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length},f.prototype.shift=function(){if(this.length===0)return;var C=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,C},f.prototype.clear=function(){this.head=this.tail=null,this.length=0},f.prototype.join=function(C){if(this.length===0)return"";for(var v=this.head,o=""+v.data;v=v.next;)o+=C+v.data;return o},f.prototype.concat=function(C){if(this.length===0)return u.alloc(0);if(this.length===1)return this.head.data;for(var v=u.allocUnsafe(C>>>0),o=this.head,a=0;o;)D(o.data,v,a),a+=o.data.length,o=o.next;return v},f}(),_&&_.inspect&&_.inspect.custom&&(J.exports.prototype[_.inspect.custom]=function(){var f=_.inspect({length:this.length});return this.constructor.name+" "+f})},{"safe-buffer":228,util:71}],220:[function(I,J,P){"use strict";var M=I("process-nextick-args");function u(f,l){var C=this,v=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return v||o?(l?l(f):f&&(!this._writableState||!this._writableState.errorEmitted)&&M.nextTick(D,this,f),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(a){!l&&a?(M.nextTick(D,C,a),C._writableState&&(C._writableState.errorEmitted=!0)):l&&l(a)}),this)}function _(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function D(f,l){f.emit("error",l)}J.exports={destroy:u,undestroy:_}},{"process-nextick-args":207}],221:[function(I,J,P){"use strict";J.exports=I("events").EventEmitter},{events:192}],222:[function(I,J,P){J.exports=I("./readable").PassThrough},{"./readable":223}],223:[function(I,J,P){P=J.exports=I("./lib/_stream_readable.js"),P.Stream=P,P.Readable=P,P.Writable=I("./lib/_stream_writable.js"),P.Duplex=I("./lib/_stream_duplex.js"),P.Transform=I("./lib/_stream_transform.js"),P.PassThrough=I("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":214,"./lib/_stream_passthrough.js":215,"./lib/_stream_readable.js":216,"./lib/_stream_transform.js":217,"./lib/_stream_writable.js":218}],224:[function(I,J,P){J.exports=I("./readable").Transform},{"./readable":223}],225:[function(I,J,P){J.exports=I("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":218}],226:[function(I,J,P){var M=function(){return this}()||Function("return this")(),u=M.regeneratorRuntime&&Object.getOwnPropertyNames(M).indexOf("regeneratorRuntime")>=0,_=u&&M.regeneratorRuntime;if(M.regeneratorRuntime=void 0,J.exports=I("./runtime"),u)M.regeneratorRuntime=_;else try{delete M.regeneratorRuntime}catch(D){M.regeneratorRuntime=void 0}},{"./runtime":227}],227:[function(I,J,P){!function(M){"use strict";var u=Object.prototype,_=u.hasOwnProperty,D,f=typeof Symbol=="function"?Symbol:{},l=f.iterator||"@@iterator",C=f.asyncIterator||"@@asyncIterator",v=f.toStringTag||"@@toStringTag",o=typeof J=="object",a=M.regeneratorRuntime;if(a){o&&(J.exports=a);return}a=M.regeneratorRuntime=o?J.exports:{};function r(K,W,G,F){var B=W&&W.prototype instanceof n?W:n,H=Object.create(B.prototype),q=new j(F||[]);return H._invoke=E(K,G,q),H}a.wrap=r;function h(K,W,G){try{return{type:"normal",arg:K.call(W,G)}}catch(F){return{type:"throw",arg:F}}}var m="suspendedStart",p="suspendedYield",w="executing",g="completed",c={};function n(){}function s(){}function d(){}var S={};S[l]=function(){return this};var y=Object.getPrototypeOf,i=y&&y(y(L([])));i&&i!==u&&_.call(i,l)&&(S=i);var k=d.prototype=n.prototype=Object.create(S);s.prototype=k.constructor=d,d.constructor=s,d[v]=s.displayName="GeneratorFunction";function O(K){["next","throw","return"].forEach(function(W){K[W]=function(G){return this._invoke(W,G)}})}a.isGeneratorFunction=function(K){var W=typeof K=="function"&&K.constructor;return W?W===s||(W.displayName||W.name)==="GeneratorFunction":!1},a.mark=function(K){return Object.setPrototypeOf?Object.setPrototypeOf(K,d):(K.__proto__=d,v in K||(K[v]="GeneratorFunction")),K.prototype=Object.create(k),K},a.awrap=function(K){return{__await:K}};function b(K){function W(B,H,q,re){var ee=h(K[B],K,H);if(ee.type==="throw")re(ee.arg);else{var Ce=ee.arg,Ee=Ce.value;return Ee&&typeof Ee=="object"&&_.call(Ee,"__await")?Promise.resolve(Ee.__await).then(function(pe){W("next",pe,q,re)},function(pe){W("throw",pe,q,re)}):Promise.resolve(Ee).then(function(pe){Ce.value=pe,q(Ce)},re)}}var G;function F(B,H){function q(){return new Promise(function(re,ee){W(B,H,re,ee)})}return G=G?G.then(q,q):q()}this._invoke=F}O(b.prototype),b.prototype[C]=function(){return this},a.AsyncIterator=b,a.async=function(K,W,G,F){var B=new b(r(K,W,G,F));return a.isGeneratorFunction(W)?B:B.next().then(function(H){return H.done?H.value:B.next()})};function E(K,W,G){var F=m;return function(H,q){if(F===w)throw new Error("Generator is already running");if(F===g){if(H==="throw")throw q;return V()}for(G.method=H,G.arg=q;;){var re=G.delegate;if(re){var ee=x(re,G);if(ee){if(ee===c)continue;return ee}}if(G.method==="next")G.sent=G._sent=G.arg;else if(G.method==="throw"){if(F===m)throw F=g,G.arg;G.dispatchException(G.arg)}else G.method==="return"&&G.abrupt("return",G.arg);F=w;var Ce=h(K,W,G);if(Ce.type==="normal"){if(F=G.done?g:p,Ce.arg===c)continue;return{value:Ce.arg,done:G.done}}else Ce.type==="throw"&&(F=g,G.method="throw",G.arg=Ce.arg)}}}function x(K,W){var G=K.iterator[W.method];if(G===D){if(W.delegate=null,W.method==="throw"){if(K.iterator.return&&(W.method="return",W.arg=D,x(K,W),W.method==="throw"))return c;W.method="throw",W.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var F=h(G,K.iterator,W.arg);if(F.type==="throw")return W.method="throw",W.arg=F.arg,W.delegate=null,c;var B=F.arg;if(!B)return W.method="throw",W.arg=new TypeError("iterator result is not an object"),W.delegate=null,c;if(B.done)W[K.resultName]=B.value,W.next=K.nextLoc,W.method!=="return"&&(W.method="next",W.arg=D);else return B;return W.delegate=null,c}O(k),k[v]="Generator",k[l]=function(){return this},k.toString=function(){return"[object Generator]"};function T(K){var W={tryLoc:K[0]};1 in K&&(W.catchLoc=K[1]),2 in K&&(W.finallyLoc=K[2],W.afterLoc=K[3]),this.tryEntries.push(W)}function N(K){var W=K.completion||{};W.type="normal",delete W.arg,K.completion=W}function j(K){this.tryEntries=[{tryLoc:"root"}],K.forEach(T,this),this.reset(!0)}a.keys=function(K){var W=[];for(var G in K)W.push(G);return W.reverse(),function F(){for(;W.length;){var B=W.pop();if(B in K)return F.value=B,F.done=!1,F}return F.done=!0,F}};function L(K){if(K){var W=K[l];if(W)return W.call(K);if(typeof K.next=="function")return K;if(!isNaN(K.length)){var G=-1,F=function B(){for(;++G=0;--F){var B=this.tryEntries[F],H=B.completion;if(B.tryLoc==="root")return G("end");if(B.tryLoc<=this.prev){var q=_.call(B,"catchLoc"),re=_.call(B,"finallyLoc");if(q&&re){if(this.prev=0;--G){var F=this.tryEntries[G];if(F.tryLoc<=this.prev&&_.call(F,"finallyLoc")&&this.prev=0;--W){var G=this.tryEntries[W];if(G.finallyLoc===K)return this.complete(G.completion,G.afterLoc),N(G),c}},catch:function(K){for(var W=this.tryEntries.length-1;W>=0;--W){var G=this.tryEntries[W];if(G.tryLoc===K){var F=G.completion;if(F.type==="throw"){var B=F.arg;N(G)}return B}}throw new Error("illegal catch attempt")},delegateYield:function(K,W,G){return this.delegate={iterator:L(K),resultName:W,nextLoc:G},this.method==="next"&&(this.arg=D),c}}}(function(){return this}()||Function("return this")())},{}],228:[function(I,J,P){var M=I("buffer"),u=M.Buffer;function _(f,l){for(var C in f)l[C]=f[C]}u.from&&u.alloc&&u.allocUnsafe&&u.allocUnsafeSlow?J.exports=M:(_(M,P),P.Buffer=D);function D(f,l,C){return u(f,l,C)}_(u,D),D.from=function(f,l,C){if(typeof f=="number")throw new TypeError("Argument must not be a number");return u(f,l,C)},D.alloc=function(f,l,C){if(typeof f!="number")throw new TypeError("Argument must be a number");var v=u(f);return l!==void 0?typeof C=="string"?v.fill(l,C):v.fill(l):v.fill(0),v},D.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return u(f)},D.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return M.SlowBuffer(f)}},{buffer:73}],229:[function(I,J,P){(function(M){"use strict";var u=I("babel-runtime/core-js/string/from-code-point"),_=p(u),D=I("babel-runtime/core-js/json/stringify"),f=p(D),l=I("babel-runtime/helpers/typeof"),C=p(l),v=I("babel-runtime/core-js/object/define-property"),o=p(v),a=I("babel-runtime/core-js/object/keys"),r=p(a),h=I("babel-runtime/core-js/object/create"),m=p(h);function p(w){return w&&w.__esModule?w:{default:w}}(function(w){w.parser=function(Y,Z){return new c(Y,Z)},w.SAXParser=c,w.SAXStream=k,w.createStream=i,w.MAX_BUFFER_LENGTH=64*1024;var g=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];w.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function c(Y,Z){if(!(this instanceof c))return new c(Y,Z);var be=this;s(be),be.q=be.c="",be.bufferCheckPosition=w.MAX_BUFFER_LENGTH,be.opt=Z||{},be.opt.lowercase=be.opt.lowercase||be.opt.lowercasetags,be.looseCase=be.opt.lowercase?"toLowerCase":"toUpperCase",be.tags=[],be.closed=be.closedRoot=be.sawRoot=!1,be.tag=be.error=null,be.strict=!!Y,be.noscript=!!(Y||be.opt.noscript),be.state=H.BEGIN,be.strictEntities=be.opt.strictEntities,be.ENTITIES=be.strictEntities?(0,m.default)(w.XML_ENTITIES):(0,m.default)(w.ENTITIES),be.attribList=[],be.opt.xmlns&&(be.ns=(0,m.default)(T)),be.trackPosition=be.opt.position!==!1,be.trackPosition&&(be.position=be.line=be.column=0),re(be,"onready")}m.default||(Object.create=function(Y){function Z(){}Z.prototype=Y;var be=new Z;return be}),r.default||(Object.keys=function(Y){var Z=[];for(var be in Y)Y.hasOwnProperty(be)&&Z.push(be);return Z});function n(Y){for(var Z=Math.max(w.MAX_BUFFER_LENGTH,10),be=0,ge=0,Re=g.length;geZ)switch(g[ge]){case"textNode":Ce(Y);break;case"cdata":ee(Y,"oncdata",Y.cdata),Y.cdata="";break;case"script":ee(Y,"onscript",Y.script),Y.script="";break;default:pe(Y,"Max buffer length exceeded: "+g[ge])}be=Math.max(be,Ze)}var qe=w.MAX_BUFFER_LENGTH-be;Y.bufferCheckPosition=qe+Y.position}function s(Y){for(var Z=0,be=g.length;Z"||K(Y)}function F(Y,Z){return Y.test(Z)}function B(Y,Z){return!F(Y,Z)}var H=0;w.STATE={BEGIN:H++,BEGIN_WHITESPACE:H++,TEXT:H++,TEXT_ENTITY:H++,OPEN_WAKA:H++,SGML_DECL:H++,SGML_DECL_QUOTED:H++,DOCTYPE:H++,DOCTYPE_QUOTED:H++,DOCTYPE_DTD:H++,DOCTYPE_DTD_QUOTED:H++,COMMENT_STARTING:H++,COMMENT:H++,COMMENT_ENDING:H++,COMMENT_ENDED:H++,CDATA:H++,CDATA_ENDING:H++,CDATA_ENDING_2:H++,PROC_INST:H++,PROC_INST_BODY:H++,PROC_INST_ENDING:H++,OPEN_TAG:H++,OPEN_TAG_SLASH:H++,ATTRIB:H++,ATTRIB_NAME:H++,ATTRIB_NAME_SAW_WHITE:H++,ATTRIB_VALUE:H++,ATTRIB_VALUE_QUOTED:H++,ATTRIB_VALUE_CLOSED:H++,ATTRIB_VALUE_UNQUOTED:H++,ATTRIB_VALUE_ENTITY_Q:H++,ATTRIB_VALUE_ENTITY_U:H++,CLOSE_TAG:H++,CLOSE_TAG_SAW_WHITE:H++,SCRIPT:H++,SCRIPT_ENDING:H++},w.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},w.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},(0,r.default)(w.ENTITIES).forEach(function(Y){var Z=w.ENTITIES[Y],be=typeof Z=="number"?String.fromCharCode(Z):Z;w.ENTITIES[Y]=be});for(var q in w.STATE)w.STATE[w.STATE[q]]=q;H=w.STATE;function re(Y,Z,be){Y[Z]&&Y[Z](be)}function ee(Y,Z,be){Y.textNode&&Ce(Y),re(Y,Z,be)}function Ce(Y){Y.textNode=Ee(Y.opt,Y.textNode),Y.textNode&&re(Y,"ontext",Y.textNode),Y.textNode=""}function Ee(Y,Z){return Y.trim&&(Z=Z.trim()),Y.normalize&&(Z=Z.replace(/\s+/g," ")),Z}function pe(Y,Z){return Ce(Y),Y.trackPosition&&(Z+=` Line: `+Y.line+` Column: `+Y.column+` Char: `+Y.c),Z=new Error(Z),Y.error=Z,re(Y,"onerror",Z),Y}function Me(Y){return Y.sawRoot&&!Y.closedRoot&&_e(Y,"Unclosed root tag"),Y.state!==H.BEGIN&&Y.state!==H.BEGIN_WHITESPACE&&Y.state!==H.TEXT&&pe(Y,"Unexpected end"),Ce(Y),Y.c="",Y.closed=!0,re(Y,"onend"),c.call(Y,Y.strict,Y.opt),Y}function _e(Y,Z){if((typeof Y=="undefined"?"undefined":(0,C.default)(Y))!=="object"||!(Y instanceof c))throw new Error("bad call to strictFail");Y.strict&&pe(Y,Z)}function he(Y){Y.strict||(Y.tagName=Y.tagName[Y.looseCase]());var Z=Y.tags[Y.tags.length-1]||Y,be=Y.tag={name:Y.tagName,attributes:{}};Y.opt.xmlns&&(be.ns=Z.ns),Y.attribList.length=0,ee(Y,"onopentagstart",be)}function ce(Y,Z){var be=Y.indexOf(":"),ge=be<0?["",Y]:Y.split(":"),Re=ge[0],Ze=ge[1];return Z&&Y==="xmlns"&&(Re="xmlns",Ze=""),{prefix:Re,local:Ze}}function oe(Y){if(Y.strict||(Y.attribName=Y.attribName[Y.looseCase]()),Y.attribList.indexOf(Y.attribName)!==-1||Y.tag.attributes.hasOwnProperty(Y.attribName)){Y.attribName=Y.attribValue="";return}if(Y.opt.xmlns){var Z=ce(Y.attribName,!0),be=Z.prefix,ge=Z.local;if(be==="xmlns")if(ge==="xml"&&Y.attribValue!==E)_e(Y,"xml: prefix must be bound to "+E+` Actual: `+Y.attribValue);else if(ge==="xmlns"&&Y.attribValue!==x)_e(Y,"xmlns: prefix must be bound to "+x+` Actual: `+Y.attribValue);else{var Re=Y.tag,Ze=Y.tags[Y.tags.length-1]||Y;Re.ns===Ze.ns&&(Re.ns=(0,m.default)(Ze.ns)),Re.ns[ge]=Y.attribValue}Y.attribList.push([Y.attribName,Y.attribValue])}else Y.tag.attributes[Y.attribName]=Y.attribValue,ee(Y,"onattribute",{name:Y.attribName,value:Y.attribValue});Y.attribName=Y.attribValue=""}function Se(Y,Z){if(Y.opt.xmlns){var be=Y.tag,ge=ce(Y.tagName);be.prefix=ge.prefix,be.local=ge.local,be.uri=be.ns[ge.prefix]||"",be.prefix&&!be.uri&&(_e(Y,"Unbound namespace prefix: "+(0,f.default)(Y.tagName)),be.uri=ge.prefix);var Re=Y.tags[Y.tags.length-1]||Y;be.ns&&Re.ns!==be.ns&&(0,r.default)(be.ns).forEach(function(Je){ee(Y,"onopennamespace",{prefix:Je,uri:be.ns[Je]})});for(var Ze=0,qe=Y.attribList.length;Ze",Y.tagName="",Y.state=H.SCRIPT;return}ee(Y,"onscript",Y.script),Y.script=""}var Z=Y.tags.length,be=Y.tagName;Y.strict||(be=be[Y.looseCase]());for(var ge=be;Z--;){var Re=Y.tags[Z];if(Re.name!==ge)_e(Y,"Unexpected close tag");else break}if(Z<0){_e(Y,"Unmatched closing tag: "+Y.tagName),Y.textNode+="",Y.state=H.TEXT;return}Y.tagName=be;for(var Ze=Y.tags.length;Ze-- >Z;){var qe=Y.tag=Y.tags.pop();Y.tagName=Y.tag.name,ee(Y,"onclosetag",Y.tagName);var et={};for(var nt in qe.ns)et[nt]=qe.ns[nt];var ut=Y.tags[Y.tags.length-1]||Y;Y.opt.xmlns&&qe.ns!==ut.ns&&(0,r.default)(qe.ns).forEach(function(ot){var je=qe.ns[ot];ee(Y,"onclosenamespace",{prefix:ot,uri:je})})}Z===0&&(Y.closedRoot=!0),Y.tagName=Y.attribValue=Y.attribName="",Y.attribList.length=0,Y.state=H.TEXT}function ue(Y){var Z=Y.entity,be=Z.toLowerCase(),ge,Re="";return Y.ENTITIES[Z]?Y.ENTITIES[Z]:Y.ENTITIES[be]?Y.ENTITIES[be]:(Z=be,Z.charAt(0)==="#"&&(Z.charAt(1)==="x"?(Z=Z.slice(2),ge=parseInt(Z,16),Re=ge.toString(16)):(Z=Z.slice(1),ge=parseInt(Z,10),Re=ge.toString(10))),Z=Z.replace(/^0+/,""),isNaN(ge)||Re.toLowerCase()!==Z?(_e(Y,"Invalid character entity"),"&"+Y.entity+";"):(0,_.default)(ge))}function Oe(Y,Z){Z==="<"?(Y.state=H.OPEN_WAKA,Y.startTagPosition=Y.position):K(Z)||(_e(Y,"Non-whitespace before first tag."),Y.textNode=Z,Y.state=H.TEXT)}function le(Y,Z){var be="";return Z"?(ee(Z,"onsgmldeclaration",Z.sgmlDecl),Z.sgmlDecl="",Z.state=H.TEXT):(W(ge)&&(Z.state=H.SGML_DECL_QUOTED),Z.sgmlDecl+=ge);continue;case H.SGML_DECL_QUOTED:ge===Z.q&&(Z.state=H.SGML_DECL,Z.q=""),Z.sgmlDecl+=ge;continue;case H.DOCTYPE:ge===">"?(Z.state=H.TEXT,ee(Z,"ondoctype",Z.doctype),Z.doctype=!0):(Z.doctype+=ge,ge==="["?Z.state=H.DOCTYPE_DTD:W(ge)&&(Z.state=H.DOCTYPE_QUOTED,Z.q=ge));continue;case H.DOCTYPE_QUOTED:Z.doctype+=ge,ge===Z.q&&(Z.q="",Z.state=H.DOCTYPE);continue;case H.DOCTYPE_DTD:Z.doctype+=ge,ge==="]"?Z.state=H.DOCTYPE:W(ge)&&(Z.state=H.DOCTYPE_DTD_QUOTED,Z.q=ge);continue;case H.DOCTYPE_DTD_QUOTED:Z.doctype+=ge,ge===Z.q&&(Z.state=H.DOCTYPE_DTD,Z.q="");continue;case H.COMMENT:ge==="-"?Z.state=H.COMMENT_ENDING:Z.comment+=ge;continue;case H.COMMENT_ENDING:ge==="-"?(Z.state=H.COMMENT_ENDED,Z.comment=Ee(Z.opt,Z.comment),Z.comment&&ee(Z,"oncomment",Z.comment),Z.comment=""):(Z.comment+="-"+ge,Z.state=H.COMMENT);continue;case H.COMMENT_ENDED:ge!==">"?(_e(Z,"Malformed comment"),Z.comment+="--"+ge,Z.state=H.COMMENT):Z.state=H.TEXT;continue;case H.CDATA:ge==="]"?Z.state=H.CDATA_ENDING:Z.cdata+=ge;continue;case H.CDATA_ENDING:ge==="]"?Z.state=H.CDATA_ENDING_2:(Z.cdata+="]"+ge,Z.state=H.CDATA);continue;case H.CDATA_ENDING_2:ge===">"?(Z.cdata&&ee(Z,"oncdata",Z.cdata),ee(Z,"onclosecdata"),Z.cdata="",Z.state=H.TEXT):ge==="]"?Z.cdata+="]":(Z.cdata+="]]"+ge,Z.state=H.CDATA);continue;case H.PROC_INST:ge==="?"?Z.state=H.PROC_INST_ENDING:K(ge)?Z.state=H.PROC_INST_BODY:Z.procInstName+=ge;continue;case H.PROC_INST_BODY:if(!Z.procInstBody&&K(ge))continue;ge==="?"?Z.state=H.PROC_INST_ENDING:Z.procInstBody+=ge;continue;case H.PROC_INST_ENDING:ge===">"?(ee(Z,"onprocessinginstruction",{name:Z.procInstName,body:Z.procInstBody}),Z.procInstName=Z.procInstBody="",Z.state=H.TEXT):(Z.procInstBody+="?"+ge,Z.state=H.PROC_INST_BODY);continue;case H.OPEN_TAG:F(j,ge)?Z.tagName+=ge:(he(Z),ge===">"?Se(Z):ge==="/"?Z.state=H.OPEN_TAG_SLASH:(K(ge)||_e(Z,"Invalid character in tag name"),Z.state=H.ATTRIB));continue;case H.OPEN_TAG_SLASH:ge===">"?(Se(Z,!0),te(Z)):(_e(Z,"Forward-slash in opening tag not followed by >"),Z.state=H.ATTRIB);continue;case H.ATTRIB:if(K(ge))continue;ge===">"?Se(Z):ge==="/"?Z.state=H.OPEN_TAG_SLASH:F(N,ge)?(Z.attribName=ge,Z.attribValue="",Z.state=H.ATTRIB_NAME):_e(Z,"Invalid attribute name");continue;case H.ATTRIB_NAME:ge==="="?Z.state=H.ATTRIB_VALUE:ge===">"?(_e(Z,"Attribute without value"),Z.attribValue=Z.attribName,oe(Z),Se(Z)):K(ge)?Z.state=H.ATTRIB_NAME_SAW_WHITE:F(j,ge)?Z.attribName+=ge:_e(Z,"Invalid attribute name");continue;case H.ATTRIB_NAME_SAW_WHITE:if(ge==="=")Z.state=H.ATTRIB_VALUE;else{if(K(ge))continue;_e(Z,"Attribute without value"),Z.tag.attributes[Z.attribName]="",Z.attribValue="",ee(Z,"onattribute",{name:Z.attribName,value:""}),Z.attribName="",ge===">"?Se(Z):F(N,ge)?(Z.attribName=ge,Z.state=H.ATTRIB_NAME):(_e(Z,"Invalid attribute name"),Z.state=H.ATTRIB)}continue;case H.ATTRIB_VALUE:if(K(ge))continue;W(ge)?(Z.q=ge,Z.state=H.ATTRIB_VALUE_QUOTED):(_e(Z,"Unquoted attribute value"),Z.state=H.ATTRIB_VALUE_UNQUOTED,Z.attribValue=ge);continue;case H.ATTRIB_VALUE_QUOTED:if(ge!==Z.q){ge==="&"?Z.state=H.ATTRIB_VALUE_ENTITY_Q:Z.attribValue+=ge;continue}oe(Z),Z.q="",Z.state=H.ATTRIB_VALUE_CLOSED;continue;case H.ATTRIB_VALUE_CLOSED:K(ge)?Z.state=H.ATTRIB:ge===">"?Se(Z):ge==="/"?Z.state=H.OPEN_TAG_SLASH:F(N,ge)?(_e(Z,"No whitespace between attributes"),Z.attribName=ge,Z.attribValue="",Z.state=H.ATTRIB_NAME):_e(Z,"Invalid attribute name");continue;case H.ATTRIB_VALUE_UNQUOTED:if(!G(ge)){ge==="&"?Z.state=H.ATTRIB_VALUE_ENTITY_U:Z.attribValue+=ge;continue}oe(Z),ge===">"?Se(Z):Z.state=H.ATTRIB;continue;case H.CLOSE_TAG:if(Z.tagName)ge===">"?te(Z):F(j,ge)?Z.tagName+=ge:Z.script?(Z.script+=""?te(Z):_e(Z,"Invalid characters in closing tag");continue;case H.TEXT_ENTITY:case H.ATTRIB_VALUE_ENTITY_Q:case H.ATTRIB_VALUE_ENTITY_U:var qe,et;switch(Z.state){case H.TEXT_ENTITY:qe=H.TEXT,et="textNode";break;case H.ATTRIB_VALUE_ENTITY_Q:qe=H.ATTRIB_VALUE_QUOTED,et="attribValue";break;case H.ATTRIB_VALUE_ENTITY_U:qe=H.ATTRIB_VALUE_UNQUOTED,et="attribValue";break}ge===";"?(Z[et]+=ue(Z),Z.entity="",Z.state=qe):F(Z.entity.length?V:L,ge)?Z.entity+=ge:(_e(Z,"Invalid character in entity name"),Z[et]+="&"+Z.entity+ge,Z.entity="",Z.state=qe);continue;default:throw new Error(Z,"Unknown state: "+Z.state)}}return Z.position>=Z.bufferCheckPosition&&n(Z),Z}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */_.default||function(){var Y=String.fromCharCode,Z=Math.floor,be=function(){var Re=16384,Ze=[],qe,et,nt=-1,ut=arguments.length;if(!ut)return"";for(var ot="";++nt1114111||Z(je)!==je)throw RangeError("Invalid code point: "+je);je<=65535?Ze.push(je):(je-=65536,qe=(je>>10)+55296,et=je%1024+56320,Ze.push(qe,et)),(nt+1===ut||Ze.length>Re)&&(ot+=Y.apply(null,Ze),Ze.length=0)}return ot};o.default?Object.defineProperty(String,"fromCodePoint",{value:be,configurable:!0,writable:!0}):String.fromCodePoint=be}()})(typeof P=="undefined"?(void 0).sax={}:P)}).call(this,I("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/define-property":56,"babel-runtime/core-js/object/keys":60,"babel-runtime/core-js/string/from-code-point":63,"babel-runtime/helpers/typeof":67,buffer:73,stream:230,string_decoder:72}],230:[function(I,J,P){J.exports=_;var M=I("events").EventEmitter,u=I("inherits");u(_,M),_.Readable=I("readable-stream/readable.js"),_.Writable=I("readable-stream/writable.js"),_.Duplex=I("readable-stream/duplex.js"),_.Transform=I("readable-stream/transform.js"),_.PassThrough=I("readable-stream/passthrough.js"),_.Stream=_;function _(){M.call(this)}_.prototype.pipe=function(D,f){var l=this;function C(p){D.writable&&(D.write(p)===!1&&l.pause&&l.pause())}l.on("data",C);function v(){l.readable&&l.resume&&l.resume()}D.on("drain",v),!D._isStdio&&(!f||f.end!==!1)&&(l.on("end",a),l.on("close",r));var o=!1;function a(){if(o)return;o=!0,D.end()}function r(){if(o)return;o=!0,typeof D.destroy=="function"&&D.destroy()}function h(p){if(m(),M.listenerCount(this,"error")===0)throw p}l.on("error",h),D.on("error",h);function m(){l.removeListener("data",C),D.removeListener("drain",v),l.removeListener("end",a),l.removeListener("close",r),l.removeListener("error",h),D.removeListener("error",h),l.removeListener("end",m),l.removeListener("close",m),D.removeListener("close",m)}return l.on("end",m),l.on("close",m),D.on("close",m),D.emit("pipe",l),D}},{events:192,inherits:196,"readable-stream/duplex.js":213,"readable-stream/passthrough.js":222,"readable-stream/readable.js":223,"readable-stream/transform.js":224,"readable-stream/writable.js":225}],231:[function(I,J,P){(function(M){var u=I("./lib/request"),_=I("./lib/response"),D=I("xtend"),f=I("builtin-status-codes"),l=I("url"),C=P;C.request=function(v,o){typeof v=="string"?v=l.parse(v):v=D(v);var a=M.location.protocol.search(/^https?:$/)===-1?"http:":"",r=v.protocol||a,h=v.hostname||v.host,m=v.port,p=v.path||"/";h&&h.indexOf(":")!==-1&&(h="["+h+"]"),v.url=(h?r+"//"+h:"")+(m?":"+m:"")+p,v.method=(v.method||"GET").toUpperCase(),v.headers=v.headers||{};var w=new u(v);return o&&w.on("response",o),w},C.get=function(o,a){var r=C.request(o,a);return r.end(),r},C.ClientRequest=u,C.IncomingMessage=_.IncomingMessage,C.Agent=function(){},C.Agent.defaultMaxSockets=4,C.globalAgent=new C.Agent,C.STATUS_CODES=f,C.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":233,"./lib/response":234,"builtin-status-codes":74,url:238,xtend:283}],232:[function(I,J,P){(function(M){"use strict";P.fetch=C(M.fetch)&&C(M.ReadableStream),P.writableStream=C(M.WritableStream),P.abortController=C(M.AbortController),P.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),P.blobConstructor=!0}catch(v){}var u;function _(){if(u!==void 0)return u;if(M.XMLHttpRequest){u=new M.XMLHttpRequest;try{u.open("GET",M.XDomainRequest?"/":"https://example.com")}catch(v){u=null}}else u=null;return u}function D(v){var o=_();if(!o)return!1;try{return o.responseType=v,o.responseType===v}catch(a){}return!1}var f=typeof M.ArrayBuffer!="undefined",l=f&&C(M.ArrayBuffer.prototype.slice);P.arraybuffer=P.fetch||f&&D("arraybuffer"),P.msstream=!P.fetch&&l&&D("ms-stream"),P.mozchunkedarraybuffer=!P.fetch&&f&&D("moz-chunked-arraybuffer"),P.overrideMimeType=P.fetch||(_()?C(_().overrideMimeType):!1),P.vbArray=C(M.VBArray);function C(v){return typeof v=="function"}u=null}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],233:[function(I,J,P){(function(M,u,_){"use strict";var D=I("babel-runtime/core-js/object/keys"),f=l(D);function l(n){return n&&n.__esModule?n:{default:n}}var C=I("./capability"),v=I("inherits"),o=I("./response"),a=I("readable-stream"),r=I("to-arraybuffer"),h=o.IncomingMessage,m=o.readyStates;function p(n,s){return C.fetch&&s?"fetch":C.mozchunkedarraybuffer?"moz-chunked-arraybuffer":C.msstream?"ms-stream":C.arraybuffer&&n?"arraybuffer":C.vbArray&&n?"text:vbarray":"text"}var w=J.exports=function(n){var s=this;a.Writable.call(s),s._opts=n,s._body=[],s._headers={},n.auth&&s.setHeader("Authorization","Basic "+new _(n.auth).toString("base64")),(0,f.default)(n.headers).forEach(function(y){s.setHeader(y,n.headers[y])});var d,S=!0;if(n.mode==="disable-fetch"||"requestTimeout"in n&&!C.abortController)S=!1,d=!0;else if(n.mode==="prefer-streaming")d=!1;else if(n.mode==="allow-wrong-content-type")d=!C.overrideMimeType;else if(!n.mode||n.mode==="default"||n.mode==="prefer-fast")d=!0;else throw new Error("Invalid value for opts.mode");s._mode=p(d,S),s._fetchTimer=null,s.on("finish",function(){s._onFinish()})};v(w,a.Writable),w.prototype.setHeader=function(n,s){var d=this,S=n.toLowerCase();if(c.indexOf(S)!==-1)return;d._headers[S]={name:n,value:s}},w.prototype.getHeader=function(n){var s=this._headers[n.toLowerCase()];return s?s.value:null},w.prototype.removeHeader=function(n){var s=this;delete s._headers[n.toLowerCase()]},w.prototype._onFinish=function(){var n=this;if(n._destroyed)return;var s=n._opts,d=n._headers,S=null;s.method!=="GET"&&s.method!=="HEAD"&&(C.arraybuffer?S=r(_.concat(n._body)):C.blobConstructor?S=new u.Blob(n._body.map(function(E){return r(E)}),{type:(d["content-type"]||{}).value||""}):S=_.concat(n._body).toString());var y=[];if((0,f.default)(d).forEach(function(E){var x=d[E].name,T=d[E].value;Array.isArray(T)?T.forEach(function(N){y.push([x,N])}):y.push([x,T])}),n._mode==="fetch"){var i=null,k=null;if(C.abortController){var O=new AbortController;i=O.signal,n._fetchAbortController=O,"requestTimeout"in s&&s.requestTimeout!==0&&(n._fetchTimer=u.setTimeout(function(){n.emit("requestTimeout"),n._fetchAbortController&&n._fetchAbortController.abort()},s.requestTimeout))}u.fetch(n._opts.url,{method:n._opts.method,headers:y,body:S||void 0,mode:"cors",credentials:s.withCredentials?"include":"same-origin",signal:i}).then(function(E){n._fetchResponse=E,n._connect()},function(E){u.clearTimeout(n._fetchTimer),n._destroyed||n.emit("error",E)})}else{var b=n._xhr=new u.XMLHttpRequest;try{b.open(n._opts.method,n._opts.url,!0)}catch(E){M.nextTick(function(){n.emit("error",E)});return}"responseType"in b&&(b.responseType=n._mode.split(":")[0]),"withCredentials"in b&&(b.withCredentials=!!s.withCredentials),n._mode==="text"&&"overrideMimeType"in b&&b.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in s&&(b.timeout=s.requestTimeout,b.ontimeout=function(){n.emit("requestTimeout")}),y.forEach(function(E){b.setRequestHeader(E[0],E[1])}),n._response=null,b.onreadystatechange=function(){switch(b.readyState){case m.LOADING:case m.DONE:n._onXHRProgress();break}},n._mode==="moz-chunked-arraybuffer"&&(b.onprogress=function(){n._onXHRProgress()}),b.onerror=function(){if(n._destroyed)return;n.emit("error",new Error("XHR error"))};try{b.send(S)}catch(E){M.nextTick(function(){n.emit("error",E)});return}}};function g(n){try{var s=n.status;return s!==null&&s!==0}catch(d){return!1}}w.prototype._onXHRProgress=function(){var n=this;if(!g(n._xhr)||n._destroyed)return;n._response||n._connect(),n._response._onXHRProgress()},w.prototype._connect=function(){var n=this;if(n._destroyed)return;n._response=new h(n._xhr,n._fetchResponse,n._mode,n._fetchTimer),n._response.on("error",function(s){n.emit("error",s)}),n.emit("response",n._response)},w.prototype._write=function(n,s,d){var S=this;S._body.push(n),d()},w.prototype.abort=w.prototype.destroy=function(){var n=this;n._destroyed=!0,u.clearTimeout(n._fetchTimer),n._response&&(n._response._destroyed=!0),n._xhr?n._xhr.abort():n._fetchAbortController&&n._fetchAbortController.abort()},w.prototype.end=function(n,s,d){var S=this;typeof n=="function"&&(d=n,n=void 0),a.Writable.prototype.end.call(S,n,s,d)},w.prototype.flushHeaders=function(){},w.prototype.setTimeout=function(){},w.prototype.setNoDelay=function(){},w.prototype.setSocketKeepAlive=function(){};var c=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},I("buffer").Buffer)},{"./capability":232,"./response":234,_process:208,"babel-runtime/core-js/object/keys":60,buffer:73,inherits:196,"readable-stream":223,"to-arraybuffer":237}],234:[function(I,J,P){(function(M,u,_){"use strict";var D=I("babel-runtime/core-js/promise"),f=l(D);function l(h){return h&&h.__esModule?h:{default:h}}var C=I("./capability"),v=I("inherits"),o=I("readable-stream"),a=P.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},r=P.IncomingMessage=function(h,m,p,w){var g=this;if(o.Readable.call(g),g._mode=p,g.headers={},g.rawHeaders=[],g.trailers={},g.rawTrailers=[],g.on("end",function(){M.nextTick(function(){g.emit("close")})}),p==="fetch"){var c=function i(){s.read().then(function(k){if(g._destroyed)return;if(k.done){u.clearTimeout(w),g.push(null);return}g.push(new _(k.value)),i()}).catch(function(k){u.clearTimeout(w),g._destroyed||g.emit("error",k)})};if(g._fetchResponse=m,g.url=m.url,g.statusCode=m.status,g.statusMessage=m.statusText,m.headers.forEach(function(i,k){g.headers[k.toLowerCase()]=i,g.rawHeaders.push(k,i)}),C.writableStream){var n=new WritableStream({write:function(k){return new f.default(function(O,b){g._destroyed?b():g.push(new _(k))?O():g._resumeFetch=O})},close:function(){u.clearTimeout(w),g._destroyed||g.push(null)},abort:function(k){g._destroyed||g.emit("error",k)}});try{m.body.pipeTo(n).catch(function(i){u.clearTimeout(w),g._destroyed||g.emit("error",i)});return}catch(i){}}var s=m.body.getReader();c()}else{g._xhr=h,g._pos=0,g.url=h.responseURL,g.statusCode=h.status,g.statusMessage=h.statusText;var d=h.getAllResponseHeaders().split(/\r?\n/);if(d.forEach(function(i){var k=i.match(/^([^:]+):\s*(.*)/);if(k){var O=k[1].toLowerCase();O==="set-cookie"?(g.headers[O]===void 0&&(g.headers[O]=[]),g.headers[O].push(k[2])):g.headers[O]!==void 0?g.headers[O]+=", "+k[2]:g.headers[O]=k[2],g.rawHeaders.push(k[1],k[2])}}),g._charset="x-user-defined",!C.overrideMimeType){var S=g.rawHeaders["mime-type"];if(S){var y=S.match(/;\s*charset=([^;])(;|$)/);y&&(g._charset=y[1].toLowerCase())}g._charset||(g._charset="utf-8")}}};v(r,o.Readable),r.prototype._read=function(){var h=this,m=h._resumeFetch;m&&(h._resumeFetch=null,m())},r.prototype._onXHRProgress=function(){var h=this,m=h._xhr,p=null;switch(h._mode){case"text:vbarray":if(m.readyState!==a.DONE)break;try{p=new u.VBArray(m.responseBody).toArray()}catch(s){}if(p!==null){h.push(new _(p));break}case"text":try{p=m.responseText}catch(s){h._mode="text:vbarray";break}if(p.length>h._pos){var w=p.substr(h._pos);if(h._charset==="x-user-defined"){for(var g=new _(w.length),c=0;ch._pos&&(h.push(new _(new Uint8Array(n.result.slice(h._pos)))),h._pos=n.result.byteLength)},n.onload=function(){h.push(null)},n.readAsArrayBuffer(p);break}h._xhr.readyState===a.DONE&&h._mode!=="ms-stream"&&h.push(null)}}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},I("buffer").Buffer)},{"./capability":232,_process:208,"babel-runtime/core-js/promise":61,buffer:73,inherits:196,"readable-stream":223}],235:[function(I,J,P){"use strict";var M=I("safe-buffer").Buffer,u=M.isEncoding||function(n){n=""+n;switch(n&&n.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _(n){if(!n)return"utf8";for(var s;;)switch(n){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return n;default:if(s)return;n=(""+n).toLowerCase(),s=!0}}function D(n){var s=_(n);if(typeof s!="string"&&(M.isEncoding===u||!u(n)))throw new Error("Unknown encoding: "+n);return s||n}P.StringDecoder=f;function f(n){this.encoding=D(n);var s;switch(this.encoding){case"utf16le":this.text=h,this.end=m,s=4;break;case"utf8":this.fillLast=o,s=4;break;case"base64":this.text=p,this.end=w,s=3;break;default:this.write=g,this.end=c;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=M.allocUnsafe(s)}f.prototype.write=function(n){if(n.length===0)return"";var s,d;if(this.lastNeed){if(s=this.fillLast(n),s===void 0)return"";d=this.lastNeed,this.lastNeed=0}else d=0;return d>5===6?2:n>>4===14?3:n>>3===30?4:n>>6===2?-1:-2}function C(n,s,d){var S=s.length-1;if(S=0?(y>0&&(n.lastNeed=y-1),y):--S=0?(y>0&&(n.lastNeed=y-2),y):--S=0?(y>0&&(y===2?y=0:n.lastNeed=y-3),y):0))}function v(n,s,d){if((s[0]&192)!==128)return n.lastNeed=0,"\uFFFD";if(n.lastNeed>1&&s.length>1){if((s[1]&192)!==128)return n.lastNeed=1,"\uFFFD";if(n.lastNeed>2&&s.length>2&&(s[2]&192)!==128)return n.lastNeed=2,"\uFFFD"}}function o(n){var s=this.lastTotal-this.lastNeed,d=v(this,n,s);if(d!==void 0)return d;if(this.lastNeed<=n.length)return n.copy(this.lastChar,s,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,s,0,n.length),this.lastNeed-=n.length}function a(n,s){var d=C(this,n,s);if(!this.lastNeed)return n.toString("utf8",s);this.lastTotal=d;var S=n.length-(d-this.lastNeed);return n.copy(this.lastChar,0,S),n.toString("utf8",s,S)}function r(n){var s=n&&n.length?this.write(n):"";return this.lastNeed?s+"\uFFFD":s}function h(n,s){if((n.length-s)%2===0){var d=n.toString("utf16le",s);if(d){var S=d.charCodeAt(d.length-1);if(S>=55296&&S<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],d.slice(0,-1)}return d}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",s,n.length-1)}function m(n){var s=n&&n.length?this.write(n):"";if(this.lastNeed){var d=this.lastTotal-this.lastNeed;return s+this.lastChar.toString("utf16le",0,d)}return s}function p(n,s){var d=(n.length-s)%3;return d===0?n.toString("base64",s):(this.lastNeed=3-d,this.lastTotal=3,d===1?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",s,n.length-d))}function w(n){var s=n&&n.length?this.write(n):"";return this.lastNeed?s+this.lastChar.toString("base64",0,3-this.lastNeed):s}function g(n){return n.toString(this.encoding)}function c(n){return n&&n.length?this.write(n):""}},{"safe-buffer":228}],236:[function(I,J,P){(function(M,u){var _=I("process/browser.js").nextTick,D=Function.prototype.apply,f=Array.prototype.slice,l={},C=0;P.setTimeout=function(){return new v(D.call(setTimeout,window,arguments),clearTimeout)},P.setInterval=function(){return new v(D.call(setInterval,window,arguments),clearInterval)},P.clearTimeout=P.clearInterval=function(o){o.close()};function v(o,a){this._id=o,this._clearFn=a}v.prototype.unref=v.prototype.ref=function(){},v.prototype.close=function(){this._clearFn.call(window,this._id)},P.enroll=function(o,a){clearTimeout(o._idleTimeoutId),o._idleTimeout=a},P.unenroll=function(o){clearTimeout(o._idleTimeoutId),o._idleTimeout=-1},P._unrefActive=P.active=function(o){clearTimeout(o._idleTimeoutId);var a=o._idleTimeout;a>=0&&(o._idleTimeoutId=setTimeout(function(){o._onTimeout&&o._onTimeout()},a))},P.setImmediate=typeof M=="function"?M:function(o){var a=C++,r=arguments.length<2?!1:f.call(arguments,1);return l[a]=!0,_(function(){l[a]&&(r?o.apply(null,r):o.call(null),P.clearImmediate(a))}),a},P.clearImmediate=typeof u=="function"?u:function(o){delete l[o]}}).call(this,I("timers").setImmediate,I("timers").clearImmediate)},{"process/browser.js":208,timers:236}],237:[function(I,J,P){var M=I("buffer").Buffer;J.exports=function(u){if(u instanceof Uint8Array){if(u.byteOffset===0&&u.byteLength===u.buffer.byteLength)return u.buffer;if(typeof u.buffer.slice=="function")return u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)}if(M.isBuffer(u)){for(var _=new Uint8Array(u.length),D=u.length,f=0;f",'"',"`"," ","\r",` `," "],v=["{","}","|","\\","^","`"].concat(C),o=["'"].concat(v),a=["%","/","?",";","#"].concat(o),r=["/","?","#"],h=255,m=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,w={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},c={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},n=I("querystring");function s(i,k,O){if(i&&u.isObject(i)&&i instanceof _)return i;var b=new _;return b.parse(i,k,O),b}_.prototype.parse=function(i,k,O){if(!u.isString(i))throw new TypeError("Parameter 'url' must be a string, not "+typeof i);var b=i.indexOf("?"),E=b!==-1&&b127?Ee+="x":Ee+=Ce[pe];if(!Ee.match(m)){var _e=re.slice(0,G),he=re.slice(G+1),ce=Ce.match(p);ce&&(_e.push(ce[1]),he.unshift(ce[2])),he.length&&(N="/"+he.join(".")+N),this.hostname=_e.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),q||(this.hostname=M.toASCII(this.hostname));var oe=this.port?":"+this.port:"",Se=this.hostname||"";this.host=Se+oe,this.href+=this.host,q&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),N[0]!=="/"&&(N="/"+N))}if(!w[V])for(var G=0,ee=o.length;G0?O.host.split("@"):!1;Ee&&(O.auth=Ee.shift(),O.host=O.hostname=Ee.shift())}return O.search=i.search,O.query=i.query,(!u.isNull(O.pathname)||!u.isNull(O.search))&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.href=O.format(),O}if(!re.length)return O.pathname=null,O.search?O.path="/"+O.search:O.path=null,O.href=O.format(),O;for(var pe=re.slice(-1)[0],Me=(O.host||i.host||re.length>1)&&(pe==="."||pe==="..")||pe==="",_e=0,he=re.length;he>=0;he--)pe=re[he],pe==="."?re.splice(he,1):pe===".."?(re.splice(he,1),_e++):_e&&(re.splice(he,1),_e--);if(!H&&!q)for(;_e--;_e)re.unshift("..");H&&re[0]!==""&&(!re[0]||re[0].charAt(0)!=="/")&&re.unshift(""),Me&&re.join("/").substr(-1)!=="/"&&re.push("");var ce=re[0]===""||re[0]&&re[0].charAt(0)==="/";if(Ce){O.hostname=O.host=ce?"":re.length?re.shift():"";var Ee=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;Ee&&(O.auth=Ee.shift(),O.host=O.hostname=Ee.shift())}return H=H||O.host&&re.length,H&&!ce&&re.unshift(""),re.length?O.pathname=re.join("/"):(O.pathname=null,O.path=null),(!u.isNull(O.pathname)||!u.isNull(O.search))&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.auth=i.auth||O.auth,O.slashes=O.slashes||i.slashes,O.href=O.format(),O},_.prototype.parseHost=function(){var i=this.host,k=f.exec(i);k&&(k=k[0],k!==":"&&(this.port=k.substr(1)),i=i.substr(0,i.length-k.length)),i&&(this.hostname=i)}},{"./util":239,punycode:209,querystring:212}],239:[function(I,J,P){"use strict";J.exports={isString:function(M){return typeof M=="string"},isObject:function(M){return typeof M=="object"&&M!==null},isNull:function(M){return M===null},isNullOrUndefined:function(M){return M==null}}},{}],240:[function(I,J,P){(function(M){J.exports=u;function u(D,f){if(_("noDeprecation"))return D;var l=!1;function C(){if(!l){if(_("throwDeprecation"))throw new Error(f);_("traceDeprecation")?console.trace(f):console.warn(f),l=!0}return D.apply(this,arguments)}return C}function _(D){try{if(!M.localStorage)return!1}catch(l){return!1}var f=M.localStorage[D];return f==null?!1:String(f).toLowerCase()==="true"}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],241:[function(I,J,P){typeof Object.create=="function"?J.exports=function(u,_){u.super_=_,u.prototype=Object.create(_.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}})}:J.exports=function(u,_){u.super_=_;var D=function(){};D.prototype=_.prototype,u.prototype=new D,u.prototype.constructor=u}},{}],242:[function(I,J,P){J.exports=function(u){return u&&typeof u=="object"&&typeof u.copy=="function"&&typeof u.fill=="function"&&typeof u.readUInt8=="function"}},{}],243:[function(I,J,P){(function(M,u){var _=/%[sdj%]/g;P.format=function(W){if(!S(W)){for(var G=[],F=0;F=H)return ee;switch(ee){case"%s":return String(B[F++]);case"%d":return Number(B[F++]);case"%j":try{return JSON.stringify(B[F++])}catch(Ce){return"[Circular]"}default:return ee}}),re=B[F];F=3&&(F.depth=arguments[2]),arguments.length>=4&&(F.colors=arguments[3]),c(G)?F.showHidden=G:G&&P._extend(F,G),i(F.showHidden)&&(F.showHidden=!1),i(F.depth)&&(F.depth=2),i(F.colors)&&(F.colors=!1),i(F.customInspect)&&(F.customInspect=!0),F.colors&&(F.stylize=C),a(F,W,F.depth)}P.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function C(W,G){var F=l.styles[G];return F?"["+l.colors[F][0]+"m"+W+"["+l.colors[F][1]+"m":W}function v(W,G){return W}function o(W){var G={};return W.forEach(function(F,B){G[F]=!0}),G}function a(W,G,F){if(W.customInspect&&G&&x(G.inspect)&&G.inspect!==P.inspect&&!(G.constructor&&G.constructor.prototype===G)){var B=G.inspect(F,W);return S(B)||(B=a(W,B,F)),B}var H=r(W,G);if(H)return H;var q=Object.keys(G),re=o(q);if(W.showHidden&&(q=Object.getOwnPropertyNames(G)),E(G)&&(q.indexOf("message")>=0||q.indexOf("description")>=0))return h(G);if(q.length===0){if(x(G)){var ee=G.name?": "+G.name:"";return W.stylize("[Function"+ee+"]","special")}if(k(G))return W.stylize(RegExp.prototype.toString.call(G),"regexp");if(b(G))return W.stylize(Date.prototype.toString.call(G),"date");if(E(G))return h(G)}var Ce="",Ee=!1,pe=["{","}"];if(g(G)&&(Ee=!0,pe=["[","]"]),x(G)){var Me=G.name?": "+G.name:"";Ce=" [Function"+Me+"]"}if(k(G)&&(Ce=" "+RegExp.prototype.toString.call(G)),b(G)&&(Ce=" "+Date.prototype.toUTCString.call(G)),E(G)&&(Ce=" "+h(G)),q.length===0&&(!Ee||G.length==0))return pe[0]+Ce+pe[1];if(F<0)return k(G)?W.stylize(RegExp.prototype.toString.call(G),"regexp"):W.stylize("[Object]","special");W.seen.push(G);var _e;return Ee?_e=m(W,G,F,re,q):_e=q.map(function(he){return p(W,G,F,re,he,Ee)}),W.seen.pop(),w(_e,Ce,pe)}function r(W,G){if(i(G))return W.stylize("undefined","undefined");if(S(G)){var F="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return W.stylize(F,"string")}if(d(G))return W.stylize(""+G,"number");if(c(G))return W.stylize(""+G,"boolean");if(n(G))return W.stylize("null","null")}function h(W){return"["+Error.prototype.toString.call(W)+"]"}function m(W,G,F,B,H){for(var q=[],re=0,ee=G.length;re-1&&(q?ee=ee.split(` `).map(function(Ee){return" "+Ee}).join(` `).substr(2):ee=` `+ee.split(` `).map(function(Ee){return" "+Ee}).join(` `))):ee=W.stylize("[Circular]","special")),i(re)){if(q&&H.match(/^\d+$/))return ee;re=JSON.stringify(""+H),re.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(re=re.substr(1,re.length-2),re=W.stylize(re,"name")):(re=re.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),re=W.stylize(re,"string"))}return re+": "+ee}function w(W,G,F){var B=0,H=W.reduce(function(q,re){return B++,re.indexOf(` `)>=0&&B++,q+re.replace(/\u001b\[\d\d?m/g,"").length+1},0);return H>60?F[0]+(G===""?"":G+` `)+" "+W.join(`, `)+" "+F[1]:F[0]+G+" "+W.join(", ")+" "+F[1]}function g(W){return Array.isArray(W)}P.isArray=g;function c(W){return typeof W=="boolean"}P.isBoolean=c;function n(W){return W===null}P.isNull=n;function s(W){return W==null}P.isNullOrUndefined=s;function d(W){return typeof W=="number"}P.isNumber=d;function S(W){return typeof W=="string"}P.isString=S;function y(W){return typeof W=="symbol"}P.isSymbol=y;function i(W){return W===void 0}P.isUndefined=i;function k(W){return O(W)&&N(W)==="[object RegExp]"}P.isRegExp=k;function O(W){return typeof W=="object"&&W!==null}P.isObject=O;function b(W){return O(W)&&N(W)==="[object Date]"}P.isDate=b;function E(W){return O(W)&&(N(W)==="[object Error]"||W instanceof Error)}P.isError=E;function x(W){return typeof W=="function"}P.isFunction=x;function T(W){return W===null||typeof W=="boolean"||typeof W=="number"||typeof W=="string"||typeof W=="symbol"||typeof W=="undefined"}P.isPrimitive=T,P.isBuffer=I("./support/isBuffer");function N(W){return Object.prototype.toString.call(W)}function j(W){return W<10?"0"+W.toString(10):W.toString(10)}var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var W=new Date,G=[j(W.getHours()),j(W.getMinutes()),j(W.getSeconds())].join(":");return[W.getDate(),L[W.getMonth()],G].join(" ")}P.log=function(){console.log("%s - %s",V(),P.format.apply(P,arguments))},P.inherits=I("inherits"),P._extend=function(W,G){if(!G||!O(G))return W;for(var F=Object.keys(G),B=F.length;B--;)W[F[B]]=G[F[B]];return W};function K(W,G){return Object.prototype.hasOwnProperty.call(W,G)}}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":242,_process:208,inherits:241}],244:[function(I,J,P){"use strict";(function(){"use strict";P.stripBOM=function(M){return M[0]==="\uFEFF"?M.substring(1):M}}).call(void 0)},{}],245:[function(I,J,P){"use strict";var M=I("babel-runtime/helpers/typeof"),u=f(M),_=I("babel-runtime/core-js/object/keys"),D=f(_);function f(l){return l&&l.__esModule?l:{default:l}}(function(){"use strict";var l,C,v,o,a,r={}.hasOwnProperty;l=I("xmlbuilder"),C=I("./defaults").defaults,o=function(m){return typeof m=="string"&&(m.indexOf("&")>=0||m.indexOf(">")>=0||m.indexOf("<")>=0)},a=function(m){return""},v=function(m){return m.replace("]]>","]]]]>")},P.Builder=function(){function h(m){var p,w,g;this.options={},w=C["0.2"];for(p in w){if(!r.call(w,p))continue;g=w[p],this.options[p]=g}for(p in m){if(!r.call(m,p))continue;g=m[p],this.options[p]=g}}return h.prototype.buildObject=function(m){var p,w,g,c,n;return p=this.options.attrkey,w=this.options.charkey,(0,D.default)(m).length===1&&this.options.rootName===C["0.2"].rootName?(n=(0,D.default)(m)[0],m=m[n]):n=this.options.rootName,g=function(s){return function(d,S){var y,i,k,O,b,E;if((typeof S=="undefined"?"undefined":(0,u.default)(S))!=="object")s.options.cdata&&o(S)?d.raw(a(S)):d.txt(S);else if(Array.isArray(S))for(O in S){if(!r.call(S,O))continue;i=S[O];for(b in i)k=i[b],d=g(d.ele(b),k).up()}else for(b in S){if(!r.call(S,b))continue;if(i=S[b],b===p){if((typeof i=="undefined"?"undefined":(0,u.default)(i))==="object")for(y in i)E=i[y],d=d.att(y,E)}else if(b===w)s.options.cdata&&o(i)?d=d.raw(a(i)):d=d.txt(i);else if(Array.isArray(i))for(O in i){if(!r.call(i,O))continue;k=i[O],typeof k=="string"?s.options.cdata&&o(k)?d=d.ele(b).raw(a(k)).up():d=d.ele(b,k).up():d=g(d.ele(b),k).up()}else(typeof i=="undefined"?"undefined":(0,u.default)(i))==="object"?d=g(d.ele(b),i).up():typeof i=="string"&&s.options.cdata&&o(i)?d=d.ele(b).raw(a(i)).up():(i==null&&(i=""),d=d.ele(b,i.toString()).up())}return d}}(this),c=l.create(n,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),g(c,m).end(this.options.renderOpts)},h}()}).call(void 0)},{"./defaults":246,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,xmlbuilder:282}],246:[function(I,J,P){"use strict";(function(){P.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:` `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(void 0)},{}],247:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/promise"),u=o(M),_=I("babel-runtime/core-js/object/get-own-property-names"),D=o(_),f=I("babel-runtime/core-js/object/keys"),l=o(f),C=I("babel-runtime/helpers/typeof"),v=o(C);function o(a){return a&&a.__esModule?a:{default:a}}(function(){"use strict";var a,r,h,m,p,w,g,c,n=function(y,i){return function(){return y.apply(i,arguments)}},s=function(y,i){for(var k in i)d.call(i,k)&&(y[k]=i[k]);function O(){this.constructor=y}return O.prototype=i.prototype,y.prototype=new O,y.__super__=i.prototype,y},d={}.hasOwnProperty;g=I("sax"),h=I("events"),a=I("./bom"),w=I("./processors"),c=I("timers").setImmediate,r=I("./defaults").defaults,m=function(y){return(typeof y=="undefined"?"undefined":(0,v.default)(y))==="object"&&y!=null&&(0,l.default)(y).length===0},p=function(y,i,k){var O,b,E;for(O=0,b=y.length;O0&&(j[E.options.childkey]=V),V=j;else if(G){G[E.options.childkey]=G[E.options.childkey]||[],K={};for(N in V){if(!d.call(V,N))continue;K[N]=V[N]}G[E.options.childkey].push(K),delete V["#name"],(0,l.default)(V).length===1&&k in V&&!E.EXPLICIT_CHARKEY&&(V=V[k])}}return b.length>0?E.assignOrPush(G,L,V):(E.options.explicitRoot&&(W=V,V={},V[L]=W),E.resultObject=V,E.saxParser.ended=!0,E.emit("end",E.resultObject))}}(this),O=function(E){return function(x){var T,N;if(N=b[b.length-1],N)return N[k]+=x,E.options.explicitChildren&&E.options.preserveChildrenOrder&&E.options.charsAsChildren&&(E.options.includeWhiteChars||x.replace(/\\n/g,"").trim()!=="")&&(N[E.options.childkey]=N[E.options.childkey]||[],T={"#name":"__text__"},T[k]=x,E.options.normalize&&(T[k]=T[k].replace(/\s{2,}/g," ").trim()),N[E.options.childkey].push(T)),N}}(this),this.saxParser.ontext=O,this.saxParser.oncdata=function(E){return function(x){var T;if(T=O(x),T)return T.cdata=!0}}(this)},y.prototype.parseString=function(i,k){var O;k!=null&&typeof k=="function"&&(this.on("end",function(b){return this.reset(),k(null,b)}),this.on("error",function(b){return this.reset(),k(b)}));try{return i=i.toString(),i.trim()===""?(this.emit("end",null),!0):(i=a.stripBOM(i),this.options.async?(this.remaining=i,c(this.processAsync),this.saxParser):this.saxParser.write(i).close())}catch(b){if(O=b,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw O}else return this.emit("error",O),this.saxParser.errThrown=!0}},y.prototype.parseStringPromise=function(i){return new u.default(function(k){return function(O,b){return k.parseString(i,function(E,x){return E?b(E):O(x)})}}(this))},y}(h),P.parseString=function(S,y,i){var k,O,b;return i!=null?(typeof i=="function"&&(k=i),(typeof y=="undefined"?"undefined":(0,v.default)(y))==="object"&&(O=y)):(typeof y=="function"&&(k=y),O={}),b=new P.Parser(O),b.parseString(S,k)},P.parseStringPromise=function(S,y){var i,k;return(typeof y=="undefined"?"undefined":(0,v.default)(y))==="object"&&(i=y),k=new P.Parser(i),k.parseStringPromise(S)}}).call(void 0)},{"./bom":244,"./defaults":246,"./processors":248,"babel-runtime/core-js/object/get-own-property-names":58,"babel-runtime/core-js/object/keys":60,"babel-runtime/core-js/promise":61,"babel-runtime/helpers/typeof":67,events:192,sax:229,timers:236}],248:[function(I,J,P){"use strict";(function(){"use strict";var M;M=new RegExp(/(?!xmlns)^.*:/),P.normalize=function(u){return u.toLowerCase()},P.firstCharLowerCase=function(u){return u.charAt(0).toLowerCase()+u.slice(1)},P.stripPrefix=function(u){return u.replace(M,"")},P.parseNumbers=function(u){return isNaN(u)||(u=u%1===0?parseInt(u,10):parseFloat(u)),u},P.parseBooleans=function(u){return/^(?:true|false)$/i.test(u)&&(u=u.toLowerCase()==="true"),u}}).call(void 0)},{}],249:[function(I,J,P){"use strict";(function(){"use strict";var M,u,_,D,f=function(v,o){for(var a in o)l.call(o,a)&&(v[a]=o[a]);function r(){this.constructor=v}return r.prototype=o.prototype,v.prototype=new r,v.__super__=o.prototype,v},l={}.hasOwnProperty;u=I("./defaults"),M=I("./builder"),_=I("./parser"),D=I("./processors"),P.defaults=u.defaults,P.processors=D,P.ValidationError=function(C){f(v,C);function v(o){this.message=o}return v}(Error),P.Builder=M.Builder,P.Parser=_.Parser,P.parseString=_.parseString,P.parseStringPromise=_.parseStringPromise}).call(void 0)},{"./builder":245,"./defaults":246,"./parser":247,"./processors":248}],250:[function(I,J,P){"use strict";(function(){J.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(void 0)},{}],251:[function(I,J,P){"use strict";(function(){J.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(void 0)},{}],252:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/get-prototype-of"),u=C(M),_=I("babel-runtime/helpers/typeof"),D=C(_),f=I("babel-runtime/core-js/object/assign"),l=C(f);function C(v){return v&&v.__esModule?v:{default:v}}(function(){var v,o,a,r,h,m,p,w=[].slice,g={}.hasOwnProperty;v=function(){var n,s,d,S,y,i;if(i=arguments[0],y=2<=arguments.length?w.call(arguments,1):[],h(l.default))l.default.apply(null,arguments);else for(n=0,d=y.length;n":"attribute: {"+v+"}, parent: <"+this.parent.name+">"},C.prototype.isEqualNode=function(v){return v.namespaceURI!==this.namespaceURI||(v.prefix!==this.prefix||v.localName!==this.localName)?!1:!(v.value!==this.value)},C}()}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],255:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/create"),u=_(M);function _(D){return D&&D.__esModule?D:{default:D}}(function(){var D,f,l,C=function(a,r){for(var h in r)v.call(r,h)&&(a[h]=r[h]);function m(){this.constructor=a}return m.prototype=r.prototype,a.prototype=new m,a.__super__=r.prototype,a},v={}.hasOwnProperty;D=I("./NodeType"),l=I("./XMLCharacterData"),J.exports=f=function(o){C(a,o);function a(r,h){if(a.__super__.constructor.call(this,r),h==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=D.CData,this.value=this.stringify.cdata(h)}return a.prototype.clone=function(){return(0,u.default)(this)},a.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))},a}(l)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],256:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/create"),u=_(M);function _(D){return D&&D.__esModule?D:{default:D}}(function(){var D,f,l=function(o,a){for(var r in a)C.call(a,r)&&(o[r]=a[r]);function h(){this.constructor=o}return h.prototype=a.prototype,o.prototype=new h,o.__super__=a.prototype,o},C={}.hasOwnProperty;f=I("./XMLNode"),J.exports=D=function(v){l(o,v);function o(a){o.__super__.constructor.call(this,a),this.value=""}return Object.defineProperty(o.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}}),Object.defineProperty(o.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(o.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}}),o.prototype.clone=function(){return(0,u.default)(this)},o.prototype.substringData=function(a,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.appendData=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.insertData=function(a,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.deleteData=function(a,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.replaceData=function(a,r,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.isEqualNode=function(a){return o.__super__.isEqualNode.apply(this,arguments).isEqualNode(a)?!(a.data!==this.data):!1},o}(f)}).call(void 0)},{"./XMLNode":273,"babel-runtime/core-js/object/create":55}],257:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/create"),u=_(M);function _(D){return D&&D.__esModule?D:{default:D}}(function(){var D,f,l,C=function(a,r){for(var h in r)v.call(r,h)&&(a[h]=r[h]);function m(){this.constructor=a}return m.prototype=r.prototype,a.prototype=new m,a.__super__=r.prototype,a},v={}.hasOwnProperty;D=I("./NodeType"),f=I("./XMLCharacterData"),J.exports=l=function(o){C(a,o);function a(r,h){if(a.__super__.constructor.call(this,r),h==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=D.Comment,this.value=this.stringify.comment(h)}return a.prototype.clone=function(){return(0,u.default)(this)},a.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))},a}(f)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],258:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/keys"),u=f(M),_=I("babel-runtime/core-js/object/create"),D=f(_);function f(l){return l&&l.__esModule?l:{default:l}}(function(){var l,C,v;C=I("./XMLDOMErrorHandler"),v=I("./XMLDOMStringList"),J.exports=l=function(){function o(){var a;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new C,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=a=(0,D.default)(this.defaultParams)}return Object.defineProperty(o.prototype,"parameterNames",{get:function(){return new v((0,u.default)(this.defaultParams))}}),o.prototype.getParameter=function(a){return this.params.hasOwnProperty(a)?this.params[a]:null},o.prototype.canSetParameter=function(a,r){return!0},o.prototype.setParameter=function(a,r){return r!=null?this.params[a]=r:delete this.params[a]},o}()}).call(void 0)},{"./XMLDOMErrorHandler":259,"./XMLDOMStringList":261,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/keys":60}],259:[function(I,J,P){"use strict";(function(){var M;J.exports=M=function(){function u(){}return u.prototype.handleError=function(_){throw new Error(_)},u}()}).call(void 0)},{}],260:[function(I,J,P){"use strict";(function(){var M;J.exports=M=function(){function u(){}return u.prototype.hasFeature=function(_,D){return!0},u.prototype.createDocumentType=function(_,D,f){throw new Error("This DOM method is not implemented.")},u.prototype.createDocument=function(_,D,f){throw new Error("This DOM method is not implemented.")},u.prototype.createHTMLDocument=function(_){throw new Error("This DOM method is not implemented.")},u.prototype.getFeature=function(_,D){throw new Error("This DOM method is not implemented.")},u}()}).call(void 0)},{}],261:[function(I,J,P){"use strict";(function(){var M;J.exports=M=function(){function u(_){this.arr=_||[]}return Object.defineProperty(u.prototype,"length",{get:function(){return this.arr.length}}),u.prototype.item=function(_){return this.arr[_]||null},u.prototype.contains=function(_){return this.arr.indexOf(_)!==-1},u}()}).call(void 0)},{}],262:[function(I,J,P){"use strict";(function(){var M,u,_,D=function(C,v){for(var o in v)f.call(v,o)&&(C[o]=v[o]);function a(){this.constructor=C}return a.prototype=v.prototype,C.prototype=new a,C.__super__=v.prototype,C},f={}.hasOwnProperty;_=I("./XMLNode"),M=I("./NodeType"),J.exports=u=function(l){D(C,l);function C(v,o,a,r,h,m){if(C.__super__.constructor.call(this,v),o==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(a==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(o));if(!r)throw new Error("Missing DTD attribute type. "+this.debugInfo(o));if(!h)throw new Error("Missing DTD attribute default. "+this.debugInfo(o));if(h.indexOf("#")!==0&&(h="#"+h),!h.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(o));if(m&&!h.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(o));this.elementName=this.stringify.name(o),this.type=M.AttributeDeclaration,this.attributeName=this.stringify.name(a),this.attributeType=this.stringify.dtdAttType(r),m&&(this.defaultValue=this.stringify.dtdAttDefault(m)),this.defaultValueType=h}return C.prototype.toString=function(v){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(v))},C}(_)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],263:[function(I,J,P){"use strict";(function(){var M,u,_,D=function(C,v){for(var o in v)f.call(v,o)&&(C[o]=v[o]);function a(){this.constructor=C}return a.prototype=v.prototype,C.prototype=new a,C.__super__=v.prototype,C},f={}.hasOwnProperty;_=I("./XMLNode"),M=I("./NodeType"),J.exports=u=function(l){D(C,l);function C(v,o,a){if(C.__super__.constructor.call(this,v),o==null)throw new Error("Missing DTD element name. "+this.debugInfo());a||(a="(#PCDATA)"),Array.isArray(a)&&(a="("+a.join(",")+")"),this.name=this.stringify.name(o),this.type=M.ElementDeclaration,this.value=this.stringify.dtdElementValue(a)}return C.prototype.toString=function(v){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(v))},C}(_)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],264:[function(I,J,P){"use strict";(function(){var M,u,_,D,f=function(v,o){for(var a in o)l.call(o,a)&&(v[a]=o[a]);function r(){this.constructor=v}return r.prototype=o.prototype,v.prototype=new r,v.__super__=o.prototype,v},l={}.hasOwnProperty;D=I("./Utility").isObject,_=I("./XMLNode"),M=I("./NodeType"),J.exports=u=function(C){f(v,C);function v(o,a,r,h){if(v.__super__.constructor.call(this,o),r==null)throw new Error("Missing DTD entity name. "+this.debugInfo(r));if(h==null)throw new Error("Missing DTD entity value. "+this.debugInfo(r));if(this.pe=!!a,this.name=this.stringify.name(r),this.type=M.EntityDeclaration,!D(h))this.value=this.stringify.dtdEntityValue(h),this.internal=!0;else{if(!h.pubID&&!h.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(r));if(h.pubID&&!h.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(r));if(this.internal=!1,h.pubID!=null&&(this.pubID=this.stringify.dtdPubID(h.pubID)),h.sysID!=null&&(this.sysID=this.stringify.dtdSysID(h.sysID)),h.nData!=null&&(this.nData=this.stringify.dtdNData(h.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(r))}}return Object.defineProperty(v.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(v.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(v.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(v.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(v.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(v.prototype,"xmlVersion",{get:function(){return null}}),v.prototype.toString=function(o){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(o))},v}(_)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],265:[function(I,J,P){"use strict";(function(){var M,u,_,D=function(C,v){for(var o in v)f.call(v,o)&&(C[o]=v[o]);function a(){this.constructor=C}return a.prototype=v.prototype,C.prototype=new a,C.__super__=v.prototype,C},f={}.hasOwnProperty;_=I("./XMLNode"),M=I("./NodeType"),J.exports=u=function(l){D(C,l);function C(v,o,a){if(C.__super__.constructor.call(this,v),o==null)throw new Error("Missing DTD notation name. "+this.debugInfo(o));if(!a.pubID&&!a.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(o));this.name=this.stringify.name(o),this.type=M.NotationDeclaration,a.pubID!=null&&(this.pubID=this.stringify.dtdPubID(a.pubID)),a.sysID!=null&&(this.sysID=this.stringify.dtdSysID(a.sysID))}return Object.defineProperty(C.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(C.prototype,"systemId",{get:function(){return this.sysID}}),C.prototype.toString=function(v){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(v))},C}(_)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],266:[function(I,J,P){"use strict";(function(){var M,u,_,D,f=function(v,o){for(var a in o)l.call(o,a)&&(v[a]=o[a]);function r(){this.constructor=v}return r.prototype=o.prototype,v.prototype=new r,v.__super__=o.prototype,v},l={}.hasOwnProperty;D=I("./Utility").isObject,_=I("./XMLNode"),M=I("./NodeType"),J.exports=u=function(C){f(v,C);function v(o,a,r,h){var m;v.__super__.constructor.call(this,o),D(a)&&(m=a,a=m.version,r=m.encoding,h=m.standalone),a||(a="1.0"),this.type=M.Declaration,this.version=this.stringify.xmlVersion(a),r!=null&&(this.encoding=this.stringify.xmlEncoding(r)),h!=null&&(this.standalone=this.stringify.xmlStandalone(h))}return v.prototype.toString=function(o){return this.options.writer.declaration(this,this.options.writer.filterOptions(o))},v}(_)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],267:[function(I,J,P){"use strict";(function(){var M,u,_,D,f,l,C,v,o,a=function(m,p){for(var w in p)r.call(p,w)&&(m[w]=p[w]);function g(){this.constructor=m}return g.prototype=p.prototype,m.prototype=new g,m.__super__=p.prototype,m},r={}.hasOwnProperty;o=I("./Utility").isObject,v=I("./XMLNode"),M=I("./NodeType"),u=I("./XMLDTDAttList"),D=I("./XMLDTDEntity"),_=I("./XMLDTDElement"),f=I("./XMLDTDNotation"),C=I("./XMLNamedNodeMap"),J.exports=l=function(h){a(m,h);function m(p,w,g){var c,n,s,d,S,y;if(m.__super__.constructor.call(this,p),this.type=M.DocType,p.children){for(d=p.children,n=0,s=d.length;n=0;)this.up();return this.onEnd()},b.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},b.prototype.openNode=function(E){var x,T,N,j;if(!E.isOpen){if(!this.root&&this.currentLevel===0&&E.type===M.Element&&(this.root=E),T="",E.type===M.Element){this.writerOptions.state=u.OpenTag,T=this.writer.indent(E,this.writerOptions,this.currentLevel)+"<"+E.name,j=E.attribs;for(N in j){if(!O.call(j,N))continue;x=j[N],T+=this.writer.attribute(x,this.writerOptions,this.currentLevel)}T+=(E.children?">":"/>")+this.writer.endline(E,this.writerOptions,this.currentLevel),this.writerOptions.state=u.InsideTag}else this.writerOptions.state=u.OpenTag,T=this.writer.indent(E,this.writerOptions,this.currentLevel)+""),T+=this.writer.endline(E,this.writerOptions,this.currentLevel);return this.onData(T,this.currentLevel),E.isOpen=!0}},b.prototype.closeNode=function(E){var x;if(!E.isClosed)return x="",this.writerOptions.state=u.CloseTag,E.type===M.Element?x=this.writer.indent(E,this.writerOptions,this.currentLevel)+""+this.writer.endline(E,this.writerOptions,this.currentLevel):x=this.writer.indent(E,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(E,this.writerOptions,this.currentLevel),this.writerOptions.state=u.None,this.onData(x,this.currentLevel),E.isClosed=!0},b.prototype.onData=function(E,x){return this.documentStarted=!0,this.onDataCallback(E,x+1)},b.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},b.prototype.debugInfo=function(E){return E==null?"":"node: <"+E+">"},b.prototype.ele=function(){return this.element.apply(this,arguments)},b.prototype.nod=function(E,x,T){return this.node(E,x,T)},b.prototype.txt=function(E){return this.text(E)},b.prototype.dat=function(E){return this.cdata(E)},b.prototype.com=function(E){return this.comment(E)},b.prototype.ins=function(E,x){return this.instruction(E,x)},b.prototype.dec=function(E,x,T){return this.declaration(E,x,T)},b.prototype.dtd=function(E,x,T){return this.doctype(E,x,T)},b.prototype.e=function(E,x,T){return this.element(E,x,T)},b.prototype.n=function(E,x,T){return this.node(E,x,T)},b.prototype.t=function(E){return this.text(E)},b.prototype.d=function(E){return this.cdata(E)},b.prototype.c=function(E){return this.comment(E)},b.prototype.r=function(E){return this.raw(E)},b.prototype.i=function(E,x){return this.instruction(E,x)},b.prototype.att=function(){return this.currentNode&&this.currentNode.type===M.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},b.prototype.a=function(){return this.currentNode&&this.currentNode.type===M.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},b.prototype.ent=function(E,x){return this.entity(E,x)},b.prototype.pent=function(E,x){return this.pEntity(E,x)},b.prototype.not=function(E,x){return this.notation(E,x)},b}()}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLAttribute":254,"./XMLCData":255,"./XMLComment":257,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLDeclaration":266,"./XMLDocType":267,"./XMLDocument":268,"./XMLElement":271,"./XMLProcessingInstruction":275,"./XMLRaw":276,"./XMLStringWriter":278,"./XMLStringifier":279,"./XMLText":280}],270:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/create"),u=_(M);function _(D){return D&&D.__esModule?D:{default:D}}(function(){var D,f,l,C=function(a,r){for(var h in r)v.call(r,h)&&(a[h]=r[h]);function m(){this.constructor=a}return m.prototype=r.prototype,a.prototype=new m,a.__super__=r.prototype,a},v={}.hasOwnProperty;l=I("./XMLNode"),D=I("./NodeType"),J.exports=f=function(o){C(a,o);function a(r){a.__super__.constructor.call(this,r),this.type=D.Dummy}return a.prototype.clone=function(){return(0,u.default)(this)},a.prototype.toString=function(r){return""},a}(l)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],271:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/create"),u=_(M);function _(D){return D&&D.__esModule?D:{default:D}}(function(){var D,f,l,C,v,o,a,r,h,m=function(g,c){for(var n in c)p.call(c,n)&&(g[n]=c[n]);function s(){this.constructor=g}return s.prototype=c.prototype,g.prototype=new s,g.__super__=c.prototype,g},p={}.hasOwnProperty;h=I("./Utility"),r=h.isObject,a=h.isFunction,o=h.getValue,v=I("./XMLNode"),D=I("./NodeType"),f=I("./XMLAttribute"),C=I("./XMLNamedNodeMap"),J.exports=l=function(w){m(g,w);function g(c,n,s){var d,S,y,i;if(g.__super__.constructor.call(this,c),n==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(n),this.type=D.Element,this.attribs={},this.schemaTypeInfo=null,s!=null&&this.attribute(s),c.type===D.Document&&(this.isRoot=!0,this.documentObject=c,c.rootObject=this,c.children)){for(i=c.children,S=0,y=i.length;S=d;n=0<=d?++s:--s)if(!this.attribs[n].isEqualNode(c.attribs[n]))return!1;return!0},g}(v)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLAttribute":254,"./XMLNamedNodeMap":272,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],272:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/keys"),u=_(M);function _(D){return D&&D.__esModule?D:{default:D}}(function(){var D;J.exports=D=function(){function f(l){this.nodes=l}return Object.defineProperty(f.prototype,"length",{get:function(){return(0,u.default)(this.nodes).length||0}}),f.prototype.clone=function(){return this.nodes=null},f.prototype.getNamedItem=function(l){return this.nodes[l]},f.prototype.setNamedItem=function(l){var C;return C=this.nodes[l.nodeName],this.nodes[l.nodeName]=l,C||null},f.prototype.removeNamedItem=function(l){var C;return C=this.nodes[l],delete this.nodes[l],C||null},f.prototype.item=function(l){return this.nodes[(0,u.default)(this.nodes)[l]]||null},f.prototype.getNamedItemNS=function(l,C){throw new Error("This DOM method is not implemented.")},f.prototype.setNamedItemNS=function(l){throw new Error("This DOM method is not implemented.")},f.prototype.removeNamedItemNS=function(l,C){throw new Error("This DOM method is not implemented.")},f}()}).call(void 0)},{"babel-runtime/core-js/object/keys":60}],273:[function(I,J,P){"use strict";(function(){var M,u,_,D,f,l,C,v,o,a,r,h,m,p,w,g,c,n,s,d={}.hasOwnProperty;s=I("./Utility"),n=s.isObject,c=s.isFunction,g=s.isEmpty,w=s.getValue,v=null,_=null,D=null,f=null,l=null,m=null,p=null,h=null,C=null,u=null,r=null,o=null,M=null,J.exports=a=function(){function S(y){this.parent=y,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,v||(v=I("./XMLElement"),_=I("./XMLCData"),D=I("./XMLComment"),f=I("./XMLDeclaration"),l=I("./XMLDocType"),m=I("./XMLRaw"),p=I("./XMLText"),h=I("./XMLProcessingInstruction"),C=I("./XMLDummy"),u=I("./NodeType"),r=I("./XMLNodeList"),o=I("./XMLNamedNodeMap"),M=I("./DocumentPosition"))}return Object.defineProperty(S.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(S.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(S.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(S.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(S.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new r(this.children)),this.childNodeList}}),Object.defineProperty(S.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(S.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(S.prototype,"previousSibling",{get:function(){var i;return i=this.parent.children.indexOf(this),this.parent.children[i-1]||null}}),Object.defineProperty(S.prototype,"nextSibling",{get:function(){var i;return i=this.parent.children.indexOf(this),this.parent.children[i+1]||null}}),Object.defineProperty(S.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(S.prototype,"textContent",{get:function(){var i,k,O,b,E;if(this.nodeType===u.Element||this.nodeType===u.DocumentFragment){for(E="",b=this.children,k=0,O=b.length;k":((k=this.parent)!=null?k.name:void 0)?"node: <"+y+">, parent: <"+this.parent.name+">":"node: <"+y+">"},S.prototype.ele=function(y,i,k){return this.element(y,i,k)},S.prototype.nod=function(y,i,k){return this.node(y,i,k)},S.prototype.txt=function(y){return this.text(y)},S.prototype.dat=function(y){return this.cdata(y)},S.prototype.com=function(y){return this.comment(y)},S.prototype.ins=function(y,i){return this.instruction(y,i)},S.prototype.doc=function(){return this.document()},S.prototype.dec=function(y,i,k){return this.declaration(y,i,k)},S.prototype.e=function(y,i,k){return this.element(y,i,k)},S.prototype.n=function(y,i,k){return this.node(y,i,k)},S.prototype.t=function(y){return this.text(y)},S.prototype.d=function(y){return this.cdata(y)},S.prototype.c=function(y){return this.comment(y)},S.prototype.r=function(y){return this.raw(y)},S.prototype.i=function(y,i){return this.instruction(y,i)},S.prototype.u=function(){return this.up()},S.prototype.importXMLBuilder=function(y){return this.importDocument(y)},S.prototype.replaceChild=function(y,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},S.prototype.removeChild=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},S.prototype.appendChild=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},S.prototype.hasChildNodes=function(){return this.children.length!==0},S.prototype.cloneNode=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},S.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},S.prototype.isSupported=function(y,i){return!0},S.prototype.hasAttributes=function(){return this.attribs.length!==0},S.prototype.compareDocumentPosition=function(y){var i,k;return i=this,i===y?0:this.document()!==y.document()?(k=M.Disconnected|M.ImplementationSpecific,Math.random()<.5?k|=M.Preceding:k|=M.Following,k):i.isAncestor(y)?M.Contains|M.Preceding:i.isDescendant(y)?M.Contains|M.Following:i.isPreceding(y)?M.Preceding:M.Following},S.prototype.isSameNode=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},S.prototype.lookupPrefix=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},S.prototype.isDefaultNamespace=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},S.prototype.lookupNamespaceURI=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},S.prototype.isEqualNode=function(y){var i,k,O;if(y.nodeType!==this.nodeType)return!1;if(y.children.length!==this.children.length)return!1;for(i=k=0,O=this.children.length-1;0<=O?k<=O:k>=O;i=0<=O?++k:--k)if(!this.children[i].isEqualNode(y.children[i]))return!1;return!0},S.prototype.getFeature=function(y,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},S.prototype.setUserData=function(y,i,k){throw new Error("This DOM method is not implemented."+this.debugInfo())},S.prototype.getUserData=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},S.prototype.contains=function(y){return y?y===this||this.isDescendant(y):!1},S.prototype.isDescendant=function(y){var i,k,O,b,E;for(E=this.children,O=0,b=E.length;Ok},S.prototype.treePosition=function(y){var i,k;return k=0,i=!1,this.foreachTreeNode(this.document(),function(O){if(k++,!i&&O===y)return i=!0}),i?k:-1},S.prototype.foreachTreeNode=function(y,i){var k,O,b,E,x;for(y||(y=this.document()),E=y.children,O=0,b=E.length;O0){for(this.stream.write(" ["),this.stream.write(this.endline(o,a,r)),a.state=u.InsideTag,w=o.children,m=0,p=w.length;m"),this.stream.write(this.endline(o,a,r)),a.state=u.None,this.closeNode(o,a,r)},v.prototype.element=function(o,a,r){var h,m,p,w,g,c,n,s,d,S;r||(r=0),this.openNode(o,a,r),a.state=u.OpenTag,this.stream.write(this.indent(o,a,r)+"<"+o.name),d=o.attribs;for(n in d){if(!l.call(d,n))continue;h=d[n],this.attribute(h,a,r)}if(p=o.children.length,w=p===0?null:o.children[0],p===0||o.children.every(function(y){return(y.type===M.Text||y.type===M.Raw)&&y.value===""}))a.allowEmpty?(this.stream.write(">"),a.state=u.CloseTag,this.stream.write("")):(a.state=u.CloseTag,this.stream.write(a.spaceBeforeSlash+"/>"));else if(a.pretty&&p===1&&(w.type===M.Text||w.type===M.Raw)&&w.value!=null)this.stream.write(">"),a.state=u.InsideTag,a.suppressPrettyCount++,s=!0,this.writeChildNode(w,a,r+1),a.suppressPrettyCount--,s=!1,a.state=u.CloseTag,this.stream.write("");else{for(this.stream.write(">"+this.endline(o,a,r)),a.state=u.InsideTag,S=o.children,g=0,c=S.length;g")}return this.stream.write(this.endline(o,a,r)),a.state=u.None,this.closeNode(o,a,r)},v.prototype.processingInstruction=function(o,a,r){return this.stream.write(v.__super__.processingInstruction.call(this,o,a,r))},v.prototype.raw=function(o,a,r){return this.stream.write(v.__super__.raw.call(this,o,a,r))},v.prototype.text=function(o,a,r){return this.stream.write(v.__super__.text.call(this,o,a,r))},v.prototype.dtdAttList=function(o,a,r){return this.stream.write(v.__super__.dtdAttList.call(this,o,a,r))},v.prototype.dtdElement=function(o,a,r){return this.stream.write(v.__super__.dtdElement.call(this,o,a,r))},v.prototype.dtdEntity=function(o,a,r){return this.stream.write(v.__super__.dtdEntity.call(this,o,a,r))},v.prototype.dtdNotation=function(o,a,r){return this.stream.write(v.__super__.dtdNotation.call(this,o,a,r))},v}(D)}).call(void 0)},{"./NodeType":251,"./WriterState":253,"./XMLWriterBase":281}],278:[function(I,J,P){"use strict";(function(){var M,u,_=function(l,C){for(var v in C)D.call(C,v)&&(l[v]=C[v]);function o(){this.constructor=l}return o.prototype=C.prototype,l.prototype=new o,l.__super__=C.prototype,l},D={}.hasOwnProperty;u=I("./XMLWriterBase"),J.exports=M=function(f){_(l,f);function l(C){l.__super__.constructor.call(this,C)}return l.prototype.document=function(C,v){var o,a,r,h,m;for(v=this.filterOptions(v),h="",m=C.children,a=0,r=m.length;a","]]]]>"),this.assertLegalChar(f))},D.prototype.comment=function(f){if(this.options.noValidation)return f;if(f=""+f||"",f.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+f);return this.assertLegalChar(f)},D.prototype.raw=function(f){return this.options.noValidation?f:""+f||""},D.prototype.attValue=function(f){return this.options.noValidation?f:this.assertLegalChar(this.attEscape(f=""+f||""))},D.prototype.insTarget=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.insValue=function(f){if(this.options.noValidation)return f;if(f=""+f||"",f.match(/\?>/))throw new Error("Invalid processing instruction value: "+f);return this.assertLegalChar(f)},D.prototype.xmlVersion=function(f){if(this.options.noValidation)return f;if(f=""+f||"",!f.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+f);return f},D.prototype.xmlEncoding=function(f){if(this.options.noValidation)return f;if(f=""+f||"",!f.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+f);return this.assertLegalChar(f)},D.prototype.xmlStandalone=function(f){return this.options.noValidation?f:f?"yes":"no"},D.prototype.dtdPubID=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.dtdSysID=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.dtdElementValue=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.dtdAttType=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.dtdAttDefault=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.dtdEntityValue=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.dtdNData=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.convertAttKey="@",D.prototype.convertPIKey="?",D.prototype.convertTextKey="#text",D.prototype.convertCDataKey="#cdata",D.prototype.convertCommentKey="#comment",D.prototype.convertRawKey="#raw",D.prototype.assertLegalChar=function(f){var l,C;if(this.options.noValidation)return f;if(l="",this.options.version==="1.0"){if(l=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,C=f.match(l))throw new Error("Invalid character in string: "+f+" at index "+C.index)}else if(this.options.version==="1.1"&&(l=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,C=f.match(l)))throw new Error("Invalid character in string: "+f+" at index "+C.index);return f},D.prototype.assertLegalName=function(f){var l;if(this.options.noValidation)return f;if(this.assertLegalChar(f),l=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!f.match(l))throw new Error("Invalid character in name");return f},D.prototype.textEscape=function(f){var l;return this.options.noValidation?f:(l=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,f.replace(l,"&").replace(//g,">").replace(/\r/g," "))},D.prototype.attEscape=function(f){var l;return this.options.noValidation?f:(l=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,f.replace(l,"&").replace(/0)?new Array(i).join(S.indent):""},s.prototype.endline=function(d,S,y){return!S.pretty||S.suppressPrettyCount?"":S.newline},s.prototype.attribute=function(d,S,y){var i;return this.openAttribute(d,S,y),i=" "+d.name+'="'+d.value+'"',this.closeAttribute(d,S,y),i},s.prototype.cdata=function(d,S,y){var i;return this.openNode(d,S,y),S.state=u.OpenTag,i=this.indent(d,S,y)+""+this.endline(d,S,y),S.state=u.None,this.closeNode(d,S,y),i},s.prototype.comment=function(d,S,y){var i;return this.openNode(d,S,y),S.state=u.OpenTag,i=this.indent(d,S,y)+""+this.endline(d,S,y),S.state=u.None,this.closeNode(d,S,y),i},s.prototype.declaration=function(d,S,y){var i;return this.openNode(d,S,y),S.state=u.OpenTag,i=this.indent(d,S,y)+"",i+=this.endline(d,S,y),S.state=u.None,this.closeNode(d,S,y),i},s.prototype.docType=function(d,S,y){var i,k,O,b,E;if(y||(y=0),this.openNode(d,S,y),S.state=u.OpenTag,b=this.indent(d,S,y),b+="0){for(b+=" [",b+=this.endline(d,S,y),S.state=u.InsideTag,E=d.children,k=0,O=E.length;k",b+=this.endline(d,S,y),S.state=u.None,this.closeNode(d,S,y),b},s.prototype.element=function(d,S,y){var i,k,O,b,E,x,T,N,j,L,V,K,W,G;y||(y=0),L=!1,V="",this.openNode(d,S,y),S.state=u.OpenTag,V+=this.indent(d,S,y)+"<"+d.name,K=d.attribs;for(j in K){if(!n.call(K,j))continue;i=K[j],V+=this.attribute(i,S,y)}if(O=d.children.length,b=O===0?null:d.children[0],O===0||d.children.every(function(F){return(F.type===M.Text||F.type===M.Raw)&&F.value===""}))S.allowEmpty?(V+=">",S.state=u.CloseTag,V+=""+this.endline(d,S,y)):(S.state=u.CloseTag,V+=S.spaceBeforeSlash+"/>"+this.endline(d,S,y));else if(S.pretty&&O===1&&(b.type===M.Text||b.type===M.Raw)&&b.value!=null)V+=">",S.state=u.InsideTag,S.suppressPrettyCount++,L=!0,V+=this.writeChildNode(b,S,y+1),S.suppressPrettyCount--,L=!1,S.state=u.CloseTag,V+=""+this.endline(d,S,y);else{if(S.dontPrettyTextNodes){for(W=d.children,E=0,T=W.length;E"+this.endline(d,S,y),S.state=u.InsideTag,G=d.children,x=0,N=G.length;x",L&&S.suppressPrettyCount--,V+=this.endline(d,S,y),S.state=u.None}return this.closeNode(d,S,y),V},s.prototype.writeChildNode=function(d,S,y){switch(d.type){case M.CData:return this.cdata(d,S,y);case M.Comment:return this.comment(d,S,y);case M.Element:return this.element(d,S,y);case M.Raw:return this.raw(d,S,y);case M.Text:return this.text(d,S,y);case M.ProcessingInstruction:return this.processingInstruction(d,S,y);case M.Dummy:return"";case M.Declaration:return this.declaration(d,S,y);case M.DocType:return this.docType(d,S,y);case M.AttributeDeclaration:return this.dtdAttList(d,S,y);case M.ElementDeclaration:return this.dtdElement(d,S,y);case M.EntityDeclaration:return this.dtdEntity(d,S,y);case M.NotationDeclaration:return this.dtdNotation(d,S,y);default:throw new Error("Unknown XML node type: "+d.constructor.name)}},s.prototype.processingInstruction=function(d,S,y){var i;return this.openNode(d,S,y),S.state=u.OpenTag,i=this.indent(d,S,y)+"",i+=this.endline(d,S,y),S.state=u.None,this.closeNode(d,S,y),i},s.prototype.raw=function(d,S,y){var i;return this.openNode(d,S,y),S.state=u.OpenTag,i=this.indent(d,S,y),S.state=u.InsideTag,i+=d.value,S.state=u.CloseTag,i+=this.endline(d,S,y),S.state=u.None,this.closeNode(d,S,y),i},s.prototype.text=function(d,S,y){var i;return this.openNode(d,S,y),S.state=u.OpenTag,i=this.indent(d,S,y),S.state=u.InsideTag,i+=d.value,S.state=u.CloseTag,i+=this.endline(d,S,y),S.state=u.None,this.closeNode(d,S,y),i},s.prototype.dtdAttList=function(d,S,y){var i;return this.openNode(d,S,y),S.state=u.OpenTag,i=this.indent(d,S,y)+""+this.endline(d,S,y),S.state=u.None,this.closeNode(d,S,y),i},s.prototype.dtdElement=function(d,S,y){var i;return this.openNode(d,S,y),S.state=u.OpenTag,i=this.indent(d,S,y)+""+this.endline(d,S,y),S.state=u.None,this.closeNode(d,S,y),i},s.prototype.dtdEntity=function(d,S,y){var i;return this.openNode(d,S,y),S.state=u.OpenTag,i=this.indent(d,S,y)+""+this.endline(d,S,y),S.state=u.None,this.closeNode(d,S,y),i},s.prototype.dtdNotation=function(d,S,y){var i;return this.openNode(d,S,y),S.state=u.OpenTag,i=this.indent(d,S,y)+""+this.endline(d,S,y),S.state=u.None,this.closeNode(d,S,y),i},s.prototype.openNode=function(d,S,y){},s.prototype.closeNode=function(d,S,y){},s.prototype.openAttribute=function(d,S,y){},s.prototype.closeAttribute=function(d,S,y){},s}()}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLCData":255,"./XMLComment":257,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLDeclaration":266,"./XMLDocType":267,"./XMLDummy":270,"./XMLElement":271,"./XMLProcessingInstruction":275,"./XMLRaw":276,"./XMLText":280}],282:[function(I,J,P){"use strict";(function(){var M,u,_,D,f,l,C,v,o,a;a=I("./Utility"),v=a.assign,o=a.isFunction,_=I("./XMLDOMImplementation"),D=I("./XMLDocument"),f=I("./XMLDocumentCB"),C=I("./XMLStringWriter"),l=I("./XMLStreamWriter"),M=I("./NodeType"),u=I("./WriterState"),J.exports.create=function(r,h,m,p){var w,g;if(r==null)throw new Error("Root element needs a name.");return p=v({},h,m,p),w=new D(p),g=w.element(r),p.headless||(w.declaration(p),(p.pubID!=null||p.sysID!=null)&&w.dtd(p)),g},J.exports.begin=function(r,h,m){var p;return o(r)&&(p=[r,h],h=p[0],m=p[1],r={}),h?new f(r,h,m):new D(r)},J.exports.stringWriter=function(r){return new C(r)},J.exports.streamWriter=function(r,h){return new l(r,h)},J.exports.implementation=new _,J.exports.nodeType=M,J.exports.writerState=u}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLDOMImplementation":260,"./XMLDocument":268,"./XMLDocumentCB":269,"./XMLStreamWriter":277,"./XMLStringWriter":278}],283:[function(I,J,P){J.exports=u;var M=Object.prototype.hasOwnProperty;function u(){for(var _={},D=0;Df?r=a(r):r.length>5]|=128<>>9<<4)+14]=h;for(var m=1732584193,p=-271733879,w=-1732584194,g=271733878,c=0;c>16)+(h>>16)+(m>>16);return p<<16|m&65535}function a(r,h){return r<>>32-h}J.exports=function(h){return M.hash(h,_,16)}},{"./helpers":285}],287:[function(I,J,P){"use strict";var M=I("./helpers");function u(C,v){C[v>>5]|=128<<24-v%32,C[(v+64>>9<<4)+15]=v;for(var o=Array(80),a=1732584193,r=-271733879,h=-1732584194,m=271733878,p=-1009589776,w=0;w>16)+(v>>16)+(o>>16);return a<<16|o&65535}function l(C,v){return C<>>32-v}J.exports=function(v){return M.hash(v,u,20,!0)}},{"./helpers":285}],288:[function(I,J,P){"use strict";J.exports=function(){return function(){}}},{}],289:[function(I,J,P){(function(M){"use strict";var u=I("babel-runtime/helpers/typeof"),_=D(u);function D(a){return a&&a.__esModule?a:{default:a}}var f=I("stream"),l=f.Stream,C=I("../lib/common/utils/isArray"),v=C.isArray;J.exports.string=function(r){return typeof r=="string"},J.exports.array=v,J.exports.buffer=M.isBuffer;function o(a){return a instanceof l}J.exports.writableStream=function(r){return o(r)&&typeof r._write=="function"&&(0,_.default)(r._writableState)==="object"}}).call(this,{isBuffer:I("../node_modules/is-buffer/index.js")})},{"../lib/common/utils/isArray":42,"../node_modules/is-buffer/index.js":197,"babel-runtime/helpers/typeof":67,stream:230}],290:[function(I,J,P){"use strict";P.encodeURIComponent=function(M){try{return encodeURIComponent(M)}catch(u){return M}},P.escape=I("escape-html"),P.timestamp=function(u){if(u){var _=u;return typeof _=="string"&&(_=Number(_)),String(u).length===10&&(_*=1e3),new Date(_)}return Math.round(Date.now()/1e3)}},{"escape-html":191}],291:[function(I,J,P){(function(M,u){"use strict";var _=I("babel-runtime/core-js/json/stringify"),D=C(_),f=I("babel-runtime/helpers/typeof"),l=C(f);function C(S){return S&&S.__esModule?S:{default:S}}var v=I("util"),o=I("url"),a=I("http"),r=I("https"),h=I("debug")("urllib"),m=I("humanize-ms"),p,w=0,g=Math.pow(2,31)-10,c=/^https?:\/\//i;function n(S,y){return S===void 0?y:S}function s(S,y){return function(i,k,O){if(i)return y(i);S({data:k,status:O.statusCode,headers:O.headers,res:O})}}P.TIMEOUTS=[m("300s"),m("300s")];var d=["json","text"];P.request=function(y,i,k){return arguments.length===2&&typeof i=="function"&&(k=i,i=null),typeof k=="function"?P.requestWithCallback(y,i,k):(p||(p=I("any-promise")),new p(function(O,b){P.requestWithCallback(y,i,s(O,b))}))},P.requestWithCallback=function(y,i,k){if(!y||typeof y!="string"&&(typeof y=="undefined"?"undefined":(0,l.default)(y))!=="object"){var O=v.format("expect request url to be a string or a http request options, but got %j",y);throw new Error(O)}arguments.length===2&&typeof i=="function"&&(k=i,i=null),i=i||{},w>=g&&(w=0);var b=++w;i.requestUrls=i.requestUrls||[];var E={requestId:b,url:y,args:i,ctx:i.ctx};i.emitter&&i.emitter.emit("request",E),i.timeout=i.timeout||P.TIMEOUTS,i.maxRedirects=i.maxRedirects||10,i.streaming=i.streaming||i.customResponse;var x=Date.now(),T;typeof y=="string"?(c.test(y)||(y="http://"+y),T=o.parse(y)):T=y;var N=(i.type||i.method||T.method||"GET").toUpperCase(),j=T.port||80,L=a,V=n(i.agent,P.agent),K=i.fixJSONCtlChars;T.protocol==="https:"&&(L=r,V=n(i.httpsAgent,P.httpsAgent),T.port||(j=443));var W={host:T.hostname||T.host||"localhost",path:T.path||"/",method:N,port:j,agent:V,headers:i.headers||{},lookup:i.lookup};Array.isArray(i.timeout)?W.requestTimeout=i.timeout[i.timeout.length-1]:typeof i.timeout!="undefined"&&(W.requestTimeout=i.timeout);for(var G=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],F=0;F=0)return h("Request#%d %s: got digest auth header WWW-Authenticate: %s",b,y,Ue),i.headers=i.headers||{},i.headers.Authorization=digestAuthHeader(W.method,W.path,Ue,i.digestAuth),h("Request#%d %s: auth with digest header: %s",b,y,i.headers.Authorization),lt.headers["set-cookie"]&&(i.headers.Cookie=lt.headers["set-cookie"].join(";")),P.requestWithCallback(y,i,Je)}var ke=Date.now()-x;le&&(le.contentDownload=ke),h("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",ke,oe,Se,W.method,W.host,W.path,ce,le);var Ie={status:Se,statusCode:Se,headers:tt,size:oe,aborted:te,rt:ke,keepAliveSocket:ce,data:rt,requestUrls:i.requestUrls,timing:le,remoteAddress:ue,remotePort:Oe};if(De){var ye="";V&&typeof V.getCurrentStatus=="function"&&(ye=", agent status: "+(0,D.default)(V.getCurrentStatus())),De.message+=", "+W.method+" "+y+" "+Se+" (connected: "+he+", keepalive socket: "+ce+ye+`) headers: `+(0,D.default)(tt),De.data=rt,De.path=W.path,De.status=Se,De.headers=tt,De.res=Ie}Je(De,rt,i.streaming?lt:Ie),i.emitter&&(E.url=y,E.socket=ot&&ot.connection,E.options=W,E.size=Ce,i.emitter.emit("response",{requestId:b,error:De,ctx:i.ctx,req:E,res:Ie}))}function be(De){var rt=null;if(i.followRedirect&&statuses.redirect[De.statusCode]){i._followRedirectCount=(i._followRedirectCount||0)+1;var lt=De.headers.location;if(!lt)rt=new Error("Got statusCode "+De.statusCode+" but cannot resolve next location from headers"),rt.name="FollowRedirectError";else if(i._followRedirectCount>i.maxRedirects)rt=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+y),rt.name="MaxRedirectError";else{var Je=i.formatRedirectUrl?i.formatRedirectUrl(y,lt):o.resolve(y,lt);h("Request#%d %s: `redirected` from %s to %s",b,W.path,y,Je),Y(),i.headers&&i.headers.Host&&c.test(lt)&&(i.headers.Host=null);var tt=k;return k=null,P.requestWithCallback(Je,i,tt),{redirect:!0,error:null}}}return{redirect:!1,error:rt}}!W.headers["User-Agent"]&&!W.headers["user-agent"]&&(W.headers["User-Agent"]=navigator.userAgent),i.gzip&&(!W.headers["Accept-Encoding"]&&!W.headers["accept-encoding"]&&(W.headers["Accept-Encoding"]="gzip"));function ge(De,rt,lt){var Je=De.headers["content-encoding"];return lt(null,rt,Je)}var Re=i.writeStream;h("Request#%d %s %s with headers %j, options.path: %s",b,N,y,W.headers,W.path),i.requestUrls.push(y);function Ze(De){if(le&&(le.waiting=Date.now()-x),h("Request#%d %s `req response` event emit: status %d, headers: %j",b,y,De.statusCode,De.headers),i.streaming){var rt=be(De);if(rt.redirect){De.resume();return}return rt.error?(De.resume(),Z(rt.error,null,De)):Z(null,null,De)}if(De.on("close",function(){h("Request#%d %s: `res close` event emit, total size %d",b,y,oe)}),De.on("error",function(){h("Request#%d %s: `res error` event emit, total size %d",b,y,oe)}),De.on("aborted",function(){te=!0,h("Request#%d %s: `res aborted` event emit, total size %d",b,y,oe)}),Re){var rt=be(De);if(rt.redirect){De.resume();return}return rt.error?(De.resume(),Re.end(),Z(rt.error,null,De)):(i.consumeWriteStream===!1?De.on("end",Z.bind(null,null,null,De)):isNode010||isNode012?first([[Re,"close"],[De,"aborted"]],function(tt,Ue,ke){h("Request#%d %s: writeStream or res %s event emitted",b,y,ke),Z(_e||null,null,De)}):Re.on("close",function(){h("Request#%d %s: writeStream close event emitted",b,y),Z(_e||null,null,De)}),De.pipe(Re))}var lt=[];De.on("data",function(Je){h("Request#%d %s: `res data` event emit, size %d",b,y,Je.length),oe+=Je.length,lt.push(Je)}),De.on("end",function(){var Je=u.concat(lt,oe);if(h("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",b,y,oe,De._dumped),_e)return Z(_e,Je,De);var tt=be(De);if(tt.error)return Z(tt.error,Je,De);if(tt.redirect)return;ge(De,Je,function(Ue,ke,Ie){if(Ue)return Z(Ue,Je,De);if(!Ie&&d.indexOf(i.dataType)>=0){try{ke=decodeBodyByCharset(ke,De)}catch(Te){return h("decodeBodyByCharset error: %s",Te),Z(null,ke,De)}if(i.dataType==="json")if(oe===0)ke=null;else{var ye=parseJSON(ke,K);ye.error?Ue=ye.error:ke=ye.data}}te&&h("Request#%d %s: Remote socket was terminated before `response.end()` was called",b,y),Z(Ue,ke,De)})})}var qe,et;Array.isArray(i.timeout)?(qe=m(i.timeout[0]),et=m(i.timeout[1])):qe=et=m(i.timeout),h("ConnectTimeout: %d, ResponseTimeout: %d",qe,et);function nt(){h("Connect timer ticking, timeout: %d",qe),pe=setTimeout(function(){pe=null,Se===-1&&(Se=-2);var De="Connect timeout for "+qe+"ms",rt="ConnectionTimeoutError";ot.socket||(rt="SocketAssignTimeoutError",De+=", working sockets is full"),_e=new Error(De),_e.name=rt,_e.requestId=b,h("ConnectTimeout: Request#%d %s %s: %s, connected: %s",b,y,_e.name,De,he),je()},qe)}function ut(){h("Response timer ticking, timeout: %d",et),Me=setTimeout(function(){Me=null;var De="Response timeout for "+et+"ms",rt="ResponseTimeoutError";_e=new Error(De),_e.name=rt,_e.requestId=b,h("ResponseTimeout: Request#%d %s %s: %s, connected: %s",b,y,_e.name,De,he),je()},et)}var ot;W.mode=i.mode?i.mode:"";try{ot=L.request(W,Ze)}catch(De){return Z(De)}typeof window=="undefined"?nt():ot.on("requestTimeout",function(){Se===-1&&(Se=-2);var De="Connect timeout for "+qe+"ms",rt="ConnectionTimeoutError";_e=new Error(De),_e.name=rt,_e.requestId=b,je()});function je(){h("Request#%d %s abort, connected: %s",b,y,he),ot.socket||(_e.noSocket=!0,Z(_e)),ot.abort()}return le&&ot.on("finish",function(){le.requestSent=Date.now()-x}),ot.once("socket",function(De){le&&(le.queuing=Date.now()-x),isNode010&&De.socket&&(De=De.socket);var rt=De.readyState;if(rt==="opening"){De.once("lookup",function(lt,Je,tt){h("Request#%d %s lookup: %s, %s, %s",b,y,lt,Je,tt),le&&(le.dnslookup=Date.now()-x),Je&&(ue=Je)}),De.once("connect",function(){le&&(le.connected=Date.now()-x),Q(),ut(),h("Request#%d %s new socket connected",b,y),he=!0,ue||(ue=De.remoteAddress),Oe=De.remotePort});return}h("Request#%d %s reuse socket connected, readyState: %s",b,y,rt),he=!0,ce=!0,ue||(ue=De.remoteAddress),Oe=De.remotePort,Q(),ut()}),ot.on("error",function(De){(De.name==="Error"||De.name==="TypeError")&&(De.name=he?"ResponseError":"RequestError"),De.message+=' (req "error")',h("Request#%d %s `req error` event emit, %s: %s",b,y,De.name,De.message),Z(_e||De)}),Re&&Re.once("error",function(De){De.message+=' (writeStream "error")',_e=De,h("Request#%d %s `writeStream error` event emit, %s: %s",b,y,De.name,De.message),je()}),i.stream?(i.stream.pipe(ot),i.stream.once("error",function(De){De.message+=' (stream "error")',_e=De,h("Request#%d %s `readStream error` event emit, %s: %s",b,y,De.name,De.message),je()})):ot.end(q),ot.requestId=b,ot}}).call(this,I("_process"),I("buffer").Buffer)},{_process:208,"any-promise":49,"babel-runtime/core-js/json/stringify":53,"babel-runtime/helpers/typeof":67,buffer:73,constants:75,debug:288,http:231,https:193,"humanize-ms":194,url:238,util:243}]},{},[1])(1)})}).call(this,__webpack_require__("IyRk"))},n6Qo:function(I,J,P){"use strict";P.d(J,"a",function(){return v});var M=P("q1tI"),u=P("biw7"),_=P("fyJ8");function D(o){var a=o.className,r=o.index,h=o.children,m=o.colSpan,p=o.rowSpan,w=M.useContext(u.a),g=w.prefixCls,c=w.fixedInfoList,n=c[r];return M.createElement(_.a,Object.assign({className:a,index:r,component:"td",prefixCls:g,record:null,dataIndex:null,render:function(){return{children:h,props:{colSpan:m,rowSpan:p}}}},n))}function f(o){return M.createElement("tr",Object.assign({},o))}function l(o){var a=o.children,r=M.useContext(u.a),h=r.prefixCls;return M.createElement("tfoot",{className:"".concat(h,"-summary")},a)}var C=J.b=l,v={Cell:D,Row:f}},nj2k:function(I,J,P){I.exports=P.p+"static/nodata.c3b0b86c.svg"},oRuE:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(M){return M.pad.Iso10126={pad:function(u,_){var D=_*4,f=D-u.sigBytes%D;u.concat(M.lib.WordArray.random(f-1)).concat(M.lib.WordArray.create([f<<24],1))},unpad:function(u){var _=u.words[u.sigBytes-1>>>2]&255;u.sigBytes-=_}},M.pad.Iso10126})},osHv:function(I,J,P){(function(M){M(P("VrN/"))})(function(M){"use strict";var u=M.Pos;function _(c,n){return c.line-n.line||c.ch-n.ch}var D="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",f=D+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",l=new RegExp("<(/?)(["+D+"]["+f+"]*)","g");function C(c,n,s,d){this.line=n,this.ch=s,this.cm=c,this.text=c.getLine(n),this.min=d?Math.max(d.from,c.firstLine()):c.firstLine(),this.max=d?Math.min(d.to-1,c.lastLine()):c.lastLine()}function v(c,n){var s=c.cm.getTokenTypeAt(u(c.line,n));return s&&/\btag\b/.test(s)}function o(c){return c.line>=c.max?void 0:(c.ch=0,c.text=c.cm.getLine(++c.line),!0)}function a(c){return c.line<=c.min?void 0:(c.text=c.cm.getLine(--c.line),c.ch=c.text.length,!0)}function r(c){for(;;){var n=c.text.indexOf(">",c.ch);if(n==-1){if(o(c))continue;return}if(!v(c,n+1)){c.ch=n+1;continue}var s=c.text.lastIndexOf("/",n),d=s>-1&&!/\S/.test(c.text.slice(s+1,n));return c.ch=n+1,d?"selfClose":"regular"}}function h(c){for(;;){var n=c.ch?c.text.lastIndexOf("<",c.ch-1):-1;if(n==-1){if(a(c))continue;return}if(!v(c,n+1)){c.ch=n;continue}l.lastIndex=n,c.ch=n;var s=l.exec(c.text);if(s&&s.index==n)return s}}function m(c){for(;;){l.lastIndex=c.ch;var n=l.exec(c.text);if(!n){if(o(c))continue;return}if(!v(c,n.index+1)){c.ch=n.index+1;continue}return c.ch=n.index+n[0].length,n}}function p(c){for(;;){var n=c.ch?c.text.lastIndexOf(">",c.ch-1):-1;if(n==-1){if(a(c))continue;return}if(!v(c,n+1)){c.ch=n;continue}var s=c.text.lastIndexOf("/",n),d=s>-1&&!/\S/.test(c.text.slice(s+1,n));return c.ch=n+1,d?"selfClose":"regular"}}function w(c,n){for(var s=[];;){var d=m(c),S,y=c.line,i=c.ch-(d?d[0].length:0);if(!d||!(S=r(c)))return;if(S=="selfClose")continue;if(d[1]){for(var k=s.length-1;k>=0;--k)if(s[k]==d[2]){s.length=k;break}if(k<0&&(!n||n==d[2]))return{tag:d[2],from:u(y,i),to:u(c.line,c.ch)}}else s.push(d[2])}}function g(c,n){for(var s=[];;){var d=p(c);if(!d)return;if(d=="selfClose"){h(c);continue}var S=c.line,y=c.ch,i=h(c);if(!i)return;if(i[1])s.push(i[2]);else{for(var k=s.length-1;k>=0;--k)if(s[k]==i[2]){s.length=k;break}if(k<0&&(!n||n==i[2]))return{tag:i[2],from:u(c.line,c.ch),to:u(S,y)}}}}M.registerHelper("fold","xml",function(c,n){for(var s=new C(c,n.line,0);;){var d=m(s);if(!d||s.line!=n.line)return;var S=r(s);if(!S)return;if(!d[1]&&S!="selfClose"){var y=u(s.line,s.ch),i=w(s,d[2]);return i&&_(i.from,y)>0?{from:y,to:i.from}:null}}}),M.findMatchingTag=function(c,n,s){var d=new C(c,n.line,n.ch,s);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var S=r(d),y=S&&u(d.line,d.ch),i=S&&h(d);if(!S||!i||_(d,n)>0)return;var k={from:u(d.line,d.ch),to:y,tag:i[2]};return S=="selfClose"?{open:k,close:null,at:"open"}:i[1]?{open:g(d,i[2]),close:k,at:"close"}:(d=new C(c,y.line,y.ch,s),{open:k,close:w(d,i[2]),at:"open"})},M.findEnclosingTag=function(c,n,s,d){for(var S=new C(c,n.line,n.ch,s);;){var y=g(S,d);if(!y)break;var i=new C(c,n.line,n.ch,s),k=w(i,y.tag);if(k)return{open:y,close:k}}},M.scanForClosingTag=function(c,n,s,d){var S=new C(c,n.line,n.ch,d?{from:0,to:d}:null);return w(S,s)}})},p5ED:function(I,J,P){"use strict";var M=P("+L6B"),u=P("2/Rp"),_=P("5Dmo"),D=P("3S7+"),f=P("k1fw"),l=P("9og8"),C=P("tJVT"),v=P("WmNS"),o=P.n(v),a=P("q1tI"),r=P.n(a),h=P("vHTk"),m=P.n(h),p=P("yEEn"),w=P("ZW9T"),g=P("1vsH"),c=P("V0Rq"),n=P("m3rI"),s=function(S){var y=S.name,i=S.data,k=S.theme,O=S.type,b=S.filename,E=S.monacoEditor,x=S.className,T=S.style,N=S.close,j=S.onClose,L=S.hasMask,V=S.otherData,K=V===void 0?{}:V,W=Object(a.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),G=Object(C.a)(W,2),F=G[0],B=G[1],H=Object(a.useState)(""),q=Object(C.a)(H,2),re=q[0],ee=q[1],Ce=Object(a.useState)(),Ee=Object(C.a)(Ce,2),pe=Ee[0],Me=Ee[1],_e=window.ENV==="build"?"/react/build/office.html":"/office.html",he,ce=1024*1024,oe=10*ce,Se=Object(a.useRef)();O==="office"&&(he=Object(g.R)(i).filesize,he>oe&&(O="other")),b&&(E.filename=b),Object(a.useEffect)(function(){var le,Q,Y=(le=document.cookie)===null||le===void 0||((Q=le.replace(/\s/g,""))===null||Q===void 0)?void 0:Q.split(";");Y==null||Y.map(function(Z){var be=Z.split("=");be[0]==="_educoder_session"&&ee(be[1])})},[]),Object(a.useEffect)(function(){O==="office"&&te()},[O]);var te=function(){var le=Object(l.a)(o.a.mark(function Q(){var Y,Z,be;return o.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return console.log("data:",i),Y=i,i.startsWith("http")||(Y=location.origin+Y),Z=new URL(Y).pathname.split("/").pop(),Re.next=6,Object(c.U)({attachment_id:Z});case 6:be=Re.sent,Me(be);case 8:case"end":return Re.stop()}},Q)}));return function(){return le.apply(this,arguments)}}(),ue=function(){if(i.startsWith("http")||i.startsWith("/api")||i.startsWith("blob:")){Oe();return}Object(g.x)(b||"educoder",i,b||"educoder")},Oe=function(){Object(g.v)(b||"educoder",decodeURIComponent(i))};return r.a.createElement("div",{style:Object(f.a)({},T||{}),className:"".concat(L&&m.a.bgBlack," ").concat(O?m.a.wrp:"hide")},N&&r.a.createElement("div",{className:m.a.close,ref:Se},r.a.createElement(D.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Se.current}},r.a.createElement("span",{onClick:Oe},r.a.createElement("i",{className:"icon-quxiaozhiding"}))),r.a.createElement(D.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Se.current}},r.a.createElement("span",{className:"",onClick:function(){j(),Me(null)}},r.a.createElement("i",{className:"icon-guanbi1"})))),r.a.createElement("div",{className:"".concat(m.a[x]," ").concat(x," ").concat(m.a.monaco," ").concat(O==="txt"?"show":"hide")},O==="txt"&&r.a.createElement(w.b,E)),O==="audio"&&r.a.createElement("audio",{src:"".concat((i==null?void 0:i.indexOf("http://"))>-1||(i==null?void 0:i.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(i),autoPlay:!0}),O==="video"&&r.a.createElement(r.a.Fragment,null,(i==null?void 0:i.indexOf("/api"))>-1?r.a.createElement("video",{controls:!0,src:"".concat(i),autoPlay:!0}):r.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(i),autoPlay:!0})),O==="office"&&pe&&r.a.createElement("iframe",{src:"".concat(_e,"?key=").concat(pe.key,"&url=").concat(n.a.API_SERVER+pe.url,"&callbackUrl=").concat(n.a.API_SERVER+pe.callbackUrl,"&fileType=").concat(pe.fileType,"&title=").concat(pe.title,"&model=view")}),(O==="xlsx"||O==="doc"||O==="pptx"||O==="docx")&&r.a.createElement("iframe",{src:"".concat(_e,"?key=").concat(K.key,"&url=").concat(n.a.API_SERVER+K.url,"&callbackUrl=").concat(n.a.API_SERVER+K.callbackUrl,"&fileType=").concat(K.fileType,"&title=").concat(K.title,"&model=").concat(K.model)}),O==="html"&&r.a.createElement("iframe",{src:i+"&disposition=inline"}),O==="pdf"&&r.a.createElement("embed",{className:m.a.embed,src:i,type:"application/pdf"}),O==="image"&&r.a.createElement("img",{src:"".concat((i==null?void 0:i.indexOf("http://"))>-1||(i==null?void 0:i.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(i)}),O==="other"&&r.a.createElement("div",null,r.a.createElement(u.a,{type:"primary",size:"large",onClick:ue},r.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),O==="download"&&r.a.createElement(u.a,{type:"primary",size:"large",onClick:ue},r.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};J.a=s},"p77/":function(I,J,P){},pA7S:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("ETIr"),P("cv67"),P("K3mO"),P("OLod"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.WordArray,f=_.BlockCipher,l=u.algo,C=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],v=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],o=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],a=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],r=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=l.DES=f.extend({_doReset:function(){for(var g=this._key,c=g.words,n=[],s=0;s<56;s++){var d=C[s]-1;n[s]=c[d>>>5]>>>31-d%32&1}for(var S=this._subKeys=[],y=0;y<16;y++){for(var i=S[y]=[],k=o[y],s=0;s<24;s++)i[s/6|0]|=n[(v[s]-1+k)%28]<<31-s%6,i[4+(s/6|0)]|=n[28+(v[s+24]-1+k)%28]<<31-s%6;i[0]=i[0]<<1|i[0]>>>31;for(var s=1;s<7;s++)i[s]=i[s]>>>(s-1)*4+3;i[7]=i[7]<<5|i[7]>>>27}for(var O=this._invSubKeys=[],s=0;s<16;s++)O[s]=S[15-s]},encryptBlock:function(g,c){this._doCryptBlock(g,c,this._subKeys)},decryptBlock:function(g,c){this._doCryptBlock(g,c,this._invSubKeys)},_doCryptBlock:function(g,c,n){this._lBlock=g[c],this._rBlock=g[c+1],m.call(this,4,252645135),m.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),m.call(this,1,1431655765);for(var s=0;s<16;s++){for(var d=n[s],S=this._lBlock,y=this._rBlock,i=0,k=0;k<8;k++)i|=a[k][((y^d[k])&r[k])>>>0];this._lBlock=y,this._rBlock=S^i}var O=this._lBlock;this._lBlock=this._rBlock,this._rBlock=O,m.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),m.call(this,16,65535),m.call(this,4,252645135),g[c]=this._lBlock,g[c+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function m(g,c){var n=(this._lBlock>>>g^this._rBlock)&c;this._rBlock^=n,this._lBlock^=n<>>g^this._lBlock)&c;this._lBlock^=n,this._rBlock^=n<192.");var n=c.slice(0,2),s=c.length<4?c.slice(0,2):c.slice(2,4),d=c.length<6?c.slice(0,2):c.slice(4,6);this._des1=h.createEncryptor(D.create(n)),this._des2=h.createEncryptor(D.create(s)),this._des3=h.createEncryptor(D.create(d))},encryptBlock:function(g,c){this._des1.encryptBlock(g,c),this._des2.decryptBlock(g,c),this._des3.encryptBlock(g,c)},decryptBlock:function(g,c){this._des3.decryptBlock(g,c),this._des2.encryptBlock(g,c),this._des1.decryptBlock(g,c)},keySize:192/32,ivSize:64/32,blockSize:64/32});u.TripleDES=f._createHelper(w)}(),M.TripleDES})},qBft:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(M){return M.pad.AnsiX923={pad:function(u,_){var D=u.sigBytes,f=_*4,l=f-D%f,C=D+l-1;u.clamp(),u.words[C>>>2]|=l<<24-C%4*8,u.sigBytes+=l},unpad:function(u){var _=u.words[u.sigBytes-1>>>2]&255;u.sigBytes-=_}},M.pad.Ansix923})},qM6L:function(I,J,P){(function(M,u){I.exports=J=u(P("Ib8C"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.WordArray,f=u.enc,l=f.Utf16=f.Utf16BE={stringify:function(v){for(var o=v.words,a=v.sigBytes,r=[],h=0;h>>2]>>>16-h%4*8&65535;r.push(String.fromCharCode(m))}return r.join("")},parse:function(v){for(var o=v.length,a=[],r=0;r>>1]|=v.charCodeAt(r)<<16-r%2*16;return D.create(a,o*2)}};f.Utf16LE={stringify:function(v){for(var o=v.words,a=v.sigBytes,r=[],h=0;h>>2]>>>16-h%4*8&65535);r.push(String.fromCharCode(m))}return r.join("")},parse:function(v){for(var o=v.length,a=[],r=0;r>>1]|=C(v.charCodeAt(r)<<16-r%2*16);return D.create(a,o*2)}};function C(v){return v<<8&4278255360|v>>>8&16711935}}(),M.enc.Utf16})},qu8F:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(M){/** @preserve * Counter block mode compatible with Dr Brian Gladman fileenc.c * derived from CryptoJS.mode.CTR * Jan Hruby jhruby.web@gmail.com */return M.mode.CTRGladman=function(){var u=M.lib.BlockCipherMode.extend();function _(l){if((l>>24&255)===255){var C=l>>16&255,v=l>>8&255,o=l&255;C===255?(C=0,v===255?(v=0,o===255?o=0:++o):++v):++C,l=0,l+=C<<16,l+=v<<8,l+=o}else l+=1<<24;return l}function D(l){return(l[0]=_(l[0]))===0&&(l[1]=_(l[1])),l}var f=u.Encryptor=u.extend({processBlock:function(l,C){var v=this._cipher,o=v.blockSize,a=this._iv,r=this._counter;a&&(r=this._counter=a.slice(0),this._iv=void 0),D(r);var h=r.slice(0);v.encryptBlock(h,0);for(var m=0;m=_.length?{done:!0}:{done:!1,value:_[l++]}},e:function(h){throw h},f:C}}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 v=!0,o=!1,a;return{s:function(){f=_[Symbol.iterator]()},n:function(){var h=f.next();return v=h.done,h},e:function(h){o=!0,a=h},f:function(){try{!v&&f.return!=null&&f.return()}finally{if(o)throw a}}}}},rUJ1:function(I,J){const P=/[&<>"']/,M=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,_=/[<>"']|&(?!#?\w+;)/g,D={"&":"&","<":"<",">":">",'"':""","'":"'"},f=O=>D[O];function l(O,b){if(b){if(P.test(O))return O.replace(M,f)}else if(u.test(O))return O.replace(_,f);return O}const C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(O){return O.replace(C,(b,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 o=/(^|[^\[])\^/g;function a(O,b){O=O.source||O,b=b||"";const E={replace:(x,T)=>(T=T.source||T,T=T.replace(o,"$1"),O=O.replace(x,T),E),getRegex:()=>new RegExp(O,b)};return E}const r=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(O,b,E){if(O){let x;try{x=decodeURIComponent(v(E)).replace(r,"").toLowerCase()}catch(T){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}b&&!h.test(E)&&(E=n(b,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(x){return null}return E}const p={},w=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(O,b){p[" "+O]||(w.test(O)?p[" "+O]=O+"/":p[" "+O]=y(O,"/",!0)),O=p[" "+O];const E=O.indexOf(":")===-1;return b.substring(0,2)==="//"?E?b:O.replace(g,"$1")+b:b.charAt(0)==="/"?E?b:O.replace(c,"$1")+b:O+b}const s={exec:function(){}};function d(O){let b=1,E,x;for(;b{let V=!1,K=j;for(;--K>=0&&L[K]==="\\";)V=!V;return V?"|":" |"}),x=E.split(/ \|/);let T=0;if(x.length>b)x.splice(b);else for(;x.length0&&(Nt.children=[],Se(Xt,Nt.children))})}function te(Tt,Rt){for(var Et=[],Ar=0;Ar0){Et[0]=Xt.id;for(var Nt=0;Nt0&&Yt[0]!==void 0?Yt[0]:"",bn(!0),dr.next=4,Object(be.a)("/api/tag_disciplines.json",{method:"get",params:{target:Et,search:Kr}});case 4:or=dr.sent,St(or.tag_disciplines||[]),bn(!1);case 7:case"end":return dr.stop()}},Qt)}));return function(){return Zr.apply(this,arguments)}}(),Ht=function(Qt){var Kr=Qt.name;G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u91CD\u547D\u540D",content:ee.a.createElement("div",null,ee.a.createElement(B.a,{defaultValue:Kr,placeholder:"\u8BF7\u8F93\u5165".concat(on,"\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57"),maxLength:20,onChange:function(Yt){Kr=Yt.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var or=Object(x.a)(q.a.mark(function nr(){var dr;return q.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:if(Kr){un.next=3;break}return E.b.warn("\u9898\u76EE".concat(on,"\u4E0D\u80FD\u4E3A\u7A7A")),un.abrupt("return",Promise.reject());case 3:return un.next=5,Object(be.a)("/api/tag_disciplines/".concat(Qt.id,"/rename.json"),{method:"post",body:{id:Qt.id,name:Kr}});case 5:dr=un.sent,(dr==null?void 0:dr.status)===0&&pt();case 7:case"end":return un.stop()}},nr)}));function Yt(){return or.apply(this,arguments)}return Yt}()})},zt=function(Qt){G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,width:570,title:"\u5220\u9664",content:Et==="practice"?ee.a.createElement("div",null,"\u786E\u8BA4\u5C06\u9898\u76EE\u6765\u6E90\u201C",ee.a.createElement("span",{className:"c-light-primary"},Qt.name),"\u201D\u5220\u9664\u5417\uFF1F",ee.a.createElement("br",null),"\u5220\u9664\u540E\uFF0C\u4F1A\u5C06\u76F8\u5173\u9898\u76EE\u4E2D\u7684\u6765\u6E90\u8FDB\u884C\u6E05\u9664\u3002"):ee.a.createElement("div",null,"\u786E\u8BA4\u5C06\u9898\u76EE\u77E5\u8BC6\u70B9\u201C",ee.a.createElement("span",{className:"c-light-primary"},Qt.name),"\u201D\u5220\u9664\u5417\uFF1F",ee.a.createElement("br",null),"\u5220\u9664\u540E\uFF0C\u4F1A\u5C06\u76F8\u5173\u9898\u76EE\u4E2D\u7684\u77E5\u8BC6\u70B9\u8FDB\u884C\u6E05\u9664\u3002"),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Kr=Object(x.a)(q.a.mark(function Yt(){var nr;return q.a.wrap(function(Jr){for(;;)switch(Jr.prev=Jr.next){case 0:return Jr.next=2,Object(be.a)("/api/tag_disciplines/".concat(Qt.id,".json"),{method:"delete",body:{id:Qt.id}});case 2:nr=Jr.sent,(nr==null?void 0:nr.status)===0&&pt();case 4:case"end":return Jr.stop()}},Yt)}));function or(){return Kr.apply(this,arguments)}return or}()})},Mr=function(Qt){pt(Qt)},on=Et==="practice"?"\u77E5\u8BC6\u70B9":"\u6765\u6E90";return ee.a.createElement(G.a,{afterClose:function(){an(!1),bn(!1),de(""),se("1"),St([])},centered:!0,keyboard:!1,width:600,title:"".concat(on,"\u7BA1\u7406"),visible:!!Et,className:gt.a.customModal,footer:null,onCancel:Br},ee.a.createElement("section",{className:gt.a.wrap},ee.a.createElement(Ke.a,{activeKey:An,onChange:function(Qt){de(""),se(Qt),pt()}},ee.a.createElement(Ke.a.TabPane,{tab:"\u65B0\u589E".concat(on),key:"1"},ee.a.createElement(B.a,{value:ne,onChange:function(Qt){return de(Qt.target.value)},className:gt.a.in,placeholder:"\u8F93\u5165".concat(on,"\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57"),maxLength:20}),ee.a.createElement("div",{className:gt.a.btns},ee.a.createElement(S.a,{onClick:Br,className:"mr20"},"\u53D6\u6D88 "),ee.a.createElement(S.a,{loading:Ut,onClick:Pt,type:"primary"},"\u786E\u8BA4\u65B0\u5EFA"))),ee.a.createElement(Ke.a.TabPane,{tab:"\u5DF2\u6709".concat(on),key:"2"},ee.a.createElement(B.a.Search,{allowClear:!0,onSearch:Mr,value:ne,onChange:function(Qt){return de(Qt.target.value)},className:gt.a.in,placeholder:"\u8F93\u5165".concat(on,"\u540D\u79F0\u8FDB\u884C\u67E5\u8BE2")}),ee.a.createElement(s.a,{dataSource:ht,bordered:!1,loading:jr,scroll:ht.length>7?{y:300}:{},style:{padding:"0 40px 20px 40px"},columns:[{title:"".concat(on,"\u540D\u79F0"),dataIndex:"name",ellipsis:!0},{title:"\u64CD\u4F5C",dataIndex:"action",width:120,render:function(Qt,Kr){return ee.a.createElement("span",null,ee.a.createElement("span",{onClick:function(){return Ht(Kr)},className:"current mr10 c-light-primary"},"\u91CD\u547D\u540D"),ee.a.createElement("span",{onClick:function(){return zt(Kr)},className:"current c-grey-666"},"\u5220\u9664"))}}],pagination:!1})))))},vt=wt,It=P("m3rI"),Lt=P("B7Ph"),_t=P("wd/R"),rr=P.n(_t),sr=P("1vsH"),$t=P("9Bee"),cr=P("xKgJ"),Wt=B.a.TextArea,Lr=G.a.confirm,Cr=K.a.Panel,Ct={loading:!0,user:null,status:0,data:void 0,lastedUpdateTime:0},lr;(function(Tt){Tt[Tt.SET_INITAL_DATA=0]="SET_INITAL_DATA",Tt[Tt.SET_LOADING=1]="SET_LOADING",Tt[Tt.SET_STATUS=2]="SET_STATUS"})(lr||(lr={}));var Fr="#### \u9898\u76EE\u63CF\u8FF0\n\u73B0\u6709\u4E00\u4E2A\u6574\u578B\u6570\u7EC4 `nums`\uFF0C\u8BF7\u7F16\u5199\u7A0B\u5E8F\u5C06\u6570\u7EC4 `nums` \u4E2D\u7684\u6240\u6709 `$$0$$` \u79FB\u52A8\u5230\u6570\u7EC4\u7684\u672B\u5C3E\uFF0C\u4F46\u4E0D\u6539\u53D8\u975E\u96F6\u5143\u7D20\u5728\u6570\u7EC4\u4E2D\u7684\u76F8\u5BF9\u4F4D\u7F6E\u3002\u8BF7\u5728\u539F\u6570\u7EC4 `nums` \u4E0A\u8FDB\u884C\u64CD\u4F5C\u3002\n#### \u8F93\u5165\u8F93\u51FA\u683C\u5F0F\n**\u8F93\u5165\u683C\u5F0F**\n\u7B2C\u4E00\u884C\u6709\u4E00\u4E2A\u6574\u6570 `numsSize`\uFF0C\u8868\u793A\u6570\u7EC4 `nums` \u7684\u5927\u5C0F\uFF1B\n\u7B2C\u4E8C\u884C\u6709 `numsSize` \u4E2A\u6574\u6570\uFF0C\u8868\u793A\u6570\u7EC4 `nums` \u7684\u6240\u6709\u5143\u7D20\uFF0C\u6BCF\u4E2A\u6574\u6570\u7528\u4E00\u4E2A\u7A7A\u683C\u9694\u5F00\u3002\n**\u8F93\u51FA\u683C\u5F0F**\n\u4E00\u884C\u8F93\u51FA\u6570\u7EC4 `nums` \u7684\u6240\u6709\u5143\u7D20\uFF0C\u6709 `numsSize` \u4E2A\u6574\u6570\uFF0C\u6BCF\u4E2A\u6574\u6570\u7528\u4E00\u4E2A\u7A7A\u683C\u9694\u5F00\u3002\n#### \u8F93\u5165\u8F93\u51FA\u6837\u4F8B1\n**\u8F93\u5165**\n`4`\n`0 1 2 3`\n**\u8F93\u51FA**\n`1 2 3 0`\n**\u89E3\u91CA\uFF08\u53EF\u9009\uFF09**\nXXXXX\n#### \u8F93\u5165\u8F93\u51FA\u6837\u4F8B2\n**\u8F93\u5165**\n`5`\n`1 1 0 1 0`\n**\u8F93\u51FA**\n`1 1 1 0 0`\n**\u89E3\u91CA\uFF08\u53EF\u9009\uFF09**\nXXXXX\n#### \u8BF4\u660E\u63D0\u793A\n-`1\u2264n\u2264100`";function $r(Tt,Rt){switch(Rt.type){case lr.SET_INITAL_DATA:return Object(L.a)(Object(L.a)({},Tt),Rt.payload);case lr.SET_LOADING:return Object(L.a)(Object(L.a)({},Tt),{},{loading:Rt.payload});case lr.SET_STATUS:return Object(L.a)(Object(L.a)({},Tt),{},{status:Rt.payload});default:throw new Error}}var Hr=J.default=function(){var Tt,Rt,Et,Ar=Object(ue.h)(),Br=Object(ue.g)(),Xt=Object(ue.i)(),Nt=Xt.id,jr=N.a.useForm(),bn=Object(j.a)(jr,1),zr=bn[0],mt=Object(re.useState)(),Ut=Object(j.a)(mt,2),an=Ut[0],xn=Ut[1],On=Object(re.useState)(!1),An=Object(j.a)(On,2),se=An[0],z=An[1],X=Object(re.useState)([]),ne=Object(j.a)(X,2),de=ne[0],ie=ne[1],ze=Object(re.useState)([]),ht=Object(j.a)(ze,2),St=ht[0],Pt=ht[1],pt=Object(re.useState)([]),Ht=Object(j.a)(pt,2),zt=Ht[0],Mr=Ht[1],on=Object(re.useState)([]),Zr=Object(j.a)(on,2),Qt=Zr[0],Kr=Zr[1],or=Object(re.useState)([]),Yt=Object(j.a)(or,2),nr=Yt[0],dr=Yt[1],Jr=Object(re.useState)("C"),un=Object(j.a)(Jr,2),En=un[0],wi=un[1],Vi=Object(re.useReducer)($r,Ct),Fi=Object(j.a)(Vi,2),Qn=Fi[0],rn=Fi[1],Ri=Qn.loading,sn=Qn.data,hi=Qn.user,Gr=Qn.status,ir=sn==null?void 0:sn.hack_sets,qr=sn==null||((Tt=sn.hack)===null||Tt===void 0)?void 0:Tt.test_set_average,Tr=Object(re.useState)(!1),dn=Object(j.a)(Tr,2),_r=dn[0],fi=dn[1],hn=Object(re.useRef)([]),Hn=Object(re.useState)(!1),Di=Object(j.a)(Hn,2),yi=Di[0],Zn=Di[1],Si=Object(re.useState)(!1),jn=Object(j.a)(Si,2),Ni=jn[0],si=jn[1],pi=Object(re.useRef)(!0),Bi=Object(re.useState)({}),li=Object(j.a)(Bi,2),en=li[0],Qi=li[1];Object(re.useEffect)(function(){return Object(Oe.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),Object(Oe.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){Object(Oe.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),Object(Oe.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}},[]),Object(re.useEffect)(function(){setTimeout(function(){document.title="\u5728\u7EBF\u5237\u9898"},400)});var Ft=function(){var er=Object(x.a)(q.a.mark(function Mt(){var ur,fr;return q.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:return wr.next=2,Object(be.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice"}});case 2:return ur=wr.sent,wr.next=5,Object(be.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice_source"}});case 5:fr=wr.sent,Pt(ur.tag_disciplines||[]),Mr(fr.tag_disciplines||[]);case 8:case"end":return wr.stop()}},Mt)}));return function(){return er.apply(this,arguments)}}(),Jt=[{language:"C",code:""},{language:"C++",code:""},{language:"Java",code:""},{language:"Python",code:""}],Gt=Object(re.useCallback)(Object(x.a)(q.a.mark(function er(){var Mt,ur,fr,tn,wr,Rn,wn,ki,Fn,Kn,Yn,$i,Ne,Ve,Qe,Fe,ve,Le,we,Be,He,Ye,Xe,it,dt,xt,bt;return q.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(rn({type:lr.SET_LOADING,payload:!0}),!Nt){Vt.next=19;break}return Vt.next=4,Ze(Nt);case 4:Mt=Vt.sent,ur=Mt.user,fr=Mt.language,tn=Mt.practice_sets,wr=Mt.practice_codes,Rn=Mt.description,wn=Mt.difficulty,ki=Mt.name,Fn=Mt.open_or_not,Kn=Mt.time_limit,Yn=Mt.test_set_average,$i=Mt.test_set_score,Ne=Mt.status,Ve=Mt.tag_discipline_ids,Qe=Mt.source_discipline_ids,Fe=Mt.item_banks_group_id,ve=Mt.is_file,Le=ve===void 0?!1:ve,we=Mt.hide_actual_output,Be=Mt.review_privilege,He=Mt.review_description,Ye={review_privilege:Be,status:Ne,review_description:He,name:ki},Qi(Ye),fi(we),Xe=Le?[{input:"",output:"",score:100,position:1}]:tn,Le?(ie(tn),zr.setFieldsValue({hack_sets:Xe})):ie([]),it={loading:!0,user:ur,status:Ne,data:{hack:{difficulty:wn,name:ki,description:Rn,open_or_not:Fn,time_limit:Kn,test_set_average:Yn,test_set_score:$i,tag_discipline_ids:Ve,source_discipline_ids:Qe,is_file:Le},hack_sets:Xe}},rn({type:lr.SET_INITAL_DATA,payload:it}),xn({hack:{difficulty:wn,name:ki,description:Rn,open_or_not:Fn,time_limit:Kn,test_set_average:Yn,test_set_score:$i,tag_discipline_ids:Ve,source_discipline_ids:Qe,is_file:Le}}),dt=wr==null?void 0:wr.map(function(pr){return Object(L.a)(Object(L.a)({},pr),{},{code:le.Base64.decode(pr==null?void 0:pr.code)})}),dr(dt),hn.current=dt,Vt.next=27;break;case 19:return Vt.next=21,Re();case 21:xt=Vt.sent,bt=xt.user,rn({type:lr.SET_INITAL_DATA,payload:{loading:!0,status:0,user:bt,data:{hack:{difficulty:"",time_limit:3,description:Fr,test_set_score:!0,test_set_average:!0,open_or_not:!0,name:"",is_file:!1},hack_sets:[{input:"",output:"",score:100,position:1}]}}}),xn({hack:{difficulty:"",time_limit:3,description:"",test_set_average:!0,open_or_not:!0,name:"",is_file:!1}}),dr(Jt),hn.current=Jt;case 27:rn({type:lr.SET_LOADING,payload:!1});case 28:case"end":return Vt.stop()}},er)})),[Nt]);Object(re.useEffect)(function(){try{Gt(),Ft()}catch(er){console.log(er,"----")}},[]);function hr(er,Mt){return xr.apply(this,arguments)}function xr(){return xr=Object(x.a)(q.a.mark(function er(Mt,ur){var fr,tn,wr,Rn,wn,ki,Fn,Kn,Yn,$i,Ne,Ve,Qe,Fe,ve,Le,we,Be;return q.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:tn=Object(L.a)({},Mt),wr=tn.hack_sets,Rn=tn.hack,Rn.hide_actual_output=_r,wn=[],ki=[],Fn=0,Kn=Rn!=null&&Rn.is_file?de.map(function(Xe,it){return Object(L.a)(Object(L.a)({},Xe),{},{position:it+1})}):wr.map(function(Xe){return Object(L.a)(Object(L.a)({},Xe),{},{is_file:!1})}),Yn=Object(w.a)(Kn);try{for(Yn.s();!($i=Yn.n()).done;)Ne=$i.value,Fn+=Ne.score,Ne.id&&Ne.id>=0?wn.push(Ne):ki.push(Ne)}catch(Xe){Yn.e(Xe)}finally{Yn.f()}if(Kn!=null&&Kn.length){Ye.next=11;break}return E.b.error("\u6D4B\u8BD5\u96C6\u4E0D\u80FD\u4E3A\u7A7A"),Ye.abrupt("return");case 11:if(!(Fn!==100&&!Rn.test_set_score)){Ye.next=14;break}return E.b.error("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100"),Ye.abrupt("return");case 14:if(!(Kn!=null&&Kn.some(function(Xe){return!Xe.output}))){Ye.next=17;break}return E.b.error("\u6D4B\u8BD5\u96C6\u8F93\u51FA\u4E0D\u80FD\u4E3A\u7A7A"),Ye.abrupt("return");case 17:if(pi.current?Zn(!0):si(!0),Qe=nr==null?void 0:nr.map(function(Xe){return Object(L.a)(Object(L.a)({},Xe),{},{code:le.Base64.encode(Xe==null?void 0:Xe.code)})}),!Nt){Ye.next=25;break}return Ye.next=22,qe(Nt,{practice:Rn,practice_codes:Qe,practice_sets:ki,update_practice_sets:wn});case 22:Ve=Ye.sent,Ye.next=28;break;case 25:return Ye.next=27,ge({practice:Rn,practice_codes:Qe,practice_sets:Kn,publish:!pi.current});case 27:Ve=Ye.sent;case 28:if(Zn(!1),si(!1),!(((fr=Ve)===null||fr===void 0?void 0:fr.status)===0)){Ye.next=46;break}if(!((Fe=Ve)!==null&&Fe!==void 0&&(ve=Fe.similar_practice)!==null&&ve!==void 0&&ve.length)){Ye.next=35;break}return z(!0),Kr((Le=Ve)===null||Le===void 0?void 0:Le.similar_practice),Ye.abrupt("return");case 35:if(!Nt){Ye.next=44;break}if(E.b.success("\u4FDD\u5B58\u6210\u529F"),pi.current){Ye.next=42;break}return Ye.next=40,Object(be.a)("/api/practices/".concat(Nt,"/start"),{method:"get"});case 40:we=Ye.sent,(we==null?void 0:we.status)===0&&Br.push("/problems/".concat(we==null?void 0:we.identifier,"/oj/").concat(Nt));case 42:Ye.next=46;break;case 44:E.b.success("\u65B0\u5EFA\u6210\u529F"),Br.replace("/problems/".concat((Be=Ve)===null||Be===void 0?void 0:Be.identifier,"/ojedit"));case 46:case"end":return Ye.stop()}},er)})),xr.apply(this,arguments)}function Vr(){Br.replace("/problems")}var vr=function(Mt){var ur=Math.floor(100/Mt.length),fr=ur+100%Mt.length;Mt=Mt.map(function(tn,wr){return wr===Mt.length-1?Object(L.a)(Object(L.a)({},tn),{},{score:fr}):Object(L.a)(Object(L.a)({},tn),{},{score:ur})}),ie(Mt)};function _n(er){er.target.value||vr(de),rn({type:lr.SET_INITAL_DATA,payload:{data:Object(L.a)(Object(L.a)({},sn),{},{hack:Object(L.a)(Object(L.a)({},sn.hack),{},{test_set_score:er.target.value})})}})}function zn(er){rn({type:lr.SET_INITAL_DATA,payload:{data:Object(L.a)(Object(L.a)({},sn),{},{hack:Object(L.a)(Object(L.a)({},sn.hack),{},{is_file:er.target.value})})}})}function mr(er){fi(er.target.checked)}function ji(er){var Mt=er.target.value;Mt&&vr(de),rn({type:lr.SET_INITAL_DATA,payload:{data:Object(L.a)(Object(L.a)({},sn),{},{hack:Object(L.a)(Object(L.a)({},sn.hack),{},{test_set_average:Mt})})}})}function Rr(){var er=zr.getFieldValue("hack_sets"),Mt=er.length+1,ur=Math.floor(100/Mt),fr=100%Mt;er.map(function(tn,wr){return qr&&(tn.score=ur),tn.position=wr+1,tn}),er.push({input:"",output:"",position:Mt,score:qr?ur+fr:0}),zr.setFieldsValue({hack_sets:er}),rn({type:lr.SET_INITAL_DATA,payload:{data:Object(L.a)(Object(L.a)({},sn),{},{hack_sets:er})}})}Object(re.useEffect)(function(){if(qr){var er=ir==null?void 0:ir.length,Mt=Math.floor(100/er),ur=100%er;ir==null||ir.map(function(fr,tn){return fr.score=Mt,fr.position=tn+1,tn===er-1&&(fr.score=Mt+ur),fr}),rn({type:lr.SET_INITAL_DATA,payload:{data:Object(L.a)(Object(L.a)({},sn),{},{hack_sets:ir})}}),zr.setFieldsValue({hack_sets:ir})}},[qr]);function Mn(er){var Mt=zr.getFieldValue("hack_sets"),ur=(Mt==null?void 0:Mt.length)-1,fr=Math.ceil(100/ur),tn=100%ur;Mt.splice(er,1),Mt==null||Mt.map(function(wr,Rn){return qr&&(wr.score=fr,Rn===ur-1&&(wr.score=fr+tn)),wr.position=Rn+1,wr}),rn({type:lr.SET_INITAL_DATA,payload:{data:Object(L.a)(Object(L.a)({},sn),{},{hack_sets:Mt})}}),zr.setFieldsValue({hack_sets:Mt})}function mi(er){wi(er)}var qn=function(Mt){var ur,fr=(ur=hn.current)===null||ur===void 0?void 0:ur.findIndex(function(tn){return tn.language===En});hn.current[fr].code=Mt,dr(hn.current)},Pr=function(Mt){xn(Object(L.a)({},zr.getFieldsValue()))},Dr=function(){var er=Object(x.a)(q.a.mark(function Mt(ur){var fr;return q.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:return wr.next=2,Object(be.a)("/api/practices/".concat(ur,"/start"),{method:"get"});case 2:fr=wr.sent,(fr==null?void 0:fr.status)===0&&Object(sr.Q)("/problems/".concat(fr==null?void 0:fr.identifier,"/oj/").concat(ur));case 4:case"end":return wr.stop()}},Mt)}));return function(ur){return er.apply(this,arguments)}}(),Er=function(){var er=Object(x.a)(q.a.mark(function Mt(){var ur,fr,tn,wr,Rn,wn;return q.a.wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:return Fn.next=2,Ze(Nt);case 2:ur=Fn.sent,fr=ur.name,tn=ur.status,wr=ur.review_privilege,Rn=ur.review_description,wn={review_privilege:wr,status:tn,review_description:Rn,name:fr},Qi(wn);case 6:case"end":return Fn.stop()}},Mt)}));return function(){return er.apply(this,arguments)}}(),ui=function(){var Mt="";G.a.confirm({icon:null,width:700,className:"custom-modal-divider",centered:!0,title:"\u4E0D\u901A\u8FC7\u539F\u56E0",content:ee.a.createElement("div",{className:"mt20"},ee.a.createElement(Z.a,{className:Ee.a.MdEditor,defaultValue:Mt,onChange:function(fr){Mt=fr}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var ur=Object(x.a)(q.a.mark(function tn(){var wr;return q.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:if(Mt){wn.next=3;break}return E.b.warn("\u4E0D\u901A\u8FC7\u539F\u56E0\u4E0D\u80FD\u4E3A\u7A7A"),wn.abrupt("return",Promise.reject());case 3:return wn.next=5,Object(be.a)("/api/practices/".concat(Nt,"/review.json"),{method:"post",body:{op:"fail",description:Mt}});case 5:wr=wn.sent,(wr==null?void 0:wr.status)===0&&(E.b.success("\u63D0\u4EA4\u6210\u529F"),Er());case 7:case"end":return wn.stop()}},tn)}));function fr(){return ur.apply(this,arguments)}return fr}()})},Xi=function(){var er=Object(x.a)(q.a.mark(function Mt(){return q.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u63D0\u793A",content:"\u786E\u8BA4\u5C06\u9898\u76EE\u300A".concat(en==null?void 0:en.name,"\u300B\u7684\u5BA1\u6838\u901A\u8FC7\u5417\uFF1F"),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var tn=Object(x.a)(q.a.mark(function Rn(){var wn;return q.a.wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:return Fn.next=2,Object(be.a)("/api/practices/".concat(Nt,"/review.json"),{method:"post",body:{op:"pass"}});case 2:wn=Fn.sent,(wn==null?void 0:wn.status)===0&&(E.b.success("\u63D0\u4EA4\u6210\u529F"),Er());case 4:case"end":return Fn.stop()}},Rn)}));function wr(){return tn.apply(this,arguments)}return wr}()});case 1:case"end":return fr.stop()}},Mt)}));return function(){return er.apply(this,arguments)}}(),Yi=function(){var Mt=G.a.confirm({icon:null,width:700,className:"".concat(Ee.a.cusModal," custom-modal-divider"),centered:!0,title:ee.a.createElement(i.a,null,ee.a.createElement(O.a,{flex:"1"},"\u4E0D\u901A\u8FC7\u539F\u56E0"),ee.a.createElement(O.a,null,ee.a.createElement("span",{className:"iconfont icon-guanbi7 font12 current c-grey-c",onClick:function(){return Mt.destroy()}}))),content:ee.a.createElement("div",null,ee.a.createElement($t.a,{className:"mt20",value:(en==null?void 0:en.review_description)||""}))})};return ee.a.createElement(c.a,{spinning:Ri,size:"large",className:Ee.a["oj-custom-large-spin"]},sn?ee.a.createElement(re.Fragment,null,ee.a.createElement("header",{className:Ee.a.header},ee.a.createElement("div",null,ee.a.createElement("img",{src:"".concat(It.a.IMG_SERVER,"/images/").concat(hi==null?void 0:hi.image_url),alt:"user",width:30}),ee.a.createElement("span",null,hi==null?void 0:hi.name)),ee.a.createElement("h2",null," ",sn==null||((Rt=sn.hack)===null||Rt===void 0)?void 0:Rt.name," "),Nt?ee.a.createElement("a",{className:Ee.a.btn_back,onClick:Vr}," ",ee.a.createElement(Q.a,null),"\u9000\u51FA"):null),ee.a.createElement(N.a,{form:zr,initialValues:sn,layout:"vertical",className:Ee.a["oj-form-container"],onValuesChange:Pr,onFinish:hr},ee.a.createElement(ut.a,{hideResize:!0,className:Ee.a["oj-problems"],leftChild:ee.a.createElement(oi,{formValue:an,onRemoveTestCase:Mn,onAddTestCase:Rr,hack:sn.hack,onChangeScore:_n,onChangehide:mr,onChangeAverage:ji,onChangeFile:zn,uploadData:de,setUploadData:ie,handleUploadRatio:vr,ischecked:_r,pointData:St,sourceData:zt,getPointData:Ft}),rightChild:ee.a.createElement(Ae,{value:nr==null||((Et=nr.find(function(er){return er.language===En}))===null||Et===void 0)?void 0:Et.code,onChange:qn,onLanguage:mi,languageItems:nr,language:En})}),ee.a.createElement("div",{className:Ee.a.footer},!!Nt&&ee.a.createElement("div",{className:Ee.a.result},ee.a.createElement("span",null,"\u5BA1\u6838\u7ED3\u679C:"),en!=null&&en.review_privilege?ee.a.createElement(ee.a.Fragment,null,ee.a.createElement("div",{onClick:Xi,className:Ee.a.pass},"\u901A\u8FC7"),ee.a.createElement("div",{onClick:ui,className:Ee.a.noPass},"\u4E0D\u901A\u8FC7")):ee.a.createElement(ee.a.Fragment,null,(en==null?void 0:en.status)===0&&ee.a.createElement("div",{className:Ee.a.passText},ee.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u672A\u53D1\u5E03"),(en==null?void 0:en.status)===1&&ee.a.createElement("div",{className:Ee.a.passText},ee.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u5DF2\u516C\u5F00"),(en==null?void 0:en.status)===2&&ee.a.createElement("div",{className:Ee.a.passText},ee.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u672A\u5BA1\u6279"),(en==null?void 0:en.status)===3&&ee.a.createElement("div",{className:Ee.a.passText},ee.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u5BA1\u6838\u4E2D"),(en==null?void 0:en.status)===4&&ee.a.createElement("div",{className:Ee.a.passText},ee.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u5BA1\u6838\u5B8C\u6210\u5F85\u516C\u5F00"),(en==null?void 0:en.status)===5&&ee.a.createElement("div",{className:Ee.a.noPassText},ee.a.createElement("i",{className:"iconfont icon-weitongguo1"}),"\u5BA1\u6838\u4E0D\u901A\u8FC7",ee.a.createElement("span",{onClick:Yi},"\u67E5\u770B\u539F\u56E0")))),ee.a.createElement(S.a,{type:"primary",ghost:!0,onClick:Vr},"\u9000\u51FA\u7F16\u8F91"),ee.a.createElement(S.a,{disabled:Ni,loading:yi,type:"primary",onClick:function(){pi.current=!0,zr.submit()}},"\u4FDD\u5B58 "),Nt?ee.a.createElement(S.a,{disabled:yi,loading:Ni,style:{background:"#2FC25B",border:0},type:"primary",onClick:function(){pi.current=!1,zr.submit()}},"\u7ACB\u5373\u4F53\u9A8C"):ee.a.createElement(S.a,{disabled:yi,loading:Ni,type:"primary",onClick:function(){pi.current=!1,zr.submit()}},"\u4FDD\u5B58\u5E76\u53D1\u5E03\u5BA1\u6838")))):null,ee.a.createElement(G.a,{centered:!0,destroyOnClose:!0,footer:null,visible:se,onCancel:function(){return z(!1)},title:"\u76F8\u4F3C\u6027\u68C0\u6D4B",width:"600px"},ee.a.createElement("div",null,ee.a.createElement("p",{className:"font14"},"\u7ECF\u7CFB\u7EDF\u68C0\u6D4B\u53D1\u73B0\uFF0C\u672C\u9898\u76EE\u4E0E\u7CFB\u7EDF\u4E2D\u5DF2\u521B\u5EFA\u7684\u9898\u76EE\u9AD8\u5EA6\u96F7\u540C\uFF0C\u8BF7\u8C03\u6574\u9898\u76EE\u540E\u518D\u8FDB\u884C\u4FDD\u5B58"),ee.a.createElement(s.a,{dataSource:Qt,bordered:!1,scroll:Qt.length>7?{y:300}:{},columns:[{title:"\u76F8\u4F3C\u9898\u9898\u76EE",dataIndex:"name",ellipsis:!0,render:function(Mt,ur){return ee.a.createElement("span",{onClick:function(){return Dr(ur==null?void 0:ur.identifier)},style:{textDecorationLine:"underline"},className:"current c-light-primary"},Mt)}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"create_time",width:170,render:function(Mt){var ur;return(ur=rr()(Mt))===null||ur===void 0?void 0:ur.format("YYYY-MM-DD HH:mm")}}],pagination:!1}))))};function oi(Tt){var Rt,Et,Ar=Tt.ischecked,Br=Tt.formValue,Xt=Tt.hack,Nt=Tt.onChangeAverage,jr=Tt.onChangeScore,bn=Tt.onChangehide,zr=Tt.onChangeFile,mt=Tt.onAddTestCase,Ut=Tt.onRemoveTestCase,an=Tt.uploadData,xn=Tt.setUploadData,On=Tt.handleUploadRatio,An=Tt.pointData,se=Tt.sourceData,z=Tt.getPointData,X=Xt.test_set_average,ne=Xt.test_set_score,de=Object(re.useState)(!1),ie=Object(j.a)(de,2),ze=ie[0],ht=ie[1],St=Object(re.useState)(!1),Pt=Object(j.a)(St,2),pt=Pt[0],Ht=Pt[1],zt=function(Yt,nr){var dr=Object(p.a)(an);dr.splice(nr,1),X?On(dr):xn(dr)},Mr=function(Yt,nr){console.log(Yt,nr);var dr=an.map(function(Jr,un){return un===nr?Object(L.a)(Object(L.a)({},Jr),{},{score:Yt.target.value?Number(Yt.target.value):0}):Jr});xn(dr)},on=function(Yt){var nr=an.concat(Yt);Xt.test_set_average?On(nr):xn(nr)};function Zr(or){or.stopPropagation()}function Qt(){if(Object(cr.v)()){Ht("practice");return}var or="";G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",content:ee.a.createElement("div",null,ee.a.createElement(B.a,{placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57",maxLength:20,onChange:function(nr){or=nr.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Yt=Object(x.a)(q.a.mark(function dr(){var Jr;return q.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return En.next=2,Object(be.a)("/api/tag_disciplines.json",{method:"post",body:{target:"practice",name:or}});case 2:Jr=En.sent,(Jr==null?void 0:Jr.status)===0&&z();case 4:case"end":return En.stop()}},dr)}));function nr(){return Yt.apply(this,arguments)}return nr}()})}function Kr(){if(Object(cr.v)()){Ht("practice_source");return}var or="";G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u65B0\u5EFA\u6765\u6E90",content:ee.a.createElement("div",null,ee.a.createElement(B.a,{placeholder:"\u8BF7\u8F93\u5165\u6765\u6E90\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57",maxLength:20,onChange:function(nr){or=nr.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Yt=Object(x.a)(q.a.mark(function dr(){var Jr;return q.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return En.next=2,Object(be.a)("/api/tag_disciplines.json",{method:"post",body:{target:"practice_source",name:or}});case 2:Jr=En.sent,(Jr==null?void 0:Jr.status)===0&&z();case 4:case"end":return En.stop()}},dr)}));function nr(){return Yt.apply(this,arguments)}return nr}()})}return ee.a.createElement("div",{className:Ee.a["oj-left-panel"]},ee.a.createElement("div",{className:Ee.a["oj-form-info"]},ee.a.createElement(N.a.Item,{label:"\u9898\u76EE\u540D\u79F0",name:["hack","name"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0"}],className:Ee.a.inputOne},ee.a.createElement(B.a,{bordered:!1,maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0",suffix:ee.a.createElement("span",null,(Br==null||((Rt=Br.hack)===null||Rt===void 0||((Et=Rt.name)===null||Et===void 0))?void 0:Et.length)||0,"/",ee.a.createElement("span",{className:"c-grey-999"},"60"))})),ee.a.createElement(N.a.Item,{name:["hack","description"],valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},ee.a.createElement(Z.a,{placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u63CF\u8FF0\u2026",miniToolbar:!0,id:"moop_cases_content",noStorage:!0,height:200})),ee.a.createElement("div",{className:Ee.a.row},ee.a.createElement("div",{className:Ee.a.a},ee.a.createElement(N.a.Item,{label:"\u96BE\u6613\u5EA6",name:["hack","difficulty"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6"}]},ee.a.createElement(m.a,null,oe(he.difficulty)))),ee.a.createElement("div",{className:Ee.a.b},ee.a.createElement(N.a.Item,{label:"\u9898\u76EE\u6765\u6E90",name:["hack","source_discipline_ids"]},ee.a.createElement(m.a,{placeholder:"\u9009\u62E9\u9898\u76EE\u6765\u6E90",showSearch:!1,mode:"multiple",showArrow:!0,getPopupContainer:function(Yt){return Yt.parentNode}},se.map(function(or){return ee.a.createElement(m.a.Option,{key:or.id,value:or.id},or.name)}))),ee.a.createElement(S.a,{style:{padding:"0 18px"},type:"primary",ghost:!0,onClick:function(){return Kr()}},Object(cr.v)()?"\u6765\u6E90\u7BA1\u7406":"\u65B0\u5EFA\u6765\u6E90"))),ee.a.createElement("div",{className:Ee.a.row},ee.a.createElement("div",{className:Ee.a.b,style:{width:"100%",marginLeft:0}},ee.a.createElement(N.a.Item,{label:"\u77E5\u8BC6\u70B9",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9"}],name:["hack","tag_discipline_ids"]},ee.a.createElement(m.a,{placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,mode:"multiple",showArrow:!0,getPopupContainer:function(Yt){return Yt.parentNode}},An.map(function(or){return ee.a.createElement(m.a.Option,{key:or.id,value:or.id},or.name)}))),ee.a.createElement(S.a,{type:"primary",ghost:!0,onClick:function(){return Qt()}},Object(cr.v)()?"\u77E5\u8BC6\u70B9\u7BA1\u7406":"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))),ee.a.createElement("div",{className:Ee.a.field},ee.a.createElement(N.a.Item,{label:"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236",name:["hack","time_limit"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"},{type:"number",min:3,message:"\u6700\u5C0F\u9650\u5236\u65F6\u95F4\u662F3\u79D2"}],className:Ee.a.inputTwo,extra:ee.a.createElement("span",{style:{position:"absolute",left:200,top:11,color:"#333"}},"\u79D2",ee.a.createElement("span",{className:"ml5 c-grey-999"},"(\u4EE3\u7801\u6267\u884C\u6240\u5141\u8BB8\u7684\u6700\u5927\u65F6\u957F)"))},ee.a.createElement(r.a,{style:{width:185},min:3}))),ee.a.createElement("div",{className:"tst-case-info"},ee.a.createElement("h3",{className:"flex-container",style:{justifyContent:"space-between"}}," ","\u6D4B\u8BD5\u7528\u4F8B\u4E0E\u7CFB\u7EDF\u8BC4\u5206\u89C4\u5219",!Xt.is_file&&ee.a.createElement(S.a,{style:{height:40},type:"primary",ghost:!0,onClick:mt},"\u6DFB\u52A0\u6D4B\u8BD5\u7528\u4F8B")),ee.a.createElement(N.a.Item,{name:["hack","test_set_score"]},ee.a.createElement(o.a.Group,{onChange:jr},ee.a.createElement(o.a,{value:!0},"\u901A\u8FC7\u5168\u90E8\u6D4B\u8BD5\u96C6",ee.a.createElement("span",{className:"tip"}," ","\uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u4EC5\u5F53\u6240\u6709\u6D4B\u8BD5\u96C6\u90FD\u6B63\u786E\u65F6\uFF0C\u624D\u83B7\u5F97\u4E00\u6B21\u6027\u5956\u52B1\uFF09")),ee.a.createElement(o.a,{value:!1},"\u901A\u8FC7\u90E8\u5206\u6D4B\u8BD5\u96C6",ee.a.createElement("span",{className:"tip"}," ","\uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u901A\u8FC7\u6D4B\u8BD5\u96C6\u5373\u53EF\u83B7\u5F97\u5BF9\u5E94\u5956\u52B1\uFF09")))),ee.a.createElement(C.a,{style:{marginBottom:"5px"},checked:Ar,onChange:bn},"\u9690\u85CF\u5B9E\u9645\u8F93\u51FA \uFF08\u9009\u4E2D\uFF0C\u5219\u5728\u5B66\u751F\u505A\u9898\u8FC7\u7A0B\u4E2D\u65E0\u6CD5\u770B\u5230\u5B9E\u9645\u8F93\u51FA\u7ED3\u679C\uFF0C\u4EC5\u5C55\u793A\u662F\u5426\u8BC4\u6D4B\u662F\u5426\u901A\u8FC7\uFF09"),ee.a.createElement(N.a.Item,{className:Ee.a.testJi,name:["hack","is_file"],label:"\u7528\u4F8B\u7C7B\u578B:"},ee.a.createElement(o.a.Group,{onChange:zr},ee.a.createElement(f.a,{direction:"horizontal"},ee.a.createElement(o.a,{value:!1},"\u6587\u672C"),ee.a.createElement(o.a,{value:!0},"\u6587\u4EF6")))),!Xt.test_set_score&&ee.a.createElement(N.a.Item,{name:["hack","test_set_average"],label:"\u7CFB\u7EDF\u8BC4\u5206\u5360\u6BD4"},ee.a.createElement(o.a.Group,{onChange:Nt},ee.a.createElement(o.a,{value:!0},"\u5747\u5206\u6BD4\u4F8B"),ee.a.createElement(o.a,{value:!1},"\u81EA\u5B9A\u4E49\u6BD4\u4F8B"))),Xt.is_file&&ee.a.createElement("div",{className:Ee.a.upBtn},ee.a.createElement(S.a,{ghost:!0,type:"primary",className:"mb20",onClick:function(){return ht(!0)}},"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"),ee.a.createElement(Lt.a,{disabled:Xt==null?void 0:Xt.test_set_average,inputChange:Mr,showScore:!Xt.test_set_score,data:an,onRemove:zt})),!Xt.is_file&&ee.a.createElement(N.a.List,{name:"hack_sets"},function(or,Yt){return Object(_.a)(Yt),ee.a.createElement(K.a,{accordion:!0},or.map(function(nr,dr){return ee.a.createElement(Cr,{key:"".concat(nr.key,"--").concat(dr),header:ee.a.createElement("a",{className:Ee.a["test-case-name"]},ee.a.createElement("span",null,"\u6D4B\u8BD5\u7528\u4F8B",dr+1),ne?null:ee.a.createElement(ee.a.Fragment,null,ee.a.createElement(N.a.Item,{name:[nr.name,"score"],fieldKey:[nr.fieldKey,"score"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D4B\u8BD5\u96C6".concat(dr+1,"\u8BC4\u5206")}]},ee.a.createElement(r.a,{onClick:Zr,min:0,max:100,disabled:X})),ee.a.createElement("span",null,"%"))),extra:dr>0?ee.a.createElement("div",{onClick:Zr},ee.a.createElement(u.a,{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u5B9A\u5220\u9664\u6D4B\u8BD5\u96C6\b"+(dr+1),onConfirm:function(){Ut(dr)}},ee.a.createElement(Y.a,{className:Ee.a["btn-remove-case"]}))):null},ee.a.createElement(N.a.Item,{label:"\u8F93\u5165",name:[nr.name,"input"],fieldKey:[nr.fieldKey,"input"]},ee.a.createElement(Wt,null)),ee.a.createElement(N.a.Item,{label:"\u8F93\u51FA",name:[nr.name,"output"],fieldKey:[nr.fieldKey,"output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},ee.a.createElement(Wt,null)))}))}))),ee.a.createElement(Lt.b,{rootIdentifier:null,visible:ze,onClose:function(){return ht(!1)},onOK:on}),ee.a.createElement(vt,{visible:pt,onCancel:function(){Ht(!1),z()},onOK:function(){Ht(!1),z()}}))}},rdUC:function(I,J,P){var M=P("MFOe"),u=M.Global;I.exports={name:"localStorage",read:D,write:f,each:l,remove:C,clearAll:v};function _(){return u.localStorage}function D(o){return _().getItem(o)}function f(o,a){return _().setItem(o,a)}function l(o){for(var a=_().length-1;a>=0;a--){var r=_().key(a);o(D(r),r)}}function C(o){return _().removeItem(o)}function v(){return _().clear()}},sR1s:function(I,J,P){"use strict";P.d(J,"b",function(){return D}),P.d(J,"a",function(){return f}),P.d(J,"c",function(){return l}),P.d(J,"d",function(){return C});var M=P("U8pU"),u="RC_TABLE_KEY";function _(v){return v==null?[]:Array.isArray(v)?v:[v]}function D(v,o){if(!o&&typeof o!="number")return v;for(var a=_(o),r=v,h=0;h1)Object(a.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(d.length===0)return Object(a.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var S=d[0];if(l.isValidElement(S)&&Object(r.c)(S)){var y=S.ref;d[0]=l.cloneElement(S,{ref:Object(r.a)(y,this.setChildNode)})}return d.length===1?d[0]:d.map(function(i,k){return!l.isValidElement(i)||"key"in i&&i.key!==null?i:l.cloneElement(i,{key:"".concat(m,"-").concat(k)})})}}]),c}(l.Component);p.displayName="ResizeObserver",J.a=p},uGsb:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("MlIO"),P("1uat"))})(this,function(M){return function(){var u=M,_=u.x64,D=_.Word,f=_.WordArray,l=u.algo,C=l.SHA512,v=l.SHA384=C.extend({_doReset:function(){this._hash=new f.init([new D.init(3418070365,3238371032),new D.init(1654270250,914150663),new D.init(2438529370,812702999),new D.init(355462360,4144912697),new D.init(1731405415,4290775857),new D.init(2394180231,1750603025),new D.init(3675008525,1694076839),new D.init(1203062813,3204075428)])},_doFinalize:function(){var o=C._doFinalize.call(this);return o.sigBytes-=16,o}});u.SHA384=C._createHelper(v),u.HmacSHA384=C._createHmacHelper(v)}(),M.SHA384})},uGxW:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(M){return M.pad.NoPadding={pad:function(){},unpad:function(){}},M.pad.NoPadding})},uQRt:function(I,J,P){I.exports=M;function M(){return P("gaXo"),{}}},ulZh:function(I,J,P){typeof window!="undefined"&&function(u,_){I.exports=_()}(this,function(){return function(M){var u={};function _(D){if(u[D])return u[D].exports;var f=u[D]={i:D,l:!1,exports:{}};return M[D].call(f.exports,f,f.exports,_),f.l=!0,f.exports}return _.m=M,_.c=u,_.d=function(D,f,l){_.o(D,f)||Object.defineProperty(D,f,{enumerable:!0,get:l})},_.r=function(D){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})},_.t=function(D,f){if(f&1&&(D=_(D)),f&8)return D;if(f&4&&typeof D=="object"&&D&&D.__esModule)return D;var l=Object.create(null);if(_.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:D}),f&2&&typeof D!="string")for(var C in D)_.d(l,C,function(v){return D[v]}.bind(null,C));return l},_.n=function(D){var f=D&&D.__esModule?function(){return D.default}:function(){return D};return _.d(f,"a",f),f},_.o=function(D,f){return Object.prototype.hasOwnProperty.call(D,f)},_.p="/dist/",_(_.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(M,u,_){"use strict";var D=Object.prototype.hasOwnProperty,f="~";function l(){}Object.create&&(l.prototype=Object.create(null),new l().__proto__||(f=!1));function C(r,h,m){this.fn=r,this.context=h,this.once=m||!1}function v(r,h,m,p,w){if(typeof m!="function")throw new TypeError("The listener must be a function");var g=new C(m,p||r,w),c=f?f+h:h;return r._events[c]?r._events[c].fn?r._events[c]=[r._events[c],g]:r._events[c].push(g):(r._events[c]=g,r._eventsCount++),r}function o(r,h){--r._eventsCount===0?r._events=new l:delete r._events[h]}function a(){this._events=new l,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],m,p;if(this._eventsCount===0)return h;for(p in m=this._events)D.call(m,p)&&h.push(f?p.slice(1):p);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},a.prototype.listeners=function(h){var m=f?f+h:h,p=this._events[m];if(!p)return[];if(p.fn)return[p.fn];for(var w=0,g=p.length,c=new Array(g);w0},!1)}function r(h,m){for(var p={main:[m]},w={main:[]},g={main:{}};a(p);)for(var c=Object.keys(p),n=0;n=2*k/b||L<=K)return;var W=Number.POSITIVE_INFINITY,G;for(G=c.level-1;G>x;G--){var F=E[G].maxBitrate;if(W=k*F/(8*.8*j),W=L)return;var B=this.bwEstimator.getEstimate();a.logger.warn("Fragment "+c.sn+(n?" part "+n.index:"")+" of level "+c.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+` Current BW estimate: `+(Object(D.isFiniteNumber)(B)?(B/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+L.toFixed(3)+` s Estimated load time for the next fragment: `+W.toFixed(3)+` s Time to underbuffer: `+K.toFixed(3)+" s"),s.nextLoadLevel=G,this.bwEstimator.sample(O,i.loaded),this.clearTimer(),c.loader&&(this.fragCurrent=this.partCurrent=null,c.loader.abort()),s.trigger(l.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:c,part:n,stats:i})},w.onFragLoaded=function(c,n){var s=n.frag,d=n.part;if(s.type===o.PlaylistLevelType.MAIN&&Object(D.isFiniteNumber)(s.sn)){var S=d?d.stats:s.stats,y=d?d.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var i=this.hls.levels[s.level],k=(i.loaded?i.loaded.bytes:0)+S.loaded,O=(i.loaded?i.loaded.duration:0)+y;i.loaded={bytes:k,duration:O},i.realBitrate=Math.round(8*k/O)}if(s.bitrateTest){var b={stats:S,frag:s,part:d,id:s.type};this.onFragBuffered(l.Events.FRAG_BUFFERED,b),s.bitrateTest=!1}}},w.onFragBuffered=function(c,n){var s=n.frag,d=n.part,S=d?d.stats:s.stats;if(S.aborted)return;if(s.type!==o.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var y=S.parsing.end-S.loading.start;this.bwEstimator.sample(y,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=y/1e3:this.bitrateTestDelay=0},w.onError=function(c,n){switch(n.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},w.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},w.getNextABRAutoLevel=function(){var c=this.fragCurrent,n=this.partCurrent,s=this.hls,d=s.maxAutoLevel,S=s.config,y=s.minAutoLevel,i=s.media,k=n?n.duration:c?c.duration:0,O=i?i.currentTime:0,b=i&&i.playbackRate!==0?Math.abs(i.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,x=(C.BufferHelper.bufferInfo(i,O,S.maxBufferHole).end-O)/b,T=this.findBestLevel(E,y,d,x,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(T>=0)return T;a.logger.trace((x?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var N=k?Math.min(k,S.maxStarvationDelay):S.maxStarvationDelay,j=S.abrBandWidthFactor,L=S.abrBandWidthUpFactor;if(!x){var V=this.bitrateTestDelay;if(V){var K=k?Math.min(k,S.maxLoadingDelay):S.maxLoadingDelay;N=K-V,a.logger.trace("bitrate test took "+Math.round(1e3*V)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*N)+" ms"),j=L=1}}return T=this.findBestLevel(E,y,d,x+N,j,L),Math.max(T,0)},w.findBestLevel=function(c,n,s,d,S,y){for(var i,k=this.fragCurrent,O=this.partCurrent,b=this.lastLoadedFragLevel,E=this.hls.levels,x=E[b],T=!!(x!=null&&(i=x.details)!==null&&i!==void 0&&i.live),N=x==null?void 0:x.codecSet,j=O?O.duration:k?k.duration:0,L=s;L>=n;L--){var V=E[L];if(!V||N&&V.codecSet!==N)continue;var K=V.details,W=(O?K==null?void 0:K.partTarget:K==null?void 0:K.averagetargetduration)||j,G=void 0;L<=b?G=S*c:G=y*c;var F=E[L].maxBitrate,B=F*W/G;if(a.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+L+"/"+Math.round(G)+"/"+F+"/"+W+"/"+d+"/"+B),G>F&&(!B||T&&!this.bitrateTestDelay||B0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+T.toFixed(3)),this.state=f.State.IDLE):(this.loadedmetadata=!1,this.state=f.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},b.doTick=function(){switch(this.state){case f.State.IDLE:this.doTickIdle();break;case f.State.WAITING_TRACK:{var x,T=this.levels,N=this.trackId,j=T==null||((x=T[N])===null||x===void 0)?void 0:x.details;if(j){if(this.waitForCdnTuneIn(j))break;this.state=f.State.WAITING_INIT_PTS}break}case f.State.FRAG_LOADING_WAITING_RETRY:{var L,V=performance.now(),K=this.retryDate;(!K||V>=K||(L=this.media)!==null&&L!==void 0&&L.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=f.State.IDLE);break}case f.State.WAITING_INIT_PTS:{var W=this.waitingData;if(W){var G=W.frag,F=W.part,B=W.cache,H=W.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=f.State.FRAG_LOADING;var q=B.flush(),re={frag:G,part:F,payload:q,networkDetails:null};this._handleFragmentLoadProgress(re),H&&k.prototype._handleFragmentLoadComplete.call(this,re)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ee=this.getLoadPosition(),Ce=C.BufferHelper.bufferInfo(this.mediaBuffer,ee,this.config.maxBufferHole),Ee=Object(w.fragmentWithinToleranceTest)(Ce.end,this.config.maxFragLookUpTolerance,G);Ee<0&&(n.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+Ce.end+" is needed"),this.clearWaitingFragment())}}else this.state=f.State.IDLE}}this.onTickEnd()},b.clearWaitingFragment=function(){var x=this.waitingData;x&&(this.fragmentTracker.removeFragment(x.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=f.State.IDLE)},b.onTickEnd=function(){var x=this.media;if(!x||!x.readyState)return;var T=this.mediaBuffer?this.mediaBuffer:x,N=T.buffered;!this.loadedmetadata&&N.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},b.doTickIdle=function(){var x,T,N=this.hls,j=this.levels,L=this.media,V=this.trackId,K=N.config;if(!j||!j[V])return;if(!L&&(this.startFragRequested||!K.startFragPrefetch))return;var W=j[V],G=W.details;if(!G||G.live&&this.levelLastLoaded!==V||this.waitForCdnTuneIn(G)){this.state=f.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,r.ElementaryStreamTypes.AUDIO,a.PlaylistLevelType.AUDIO));var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,a.PlaylistLevelType.AUDIO);if(F===null)return;var B=F.len,H=this.getMaxBufferLength(),q=this.audioSwitch;if(B>=H&&!q)return;if(!q&&this._streamEnded(F,G)){N.trigger(l.Events.BUFFER_EOS,{type:"audio"}),this.state=f.State.ENDED;return}var re=G.fragments,ee=re[0].start,Ce=F.end;if(q){var Ee=this.getLoadPosition();Ce=Ee,G.PTSKnown&&Eeee||F.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),L.currentTime=ee+.05))}var pe=this.getNextFragment(Ce,G);if(!pe){this.bufferFlushed=!0;return}((x=pe.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((T=pe.decryptdata)!==null&&T!==void 0&&T.key)?this.loadKey(pe,G):this.loadFragment(pe,G,Ce)},b.getMaxBufferLength=function(){var x=k.prototype.getMaxBufferLength.call(this),T=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,a.PlaylistLevelType.MAIN);return T===null?x:Math.max(x,T.len)},b.onMediaDetaching=function(){this.videoBuffer=null,k.prototype.onMediaDetaching.call(this)},b.onAudioTracksUpdated=function(x,T){var N=T.audioTracks;this.resetTransmuxer(),this.levels=N.map(function(j){return new o.Level(j)})},b.onAudioTrackSwitching=function(x,T){var N=!!T.url;this.trackId=T.id;var j=this.fragCurrent;j!=null&&j.loader&&j.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),N?this.setInterval(y):this.resetTransmuxer(),N?(this.audioSwitch=!0,this.state=f.State.IDLE):this.state=f.State.STOPPED,this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},b.onLevelLoaded=function(x,T){this.mainDetails=T.details},b.onAudioTrackLoaded=function(x,T){var N,j=this.levels,L=T.details,V=T.id;if(!j){this.warn("Audio tracks were reset while loading level "+V);return}this.log("Track "+V+" loaded ["+L.startSN+","+L.endSN+"],duration:"+L.totalduration);var K=j[V],W=0;if(L.live||(N=K.details)!==null&&N!==void 0&&N.live){var G=this.mainDetails;if(L.fragments[0]||(L.deltaUpdateFailed=!0),L.deltaUpdateFailed||!G)return;!K.details&&L.hasProgramDateTime&&G.hasProgramDateTime?(Object(g.alignMediaPlaylistByPDT)(L,G),W=L.fragments[0].start):W=this.alignPlaylists(L,K.details)}K.details=L,this.levelLastLoaded=V,!this.startFragRequested&&(this.mainDetails||!L.live)&&this.setStartPosition(K.details,W),this.state===f.State.WAITING_TRACK&&!this.waitForCdnTuneIn(L)&&(this.state=f.State.IDLE),this.tick()},b._handleFragmentLoadProgress=function(x){var T,N=x.frag,j=x.part,L=x.payload,V=this.config,K=this.trackId,W=this.levels;if(!W){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+N.sn+" of level "+N.level+" will not be buffered");return}var G=W[K];console.assert(G,"Audio track is defined on fragment load progress");var F=G.details;console.assert(F,"Audio track details are defined on fragment load progress");var B=V.defaultAudioCodec||G.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new m.default(this.hls,a.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var q=this.initPTS[N.cc],re=(T=N.initSegment)===null||T===void 0?void 0:T.data;if(q!==void 0){var ee=!1,Ce=j?j.index:-1,Ee=Ce!==-1,pe=new p.ChunkMetadata(N.level,N.sn,N.stats.chunkCount,L.byteLength,Ce,Ee);H.push(L,re,B,"",N,j,F.totalduration,ee,pe,q)}else{n.logger.log("Unknown video PTS for cc "+N.cc+", waiting for video PTS before demuxing audio frag "+N.sn+" of ["+F.startSN+" ,"+F.endSN+"],track "+K);var Me=this.waitingData=this.waitingData||{frag:N,part:j,cache:new h.default,complete:!1},_e=Me.cache;_e.push(new Uint8Array(L)),this.waitingVideoCC=this.videoTrackCC,this.state=f.State.WAITING_INIT_PTS}},b._handleFragmentLoadComplete=function(x){if(this.waitingData){this.waitingData.complete=!0;return}k.prototype._handleFragmentLoadComplete.call(this,x)},b.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},b.onBufferCreated=function(x,T){var N=T.tracks.audio;N&&(this.mediaBuffer=N.buffer),T.tracks.video&&(this.videoBuffer=T.tracks.video.buffer)},b.onFragBuffered=function(x,T){var N=T.frag,j=T.part;if(N.type!==a.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(N)){this.warn("Fragment "+N.sn+(j?" p: "+j.index:"")+" of level "+N.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}N.sn!=="initSegment"&&(this.fragPrevious=N,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(l.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(N,j)},b.onError=function(x,T){switch(T.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(a.PlaylistLevelType.AUDIO,T);break;case c.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case c.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==f.State.ERROR&&this.state!==f.State.STOPPED&&(this.state=T.fatal?f.State.ERROR:f.State.IDLE,this.warn(T.details+" while loading frag, switching to "+this.state+" state"));break;case c.ErrorDetails.BUFFER_FULL_ERROR:if(T.parent==="audio"&&(this.state===f.State.PARSING||this.state===f.State.PARSED)){var N=!0,j=this.getFwdBufferInfo(this.mediaBuffer,a.PlaylistLevelType.AUDIO);j&&j.len>.5&&(N=!this.reduceMaxBufferLength(j.len)),N&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,k.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},b.onBufferFlushed=function(x,T){var N=T.type;N===r.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},b._handleTransmuxComplete=function(x){var T,N="audio",j=this.hls,L=x.remuxResult,V=x.chunkMeta,K=this.getCurrentContext(V);if(!K){this.warn("The loading context changed while buffering fragment "+V.sn+" of level "+V.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(V.level);return}var W=K.frag,G=K.part,F=L.audio,B=L.text,H=L.id3,q=L.initSegment;if(this.fragContextChanged(W))return;if(this.state=f.State.PARSING,this.audioSwitch&&F&&this.completeAudioSwitch(),q!=null&&q.tracks&&(this._bufferInitSegment(q.tracks,W,V),j.trigger(l.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:N,tracks:q.tracks})),F){var re=F.startPTS,ee=F.endPTS,Ce=F.startDTS,Ee=F.endDTS;G&&(G.elementaryStreams[r.ElementaryStreamTypes.AUDIO]={startPTS:re,endPTS:ee,startDTS:Ce,endDTS:Ee}),W.setElementaryStreamInfo(r.ElementaryStreamTypes.AUDIO,re,ee,Ce,Ee),this.bufferFragmentData(F,W,G,V)}if(H!=null&&(T=H.samples)!==null&&T!==void 0&&T.length){var pe=s({frag:W,id:N},H);j.trigger(l.Events.FRAG_PARSING_METADATA,pe)}if(B){var Me=s({frag:W,id:N},B);j.trigger(l.Events.FRAG_PARSING_USERDATA,Me)}},b._bufferInitSegment=function(x,T,N){if(this.state!==f.State.PARSING)return;x.video&&delete x.video;var j=x.audio;if(!j)return;j.levelCodec=j.codec,j.id="audio",this.log("Init audio buffer, container:"+j.container+", codecs[parsed]=["+j.codec+"]"),this.hls.trigger(l.Events.BUFFER_CODECS,x);var L=j.initSegment;if(L!=null&&L.byteLength){var V={type:"audio",frag:T,part:null,chunkMeta:N,parent:T.type,data:L};this.hls.trigger(l.Events.BUFFER_APPENDING,V)}this.tick()},b.loadFragment=function(x,T,N){var j=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||j===v.FragmentState.NOT_LOADED||j===v.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):T.live&&!Object(D.isFiniteNumber)(this.initPTS[x.cc])?(this.log("Waiting for video PTS in continuity counter "+x.cc+" of live stream before loading audio fragment "+x.sn+" of level "+this.trackId),this.state=f.State.WAITING_INIT_PTS):(this.startFragRequested=!0,k.prototype.loadFragment.call(this,x,T,N)))},b.completeAudioSwitch=function(){var x=this.hls,T=this.media,N=this.trackId;T&&(this.log("Switching audio track : flushing all audio"),k.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,x.trigger(l.Events.AUDIO_TRACK_SWITCHED,{id:N})},O}(f.default);u.default=i},"./src/controller/audio-track-controller.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/events.ts"),f=_("./src/errors.ts"),l=_("./src/controller/base-playlist-controller.ts"),C=_("./src/types/loader.ts");function v(m,p){for(var w=0;w=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=n[this.trackId];this.log("Now switching to audio-track index "+c);var d=n[c],S=d.id,y=d.groupId,i=y===void 0?"":y,k=d.name,O=d.type,b=d.url;if(this.trackId=c,this.trackName=k,this.selectDefaultTrack=!1,this.hls.trigger(D.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:i,name:k,type:O,url:b}),d.details&&!d.details.live)return;var E=this.switchParams(d.url,s==null?void 0:s.details);this.loadPlaylist(E)},w.selectInitialTrack=function(){var c=this.tracksInGroup;console.assert(c.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,s=this.findTrackId(n)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(D.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},w.findTrackId=function(c){for(var n=this.tracksInGroup,s=0;sp.partTarget&&(d+=1)}if(Object(D.isFiniteNumber)(s))return new f.HlsUrlParameters(s,Object(D.isFiniteNumber)(d)?d:void 0,f.HlsSkip.No)}}},r.loadPlaylist=function(m){},r.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},r.playlistLoaded=function(m,p,w){var g=this,c=p.details,n=p.stats,s=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(c.advancedDateTime=Date.now()-s,c.live||w!=null&&w.live){if(c.reloaded(w),w&&this.log("live playlist "+m+" "+(c.advanced?"REFRESHED "+c.lastPartSn+"-"+c.lastPartIndex:"MISSED")),w&&c.fragments.length>0&&Object(l.mergeDetails)(w,c),!this.canLoad||!c.live)return;var d,S=void 0,y=void 0;if(c.canBlockReload&&c.endSN&&c.advanced){var i=this.hls.config.lowLatencyMode,k=c.lastPartSn,O=c.endSN,b=c.lastPartIndex,E=b!==-1,x=k===O,T=i?0:b;E?(S=x?O+1:k,y=x?T:b+1):S=O+1;var N=c.age,j=N+c.ageHeader,L=Math.min(j-c.partTarget,c.targetduration*1.5);if(L>0){if(w&&L>w.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+w.tuneInGoal+" to: "+L+" with playlist age: "+c.age),L=0;else{var V=Math.floor(L/c.targetduration);if(S+=V,y!==void 0){var K=Math.round(L%c.targetduration/c.partTarget);y+=K}this.log("CDN Tune-in age: "+c.ageHeader+"s last advanced "+N.toFixed(2)+"s goal: "+L+" skip sn "+V+" to part "+y)}c.tuneInGoal=L}if(d=this.getDeliveryDirectives(c,p.deliveryDirectives,S,y),i||!x){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(c,p.deliveryDirectives,S,y);var W=Object(l.computeReloadInterval)(c,n);S!==void 0&&c.canBlockReload&&(W-=c.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(W)+" ms"),this.timer=self.setTimeout(function(){return g.loadPlaylist(d)},W)}else this.clearTimer()},r.getDeliveryDirectives=function(m,p,w,g){var c=Object(f.getSkipValue)(m,w);return p!=null&&p.skip&&m.deltaUpdateFailed&&(w=p.msn,g=p.part,c=f.HlsSkip.No),new f.HlsUrlParameters(w,g,c)},r.retryLoadingOrFail=function(m){var p=this,w=this.hls.config,g=this.retryCount-1&&(c=m.context)!==null&&c!==void 0&&c.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*w.levelLoadingRetryDelay,w.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return p.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return g},a}()},"./src/controller/base-stream-controller.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"State",function(){return O}),_.d(u,"default",function(){return b});var D=_("./src/polyfills/number.ts"),f=_("./src/task-loop.ts"),l=_("./src/controller/fragment-tracker.ts"),C=_("./src/utils/buffer-helper.ts"),v=_("./src/utils/logger.ts"),o=_("./src/events.ts"),a=_("./src/errors.ts"),r=_("./src/types/transmuxer.ts"),h=_("./src/utils/mp4-tools.ts"),m=_("./src/utils/discontinuities.ts"),p=_("./src/controller/fragment-finders.ts"),w=_("./src/controller/level-helper.ts"),g=_("./src/loader/fragment-loader.ts"),c=_("./src/crypt/decrypter.ts"),n=_("./src/utils/time-ranges.ts"),s=_("./src/types/loader.ts");function d(E,x){for(var T=0;Tq;(G0&&G&&G.key&&G.iv&&G.method==="AES-128"){var F=self.performance.now();return L.decrypter.webCryptoDecrypt(new Uint8Array(W),G.key.buffer,G.iv.buffer).then(function(B){var H=self.performance.now();return K.trigger(o.Events.FRAG_DECRYPTED,{frag:j,payload:B,stats:{tstart:F,tdecrypt:H}}),V.payload=B,V})}return V}).then(function(V){var K=L.fragCurrent,W=L.hls,G=L.levels;if(!G)throw new Error("init load aborted, missing levels");var F=G[j.level].details;console.assert(F,"Level details are defined when init segment is loaded");var B=j.stats;L.state=O.IDLE,L.fragLoadError=0,j.data=new Uint8Array(V.payload),B.parsing.start=B.buffering.start=self.performance.now(),B.parsing.end=B.buffering.end=self.performance.now(),V.frag===K&&W.trigger(o.Events.FRAG_BUFFERED,{stats:B,frag:K,part:null,id:j.type}),L.tick()}).catch(function(V){L.warn(V),L.resetFragmentLoading(j)})},T.fragContextChanged=function(j){var L=this.fragCurrent;return!j||!L||j.level!==L.level||j.sn!==L.sn||j.urlId!==L.urlId},T.fragBufferedComplete=function(j,L){var V=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+j.type+" sn: "+j.sn+(L?" part: "+L.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+j.level+" "+n.default.toString(C.BufferHelper.getBuffered(V))),this.state=O.IDLE,this.tick()},T._handleFragmentLoadComplete=function(j){var L=this.transmuxer;if(!L)return;var V=j.frag,K=j.part,W=j.partsLoaded,G=!W||W.length===0||W.some(function(B){return!B}),F=new r.ChunkMetadata(V.level,V.sn,V.stats.chunkCount+1,0,K?K.index:-1,!G);L.flush(F)},T._handleFragmentLoadProgress=function(j){},T._doFragLoad=function(j,L,V,K){var W=this;if(V===void 0&&(V=null),!this.levels)throw new Error("frag load aborted, missing levels");if(V=Math.max(j.start,V||0),this.config.lowLatencyMode&&L){var G=L.partList;if(G&&K){V>j.end&&L.fragmentHint&&(j=L.fragmentHint);var F=this.getNextPart(G,j,V);if(F>-1){var B=G[F];return this.log("Loading part sn: "+j.sn+" p: "+B.index+" cc: "+j.cc+" of playlist ["+L.startSN+"-"+L.endSN+"] parts [0-"+F+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+j.level+", target: "+parseFloat(V.toFixed(3))),this.nextLoadPosition=B.start+B.duration,this.state=O.FRAG_LOADING,this.hls.trigger(o.Events.FRAG_LOADING,{frag:j,part:G[F],targetBufferTime:V}),this.doFragPartsLoad(j,G,F,K).catch(function(H){return W.handleFragLoadError(H)})}else if(!j.url||this.loadedEndOfParts(G,V))return Promise.resolve(null)}}return this.log("Loading fragment "+j.sn+" cc: "+j.cc+" "+(L?"of ["+L.startSN+"-"+L.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+j.level+", target: "+parseFloat(V.toFixed(3))),Object(D.isFiniteNumber)(j.sn)&&!this.bitrateTest&&(this.nextLoadPosition=j.start+j.duration),this.state=O.FRAG_LOADING,this.hls.trigger(o.Events.FRAG_LOADING,{frag:j,targetBufferTime:V}),this.fragmentLoader.load(j,K).catch(function(H){return W.handleFragLoadError(H)})},T.doFragPartsLoad=function(j,L,V,K){var W=this;return new Promise(function(G,F){var B=[],H=function q(re){var ee=L[re];W.fragmentLoader.loadPart(j,ee,K).then(function(Ce){B[ee.index]=Ce;var Ee=Ce.part;W.hls.trigger(o.Events.FRAG_LOADED,Ce);var pe=L[re+1];if(pe&&pe.fragment===j)q(re+1);else return G({frag:j,part:Ee,partsLoaded:B})}).catch(F)};H(V)})},T.handleFragLoadError=function(j){var L=j.data;return L&&L.details===a.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(L.frag,L.part):this.hls.trigger(o.Events.ERROR,L),null},T._handleTransmuxerFlush=function(j){var L=this.getCurrentContext(j);if(!L||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var V=L.frag,K=L.part,W=L.level,G=self.performance.now();V.stats.parsing.end=G,K&&(K.stats.parsing.end=G),this.updateLevelTiming(V,K,W,j.partial)},T.getCurrentContext=function(j){var L=this.levels,V=j.level,K=j.sn,W=j.part;if(!L||!L[V])return this.warn("Levels object was unset while buffering fragment "+K+" of level "+V+". The current chunk will not be buffered."),null;var G=L[V],F=W>-1?Object(w.getPartWith)(G,K,W):null,B=F?F.fragment:Object(w.getFragmentWithSN)(G,K,this.fragCurrent);return B?{frag:B,part:F,level:G}:null},T.bufferFragmentData=function(j,L,V,K){if(!j||this.state!==O.PARSING)return;var W=j.data1,G=j.data2,F=W;if(W&&G&&(F=Object(h.appendUint8Array)(W,G)),!F||!F.length)return;var B={type:j.type,frag:L,part:V,chunkMeta:K,parent:L.type,data:F};this.hls.trigger(o.Events.BUFFER_APPENDING,B),j.dropped&&j.independent&&!V&&this.flushBufferGap(L)},T.flushBufferGap=function(j){var L=this.media;if(!L)return;if(!C.BufferHelper.isBuffered(L,L.currentTime)){this.flushMainBuffer(0,j.start);return}var V=L.currentTime,K=C.BufferHelper.bufferInfo(L,V,0),W=j.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,W*.25),F=Math.max(Math.min(j.start-G,K.end-G),V+G);j.start-F>G&&this.flushMainBuffer(F,j.start)},T.getFwdBufferInfo=function(j,L){var V=this.config,K=this.getLoadPosition();if(!Object(D.isFiniteNumber)(K))return null;var W=C.BufferHelper.bufferInfo(j,K,V.maxBufferHole);if(W.len===0&&W.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(K,L);if(G&&W.nextStart=V?(L.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+L.maxMaxBufferLength+"s"),!0):!1},T.getNextFragment=function(j,L){var V,K,W=L.fragments,G=W.length;if(!G)return null;var F=this.config,B=W[0].start,H;if(L.live){var q=F.initialLiveManifestSize;if(G-1&&VV.start&&V.loaded},T.getInitialLiveFragment=function(j,L){var V=this.fragPrevious,K=null;if(V){if(j.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+V.programDateTime),K=Object(p.findFragmentByPDT)(L,V.endProgramDateTime,this.config.maxFragLookUpTolerance)),!K){var W=V.sn+1;if(W>=j.startSN&&W<=j.endSN){var G=L[W-j.startSN];V.cc===G.cc&&(K=G,this.log("Live playlist, switching playlist, load frag with next SN: "+K.sn))}K||(K=Object(p.findFragWithCC)(L,V.cc),K&&this.log("Live playlist, switching playlist, load frag with same CC: "+K.sn))}}else{var F=this.hls.liveSyncPosition;F!==null&&(K=this.getFragmentAtPosition(F,this.bitrateTest?j.fragmentEnd:j.edge,j))}return K},T.getFragmentAtPosition=function(j,L,V){var K=this.config,W=this.fragPrevious,G=V.fragments,F=V.endSN,B=V.fragmentHint,H=K.maxFragLookUpTolerance,q=!!(K.lowLatencyMode&&V.partList&&B);q&&B&&!this.bitrateTest&&(G=G.concat(B),F=B.sn);var re;if(jL-H?0:H;re=Object(p.findFragmentByPTS)(W,G,j,ee)}else re=G[G.length-1];if(re){var Ce=re.sn-V.startSN,Ee=W&&re.level===W.level,pe=G[Ce+1],Me=this.fragmentTracker.getState(re);if(Me===l.FragmentState.BACKTRACKED){re=null;for(var _e=Ce;G[_e]&&this.fragmentTracker.getState(G[_e])===l.FragmentState.BACKTRACKED;)W?re=G[_e--]:re=G[--_e];re||(re=pe)}else W&&re.sn===W.sn&&!q&&(Ee&&(re.sn=G-L.maxFragLookUpTolerance&&W<=F;if(K!==null&&V.duration>K&&(W"+j.startSN+" prev-sn: "+(W?W.sn:"na")+" fragments: "+F),re}return B},T.waitForCdnTuneIn=function(j){var L=3;return j.live&&j.canBlockReload&&j.tuneInGoal>Math.max(j.partHoldBack,j.partTarget*L)},T.setStartPosition=function(j,L){var V=this.startPosition;if(V"+j))}}]),x}(f.default)},"./src/controller/buffer-controller.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return p});var D=_("./src/polyfills/number.ts"),f=_("./src/events.ts"),l=_("./src/utils/logger.ts"),C=_("./src/errors.ts"),v=_("./src/utils/buffer-helper.ts"),o=_("./src/utils/mediasource-helper.ts"),a=_("./src/loader/fragment.ts"),r=_("./src/controller/buffer-operation-queue.ts"),h=Object(o.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,p=function(){function w(c){var n=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var s=n.hls,d=n.media,S=n.mediaSource;l.logger.log("[buffer-controller]: Media source opened"),d&&(n.updateMediaElementDuration(),s.trigger(f.Events.MEDIA_ATTACHED,{media:d})),S&&S.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){l.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){l.logger.log("[buffer-controller]: Media source ended")},this.hls=c,this._initSourceBuffer(),this.registerListeners()}var g=w.prototype;return g.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},g.destroy=function(){this.unregisterListeners(),this.details=null},g.registerListeners=function(){var n=this.hls;n.on(f.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(f.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(f.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(f.Events.BUFFER_RESET,this.onBufferReset,this),n.on(f.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(f.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(f.Events.BUFFER_EOS,this.onBufferEos,this),n.on(f.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(f.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(f.Events.FRAG_PARSED,this.onFragParsed,this),n.on(f.Events.FRAG_CHANGED,this.onFragChanged,this)},g.unregisterListeners=function(){var n=this.hls;n.off(f.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(f.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(f.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(f.Events.BUFFER_RESET,this.onBufferReset,this),n.off(f.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(f.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(f.Events.BUFFER_EOS,this.onBufferEos,this),n.off(f.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(f.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(f.Events.FRAG_PARSED,this.onFragParsed,this),n.off(f.Events.FRAG_CHANGED,this.onFragChanged,this)},g._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new r.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},g.onManifestParsed=function(n,s){var d=2;(s.audio&&!s.video||!s.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,l.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},g.onMediaAttaching=function(n,s){var d=this.media=s.media;if(d&&h){var S=this.mediaSource=new h;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(S),this._objectUrl=d.src}},g.onMediaDetaching=function(){var n=this.media,s=this.mediaSource,d=this._objectUrl;if(s){if(l.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(S){l.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(d&&self.URL.revokeObjectURL(d),n.src===d?(n.removeAttribute("src"),n.load()):l.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(f.Events.MEDIA_DETACHED,void 0)},g.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(s){var d=n.sourceBuffer[s];try{d&&(n.removeBufferListeners(s),n.mediaSource&&n.mediaSource.removeSourceBuffer(d),n.sourceBuffer[s]=void 0)}catch(S){l.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",S)}}),this._initSourceBuffer()},g.onBufferCodecs=function(n,s){var d=this,S=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(y){if(S){var i=d.tracks[y];if(i&&typeof i.buffer.changeType=="function"){var k=s[y],O=k.codec,b=k.levelCodec,E=k.container,x=(i.levelCodec||i.codec).replace(m,"$1"),T=(b||O).replace(m,"$1");if(x!==T){var N=E+";codecs="+(b||O);d.appendChangeType(y,N)}}}else d.pendingTracks[y]=s[y]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},g.appendChangeType=function(n,s){var d=this,S=this.operationQueue,y={execute:function(){var k=d.sourceBuffer[n];k&&(l.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+s),k.changeType(s)),S.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(k){l.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",k)}};S.append(y,n)},g.onBufferAppending=function(n,s){var d=this,S=this.hls,y=this.operationQueue,i=this.tracks,k=s.data,O=s.type,b=s.frag,E=s.part,x=s.chunkMeta,T=x.buffering[O],N=self.performance.now();T.start=N;var j=b.stats.buffering,L=E?E.stats.buffering:null;j.start===0&&(j.start=N),L&&L.start===0&&(L.start=N);var V=i.audio,K=O==="audio"&&x.id===1&&(V==null?void 0:V.container)==="audio/mpeg",W={execute:function(){if(T.executeStart=self.performance.now(),K){var F=d.sourceBuffer[O];if(F){var B=b.start-F.timestampOffset;Math.abs(B)>=.1&&(l.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+b.start+" (delta: "+B+") sn: "+b.sn+")"),F.timestampOffset=b.start)}}d.appendExecutor(k,O)},onStart:function(){},onComplete:function(){var F=self.performance.now();T.executeEnd=T.end=F,j.first===0&&(j.first=F),L&&L.first===0&&(L.first=F);var B=d.sourceBuffer,H={};for(var q in B)H[q]=v.BufferHelper.getBuffered(B[q]);d.appendError=0,d.hls.trigger(f.Events.BUFFER_APPENDED,{type:O,frag:b,part:E,chunkMeta:x,parent:b.type,timeRanges:H})},onError:function(F){l.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",F);var B={type:C.ErrorTypes.MEDIA_ERROR,parent:b.type,details:C.ErrorDetails.BUFFER_APPEND_ERROR,err:F,fatal:!1};F.code===DOMException.QUOTA_EXCEEDED_ERR?B.details=C.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,B.details=C.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>S.config.appendErrorMaxRetry&&(l.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),B.fatal=!0)),S.trigger(f.Events.ERROR,B)}};y.append(W,O)},g.onBufferFlushing=function(n,s){var d=this,S=this.operationQueue,y=function(k){return{execute:d.removeExecutor.bind(d,k,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(f.Events.BUFFER_FLUSHED,{type:k})},onError:function(b){l.logger.warn("[buffer-controller]: Failed to remove from "+k+" SourceBuffer",b)}}};s.type?S.append(y(s.type),s.type):this.getSourceBufferTypes().forEach(function(i){S.append(y(i),i)})},g.onFragParsed=function(n,s){var d=this,S=s.frag,y=s.part,i=[],k=y?y.elementaryStreams:S.elementaryStreams;k[a.ElementaryStreamTypes.AUDIOVIDEO]?i.push("audiovideo"):(k[a.ElementaryStreamTypes.AUDIO]&&i.push("audio"),k[a.ElementaryStreamTypes.VIDEO]&&i.push("video"));var O=function(){var E=self.performance.now();S.stats.buffering.end=E,y&&(y.stats.buffering.end=E);var x=y?y.stats:S.stats;d.hls.trigger(f.Events.FRAG_BUFFERED,{frag:S,part:y,stats:x,id:S.type})};i.length===0&&l.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(O,i)},g.onFragChanged=function(n,s){this.flushBackBuffer()},g.onBufferEos=function(n,s){var d=this,S=this.getSourceBufferTypes().reduce(function(y,i){var k=d.sourceBuffer[i];return(!s.type||s.type===i)&&(k&&!k.ended&&(k.ended=!0,l.logger.log("[buffer-controller]: "+i+" sourceBuffer now EOS"))),y&&!!(!k||k.ended)},!0);S&&this.blockBuffers(function(){var y=d.mediaSource;if(!y||y.readyState!=="open")return;y.endOfStream()})},g.onLevelUpdated=function(n,s){var d=s.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},g.flushBackBuffer=function(){var n=this.hls,s=this.details,d=this.media,S=this.sourceBuffer;if(!d||s===null)return;var y=this.getSourceBufferTypes();if(!y.length)return;var i=s.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(D.isFiniteNumber)(i)||i<0)return;var k=d.currentTime,O=s.levelTargetDuration,b=Math.max(i,O),E=Math.floor(k/O)*O-b;y.forEach(function(x){var T=S[x];if(T){var N=v.BufferHelper.getBuffered(T);N.length>0&&E>N.start(0)&&(n.trigger(f.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),s.live&&n.trigger(f.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),n.trigger(f.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:x}))}})},g.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,s=this.hls,d=this.media,S=this.mediaSource,y=n.fragments[0].start+n.totalduration,i=d.duration,k=Object(D.isFiniteNumber)(S.duration)?S.duration:0;n.live&&s.config.liveDurationInfinity?(l.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(n)):(y>k&&y>i||!Object(D.isFiniteNumber)(i))&&(l.logger.log("[buffer-controller]: Updating Media Source duration to "+y.toFixed(3)),S.duration=y)},g.updateSeekableRange=function(n){var s=this.mediaSource,d=n.fragments,S=d.length;if(S&&n.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var y=Math.max(0,d[0].start),i=Math.max(y,y+n.totalduration);s.setLiveSeekableRange(y,i)}},g.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,s=this.operationQueue,d=this.pendingTracks,S=Object.keys(d).length;if(S&&!n||S===2){this.createSourceBuffers(d),this.pendingTracks={};var y=this.getSourceBufferTypes();if(y.length===0){this.hls.trigger(f.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}y.forEach(function(i){s.executeNext(i)})}},g.createSourceBuffers=function(n){var s=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var y in n)if(!s[y]){var i=n[y];if(!i)throw Error("source buffer exists for track "+y+", however track does not");var k=i.levelCodec||i.codec,O=i.container+";codecs="+k;l.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var b=s[y]=d.addSourceBuffer(O),E=y;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[y]={buffer:b,codec:k,container:i.container,levelCodec:i.levelCodec,id:i.id},S++}catch(x){l.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(f.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:O})}}S&&this.hls.trigger(f.Events.BUFFER_CREATED,{tracks:this.tracks})},g._onSBUpdateStart=function(n){var s=this.operationQueue,d=s.current(n);d.onStart()},g._onSBUpdateEnd=function(n){var s=this.operationQueue,d=s.current(n);d.onComplete(),s.shiftAndExecuteNext(n)},g._onSBUpdateError=function(n,s){l.logger.error("[buffer-controller]: "+n+" SourceBuffer error",s),this.hls.trigger(f.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(n);d&&d.onError(s)},g.removeExecutor=function(n,s,d){var S=this.media,y=this.mediaSource,i=this.operationQueue,k=this.sourceBuffer,O=k[n];if(!S||!y||!O){l.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(n);return}var b=Object(D.isFiniteNumber)(S.duration)?S.duration:Infinity,E=Object(D.isFiniteNumber)(y.duration)?y.duration:Infinity,x=Math.max(0,s),T=Math.min(d,b,E);T>x?(l.logger.log("[buffer-controller]: Removing ["+x+","+T+"] from the "+n+" SourceBuffer"),console.assert(!O.updating,n+" sourceBuffer must not be updating"),O.remove(x,T)):i.shiftAndExecuteNext(n)},g.appendExecutor=function(n,s){var d=this.operationQueue,S=this.sourceBuffer,y=S[s];if(!y){l.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(s);return}y.ended=!1,console.assert(!y.updating,s+" sourceBuffer must not be updating"),y.appendBuffer(n)},g.blockBuffers=function(n,s){var d=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){l.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var S=this.operationQueue,y=s.map(function(i){return S.appendBlocker(i)});Promise.all(y).then(function(){n(),s.forEach(function(i){var k=d.sourceBuffer[i];(!k||!k.updating)&&S.shiftAndExecuteNext(i)})})},g.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},g.addBufferListener=function(n,s,d){var S=this.sourceBuffer[n];if(!S)return;var y=d.bind(this,n);this.listeners[n].push({event:s,listener:y}),S.addEventListener(s,y)},g.removeBufferListeners=function(n){var s=this.sourceBuffer[n];if(!s)return;this.listeners[n].forEach(function(d){s.removeEventListener(d.event,d.listener)})},w}()},"./src/controller/buffer-operation-queue.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return f});var D=_("./src/utils/logger.ts"),f=function(){function l(v){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=v}var C=l.prototype;return C.append=function(o,a){var r=this.queues[a];r.push(o),r.length===1&&this.buffers[a]&&this.executeNext(a)},C.insertAbort=function(o,a){var r=this.queues[a];r.unshift(o),this.executeNext(a)},C.appendBlocker=function(o){var a,r=new Promise(function(m){a=m}),h={execute:a,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(h,o),r},C.executeNext=function(o){var a=this.buffers,r=this.queues,h=a[o],m=r[o];if(m.length){var p=m[0];try{p.execute()}catch(w){D.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),p.onError(w),(!h||!h.updating)&&(m.shift(),this.executeNext(o))}}},C.shiftAndExecuteNext=function(o){this.queues[o].shift(),this.executeNext(o)},C.current=function(o){return this.queues[o][0]},l}()},"./src/controller/cap-level-controller.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/events.ts");function f(v,o){for(var a=0;a0&&this.mediaWidth>0){var r=this.hls.levels;if(r.length){var h=this.hls;h.autoLevelCapping=this.getMaxLevel(r.length-1),h.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=h.autoLevelCapping}}},o.getMaxLevel=function(r){var h=this,m=this.hls.levels;if(!m.length)return-1;var p=m.filter(function(w,g){return v.isLevelAllowed(g,h.restrictedLevels)&&g<=r});return this.clientRect=null,v.getMaxLevelByMediaSize(p,this.mediaWidth,this.mediaHeight)},o.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()},o.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},o.getDimensions=function(){if(this.clientRect)return this.clientRect;var r=this.media,h={width:0,height:0};if(r){var m=r.getBoundingClientRect();h.width=m.width,h.height=m.height,!h.width&&!h.height&&(h.width=m.right-m.left||r.width||0,h.height=m.bottom-m.top||r.height||0)}return this.clientRect=h,h},v.isLevelAllowed=function(r,h){return h===void 0&&(h=[]),h.indexOf(r)===-1},v.getMaxLevelByMediaSize=function(r,h,m){if(!r||!r.length)return-1;for(var p=function(s,d){return d?s.width!==d.width||s.height!==d.height:!0},w=r.length-1,g=0;g=h||c.height>=m)&&p(c,r[g+1])){w=g;break}}return w},l(v,[{key:"mediaWidth",get:function(){return this.getDimensions().width*v.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*v.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var r=1;try{r=self.devicePixelRatio}catch(h){}return r}}]),v}();u.default=C},"./src/controller/cmcd-controller.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return p});var D=_("./src/events.ts"),f=_("./src/types/cmcd.ts"),l=_("./src/utils/buffer-helper.ts"),C=_("./src/utils/logger.ts");function v(w,g){for(var c=0;c=w.length?{done:!0}:{done:!1,value:w[n++]}}}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 r(w,g){if(!w)return;if(typeof w=="string")return h(w,g);var c=Object.prototype.toString.call(w).slice(8,-1);if(c==="Object"&&w.constructor&&(c=w.constructor.name),c==="Map"||c==="Set")return Array.from(w);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return h(w,g)}function h(w,g){(g==null||g>w.length)&&(g=w.length);for(var c=0,n=new Array(g);cs&&(s=i.bitrate)}return s>0?s:NaN},g.getBufferLength=function(n){var s=this.hls.media,d=n===f.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!s)return NaN;var S=l.BufferHelper.bufferInfo(d,s.currentTime,this.config.maxBufferHole);return S.len*1e3},g.createPlaylistLoader=function(){var n=this.config.pLoader,s=this.applyPlaylistData,d=n||this.config.loader;return function(){function S(i){this.loader=void 0,this.loader=new d(i)}var y=S.prototype;return y.destroy=function(){this.loader.destroy()},y.abort=function(){this.loader.abort()},y.load=function(k,O,b){s(k),this.loader.load(k,O,b)},o(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},g.createFragmentLoader=function(){var n=this.config.fLoader,s=this.applyFragmentData,d=n||this.config.loader;return function(){function S(i){this.loader=void 0,this.loader=new d(i)}var y=S.prototype;return y.destroy=function(){this.loader.destroy()},y.abort=function(){this.loader.abort()},y.load=function(k,O,b){s(k),this.loader.load(k,O,b)},o(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},w.uuid=function(){var n=URL.createObjectURL(new Blob),s=n.toString();return URL.revokeObjectURL(n),s.substr(s.lastIndexOf("/")+1)},w.serialize=function(n){for(var s=[],d=function(K){return!Number.isNaN(K)&&K!=null&&K!==""&&K!==!1},S=function(K){return Math.round(K)},y=function(K){return S(K/100)*100},i=function(K){return encodeURIComponent(K)},k={br:S,d:S,bl:y,dl:y,mtp:y,nor:i,rtp:y,tb:S},O=Object.keys(n||{}).sort(),b=a(O),E;!(E=b()).done;){var x=E.value,T=n[x];if(!d(T))continue;if(x==="v"&&T===1)continue;if(x=="pr"&&T===1)continue;var N=k[x];N&&(T=N(T));var j=typeof T,L=void 0;x==="ot"||x==="sf"||x==="st"?L=x+"="+T:j==="boolean"?L=x:j==="number"?L=x+"="+T:L=x+"="+JSON.stringify(T),s.push(L)}return s.join(",")},w.toHeaders=function(n){for(var s=Object.keys(n),d={},S=["Object","Request","Session","Status"],y=[{},{},{},{}],i={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},k=0,O=s;ka){this.hls.trigger(D.Events.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var i=a-this._requestLicenseFailureCount+1;l.logger.warn("Retrying license request, "+i+" attempts left"),this._requestLicense(s,d)}break}},w._generateLicenseRequestChallenge=function(c,n){switch(c.mediaKeySystemDomain){case C.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+c.mediaKeySystemDomain)},w._requestLicense=function(c,n){l.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){l.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(D.Events.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(s.mediaKeySystemDomain),S=this._createLicenseXhr(d,c,n);l.logger.log("Sending license request to URL: "+d);var y=this._generateLicenseRequestChallenge(s,c);S.send(y)}catch(i){l.logger.error("Failure requesting DRM license: "+i),this.hls.trigger(D.Events.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},w.onMediaAttached=function(c,n){if(!this._emeEnabled)return;var s=n.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},w.onMediaDetached=function(){var c=this._media,n=this._mediaKeysList;if(!c)return;c.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return c.setMediaKeys(null)}).catch(function(){})},w.onManifestParsed=function(c,n){if(!this._emeEnabled)return;var s=n.levels.map(function(S){return S.audioCodec}).filter(function(S){return!!S}),d=n.levels.map(function(S){return S.videoCodec}).filter(function(S){return!!S});this._attemptKeySystemAccess(C.KeySystems.WIDEVINE,s,d)},o(p,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),p}();u.default=m},"./src/controller/fps-controller.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/events.ts"),f=_("./src/utils/logger.ts"),l=function(){function C(o){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=o,this.registerListeners()}var v=C.prototype;return v.setStreamController=function(a){this.streamController=a},v.registerListeners=function(){this.hls.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},v.unregisterListeners=function(){this.hls.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching)},v.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},v.onMediaAttaching=function(a,r){var h=this.hls.config;if(h.capLevelOnFPSDrop){var m=r.media instanceof self.HTMLVideoElement?r.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),h.fpsDroppedMonitoringPeriod)}},v.checkFPS=function(a,r,h){var m=performance.now();if(r){if(this.lastTime){var p=m-this.lastTime,w=h-this.lastDroppedFrames,g=r-this.lastDecodedFrames,c=1e3*w/p,n=this.hls;if(n.trigger(D.Events.FPS_DROP,{currentDropped:w,currentDecoded:g,totalDroppedFrames:h}),c>0&&w>n.config.fpsDroppedMonitoringThreshold*g){var s=n.currentLevel;f.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=s)&&(s=s-1,n.trigger(D.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:n.currentLevel}),n.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=h,this.lastDecodedFrames=r}},v.checkFPSInterval=function(){var a=this.media;if(a)if(this.isVideoPlaybackQualityAvailable){var r=a.getVideoPlaybackQuality();this.checkFPS(a,r.totalVideoFrames,r.droppedVideoFrames)}else this.checkFPS(a,a.webkitDecodedFrameCount,a.webkitDroppedFrameCount)},C}();u.default=l},"./src/controller/fragment-finders.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"findFragmentByPDT",function(){return l}),_.d(u,"findFragmentByPTS",function(){return C}),_.d(u,"fragmentWithinToleranceTest",function(){return v}),_.d(u,"pdtWithinToleranceTest",function(){return o}),_.d(u,"findFragWithCC",function(){return a});var D=_("./src/polyfills/number.ts"),f=_("./src/utils/binary-search.ts");function l(r,h,m){if(h===null||!Array.isArray(r)||!r.length||!Object(D.isFiniteNumber)(h))return null;var p=r[0].programDateTime;if(h<(p||0))return null;var w=r[r.length-1].endProgramDateTime;if(h>=(w||0))return null;m=m||0;for(var g=0;gr&&m.start?-1:0}function o(r,h,m){var p=Math.min(h,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,w=m.endProgramDateTime||0;return w-p>r}function a(r,h){return f.default.search(r,function(m){return m.cch?-1:0})}},"./src/controller/fragment-tracker.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"FragmentState",function(){return l}),_.d(u,"FragmentTracker",function(){return C});var D=_("./src/events.ts"),f=_("./src/types/loader.ts"),l;(function(a){a.NOT_LOADED="NOT_LOADED",a.BACKTRACKED="BACKTRACKED",a.APPENDING="APPENDING",a.PARTIAL="PARTIAL",a.OK="OK"})(l||(l={}));var C=function(){function a(h){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=h,this._registerListeners()}var r=a.prototype;return r._registerListeners=function(){var m=this.hls;m.on(D.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(D.Events.FRAG_LOADED,this.onFragLoaded,this)},r._unregisterListeners=function(){var m=this.hls;m.off(D.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(D.Events.FRAG_LOADED,this.onFragLoaded,this)},r.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},r.getAppendedFrag=function(m,p){if(p===f.PlaylistLevelType.MAIN){var w=this.activeFragment,g=this.activeParts;if(!w)return null;if(g)for(var c=g.length;c--;){var n=g[c],s=n?n.end:w.appendedPTS;if(n.start<=m&&s!==void 0&&m<=s)return c>9&&(this.activeParts=g.slice(c-9)),n}else if(w.start<=m&&w.appendedPTS!==void 0&&m<=w.appendedPTS)return w}return this.getBufferedFrag(m,p)},r.getBufferedFrag=function(m,p){for(var w=this.fragments,g=Object.keys(w),c=g.length;c--;){var n=w[g[c]];if((n==null?void 0:n.body.type)===p&&n.buffered){var s=n.body;if(s.start<=m&&m<=s.end)return s}}return null},r.detectEvictedFragments=function(m,p,w){var g=this;Object.keys(this.fragments).forEach(function(c){var n=g.fragments[c];if(!n)return;if(!n.buffered){n.body.type===w&&g.removeFragment(n.body);return}var s=n.range[m];if(!s)return;s.time.some(function(d){var S=!g.isTimeBuffered(d.startPTS,d.endPTS,p);return S&&g.removeFragment(n.body),S})})},r.detectPartialFragments=function(m){var p=this,w=this.timeRanges,g=m.frag,c=m.part;if(!w||g.sn==="initSegment")return;var n=o(g),s=this.fragments[n];if(!s)return;Object.keys(w).forEach(function(d){var S=g.elementaryStreams[d];if(!S)return;var y=w[d],i=c!==null||S.partial===!0;s.range[d]=p.getBufferedTimes(g,c,i,y)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},r.fragBuffered=function(m){var p=o(m),w=this.fragments[p];w&&(w.backtrack=w.loaded=null,w.buffered=!0)},r.getBufferedTimes=function(m,p,w,g){for(var c={time:[],partial:w},n=p?p.start:m.start,s=p?p.end:m.end,d=m.minEndPTS||s,S=m.maxStartPTS||n,y=0;y=i&&d<=k){c.time.push({startPTS:Math.max(n,g.start(y)),endPTS:Math.min(s,g.end(y))});break}else if(ni)c.partial=!0,c.time.push({startPTS:Math.max(n,g.start(y)),endPTS:Math.min(s,g.end(y))});else if(s<=i)break}return c},r.getPartialFragment=function(m){var p=null,w,g,c,n=0,s=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(S){var y=d[S];if(!y)return;v(y)&&(g=y.body.start-s,c=y.body.end+s,m>=g&&m<=c&&(w=Math.min(m-g,c-m),n<=w&&(p=y.body,n=w)))}),p},r.getState=function(m){var p=o(m),w=this.fragments[p];return w?w.buffered?v(w)?l.PARTIAL:l.OK:w.backtrack?l.BACKTRACKED:l.APPENDING:l.NOT_LOADED},r.backtrack=function(m,p){var w=o(m),g=this.fragments[w];if(!g||g.backtrack)return null;var c=g.backtrack=p||g.loaded;return g.loaded=null,c},r.getBacktrackData=function(m){var p=o(m),w=this.fragments[p];if(w){var g,c=w.backtrack;if(c!=null&&(g=c.payload)!==null&&g!==void 0&&g.byteLength)return c;this.removeFragment(m)}return null},r.isTimeBuffered=function(m,p,w){for(var g,c,n=0;n=g&&p<=c)return!0;if(p<=g)return!1}return!1},r.onFragLoaded=function(m,p){var w=p.frag,g=p.part;if(w.sn==="initSegment"||w.bitrateTest||g)return;var c=o(w);this.fragments[c]={body:w,loaded:p,backtrack:null,buffered:!1,range:Object.create(null)}},r.onBufferAppended=function(m,p){var w=this,g=p.frag,c=p.part,n=p.timeRanges;if(g.type===f.PlaylistLevelType.MAIN)if(this.activeFragment=g,c){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(c)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(d){var S=n[d];if(w.detectEvictedFragments(d,S),!c)for(var y=0;ym&&g.removeFragment(s)}})},r.removeFragment=function(m){var p=o(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[p]},r.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},a}();function v(a){var r,h;return a.buffered&&(((r=a.range.video)===null||r===void 0?void 0:r.partial)||((h=a.range.audio)===null||h===void 0?void 0:h.partial))}function o(a){return a.type+"_"+a.level+"_"+a.urlId+"_"+a.sn}},"./src/controller/gap-controller.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"STALL_MINIMUM_DURATION_MS",function(){return v}),_.d(u,"MAX_START_GAP_JUMP",function(){return o}),_.d(u,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return a}),_.d(u,"SKIP_BUFFER_RANGE_START",function(){return r}),_.d(u,"default",function(){return h});var D=_("./src/utils/buffer-helper.ts"),f=_("./src/errors.ts"),l=_("./src/events.ts"),C=_("./src/utils/logger.ts"),v=250,o=2,a=.1,r=.05,h=function(){function m(w,g,c,n){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=w,this.media=g,this.fragmentTracker=c,this.hls=n}var p=m.prototype;return p.destroy=function(){this.hls=this.fragmentTracker=this.media=null},p.poll=function(g){var c=this.config,n=this.media,s=this.stalled,d=n.currentTime,S=n.seeking,y=this.seeking&&!S,i=!this.seeking&&S;if(this.seeking=S,d!==g){if(this.moved=!0,s!==null){if(this.stallReported){var k=self.performance.now()-s;C.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(k)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((i||y)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!D.BufferHelper.getBuffered(n).length)return;var O=D.BufferHelper.bufferInfo(n,d,0),b=O.len>0,E=O.nextStart||0;if(!b&&!E)return;if(S){var x=O.len>o,T=!E||E-d>o&&!this.fragmentTracker.getPartialFragment(d);if(x||T)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var N,j=Math.max(E,O.start||0)-d,L=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,V=L==null||((N=L.details)===null||N===void 0)?void 0:N.live,K=V?L.details.targetduration*2:o;if(j>0&&j<=K){this._trySkipBufferHole(null);return}}var W=self.performance.now();if(s===null){this.stalled=W;return}var G=W-s;!S&&G>=v&&this._reportStall(O.len);var F=D.BufferHelper.bufferInfo(n,d,c.maxBufferHole);this._tryFixBufferStall(F,G)},p._tryFixBufferStall=function(g,c){var n=this.config,s=this.fragmentTracker,d=this.media,S=d.currentTime,y=s.getPartialFragment(S);if(y){var i=this._trySkipBufferHole(y);if(i)return}g.len>n.maxBufferHole&&c>n.highBufferWatchdogPeriod*1e3&&(C.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},p._reportStall=function(g){var c=this.hls,n=this.media,s=this.stallReported;s||(this.stallReported=!0,C.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+g+")"),c.trigger(l.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:g}))},p._trySkipBufferHole=function(g){for(var c=this.config,n=this.hls,s=this.media,d=s.currentTime,S=0,y=D.BufferHelper.getBuffered(s),i=0;i=S&&d.05&&this.forwardBufferLength>1){var i=Math.min(2,Math.max(1,n)),k=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;m.playbackRate=Math.min(i,Math.max(1,k))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},r.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},r.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},v(a,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,p=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:p?m.liveMaxLatencyDurationCount*p.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var p=m.holdBack,w=m.partHoldBack,g=m.targetduration,c=this.config,n=c.liveSyncDuration,s=c.liveSyncDurationCount,d=c.lowLatencyMode,S=this.hls.userConfig,y=d&&w||p;(S.liveSyncDuration||S.liveSyncDurationCount||y===0)&&(y=n!==void 0?n:s*g);var i=g,k=1;return y+Math.min(this.stallCount*k,i)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),p=this.targetLatency,w=this.levelDetails;if(m===null||p===null||w===null)return null;var g=w.edge,c=m-p-this.edgeStalled,n=g-w.totalduration,s=g-(this.config.lowLatencyMode&&w.partTarget||w.targetduration);return Math.min(Math.max(n,c),s)}},{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 p=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-p,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,p=this.levelDetails;if(!m||!p)return 0;var w=m.buffered.length;return w?m.buffered.end(w-1):p.edge-this.currentTime}}]),a}()},"./src/controller/level-controller.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return c});var D=_("./src/types/level.ts"),f=_("./src/events.ts"),l=_("./src/errors.ts"),C=_("./src/utils/codecs.ts"),v=_("./src/controller/level-helper.ts"),o=_("./src/controller/base-playlist-controller.ts"),a=_("./src/types/loader.ts");function r(){return r=Object.assign||function(n){for(var s=1;s0){E=k[0].bitrate,k.sort(function(G,F){return G.bitrate-F.bitrate}),this._levels=k;for(var V=0;Vthis.hls.config.fragLoadingMaxRetry&&(x=i.frag.level)):x=i.frag.level}break;case l.ErrorDetails.LEVEL_LOAD_ERROR:case l.ErrorDetails.LEVEL_LOAD_TIMEOUT:k&&(k.deliveryDirectives&&(E=!1),x=k.level),b=!0;break;case l.ErrorDetails.REMUX_ALLOC_ERROR:x=i.level,b=!0;break}x!==void 0&&this.recoverLevel(i,x,b,E)},d.recoverLevel=function(y,i,k,O){var b=y.details,E=this._levels[i];if(E.loadError++,k){var x=this.retryLoadingOrFail(y);if(x)y.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var T=E.url.length;if(T>1&&E.loadError1){var O=(i.urlId+1)%k;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(b){b.urlId=O}),this.level=y}},d.onFragLoaded=function(y,i){var k=i.frag;if(k!==void 0&&k.type===a.PlaylistLevelType.MAIN){var O=this._levels[k.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},d.onLevelLoaded=function(y,i){var k,O=i.level,b=i.details,E=this._levels[O];if(!E){var x;this.warn("Invalid level index "+O),(x=i.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(b.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(O,i,E.details)):(k=i.deliveryDirectives)!==null&&k!==void 0&&k.skip&&(b.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(y,i){var k=this.hls.levels[this.currentLevelIndex];if(!k)return;if(k.audioGroupIds){for(var O=-1,b=this.hls.audioTracks[i.id].groupId,E=0;E0){var O=k.urlId,b=k.url[O];if(y)try{b=y.addDirectives(b)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+i+(y?" at sn "+y.msn+" part "+y.part:"")+" with URL-id "+O+" "+b),this.clearTimer(),this.hls.trigger(f.Events.LEVEL_LOADING,{url:b,level:i,id:O,deliveryDirectives:y||null})}},d.removeLevel=function(y,i){var k=function(E,x){return x!==i},O=this._levels.filter(function(b,E){return E!==y?!0:b.url.length>1&&i!==void 0?(b.url=b.url.filter(k),b.audioGroupIds&&(b.audioGroupIds=b.audioGroupIds.filter(k)),b.textGroupIds&&(b.textGroupIds=b.textGroupIds.filter(k)),b.urlId=0,!0):!1}).map(function(b,E){var x=b.details;return x!=null&&x.fragments&&x.fragments.forEach(function(T){T.level=E}),b});this._levels=O,this.hls.trigger(f.Events.LEVELS_UPDATED,{levels:O})},m(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(y){var i,k=this._levels;if(k.length===0)return;if(this.currentLevelIndex===y&&(i=k[y])!==null&&i!==void 0&&i.details)return;if(y<0||y>=k.length){var O=y<0;if(this.hls.trigger(f.Events.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.LEVEL_SWITCH_ERROR,level:y,fatal:O,reason:"invalid level idx"}),O)return;y=Math.min(y,k.length-1)}this.clearTimer();var b=this.currentLevelIndex,E=k[b],x=k[y];this.log("switching to level "+y+" from "+b),this.currentLevelIndex=y;var T=r({},x,{level:y,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete T._urlId,this.hls.trigger(f.Events.LEVEL_SWITCHING,T);var N=x.details;if(!N||N.live){var j=this.switchParams(x.uri,E==null?void 0:E.details);this.loadPlaylist(j)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(y){this.manualLevelIndex=y,this._startLevel===void 0&&(this._startLevel=y),y!==-1&&(this.level=y)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(y){this._firstLevel=y}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var y=this.hls.config.startLevel;return y!==void 0?y:this._firstLevel}else return this._startLevel},set:function(y){this._startLevel=y}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(y){this.level=y,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=y)}}]),s}(o.default)},"./src/controller/level-helper.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"addGroupId",function(){return l}),_.d(u,"assignTrackIdsByGroup",function(){return C}),_.d(u,"updatePTS",function(){return v}),_.d(u,"updateFragPTSDTS",function(){return a}),_.d(u,"mergeDetails",function(){return r}),_.d(u,"mapPartIntersection",function(){return h}),_.d(u,"mapFragmentIntersection",function(){return m}),_.d(u,"adjustSliding",function(){return p}),_.d(u,"addSliding",function(){return w}),_.d(u,"computeReloadInterval",function(){return g}),_.d(u,"getFragmentWithSN",function(){return c}),_.d(u,"getPartWith",function(){return n});var D=_("./src/polyfills/number.ts"),f=_("./src/utils/logger.ts");function l(s,d,S){switch(d){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(S);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(S);break}}function C(s){var d={};s.forEach(function(S){var y=S.groupId||"";S.id=d[y]=d[y]||0,d[y]++})}function v(s,d,S){var y=s[d],i=s[S];o(y,i)}function o(s,d){var S=d.startPTS;if(Object(D.isFiniteNumber)(S)){var y=0,i;d.sn>s.sn?(y=S-s.start,i=s):(y=s.start-S,i=d),i.duration!==y&&(i.duration=y)}else if(d.sn>s.sn){var k=s.cc===d.cc;k&&s.minEndPTS?d.start=s.start+(s.minEndPTS-s.start):d.start=s.start+s.duration}else d.start=Math.max(s.start-d.duration,0)}function a(s,d,S,y,i,k){var O=y-S;O<=0&&(f.logger.warn("Fragment should have a positive duration",d),y=S+d.duration,k=i+d.duration);var b=S,E=y,x=d.startPTS,T=d.endPTS;if(Object(D.isFiniteNumber)(x)){var N=Math.abs(x-S);Object(D.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(N,d.deltaPTS):d.deltaPTS=N,b=Math.max(S,x),S=Math.min(S,x),i=Math.min(i,d.startDTS),E=Math.min(y,T),y=Math.max(y,T),k=Math.max(k,d.endDTS)}d.duration=y-S;var j=S-d.start;d.appendedPTS=y,d.start=d.startPTS=S,d.maxStartPTS=b,d.startDTS=i,d.endPTS=y,d.minEndPTS=E,d.endDTS=k;var L=d.sn;if(!s||Ls.endSN)return 0;var V,K=L-s.startSN,W=s.fragments;for(W[K]=d,V=K;V>0;V--)o(W[V],W[V-1]);for(V=K;V=0;i--){var k=y[i].initSegment;if(k){S=k;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var O=0,b;if(m(s,d,function(V,K){V.relurl&&(O=V.cc-K.cc),Object(D.isFiniteNumber)(V.startPTS)&&Object(D.isFiniteNumber)(V.endPTS)&&(K.start=K.startPTS=V.startPTS,K.startDTS=V.startDTS,K.appendedPTS=V.appendedPTS,K.maxStartPTS=V.maxStartPTS,K.endPTS=V.endPTS,K.endDTS=V.endDTS,K.minEndPTS=V.minEndPTS,K.duration=V.endPTS-V.startPTS,K.duration&&(b=K),d.PTSKnown=d.alignedSliding=!0),K.elementaryStreams=V.elementaryStreams,K.loader=V.loader,K.stats=V.stats,K.urlId=V.urlId,V.initSegment&&(K.initSegment=V.initSegment,S=V.initSegment)}),S){var E=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;E.forEach(function(V){var K;(!V.initSegment||V.initSegment.relurl===((K=S)===null||K===void 0?void 0:K.relurl))&&(V.initSegment=S)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(V){return!V}),d.deltaUpdateFailed)){f.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=d.skippedSegments;x--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var T=d.fragments;if(O){f.logger.warn("discontinuity sliding from playlist, take drift into account");for(var N=0;N=y.length)return;w(d,y[S].start)}function w(s,d){if(d){for(var S=s.fragments,y=s.skippedSegments;y0&&i0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),E=x),this.state=f.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=f.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,i.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case f.State.IDLE:this.doTickIdle();break;case f.State.WAITING_LEVEL:{var E,x=this.levels,T=this.level,N=x==null||((E=x[T])===null||E===void 0)?void 0:E.details;if(N&&(!N.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(N))break;this.state=f.State.IDLE;break}break}case f.State.FRAG_LOADING_WAITING_RETRY:{var j,L=self.performance.now(),V=this.retryDate;(!V||L>=V||(j=this.media)!==null&&j!==void 0&&j.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=f.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){i.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var E,x,T=this.hls,N=this.levelLastLoaded,j=this.levels,L=this.media,V=T.config,K=T.nextLoadLevel;if(N===null||!L&&(this.startFragRequested||!V.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!j||!j[K])return;var W=j[K];this.level=T.nextLoadLevel=K;var G=W.details;if(!G||this.state===f.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==K){this.state=f.State.WAITING_LEVEL;return}var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:L,a.PlaylistLevelType.MAIN);if(F===null)return;var B=F.len,H=this.getMaxBufferLength(W.maxBitrate);if(B>=H)return;if(this._streamEnded(F,G)){var q={};this.altAudio&&(q.type="video"),this.hls.trigger(C.Events.BUFFER_EOS,q),this.state=f.State.ENDED;return}var re=F.end,ee=this.getNextFragment(re,G);if(this.couldBacktrack&&!this.fragPrevious&&ee&&ee.sn!=="initSegment"){var Ce=ee.sn-G.startSN;Ce>1&&(ee=G.fragments[Ce-1],this.fragmentTracker.removeFragment(ee))}if(ee&&this.fragmentTracker.getState(ee)===o.FragmentState.OK&&this.nextLoadPosition>re){var Ee=this.audioOnly&&!this.altAudio?r.ElementaryStreamTypes.AUDIO:r.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(L,Ee,a.PlaylistLevelType.MAIN),ee=this.getNextFragment(this.nextLoadPosition,G)}if(!ee)return;ee.initSegment&&!ee.initSegment.data&&!this.bitrateTest&&(ee=ee.initSegment),((E=ee.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((x=ee.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(ee,G):this.loadFragment(ee,G,re)},O.loadFragment=function(E,x,T){var N,j=this.fragmentTracker.getState(E);if(this.fragCurrent=E,j===o.FragmentState.BACKTRACKED){var L=this.fragmentTracker.getBacktrackData(E);if(L){this._handleFragmentLoadProgress(L),this._handleFragmentLoadComplete(L);return}else j=o.FragmentState.NOT_LOADED}j===o.FragmentState.NOT_LOADED||j===o.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,i.prototype.loadFragment.call(this,E,x,T)):j===o.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((N=this.media)===null||N===void 0?void 0:N.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(E){var x=this.fragmentTracker.getAppendedFrag(E,a.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},O.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,a.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var E=this.levels,x=this.media;if(x!=null&&x.readyState){var T,N=this.getAppendedFrag(x.currentTime);if(N&&N.start>1&&this.flushMainBuffer(0,N.start-1),!x.paused&&E){var j=this.hls.nextLoadLevel,L=E[j],V=this.fragLastKbps;V&&this.fragCurrent?T=this.fragCurrent.duration*L.maxBitrate/(1e3*V)+1:T=0}else T=0;var K=this.getBufferedFrag(x.currentTime+T);if(K){var W=this.followingBufferedFrag(K);if(W){this.abortCurrentFrag();var G=W.maxStartPTS?W.maxStartPTS:W.start,F=W.duration,B=Math.max(K.end,G+Math.min(Math.max(F-this.config.maxFragLookUpTolerance,F*.5),F*.75));this.flushMainBuffer(B,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===f.State.KEY_LOADING&&(this.state=f.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(E,x){i.prototype.flushMainBuffer.call(this,E,x,this.altAudio?"video":null)},O.onMediaAttached=function(E,x){i.prototype.onMediaAttached.call(this,E,x);var T=x.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),T.addEventListener("playing",this.onvplaying),T.addEventListener("seeked",this.onvseeked),this.gapController=new p.default(this.config,T,this.fragmentTracker,this.hls)},O.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),i.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var E=this.media,x=E?E.currentTime:null;Object(D.isFiniteNumber)(x)&&this.log("Media seeked to "+x.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(C.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(E,x){var T=!1,N=!1,j;x.levels.forEach(function(L){j=L.audioCodec,j&&(j.indexOf("mp4a.40.2")!==-1&&(T=!0),j.indexOf("mp4a.40.5")!==-1&&(N=!0))}),this.audioCodecSwitch=T&&N&&!Object(l.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=x.levels,this.startFragRequested=!1},O.onLevelLoading=function(E,x){var T=this.levels;if(!T||this.state!==f.State.IDLE)return;var N=T[x.level];(!N.details||N.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(N.details))&&(this.state=f.State.WAITING_LEVEL)},O.onLevelLoaded=function(E,x){var T,N=this.levels,j=x.level,L=x.details,V=L.totalduration;if(!N){this.warn("Levels were reset while loading level "+j);return}this.log("Level "+j+" loaded ["+L.startSN+","+L.endSN+"], cc ["+L.startCC+", "+L.endCC+"] duration:"+V);var K=this.fragCurrent;K&&(this.state===f.State.FRAG_LOADING||this.state===f.State.FRAG_LOADING_WAITING_RETRY)&&(K.level!==x.level&&K.loader&&(this.state=f.State.IDLE,K.loader.abort()));var W=N[j],G=0;if(L.live||(T=W.details)!==null&&T!==void 0&&T.live){if(L.fragments[0]||(L.deltaUpdateFailed=!0),L.deltaUpdateFailed)return;G=this.alignPlaylists(L,W.details)}if(W.details=L,this.levelLastLoaded=j,this.hls.trigger(C.Events.LEVEL_UPDATED,{details:L,level:j}),this.state===f.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(L))return;this.state=f.State.IDLE}this.startFragRequested?L.live&&this.synchronizeToLiveEdge(L):this.setStartPosition(L,G),this.tick()},O._handleFragmentLoadProgress=function(E){var x,T=E.frag,N=E.part,j=E.payload,L=this.levels;if(!L){this.warn("Levels were reset while fragment load was in progress. Fragment "+T.sn+" of level "+T.level+" will not be buffered");return}var V=L[T.level],K=V.details;if(!K){this.warn("Dropping fragment "+T.sn+" of level "+T.level+" after level details were reset");return}var W=V.videoCodec,G=K.PTSKnown||!K.live,F=(x=T.initSegment)===null||x===void 0?void 0:x.data,B=this._getAudioCodec(V),H=this.transmuxer=this.transmuxer||new h.default(this.hls,a.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),q=N?N.index:-1,re=q!==-1,ee=new m.ChunkMetadata(T.level,T.sn,T.stats.chunkCount,j.byteLength,q,re),Ce=this.initPTS[T.cc];H.push(j,F,B,W,T,N,K.totalduration,G,ee,Ce)},O.onAudioTrackSwitching=function(E,x){var T=this.altAudio,N=!!x.url,j=x.id;if(!N){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var L=this.fragCurrent;L!=null&&L.loader&&(this.log("Switching to main audio track, cancel main fragment load"),L.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var V=this.hls;T&&V.trigger(C.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),V.trigger(C.Events.AUDIO_TRACK_SWITCHED,{id:j})}},O.onAudioTrackSwitched=function(E,x){var T=x.id,N=!!this.hls.audioTracks[T].url;if(N){var j=this.videoBuffer;j&&this.mediaBuffer!==j&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=j)}this.altAudio=N,this.tick()},O.onBufferCreated=function(E,x){var T=x.tracks,N,j,L=!1;for(var V in T){var K=T[V];if(K.id==="main"){if(j=V,N=K,V==="video"){var W=T[V];W&&(this.videoBuffer=W.buffer)}}else L=!0}L&&N?(this.log("Alternate track found, use "+j+".buffered to schedule main fragment loading"),this.mediaBuffer=N.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(E,x){var T=x.frag,N=x.part;if(T&&T.type!==a.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(T)){this.warn("Fragment "+T.sn+(N?" p: "+N.index:"")+" of level "+T.level+" finished buffering, but was aborted. state: "+this.state),this.state===f.State.PARSED&&(this.state=f.State.IDLE);return}var j=N?N.stats:T.stats;this.fragLastKbps=Math.round(8*j.total/(j.buffering.end-j.loading.first)),T.sn!=="initSegment"&&(this.fragPrevious=T),this.fragBufferedComplete(T,N)},O.onError=function(E,x){switch(x.details){case w.ErrorDetails.FRAG_LOAD_ERROR:case w.ErrorDetails.FRAG_LOAD_TIMEOUT:case w.ErrorDetails.KEY_LOAD_ERROR:case w.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(a.PlaylistLevelType.MAIN,x);break;case w.ErrorDetails.LEVEL_LOAD_ERROR:case w.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==f.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=f.State.ERROR):!x.levelRetry&&this.state===f.State.WAITING_LEVEL&&(this.state=f.State.IDLE));break;case w.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===f.State.PARSING||this.state===f.State.PARSED)){var T=!0,N=this.getFwdBufferInfo(this.media,a.PlaylistLevelType.MAIN);N&&N.len>.5&&(T=!this.reduceMaxBufferLength(N.len)),T&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var E=this.media,x=this.gapController;if(!E||!x||!E.readyState)return;var T=v.BufferHelper.getBuffered(E);!this.loadedmetadata&&T.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=f.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(E,x){var T=x.type;if(T!==r.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var N=(T===r.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(N,T,a.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(E,x){this.levels=x.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var E=this.media,x=E.currentTime,T=this.startPosition;if(T>=0&&x0&&(L1&&E.seeking===!1){var T=E.currentTime;if(v.BufferHelper.isBuffered(E,T)?x=this.getAppendedFrag(T):v.BufferHelper.isBuffered(E,T+.1)&&(x=this.getAppendedFrag(T+.1)),x){var N=this.fragPlaying,j=x.level;(!N||x.sn!==N.sn||N.level!==j||x.urlId!==N.urlId)&&(this.hls.trigger(C.Events.FRAG_CHANGED,{frag:x}),(!N||N.level!==j)&&this.hls.trigger(C.Events.LEVEL_SWITCHED,{level:j}),this.fragPlaying=x)}}},n(k,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var x=this.getAppendedFrag(E.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var x=this.getAppendedFrag(E.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),k}(f.default)},"./src/controller/subtitle-stream-controller.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"SubtitleStreamController",function(){return s});var D=_("./src/events.ts"),f=_("./src/utils/logger.ts"),l=_("./src/utils/buffer-helper.ts"),C=_("./src/controller/fragment-finders.ts"),v=_("./src/utils/discontinuities.ts"),o=_("./src/controller/level-helper.ts"),a=_("./src/controller/fragment-tracker.ts"),r=_("./src/controller/base-stream-controller.ts"),h=_("./src/types/loader.ts"),m=_("./src/types/level.ts");function p(d,S){for(var y=0;y=x[j].start&&N<=x[j].end){T=x[j];break}var L=b.start+b.duration;T?T.end=L:(T={start:N,end:L},x.push(T)),this.fragmentTracker.fragBuffered(b)},y.onBufferFlushing=function(k,O){var b=O.startOffset,E=O.endOffset;if(b===0&&E!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,T=this.levels;if(!T.length||!T[x]||!T[x].details)return;var N=T[x].details,j=N.targetduration,L=E-j;if(L<=0)return;O.endOffsetSubtitles=Math.max(0,L),this.tracksBuffered.forEach(function(V){for(var K=0;K=N.length||x!==T||!j)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(b=j.details)!==null&&b!==void 0&&b.live){var L=this.mainDetails;if(E.deltaUpdateFailed||!L)return;var V=L.fragments[0];if(!j.details)E.hasProgramDateTime&&L.hasProgramDateTime?Object(v.alignMediaPlaylistByPDT)(E,L):V&&Object(o.addSliding)(E,V.start);else{var K=this.alignPlaylists(E,j.details);K===0&&V&&Object(o.addSliding)(E,V.start)}}if(j.details=E,this.levelLastLoaded=x,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===r.State.IDLE){var W=Object(C.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);W||(this.warn("Subtitle playlist not aligned with playback"),j.details=void 0)}},y._handleFragmentLoadComplete=function(k){var O=k.frag,b=k.payload,E=O.decryptdata,x=this.hls;if(this.fragContextChanged(O))return;if(b&&b.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var T=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(b),E.key.buffer,E.iv.buffer).then(function(N){var j=performance.now();x.trigger(D.Events.FRAG_DECRYPTED,{frag:O,payload:N,stats:{tstart:T,tdecrypt:j}})})}},y.doTick=function(){if(!this.media){this.state=r.State.IDLE;return}if(this.state===r.State.IDLE){var k,O=this.currentTrackId,b=this.levels;if(!b.length||!b[O]||!b[O].details)return;var E=b[O].details,x=E.targetduration,T=this.config,N=this.media,j=l.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,N.currentTime-x,T.maxBufferHole),L=j.end,V=j.len,K=this.getMaxBufferLength()+x;if(V>K)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var W=E.fragments,G=W.length,F=E.edge,B,H=this.fragPrevious;if(L-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)},g.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},g.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 n=m(this.media.textTracks);n.forEach(function(s){Object(f.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},g.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},g.onManifestParsed=function(n,s){this.tracks=s.subtitleTracks},g.onSubtitleTrackLoaded=function(n,s){var d=s.id,S=s.details,y=this.trackId,i=this.tracksInGroup[y];if(!i){this.warn("Invalid subtitle track id "+d);return}var k=i.details;i.details=s.details,this.log("subtitle track "+d+" loaded ["+S.startSN+"-"+S.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,s,k))},g.onLevelLoading=function(n,s){this.switchLevel(s.level)},g.onLevelSwitching=function(n,s){this.switchLevel(s.level)},g.switchLevel=function(n){var s=this.hls.levels[n];if(!(s!=null&&s.textGroupIds))return;var d=s.textGroupIds[s.urlId];if(this.groupId!==d){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,y=this.tracks.filter(function(O){return!d||O.groupId===d});this.tracksInGroup=y;var i=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=d;var k={subtitleTracks:y};this.log("Updating subtitle tracks, "+y.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(D.Events.SUBTITLE_TRACKS_UPDATED,k),i!==-1&&this.setSubtitleTrack(i,S)}},g.findTrackId=function(n){for(var s=this.tracksInGroup,d=0;d=S.length)return;this.clearTimer();var y=S[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,y){var i=y.id,k=y.groupId,O=k===void 0?"":k,b=y.name,E=y.type,x=y.url;this.hls.trigger(D.Events.SUBTITLE_TRACK_SWITCH,{id:i,groupId:O,name:b,type:E,url:x});var T=this.switchParams(y.url,s==null?void 0:s.details);this.loadPlaylist(T)}else this.hls.trigger(D.Events.SUBTITLE_TRACK_SWITCH,{id:n})},g.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,s=m(this.media.textTracks),d=0;d=0&&(E[0]=Math.min(E[0],S),E[1]=Math.max(E[1],y),O=!0,x/(y-S)>.5))return}if(O||k.push([S,y]),this.config.renderTextTracksNatively){var T=this.captionsTracks[d];this.Cues.newCue(T,S,y,i)}else{var N=this.Cues.newCue(null,S,y,i);this.hls.trigger(f.Events.CUES_PARSED,{type:"captions",cues:N,track:d})}},n.onInitPtsFound=function(d,S){var y=this,i=S.frag,k=S.id,O=S.initPTS,b=S.timescale,E=this.unparsedVttFrags;k==="main"&&(this.initPTS[i.cc]=O,this.timescale[i.cc]=b),E.length&&(this.unparsedVttFrags=[],E.forEach(function(x){y.onFragLoaded(f.Events.FRAG_LOADED,x)}))},n.getExistingTrack=function(d){var S=this.media;if(S)for(var y=0;y>>8^b&255^99,a[i]=b,r[b]=i;var E=y[i],x=y[E],T=y[x],N=y[b]*257^b*16843008;m[i]=N<<24|N>>>8,p[i]=N<<16|N>>>16,w[i]=N<<8|N>>>24,g[i]=N,N=T*16843009^x*65537^E*257^i*16843008,n[b]=N<<24|N>>>8,s[b]=N<<16|N>>>16,d[b]=N<<8|N>>>24,S[b]=N,i?(i=E^y[y[y[T^E]]],k^=y[y[k]]):i=k=1}},v.expandKey=function(a){for(var r=this.uint8ArrayToUint32Array_(a),h=!0,m=0;m>>6)+1;var N=(d[S+2]&60)>>>2;if(N>T.length-1){s.trigger(l.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+N});return}return O=(d[S+2]&1)<<2,O|=(d[S+3]&192)>>>6,D.logger.log("manifest codec:"+y+", ADTS type:"+i+", samplingIndex:"+N),/firefox/i.test(E)?N>=6?(i=5,b=new Array(4),k=N-3):(i=2,b=new Array(2),k=N):E.indexOf("android")!==-1?(i=2,b=new Array(2),k=N):(i=5,b=new Array(4),y&&(y.indexOf("mp4a.40.29")!==-1||y.indexOf("mp4a.40.5")!==-1)||!y&&N>=6?k=N-3:((y&&y.indexOf("mp4a.40.2")!==-1&&(N>=6&&O===1||/vivaldi/i.test(E))||!y&&O===1)&&(i=2,b=new Array(2)),k=N)),b[0]=i<<3,b[0]|=(N&14)>>1,b[1]|=(N&1)<<7,b[1]|=O<<3,i===5&&(b[1]|=(k&14)>>1,b[2]=(k&1)<<7,b[2]|=2<<2,b[3]=0),{config:b,samplerate:T[N],channelCount:O,codec:"mp4a.40."+i,manifestCodec:x}}function v(s,d){return s[d]===255&&(s[d+1]&246)===240}function o(s,d){return s[d+1]&1?7:9}function a(s,d){return(s[d+3]&3)<<11|s[d+4]<<3|(s[d+5]&224)>>>5}function r(s,d){return d+5=s.length)return!1;var y=a(s,d);if(y<=S)return!1;var i=d+y;return i===s.length||h(s,i)}return!1}function w(s,d,S,y,i){if(!s.samplerate){var k=C(d,S,y,i);if(!k)return;s.config=k.config,s.samplerate=k.samplerate,s.channelCount=k.channelCount,s.codec=k.codec,s.manifestCodec=k.manifestCodec,D.logger.log("parsed codec:"+s.codec+", rate:"+k.samplerate+", channels:"+k.channelCount)}}function g(s){return 1024*9e4/s}function c(s,d,S,y,i){var k=o(s,d),O=a(s,d);if(O-=k,O>0){var b=S+y*i;return{headerLength:k,frameLength:O,stamp:b}}}function n(s,d,S,y,i){var k=g(s.samplerate),O=c(d,S,y,i,k);if(O){var b=O.frameLength,E=O.headerLength,x=O.stamp,T=E+b,N=Math.max(0,S+T-d.length),j;N?(j=new Uint8Array(T-E),j.set(d.subarray(S+E,d.length),0)):j=d.subarray(S+E,S+T);var L={unit:j,pts:x};return N||s.samples.push(L),{sample:L,length:T,missing:N}}}},"./src/demux/base-audio-demuxer.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"initPTSFn",function(){return a});var D=_("./src/polyfills/number.ts"),f=_("./src/demux/id3.ts"),l=_("./src/demux/dummy-demuxed-track.ts"),C=_("./src/utils/mp4-tools.ts"),v=_("./src/utils/typed-array.ts"),o=function(){function r(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var h=r.prototype;return h.resetInitSegment=function(p,w,g){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},h.resetTimeStamp=function(){},h.resetContiguity=function(){},h.canParse=function(p,w){return!1},h.appendFrame=function(p,w,g){},h.demux=function(p,w){this.cachedData&&(p=Object(C.appendUint8Array)(this.cachedData,p),this.cachedData=null);var g=f.getID3Data(p,0),c=g?g.length:0,n,s,d=this._audioTrack,S=this._id3Track,y=g?f.getTimeStamp(g):void 0,i=p.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=a(y,w)),g&&g.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:g}),s=this.initPTS;co?(this.word<<=o,this.bitsAvailable-=o):(o-=this.bitsAvailable,a=o>>3,o-=a>>3,this.bytesAvailable-=a,this.loadWord(),this.word<<=o,this.bitsAvailable-=o)},C.readBits=function(o){var a=Math.min(this.bitsAvailable,o),r=this.word>>>32-a;return o>32&&D.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=a,this.bitsAvailable>0?this.word<<=a:this.bytesAvailable>0&&this.loadWord(),a=o-a,a>0&&this.bitsAvailable?r<>>o)!==0)return this.word<<=o,this.bitsAvailable-=o,o;return this.loadWord(),o+this.skipLZ()},C.skipUEG=function(){this.skipBits(1+this.skipLZ())},C.skipEG=function(){this.skipBits(1+this.skipLZ())},C.readUEG=function(){var o=this.skipLZ();return this.readBits(o+1)-1},C.readEG=function(){var o=this.readUEG();return 1&o?1+o>>>1:-1*(o>>>1)},C.readBoolean=function(){return this.readBits(1)===1},C.readUByte=function(){return this.readBits(8)},C.readUShort=function(){return this.readBits(16)},C.readUInt=function(){return this.readBits(32)},C.skipScalingList=function(o){for(var a=8,r=8,h,m=0;m0?i.subarray(O,O+b):void 0},C=function(i,k){var O=0;return O=(i[k]&127)<<21,O|=(i[k+1]&127)<<14,O|=(i[k+2]&127)<<7,O|=i[k+3]&127,O},v=function(i,k){return D(i,k)&&C(i,k+6)+10<=i.length-k},o=function(i){for(var k=h(i),O=0;O>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:L+=String.fromCharCode(T);break;case 12:case 13:N=i[V++],L+=String.fromCharCode((T&31)<<6|N&63);break;case 14:N=i[V++],j=i[V++],L+=String.fromCharCode((T&15)<<12|(N&63)<<6|(j&63)<<0);break;default:}}return L},s={decodeTextFrame:w},d;function S(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/demux/base-audio-demuxer.ts"),f=_("./src/demux/id3.ts"),l=_("./src/utils/logger.ts"),C=_("./src/demux/mpegaudio.ts");function v(r,h){r.prototype=Object.create(h.prototype),r.prototype.constructor=r,o(r,h)}function o(r,h){return o=Object.setPrototypeOf||function(p,w){return p.__proto__=w,p},o(r,h)}var a=function(r){v(h,r);function h(){return r.apply(this,arguments)||this}var m=h.prototype;return m.resetInitSegment=function(w,g,c){r.prototype.resetInitSegment.call(this,w,g,c),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:w,duration:c,inputTimeScale:9e4,dropped:0}},h.probe=function(w){if(!w)return!1;for(var g=f.getID3Data(w,0)||[],c=g.length,n=w.length;c0},v.demux=function(a){var r=a,h=Object(f.dummyTrack)();if(this.config.progressive){this.remainderData&&(r=Object(D.appendUint8Array)(this.remainderData,a));var m=Object(D.segmentValidRange)(r);this.remainderData=m.remainder,h.samples=m.valid||new Uint8Array}else h.samples=r;return{audioTrack:Object(f.dummyTrack)(),avcTrack:h,id3Track:Object(f.dummyTrack)(),textTrack:Object(f.dummyTrack)()}},v.flush=function(){var a=Object(f.dummyTrack)();return a.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(f.dummyTrack)(),avcTrack:a,id3Track:Object(f.dummyTrack)(),textTrack:Object(f.dummyTrack)()}},v.demuxSampleAes=function(a,r,h){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},v.destroy=function(){},C}();l.minProbeByteLength=1024,u.default=l},"./src/demux/mpegaudio.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"appendFrame",function(){return o}),_.d(u,"parseHeader",function(){return a}),_.d(u,"isHeaderPattern",function(){return r}),_.d(u,"isHeader",function(){return h}),_.d(u,"canParse",function(){return m}),_.d(u,"probe",function(){return p});var D=null,f=[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],l=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],C=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],v=[0,1,1,4];function o(w,g,c,n,s){if(c+24>g.length)return;var d=a(g,c);if(d&&c+d.frameLength<=g.length){var S=d.samplesPerFrame*9e4/d.sampleRate,y=n+s*S,i={unit:g.subarray(c,c+d.frameLength),pts:y,dts:y};return w.config=[],w.channelCount=d.channelCount,w.samplerate=d.sampleRate,w.samples.push(i),{sample:i,length:d.frameLength,missing:0}}}function a(w,g){var c=w[g+1]>>3&3,n=w[g+1]>>1&3,s=w[g+2]>>4&15,d=w[g+2]>>2&3;if(c!==1&&s!==0&&s!==15&&d!==3){var S=w[g+2]>>1&1,y=w[g+3]>>6,i=c===3?3-n:n===3?3:4,k=f[i*14+s-1]*1e3,O=c===3?0:c===2?1:2,b=l[O*3+d],E=y===3?1:2,x=C[c][n],T=v[n],N=x*8*T,j=Math.floor(x*k/b+S)*T;if(D===null){var L=navigator.userAgent||"",V=L.match(/Chrome\/(\d+)/i);D=V?parseInt(V[1]):0}var K=!!D&&D<=87;return K&&n===2&&k>=224e3&&y===0&&(w[g+3]=w[g+3]|128),{sampleRate:b,channelCount:E,frameLength:j,samplesPerFrame:N}}}function r(w,g){return w[g]===255&&(w[g+1]&224)===224&&(w[g+1]&6)!==0}function h(w,g){return g+1=a.length){h();return}if(a[r].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(a,r,h,m),!m)return}},v.getAvcEncryptedData=function(a){for(var r=Math.floor((a.length-48)/160)*16+16,h=new Int8Array(r),m=0,p=32;p<=a.length-16;p+=160,m+=16)h.set(a.subarray(p,p+16),m);return h},v.getAvcDecryptedUnit=function(a,r){for(var h=new Uint8Array(r),m=0,p=32;p<=a.length-16;p+=160,m+=16)a.set(h.subarray(m,m+16),p);return a},v.decryptAvcSample=function(a,r,h,m,p,w){var g=Object(f.discardEPB)(p.data),c=this.getAvcEncryptedData(g),n=this;this.decryptBuffer(c.buffer,function(s){p.data=n.getAvcDecryptedUnit(g,s),w||n.decryptAvcSamples(a,r,h+1,m)})},v.decryptAvcSamples=function(a,r,h,m){if(a instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;r++,h=0){if(r>=a.length){m();return}for(var p=a[r].units;!(h>=p.length);h++){var w=p[h];if(w.data.length<=48||w.type!==1&&w.type!==5)continue;var g=this.decrypter.isSync();if(this.decryptAvcSample(a,r,h,m,w,g),!g)return}}},C}();u.default=l},"./src/demux/transmuxer-interface.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return p});var D=_("./node_modules/webworkify-webpack/index.js"),f=_.n(D),l=_("./src/events.ts"),C=_("./src/demux/transmuxer.ts"),v=_("./src/utils/logger.ts"),o=_("./src/errors.ts"),a=_("./src/utils/mediasource-helper.ts"),r=_("./node_modules/eventemitter3/index.js"),h=_.n(r),m=Object(a.getMediaSource)()||{isTypeSupported:function(){return!1}},p=function(){function w(c,n,s,d){var S=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=c,this.id=n,this.onTransmuxComplete=s,this.onFlush=d;var y=c.config,i=function(x,T){T=T||{},T.frag=S.frag,T.id=S.id,c.trigger(x,T)};this.observer=new r.EventEmitter,this.observer.on(l.Events.FRAG_DECRYPTED,i),this.observer.on(l.Events.ERROR,i);var k={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(y.enableWorker&&typeof Worker!="undefined"){v.logger.log("demuxing in webworker");var b;try{b=this.worker=D("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(E){c.trigger(l.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},b.postMessage({cmd:"init",typeSupported:k,vendor:O,id:n,config:JSON.stringify(y)})}catch(E){v.logger.warn("Error in worker:",E),v.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new C.default(this.observer,k,y,O,n),this.worker=null}}else this.transmuxer=new C.default(this.observer,k,y,O,n)}var g=w.prototype;return g.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},g.push=function(n,s,d,S,y,i,k,O,b,E){var x=this;b.transmuxing.start=self.performance.now();var T=this.transmuxer,N=this.worker,j=i?i.start:y.start,L=y.decryptdata,V=this.frag,K=!(V&&y.cc===V.cc),W=!(V&&b.level===V.level),G=V?b.sn-V.sn:-1,F=this.part?b.part-this.part.index:1,B=!W&&(G===1||G===0&&F===1),H=self.performance.now();(W||G||y.stats.parsing.start===0)&&(y.stats.parsing.start=H),i&&(F||!B)&&(i.stats.parsing.start=H);var q=new C.TransmuxState(K,B,O,W,j);if(!B||K){v.logger.log("[transmuxer-interface, "+y.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+` discontinuity: `+K+` trackSwitch: `+W+` contiguous: `+B+` accurateTimeOffset: `+O+` timeOffset: `+j);var re=new C.TransmuxConfig(d,S,s,k,E);this.configureTransmuxer(re)}if(this.frag=y,this.part=i,N)N.postMessage({cmd:"demux",data:n,decryptdata:L,chunkMeta:b,state:q},n instanceof ArrayBuffer?[n]:[]);else if(T){var ee=T.push(n,L,b,q);Object(C.isPromise)(ee)?ee.then(function(Ce){x.handleTransmuxComplete(Ce)}):this.handleTransmuxComplete(ee)}},g.flush=function(n){var s=this;n.transmuxing.start=self.performance.now();var d=this.transmuxer,S=this.worker;if(S)S.postMessage({cmd:"flush",chunkMeta:n});else if(d){var y=d.flush(n);Object(C.isPromise)(y)?y.then(function(i){s.handleFlushResult(i,n)}):this.handleFlushResult(y,n)}},g.handleFlushResult=function(n,s){var d=this;n.forEach(function(S){d.handleTransmuxComplete(S)}),this.onFlush(s)},g.onWorkerMessage=function(n){var s=n.data,d=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,d.trigger(s.event,s.data);break}}},g.configureTransmuxer=function(n){var s=this.worker,d=this.transmuxer;s?s.postMessage({cmd:"configure",config:n}):d&&d.configure(n)},g.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},w}()},"./src/demux/transmuxer-worker.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return o});var D=_("./src/demux/transmuxer.ts"),f=_("./src/events.ts"),l=_("./src/utils/logger.ts"),C=_("./node_modules/eventemitter3/index.js"),v=_.n(C);function o(p){var w=new C.EventEmitter,g=function(n,s){p.postMessage({event:n,data:s})};w.on(f.Events.FRAG_DECRYPTED,g),w.on(f.Events.ERROR,g),p.addEventListener("message",function(c){var n=c.data;switch(n.cmd){case"init":{var s=JSON.parse(n.config);p.transmuxer=new D.default(w,n.typeSupported,s,n.vendor,n.id),Object(l.enableLogs)(s.debug),g("init",null);break}case"configure":{p.transmuxer.configure(n.config);break}case"demux":{var d=p.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(D.isPromise)(d)?d.then(function(i){a(p,i)}):a(p,d);break}case"flush":{var S=n.chunkMeta,y=p.transmuxer.flush(S);Object(D.isPromise)(y)?y.then(function(i){h(p,i,S)}):h(p,y,S);break}default:break}})}function a(p,w){if(m(w.remuxResult))return;var g=[],c=w.remuxResult,n=c.audio,s=c.video;n&&r(g,n),s&&r(g,s),p.postMessage({event:"transmuxComplete",data:w},g)}function r(p,w){w.data1&&p.push(w.data1.buffer),w.data2&&p.push(w.data2.buffer)}function h(p,w,g){w.forEach(function(c){a(p,c)}),p.postMessage({event:"flush",data:g})}function m(p){return!p.audio&&!p.video&&!p.text&&!p.id3&&!p.initSegment}},"./src/demux/transmuxer.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return s}),_.d(u,"isPromise",function(){return y}),_.d(u,"TransmuxConfig",function(){return i}),_.d(u,"TransmuxState",function(){return k});var D=_("./src/events.ts"),f=_("./src/errors.ts"),l=_("./src/crypt/decrypter.ts"),C=_("./src/demux/aacdemuxer.ts"),v=_("./src/demux/mp4demuxer.ts"),o=_("./src/demux/tsdemuxer.ts"),a=_("./src/demux/mp3demuxer.ts"),r=_("./src/remux/mp4-remuxer.ts"),h=_("./src/remux/passthrough-remuxer.ts"),m=_("./src/demux/chunk-cache.ts"),p=_("./src/utils/mp4-tools.ts"),w=_("./src/utils/logger.ts"),g;try{g=self.performance.now.bind(self.performance)}catch(O){w.logger.debug("Unable to use Performance API on this environment"),g=self.Date.now}var c=[{demux:o.default,remux:r.default},{demux:v.default,remux:h.default},{demux:C.default,remux:r.default},{demux:a.default,remux:r.default}],n=1024;c.forEach(function(O){var b=O.demux;n=Math.max(n,b.minProbeByteLength)});var s=function(){function O(E,x,T,N,j){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=x,this.config=T,this.vendor=N,this.id=j}var b=O.prototype;return b.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},b.push=function(x,T,N,j){var L=this,V=N.transmuxing;V.executeStart=g();var K=new Uint8Array(x),W=this.cache,G=this.config,F=this.currentTransmuxState,B=this.transmuxConfig;j&&(this.currentTransmuxState=j);var H=d(K,T);if(H&&H.method==="AES-128"){var q=this.getDecrypter();if(G.enableSoftwareAES){var re=q.softwareDecrypt(K,H.key.buffer,H.iv.buffer);if(!re)return V.executeEnd=g(),S(N);K=new Uint8Array(re)}else return this.decryptionPromise=q.webCryptoDecrypt(K,H.key.buffer,H.iv.buffer).then(function(Q){var Y=L.push(Q,null,N);return L.decryptionPromise=null,Y}),this.decryptionPromise}var ee=j||F,Ce=ee.contiguous,Ee=ee.discontinuity,pe=ee.trackSwitch,Me=ee.accurateTimeOffset,_e=ee.timeOffset,he=B.audioCodec,ce=B.videoCodec,oe=B.defaultInitPts,Se=B.duration,te=B.initSegmentData;if((Ee||pe)&&this.resetInitSegment(te,he,ce,Se),Ee&&this.resetInitialTimestamp(oe),Ce||this.resetContiguity(),this.needsProbing(K,Ee,pe)){if(W.dataLength){var ue=W.flush();K=Object(p.appendUint8Array)(ue,K)}this.configureTransmuxer(K,B)}var Oe=this.transmux(K,H,_e,Me,N),le=this.currentTransmuxState;return le.contiguous=!0,le.discontinuity=!1,le.trackSwitch=!1,V.executeEnd=g(),Oe},b.flush=function(x){var T=this,N=x.transmuxing;N.executeStart=g();var j=this.decrypter,L=this.cache,V=this.currentTransmuxState,K=this.decryptionPromise;if(K)return K.then(function(){return T.flush(x)});var W=[],G=V.timeOffset;if(j){var F=j.flush();F&&W.push(this.push(F,null,x))}var B=L.dataLength;L.reset();var H=this.demuxer,q=this.remuxer;if(!H||!q)return B>=n&&this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),N.executeEnd=g(),[S(x)];var re=H.flush(G);return y(re)?re.then(function(ee){return T.flushRemux(W,ee,x),W}):(this.flushRemux(W,re,x),W)},b.flushRemux=function(x,T,N){var j=T.audioTrack,L=T.avcTrack,V=T.id3Track,K=T.textTrack,W=this.currentTransmuxState,G=W.accurateTimeOffset,F=W.timeOffset;w.logger.log("[transmuxer.ts]: Flushed fragment "+N.sn+(N.part>-1?" p: "+N.part:"")+" of level "+N.level);var B=this.remuxer.remux(j,L,V,K,F,G,!0,this.id);x.push({remuxResult:B,chunkMeta:N}),N.transmuxing.executeEnd=g()},b.resetInitialTimestamp=function(x){var T=this.demuxer,N=this.remuxer;if(!T||!N)return;T.resetTimeStamp(x),N.resetTimeStamp(x)},b.resetContiguity=function(){var x=this.demuxer,T=this.remuxer;if(!x||!T)return;x.resetContiguity(),T.resetNextTimestamp()},b.resetInitSegment=function(x,T,N,j){var L=this.demuxer,V=this.remuxer;if(!L||!V)return;L.resetInitSegment(T,N,j),V.resetInitSegment(x,T,N)},b.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},b.transmux=function(x,T,N,j,L){var V;return T&&T.method==="SAMPLE-AES"?V=this.transmuxSampleAes(x,T,N,j,L):V=this.transmuxUnencrypted(x,N,j,L),V},b.transmuxUnencrypted=function(x,T,N,j){var L=this.demuxer.demux(x,T,!1,!this.config.progressive),V=L.audioTrack,K=L.avcTrack,W=L.id3Track,G=L.textTrack,F=this.remuxer.remux(V,K,W,G,T,N,!1,this.id);return{remuxResult:F,chunkMeta:j}},b.transmuxSampleAes=function(x,T,N,j,L){var V=this;return this.demuxer.demuxSampleAes(x,T,N).then(function(K){var W=V.remuxer.remux(K.audioTrack,K.avcTrack,K.id3Track,K.textTrack,N,j,!1,V.id);return{remuxResult:W,chunkMeta:L}})},b.configureTransmuxer=function(x,T){for(var N=this.config,j=this.observer,L=this.typeSupported,V=this.vendor,K=T.audioCodec,W=T.defaultInitPts,G=T.duration,F=T.initSegmentData,B=T.videoCodec,H,q=0,re=c.length;q0&&b!=null&&b.key!=null&&b.iv!==null&&b.method!=null&&(E=b),E}var S=function(b){return{remuxResult:{},chunkMeta:b}};function y(O){return"then"in O&&O.then instanceof Function}var i=function(b,E,x,T,N){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=b,this.videoCodec=E,this.initSegmentData=x,this.duration=T,this.defaultInitPts=N},k=function(b,E,x,T,N){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=b,this.contiguous=E,this.accurateTimeOffset=x,this.trackSwitch=T,this.timeOffset=N}},"./src/demux/tsdemuxer.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"discardEPB",function(){return S});var D=_("./src/demux/adts.ts"),f=_("./src/demux/mpegaudio.ts"),l=_("./src/demux/exp-golomb.ts"),C=_("./src/demux/id3.ts"),v=_("./src/demux/sample-aes.ts"),o=_("./src/events.ts"),a=_("./src/utils/mp4-tools.ts"),r=_("./src/utils/logger.ts"),h=_("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},p=function(){function y(k,O,b){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=k,this.config=O,this.typeSupported=b}y.probe=function(O){var b=y.syncOffset(O);return b<0?!1:(b&&r.logger.warn("MPEG2-TS detected but first sync word found @ offset "+b+", junk ahead ?"),!0)},y.syncOffset=function(O){for(var b=Math.min(1e3,O.length-3*188),E=0;E>4,he=void 0;if(_e>1){if(he=Ee+5+O[Ee+4],he===Ee+188)continue}else he=Ee+4;switch(Me){case V:pe&&(K&&(T=n(K))&&this.parseAVCPES(T,!1),K={data:[],size:0}),K&&(K.data.push(O.subarray(he,Ee+188)),K.size+=Ee+188-he);break;case W:pe&&(F&&(T=n(F))&&(j.isAAC?this.parseAACPES(T):this.parseMPEGPES(T)),F={data:[],size:0}),F&&(F.data.push(O.subarray(he,Ee+188)),F.size+=Ee+188-he);break;case G:pe&&(B&&(T=n(B))&&this.parseID3PES(T),B={data:[],size:0}),B&&(B.data.push(O.subarray(he,Ee+188)),B.size+=Ee+188-he);break;case 0:pe&&(he+=O[he]+1),re=this._pmtId=g(O,he);break;case re:{pe&&(he+=O[he]+1);var ce=c(O,he,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);V=ce.avc,V>0&&(N.pid=V),W=ce.audio,W>0&&(j.pid=W,j.isAAC=ce.isAAC),G=ce.id3,G>0&&(L.pid=G),H&&!q&&(r.logger.log("reparse from beginning"),H=!1,Ee=Ce-188),q=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(o.Events.ERROR,o.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});N.pesData=K,j.pesData=F,L.pesData=B;var oe={audioTrack:j,avcTrack:N,id3Track:L,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(oe),oe},i.flush=function(){var O=this.remainderData;this.remainderData=null;var b;return O?b=this.demux(O,-1,!1,!0):b={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(b),this.sampleAes?this.decrypt(b,this.sampleAes):b},i.extractRemainingSamples=function(O){var b=O.audioTrack,E=O.avcTrack,x=O.id3Track,T=E.pesData,N=b.pesData,j=x.pesData,L;T&&(L=n(T))?(this.parseAVCPES(L,!0),E.pesData=null):E.pesData=T,N&&(L=n(N))?(b.isAAC?this.parseAACPES(L):this.parseMPEGPES(L),b.pesData=null):(N!=null&&N.size&&r.logger.log("last AAC PES packet truncated,might overlap between fragments"),b.pesData=N),j&&(L=n(j))?(this.parseID3PES(L),x.pesData=null):x.pesData=j},i.demuxSampleAes=function(O,b,E){var x=this.demux(O,E,!0,!this.config.progressive),T=this.sampleAes=new v.default(this.observer,this.config,b);return this.decrypt(x,T)},i.decrypt=function(O,b){return new Promise(function(E){var x=O.audioTrack,T=O.avcTrack;x.samples&&x.isAAC?b.decryptAacSamples(x.samples,0,function(){T.samples?b.decryptAvcSamples(T.samples,0,0,function(){E(O)}):E(O)}):T.samples&&b.decryptAvcSamples(T.samples,0,0,function(){E(O)})})},i.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},i.parseAVCPES=function(O,b){var E=this,x=this._avcTrack,T=this.parseAVCNALu(O.data),N=!1,j=this.avcSample,L,V=!1;O.data=null,j&&T.length&&!x.audFound&&(s(j,x),j=this.avcSample=w(!1,O.pts,O.dts,"")),T.forEach(function(K){switch(K.type){case 1:{L=!0,j||(j=E.avcSample=w(!0,O.pts,O.dts,"")),N&&(j.debug+="NDR "),j.frame=!0;var W=K.data;if(V&&W.length>4){var G=new l.default(W).readSliceType();(G===2||G===4||G===7||G===9)&&(j.key=!0)}break}case 5:L=!0,j||(j=E.avcSample=w(!0,O.pts,O.dts,"")),N&&(j.debug+="IDR "),j.key=!0,j.frame=!0;break;case 6:{L=!0,N&&j&&(j.debug+="SEI ");var F=new l.default(S(K.data));F.readUByte();for(var B=0,H=0,q=!1,re=0;!q&&F.bytesAvailable>1;){B=0;do re=F.readUByte(),B+=re;while(re===255);H=0;do re=F.readUByte(),H+=re;while(re===255);if(B===4&&F.bytesAvailable!==0){q=!0;var ee=F.readUByte();if(ee===181){var Ce=F.readUShort();if(Ce===49){var Ee=F.readUInt();if(Ee===1195456820){var pe=F.readUByte();if(pe===3){for(var Me=F.readUByte(),_e=F.readUByte(),he=31&Me,ce=[Me,_e],oe=0;oe16){for(var Se=[],te=0;te<16;te++)Se.push(F.readUByte().toString(16)),(te===3||te===5||te===7||te===9)&&Se.push("-");for(var ue=H-16,Oe=new Uint8Array(ue),le=0;le=0){var F={data:O.subarray(W,j-x-1),type:G};N.push(F)}else{var B=this.getLastNalUnit();if(B&&(T&&j<=4-T&&(B.state&&(B.data=B.data.subarray(0,B.data.byteLength-T))),V=j-x-1,V>0)){var H=new Uint8Array(B.data.byteLength+V);H.set(B.data,0),H.set(O.subarray(0,V),B.data.byteLength),B.data=H,B.state=0}}j=0&&x>=0){var q={data:O.subarray(W,b),type:G,state:x};N.push(q)}if(N.length===0){var re=this.getLastNalUnit();if(re){var ee=new Uint8Array(re.data.byteLength+O.byteLength);ee.set(re.data,0),ee.set(O,re.data.byteLength),re.data=ee}}return E.naluState=x,N},i.parseAACPES=function(O){var b=0,E=this._audioTrack,x=this.aacOverFlow,T=O.data;if(x){this.aacOverFlow=null;var N=x.sample.unit.byteLength,j=Math.min(x.missing,N),L=N-j;x.sample.unit.set(T.subarray(0,j),L),E.samples.push(x.sample),b=x.missing}var V,K;for(V=b,K=T.length;V1;){var N=new Uint8Array(T[0].length+T[1].length);N.set(T[0]),N.set(T[1],T[0].length),T[0]=N,T.splice(1,1)}k=T[0];var j=(k[0]<<16)+(k[1]<<8)+k[2];if(j===1){if(O=(k[4]<<8)+k[5],O&&O>y.size-6)return null;var L=k[7];L&192&&(E=(k[9]&14)*536870912+(k[10]&255)*4194304+(k[11]&254)*16384+(k[12]&255)*128+(k[13]&254)/2,L&64?(x=(k[14]&14)*536870912+(k[15]&255)*4194304+(k[16]&254)*16384+(k[17]&255)*128+(k[18]&254)/2,E-x>60*9e4&&(r.logger.warn(Math.round((E-x)/9e4)+"s delta between PTS and DTS, align them"),E=x)):x=E),b=k[8];var V=b+9;if(y.size<=V)return null;y.size-=V;for(var K=new Uint8Array(y.size),W=0,G=T.length;WF){V-=F;continue}else k=k.subarray(V),F-=V,V=0;K.set(k,i),i+=F}return O&&(O-=b+3),{data:K,pts:E,dts:x,len:O}}return null}function s(y,i){if(y.units.length&&y.frame){if(y.pts===void 0){var k=i.samples,O=k.length;if(O){var b=k[O-1];y.pts=b.pts,y.dts=b.dts}else{i.dropped++;return}}i.samples.push(y)}y.debug.length&&r.logger.log(y.pts+"/"+y.dts+":"+y.debug)}function d(y,i){var k=y.length;if(k>0){if(i.pts>=y[k-1].pts)y.push(i);else for(var O=k-1;O>=0;O--)if(i.ptsE)return T;return 0}},{key:"maxAutoLevel",get:function(){var b=this.levels,E=this.autoLevelCapping,x;return E===-1&&b&&b.length?x=b.length-1:x=E,x}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(b){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,b)}},{key:"audioTracks",get:function(){var b=this.audioTrackController;return b?b.audioTracks:[]}},{key:"audioTrack",get:function(){var b=this.audioTrackController;return b?b.audioTrack:-1},set:function(b){var E=this.audioTrackController;E&&(E.audioTrack=b)}},{key:"subtitleTracks",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTrack:-1},set:function(b){var E=this.subtitleTrackController;E&&(E.subtitleTrack=b)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var b=this.subtitleTrackController;return b?b.subtitleDisplay:!1},set:function(b){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=b)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(b){this.config.lowLatencyMode=b}},{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 n.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return i.defaultConfig?i.defaultConfig:w.hlsDefaultConfig},set:function(b){i.defaultConfig=b}}]),i}();y.defaultConfig=void 0},"./src/is-supported.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"isSupported",function(){return l}),_.d(u,"changeTypeSupported",function(){return C});var D=_("./src/utils/mediasource-helper.ts");function f(){return self.SourceBuffer||self.WebKitSourceBuffer}function l(){var v=Object(D.getMediaSource)();if(!v)return!1;var o=f(),a=v&&typeof v.isTypeSupported=="function"&&v.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!o||o.prototype&&typeof o.prototype.appendBuffer=="function"&&typeof o.prototype.remove=="function";return!!a&&!!r}function C(){var v,o=f();return typeof(o==null||((v=o.prototype)===null||v===void 0)?void 0:v.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return p}),_.d(u,"LoadError",function(){return g});var D=_("./src/polyfills/number.ts"),f=_("./src/errors.ts");function l(c,n){c.prototype=Object.create(n.prototype),c.prototype.constructor=c,r(c,n)}function C(c){var n=typeof Map=="function"?new Map:void 0;return C=function(d){if(d===null||!a(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(d))return n.get(d);n.set(d,S)}function S(){return v(d,arguments,h(this).constructor)}return S.prototype=Object.create(d.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),r(S,d)},C(c)}function v(c,n,s){return o()?v=Reflect.construct:v=function(S,y,i){var k=[null];k.push.apply(k,y);var O=Function.bind.apply(S,k),b=new O;return i&&r(b,i.prototype),b},v.apply(null,arguments)}function o(){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(c){return!1}}function a(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function r(c,n){return r=Object.setPrototypeOf||function(d,S){return d.__proto__=S,d},r(c,n)}function h(c){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},h(c)}var m=Math.pow(2,17),p=function(){function c(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var n=c.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(d,S){var y=this,i=d.url;if(!i)return Promise.reject(new g({type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(i?"part list":"url")));this.abort();var k=this.config,O=k.fLoader,b=k.loader;return new Promise(function(E,x){y.loader&&y.loader.destroy();var T=y.loader=d.loader=O?new O(k):new b(k),N=w(d),j={timeout:k.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:k.fragLoadingMaxRetryTimeout,highWaterMark:m};d.stats=T.stats,T.load(N,j,{onSuccess:function(V,K,W,G){y.resetLoader(d,T),E({frag:d,part:null,payload:V.data,networkDetails:G})},onError:function(V,K,W){y.resetLoader(d,T),x(new g({type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:V,networkDetails:W}))},onAbort:function(V,K,W){y.resetLoader(d,T),x(new g({type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:W}))},onTimeout:function(V,K,W){y.resetLoader(d,T),x(new g({type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:W}))},onProgress:function(V,K,W,G){S&&S({frag:d,part:null,payload:W,networkDetails:G})}})})},n.loadPart=function(d,S,y){var i=this;this.abort();var k=this.config,O=k.fLoader,b=k.loader;return new Promise(function(E,x){i.loader&&i.loader.destroy();var T=i.loader=d.loader=O?new O(k):new b(k),N=w(d,S),j={timeout:k.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:k.fragLoadingMaxRetryTimeout,highWaterMark:m};S.stats=T.stats,T.load(N,j,{onSuccess:function(V,K,W,G){i.resetLoader(d,T),i.updateStatsFromPart(d,S);var F={frag:d,part:S,payload:V.data,networkDetails:G};y(F),E(F)},onError:function(V,K,W){i.resetLoader(d,T),x(new g({type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:S,response:V,networkDetails:W}))},onAbort:function(V,K,W){d.stats.aborted=S.stats.aborted,i.resetLoader(d,T),x(new g({type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:S,networkDetails:W}))},onTimeout:function(V,K,W){i.resetLoader(d,T),x(new g({type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:S,networkDetails:W}))}})})},n.updateStatsFromPart=function(d,S){var y=d.stats,i=S.stats,k=i.total;if(y.loaded+=i.loaded,k){var O=Math.round(d.duration/S.duration),b=Math.min(Math.round(y.loaded/k),O),E=O-b,x=E*Math.round(y.loaded/b);y.total=y.loaded+x}else y.total=Math.max(y.loaded,y.total);var T=y.loading,N=i.loading;T.start?T.first+=N.first-N.start:(T.start=N.start,T.first=N.first),T.end=N.end},n.resetLoader=function(d,S){d.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},c}();function w(c,n){n===void 0&&(n=null);var s=n||c,d={frag:c,part:n,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},S=s.byteRangeStartOffset,y=s.byteRangeEndOffset;return Object(D.isFiniteNumber)(S)&&Object(D.isFiniteNumber)(y)&&(d.rangeStart=S,d.rangeEnd=y),d}var g=function(c){l(n,c);function n(s){for(var d,S=arguments.length,y=new Array(S>1?S-1:0),i=1;i>8*(15-k)&255;return i},d.setDecryptDataFromLevelKey=function(y,i){var k=y;return(y==null?void 0:y.method)==="AES-128"&&y.uri&&!y.iv&&(k=v.LevelKey.fromURI(y.uri),k.method=y.method,k.iv=this.createInitializationVector(i),k.keyFormat="identity"),k},d.setElementaryStreamInfo=function(y,i,k,O,b,E){E===void 0&&(E=!1);var x=this.elementaryStreams,T=x[y];if(!T){x[y]={startPTS:i,endPTS:k,startDTS:O,endDTS:b,partial:E};return}T.startPTS=Math.min(T.startPTS,i),T.endPTS=Math.max(T.endPTS,k),T.startDTS=Math.min(T.startDTS,O),T.endDTS=Math.max(T.endDTS,b)},d.clearElementaryStreamInfo=function(){var y=this.elementaryStreams;y[p.AUDIO]=null,y[p.VIDEO]=null,y[p.AUDIOVIDEO]=null},m(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var y=this.sn;typeof y!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&C.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),y=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,y)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(D.isFiniteNumber)(this.programDateTime))return null;var y=Object(D.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+y*1e3}},{key:"encrypted",get:function(){var y;return!!((y=this.decryptdata)!==null&&y!==void 0&&y.keyFormat&&this.decryptdata.uri)}}]),s}(w),c=function(n){a(s,n);function s(d,S,y,i,k){var O;O=n.call(this,y)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new o.LoadStats,O.duration=d.decimalFloatingPoint("DURATION"),O.gap=d.bool("GAP"),O.independent=d.bool("INDEPENDENT"),O.relurl=d.enumeratedString("URI"),O.fragment=S,O.index=i;var b=d.enumeratedString("BYTERANGE");return b&&O.setByteRange(b,k),k&&(O.fragOffset=k.fragOffset+k.duration),O}return m(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),s}(w)},"./src/loader/key-loader.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return C});var D=_("./src/events.ts"),f=_("./src/errors.ts"),l=_("./src/utils/logger.ts"),C=function(){function v(a){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=a,this._registerListeners()}var o=v.prototype;return o._registerListeners=function(){this.hls.on(D.Events.KEY_LOADING,this.onKeyLoading,this)},o._unregisterListeners=function(){this.hls.off(D.Events.KEY_LOADING,this.onKeyLoading)},o.destroy=function(){this._unregisterListeners();for(var r in this.loaders){var h=this.loaders[r];h&&h.destroy()}this.loaders={}},o.onKeyLoading=function(r,h){var m=h.frag,p=m.type,w=this.loaders[p];if(!m.decryptdata){l.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var g=m.decryptdata.uri;if(g!==this.decrypturl||this.decryptkey===null){var c=this.hls.config;if(w&&(l.logger.warn("abort previous key loader for type:"+p),w.abort()),!g){l.logger.warn("key uri is falsy");return}var n=c.loader,s=m.loader=this.loaders[p]=new n(c);this.decrypturl=g,this.decryptkey=null;var d={url:g,frag:m,responseType:"arraybuffer"},S={timeout:c.fragLoadingTimeOut,maxRetry:0,retryDelay:c.fragLoadingRetryDelay,maxRetryDelay:c.fragLoadingMaxRetryTimeout,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(d,S,y)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(D.Events.KEY_LOADED,{frag:m}))},o.loadsuccess=function(r,h,m){var p=m.frag;if(!p.decryptdata){l.logger.error("after key load, decryptdata unset");return}this.decryptkey=p.decryptdata.key=new Uint8Array(r.data),p.loader=null,delete this.loaders[p.type],this.hls.trigger(D.Events.KEY_LOADED,{frag:p})},o.loaderror=function(r,h){var m=h.frag,p=m.loader;p&&p.abort(),delete this.loaders[m.type],this.hls.trigger(D.Events.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:r})},o.loadtimeout=function(r,h){var m=h.frag,p=m.loader;p&&p.abort(),delete this.loaders[m.type],this.hls.trigger(D.Events.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},v}()},"./src/loader/level-details.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"LevelDetails",function(){return v});var D=_("./src/polyfills/number.ts");function f(o,a){for(var r=0;rh.endSN||m>0||m===0&&p>0,this.updated||this.advanced?this.misses=Math.floor(h.misses*.6):this.misses=h.misses+1,this.availabilityDelay=h.availabilityDelay},l(o,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(D.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||C}},{key:"drift",get:function(){var h=this.driftEndTime-this.driftStartTime;if(h>0){var m=this.driftEnd-this.driftStart;return m*1e3/h}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var h;return(h=this.fragments)!==null&&h!==void 0&&h.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 h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),o}()},"./src/loader/level-key.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"LevelKey",function(){return v});var D=_("./node_modules/url-toolkit/src/url-toolkit.js"),f=_.n(D);function l(o,a){for(var r=0;r2){var x=E.shift()+".";return x+=parseInt(E.shift()).toString(16),x+=("000"+parseInt(E.shift()).toString(16)).substr(-4),x}return b},k.resolve=function(b,E){return f.buildAbsoluteURL(E,b,{alwaysNormalize:!0})},k.parseMasterPlaylist=function(b,E){var x=[],T={},N=!1;m.lastIndex=0;for(var j;(j=m.exec(b))!=null;)if(j[1]){var L=new a.AttrList(j[1]),V={attrs:L,bitrate:L.decimalInteger("AVERAGE-BANDWIDTH")||L.decimalInteger("BANDWIDTH"),name:L.NAME,url:k.resolve(j[2],E)},K=L.decimalResolution("RESOLUTION");K&&(V.width=K.width,V.height=K.height),d((L.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),V),V.videoCodec&&V.videoCodec.indexOf("avc1")!==-1&&(V.videoCodec=k.convertAVC1ToAVCOTI(V.videoCodec)),x.push(V)}else if(j[3]){var W=new a.AttrList(j[3]);W["DATA-ID"]&&(N=!0,T[W["DATA-ID"]]=W)}return{levels:x,sessionData:N?T:null}},k.parseMasterPlaylistMedia=function(b,E,x,T){T===void 0&&(T=[]);var N,j=[],L=0;for(p.lastIndex=0;(N=p.exec(b))!==null;){var V=new a.AttrList(N[1]);if(V.TYPE===x){var K={attrs:V,bitrate:0,id:L++,groupId:V["GROUP-ID"],instreamId:V["INSTREAM-ID"],name:V.NAME||V.LANGUAGE||"",type:x,default:V.bool("DEFAULT"),autoselect:V.bool("AUTOSELECT"),forced:V.bool("FORCED"),lang:V.LANGUAGE,url:V.URI?k.resolve(V.URI,E):""};if(T.length){var W=k.findGroup(T,K.groupId)||T[0];S(K,W,"audioCodec"),S(K,W,"textCodec")}j.push(K)}}return j},k.parseLevelPlaylist=function(b,E,x,T,N){var j=new v.LevelDetails(E),L=j.fragments,V=null,K=0,W=0,G=0,F=0,B=null,H=new C.Fragment(T,E),q,re,ee,Ce=-1,Ee=!1;for(w.lastIndex=0,j.m3u8=b;(q=w.exec(b))!==null;){Ee&&(Ee=!1,H=new C.Fragment(T,E),H.start=G,H.sn=K,H.cc=F,H.level=x,V&&(H.initSegment=V,H.rawProgramDateTime=V.rawProgramDateTime));var pe=q[1];if(pe){H.duration=parseFloat(pe);var Me=(" "+q[2]).slice(1);H.title=Me||null,H.tagList.push(Me?["INF",pe,Me]:["INF",pe])}else if(q[3])Object(D.isFiniteNumber)(H.duration)&&(H.start=G,ee&&(H.levelkey=ee),H.sn=K,H.level=x,H.cc=F,H.urlId=N,L.push(H),H.relurl=(" "+q[3]).slice(1),i(H,B),B=H,G+=H.duration,K++,W=0,Ee=!0);else if(q[4]){var _e=(" "+q[4]).slice(1);B?H.setByteRange(_e,B):H.setByteRange(_e)}else if(q[5])H.rawProgramDateTime=(" "+q[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),Ce===-1&&(Ce=L.length);else{if(q=q[0].match(g),!q){r.logger.warn("No matches on slow regex match for level playlist!");continue}for(re=1;re-1){r.logger.warn("Keyformat "+Ze+" is not supported from the manifest");continue}else if(Ze!=="identity")continue;Y&&(ee=o.LevelKey.fromURL(E,Z),Z&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Y)>=0&&(ee.method=Y,ee.keyFormat=Ze,Re&&(ee.keyID=Re),ge&&(ee.keyFormatVersions=ge),ee.iv=be));break}case"START":{var et=new a.AttrList(ce),nt=et.decimalFloatingPoint("TIME-OFFSET");Object(D.isFiniteNumber)(nt)&&(j.startTimeOffset=nt);break}case"MAP":{var ut=new a.AttrList(ce);H.relurl=ut.URI,ut.BYTERANGE&&H.setByteRange(ut.BYTERANGE),H.level=x,H.sn="initSegment",ee&&(H.levelkey=ee),H.initSegment=null,V=H,Ee=!0;break}case"SERVER-CONTROL":{var ot=new a.AttrList(ce);j.canBlockReload=ot.bool("CAN-BLOCK-RELOAD"),j.canSkipUntil=ot.optionalFloat("CAN-SKIP-UNTIL",0),j.canSkipDateRanges=j.canSkipUntil>0&&ot.bool("CAN-SKIP-DATERANGES"),j.partHoldBack=ot.optionalFloat("PART-HOLD-BACK",0),j.holdBack=ot.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var je=new a.AttrList(ce);j.partTarget=je.decimalFloatingPoint("PART-TARGET");break}case"PART":{var De=j.partList;De||(De=j.partList=[]);var rt=W>0?De[De.length-1]:void 0,lt=W++,Je=new C.Part(new a.AttrList(ce),H,E,lt,rt);De.push(Je),H.duration+=Je.duration;break}case"PRELOAD-HINT":{var tt=new a.AttrList(ce);j.preloadHint=tt;break}case"RENDITION-REPORT":{var Ue=new a.AttrList(ce);j.renditionReports=j.renditionReports||[],j.renditionReports.push(Ue);break}default:r.logger.warn("line parsed but not handled: "+q);break}}}B&&!B.relurl?(L.pop(),G-=B.duration,j.partList&&(j.fragmentHint=B)):j.partList&&(i(H,B),H.cc=F,j.fragmentHint=H);var ke=L.length,Ie=L[0],ye=L[ke-1];if(G+=j.skippedSegments*j.targetduration,G>0&&ke&&ye){j.averagetargetduration=G/ke;var Te=ye.sn;j.endSN=Te!=="initSegment"?Te:0,Ie&&(j.startCC=Ie.cc,Ie.initSegment||j.fragments.every(function(Ae){return Ae.relurl&&n(Ae.relurl)})&&(r.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new C.Fragment(T,E),H.relurl=ye.relurl,H.level=x,H.sn="initSegment",Ie.initSegment=H,j.needSidxRanges=!0))}else j.endSN=0,j.startCC=0;return j.fragmentHint&&(G+=j.fragmentHint.duration),j.totalduration=G,j.endCC=F,Ce>0&&y(L,Ce),j},k}();function d(k,O){["video","audio","text"].forEach(function(b){var E=k.filter(function(T){return Object(h.isCodecType)(T,b)});if(E.length){var x=E.filter(function(T){return T.lastIndexOf("avc1",0)===0||T.lastIndexOf("mp4a",0)===0});O[b+"Codec"]=x.length>0?x[0]:E[0],k=k.filter(function(T){return E.indexOf(T)===-1})}}),O.unknownCodecs=k}function S(k,O,b){var E=O[b];E&&(k[b]=E)}function y(k,O){for(var b=k[O],E=O;E--;){var x=k[E];if(!x)return;x.programDateTime=b.programDateTime-x.duration*1e3,b=x}}function i(k,O){k.rawProgramDateTime?k.programDateTime=Date.parse(k.rawProgramDateTime):O!=null&&O.programDateTime&&(k.programDateTime=O.endProgramDateTime),Object(D.isFiniteNumber)(k.programDateTime)||(k.programDateTime=null,k.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/polyfills/number.ts"),f=_("./src/events.ts"),l=_("./src/errors.ts"),C=_("./src/utils/logger.ts"),v=_("./src/utils/mp4-tools.ts"),o=_("./src/loader/m3u8-parser.ts"),a=_("./src/types/loader.ts"),r=_("./src/utils/attr-list.ts");function h(w){var g=w.type;switch(g){case a.PlaylistContextType.AUDIO_TRACK:return a.PlaylistLevelType.AUDIO;case a.PlaylistContextType.SUBTITLE_TRACK:return a.PlaylistLevelType.SUBTITLE;default:return a.PlaylistLevelType.MAIN}}function m(w,g){var c=w.url;return(c===void 0||c.indexOf("data:")===0)&&(c=g.url),c}var p=function(){function w(c){this.hls=void 0,this.loaders=Object.create(null),this.hls=c,this.registerListeners()}var g=w.prototype;return g.registerListeners=function(){var n=this.hls;n.on(f.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(f.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(f.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(f.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},g.unregisterListeners=function(){var n=this.hls;n.off(f.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(f.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(f.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(f.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},g.createInternalLoader=function(n){var s=this.hls.config,d=s.pLoader,S=s.loader,y=d||S,i=new y(s);return n.loader=i,this.loaders[n.type]=i,i},g.getInternalLoader=function(n){return this.loaders[n.type]},g.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},g.destroyInternalLoaders=function(){for(var n in this.loaders){var s=this.loaders[n];s&&s.destroy(),this.resetInternalLoader(n)}},g.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},g.onManifestLoading=function(n,s){var d=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:a.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},g.onLevelLoading=function(n,s){var d=s.id,S=s.level,y=s.url,i=s.deliveryDirectives;this.load({id:d,groupId:null,level:S,responseType:"text",type:a.PlaylistContextType.LEVEL,url:y,deliveryDirectives:i})},g.onAudioTrackLoading=function(n,s){var d=s.id,S=s.groupId,y=s.url,i=s.deliveryDirectives;this.load({id:d,groupId:S,level:null,responseType:"text",type:a.PlaylistContextType.AUDIO_TRACK,url:y,deliveryDirectives:i})},g.onSubtitleTrackLoading=function(n,s){var d=s.id,S=s.groupId,y=s.url,i=s.deliveryDirectives;this.load({id:d,groupId:S,level:null,responseType:"text",type:a.PlaylistContextType.SUBTITLE_TRACK,url:y,deliveryDirectives:i})},g.load=function(n){var s,d=this.hls.config,S=this.getInternalLoader(n);if(S){var y=S.context;if(y&&y.url===n.url){C.logger.trace("[playlist-loader]: playlist request ongoing");return}C.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),S.abort()}var i,k,O,b;switch(n.type){case a.PlaylistContextType.MANIFEST:i=d.manifestLoadingMaxRetry,k=d.manifestLoadingTimeOut,O=d.manifestLoadingRetryDelay,b=d.manifestLoadingMaxRetryTimeout;break;case a.PlaylistContextType.LEVEL:case a.PlaylistContextType.AUDIO_TRACK:case a.PlaylistContextType.SUBTITLE_TRACK:i=0,k=d.levelLoadingTimeOut;break;default:i=d.levelLoadingMaxRetry,k=d.levelLoadingTimeOut,O=d.levelLoadingRetryDelay,b=d.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(n),(s=n.deliveryDirectives)!==null&&s!==void 0&&s.part){var E;if(n.type===a.PlaylistContextType.LEVEL&&n.level!==null?E=this.hls.levels[n.level].details:n.type===a.PlaylistContextType.AUDIO_TRACK&&n.id!==null?E=this.hls.audioTracks[n.id].details:n.type===a.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(E=this.hls.subtitleTracks[n.id].details),E){var x=E.partTarget,T=E.targetduration;x&&T&&(k=Math.min(Math.max(x*3,T*.8)*1e3,k))}}var N={timeout:k,maxRetry:i,retryDelay:O,maxRetryDelay:b,highWaterMark:0},j={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(n,N,j)},g.loadsuccess=function(n,s,d,S){if(S===void 0&&(S=null),d.isSidxRequest){this.handleSidxRequest(n,d),this.handlePlaylistLoaded(n,s,d,S);return}this.resetInternalLoader(d.type);var y=n.data;if(y.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,d,"no EXTM3U delimiter",S);return}s.parsing.start=performance.now(),y.indexOf("#EXTINF:")>0||y.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,s,d,S):this.handleMasterPlaylist(n,s,d,S)},g.loaderror=function(n,s,d){d===void 0&&(d=null),this.handleNetworkError(s,d,!1,n)},g.loadtimeout=function(n,s,d){d===void 0&&(d=null),this.handleNetworkError(s,d,!0)},g.handleMasterPlaylist=function(n,s,d,S){var y=this.hls,i=n.data,k=m(n,d),O=o.default.parseMasterPlaylist(i,k),b=O.levels,E=O.sessionData;if(!b.length){this.handleManifestParsingError(n,d,"no level found in manifest",S);return}var x=b.map(function(K){return{id:K.attrs.AUDIO,audioCodec:K.audioCodec}}),T=b.map(function(K){return{id:K.attrs.SUBTITLES,textCodec:K.textCodec}}),N=o.default.parseMasterPlaylistMedia(i,k,"AUDIO",x),j=o.default.parseMasterPlaylistMedia(i,k,"SUBTITLES",T),L=o.default.parseMasterPlaylistMedia(i,k,"CLOSED-CAPTIONS");if(N.length){var V=N.some(function(K){return!K.url});!V&&b[0].audioCodec&&!b[0].attrs.AUDIO&&(C.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),N.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new r.AttrList({}),bitrate:0,url:""}))}y.trigger(f.Events.MANIFEST_LOADED,{levels:b,audioTracks:N,subtitles:j,captions:L,url:k,stats:s,networkDetails:S,sessionData:E})},g.handleTrackOrLevelPlaylist=function(n,s,d,S){var y=this.hls,i=d.id,k=d.level,O=d.type,b=m(n,d),E=Object(D.isFiniteNumber)(i)?i:0,x=Object(D.isFiniteNumber)(k)?k:E,T=h(d),N=o.default.parseLevelPlaylist(n.data,b,x,T,E);if(!N.fragments.length){y.trigger(f.Events.ERROR,{type:l.ErrorTypes.NETWORK_ERROR,details:l.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:b,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(O===a.PlaylistContextType.MANIFEST){var j={attrs:new r.AttrList({}),bitrate:0,details:N,name:"",url:b};y.trigger(f.Events.MANIFEST_LOADED,{levels:[j],audioTracks:[],url:b,stats:s,networkDetails:S,sessionData:null})}if(s.parsing.end=performance.now(),N.needSidxRanges){var L,V=(L=N.fragments[0].initSegment)===null||L===void 0?void 0:L.url;this.load({url:V,isSidxRequest:!0,type:O,level:k,levelDetails:N,id:i,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=N,this.handlePlaylistLoaded(n,s,d,S)},g.handleSidxRequest=function(n,s){var d=Object(v.parseSegmentIndex)(new Uint8Array(n.data));if(!d)return;var S=d.references,y=s.levelDetails;S.forEach(function(i,k){var O=i.info,b=y.fragments[k];b.byteRange.length===0&&b.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),b.initSegment&&b.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},g.handleManifestParsingError=function(n,s,d,S){this.hls.trigger(f.Events.ERROR,{type:l.ErrorTypes.NETWORK_ERROR,details:l.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===a.PlaylistContextType.MANIFEST,url:n.url,reason:d,response:n,context:s,networkDetails:S})},g.handleNetworkError=function(n,s,d,S){d===void 0&&(d=!1),C.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var y=l.ErrorDetails.UNKNOWN,i=!1,k=this.getInternalLoader(n);switch(n.type){case a.PlaylistContextType.MANIFEST:y=d?l.ErrorDetails.MANIFEST_LOAD_TIMEOUT:l.ErrorDetails.MANIFEST_LOAD_ERROR,i=!0;break;case a.PlaylistContextType.LEVEL:y=d?l.ErrorDetails.LEVEL_LOAD_TIMEOUT:l.ErrorDetails.LEVEL_LOAD_ERROR,i=!1;break;case a.PlaylistContextType.AUDIO_TRACK:y=d?l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,i=!1;break;case a.PlaylistContextType.SUBTITLE_TRACK:y=d?l.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:l.ErrorDetails.SUBTITLE_LOAD_ERROR,i=!1;break}k&&this.resetInternalLoader(n.type);var O={type:l.ErrorTypes.NETWORK_ERROR,details:y,fatal:i,url:n.url,loader:k,context:n,networkDetails:s};S&&(O.response=S),this.hls.trigger(f.Events.ERROR,O)},g.handlePlaylistLoaded=function(n,s,d,S){var y=d.type,i=d.level,k=d.id,O=d.groupId,b=d.loader,E=d.levelDetails,x=d.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(n,d,"invalid target duration",S);return}if(!b)return;E.live&&(b.getCacheAge&&(E.ageHeader=b.getCacheAge()||0),(!b.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(y){case a.PlaylistContextType.MANIFEST:case a.PlaylistContextType.LEVEL:this.hls.trigger(f.Events.LEVEL_LOADED,{details:E,level:i||0,id:k||0,stats:s,networkDetails:S,deliveryDirectives:x});break;case a.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(f.Events.AUDIO_TRACK_LOADED,{details:E,id:k||0,groupId:O||"",stats:s,networkDetails:S,deliveryDirectives:x});break;case a.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(f.Events.SUBTITLE_TRACK_LOADED,{details:E,id:k||0,groupId:O||"",stats:s,networkDetails:S,deliveryDirectives:x});break}},w}();u.default=p},"./src/polyfills/number.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"isFiniteNumber",function(){return D}),_.d(u,"MAX_SAFE_INTEGER",function(){return f});var D=Number.isFinite||function(l){return typeof l=="number"&&isFinite(l)},f=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(M,u,_){"use strict";_.r(u);var D=function(){function f(){}return f.getSilentFrame=function(C,v){switch(C){case"mp4a.40.2":if(v===1)return new Uint8Array([0,200,0,128,35,128]);if(v===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(v===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(v===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(v===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(v===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(v===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(v===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(v===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},f}();u.default=D},"./src/remux/mp4-generator.ts":function(M,u,_){"use strict";_.r(u);var D=Math.pow(2,32)-1,f=function(){function l(){}return l.init=function(){l.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 v;for(v in l.types)l.types.hasOwnProperty(v)&&(l.types[v]=[v.charCodeAt(0),v.charCodeAt(1),v.charCodeAt(2),v.charCodeAt(3)]);var o=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]),a=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]);l.HDLR_TYPES={video:o,audio:a};var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),h=new Uint8Array([0,0,0,0,0,0,0,0]);l.STTS=l.STSC=l.STCO=h,l.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),l.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),l.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),l.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),p=new Uint8Array([97,118,99,49]),w=new Uint8Array([0,0,0,1]);l.FTYP=l.box(l.types.ftyp,m,w,m,p),l.DINF=l.box(l.types.dinf,l.box(l.types.dref,r))},l.box=function(v){for(var o=8,a=arguments.length,r=new Array(a>1?a-1:0),h=1;h>24&255,w[1]=o>>16&255,w[2]=o>>8&255,w[3]=o&255,w.set(v,4),m=0,o=8;m>24&255,v>>16&255,v>>8&255,v&255,a>>24,a>>16&255,a>>8&255,a&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))},l.mdia=function(v){return l.box(l.types.mdia,l.mdhd(v.timescale,v.duration),l.hdlr(v.type),l.minf(v))},l.mfhd=function(v){return l.box(l.types.mfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255]))},l.minf=function(v){return v.type==="audio"?l.box(l.types.minf,l.box(l.types.smhd,l.SMHD),l.DINF,l.stbl(v)):l.box(l.types.minf,l.box(l.types.vmhd,l.VMHD),l.DINF,l.stbl(v))},l.moof=function(v,o,a){return l.box(l.types.moof,l.mfhd(v),l.traf(a,o))},l.moov=function(v){for(var o=v.length,a=[];o--;)a[o]=l.trak(v[o]);return l.box.apply(null,[l.types.moov,l.mvhd(v[0].timescale,v[0].duration)].concat(a).concat(l.mvex(v)))},l.mvex=function(v){for(var o=v.length,a=[];o--;)a[o]=l.trex(v[o]);return l.box.apply(null,[l.types.mvex].concat(a))},l.mvhd=function(v,o){o*=v;var a=Math.floor(o/(D+1)),r=Math.floor(o%(D+1)),h=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,v>>24&255,v>>16&255,v>>8&255,v&255,a>>24,a>>16&255,a>>8&255,a&255,r>>24,r>>16&255,r>>8&255,r&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 l.box(l.types.mvhd,h)},l.sdtp=function(v){var o=v.samples||[],a=new Uint8Array(4+o.length),r,h;for(r=0;r>>8&255),o.push(m&255),o=o.concat(Array.prototype.slice.call(h));for(r=0;r>>8&255),a.push(m&255),a=a.concat(Array.prototype.slice.call(h));var p=l.box(l.types.avcC,new Uint8Array([1,o[3],o[4],o[5],252|3,224|v.sps.length].concat(o).concat([v.pps.length]).concat(a))),w=v.width,g=v.height,c=v.pixelRatio[0],n=v.pixelRatio[1];return l.box(l.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,w>>8&255,w&255,g>>8&255,g&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]),p,l.box(l.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),l.box(l.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,n>>24,n>>16&255,n>>8&255,n&255])))},l.esds=function(v){var o=v.config.length;return new Uint8Array([0,0,0,0,3,23+o,0,1,0,4,15+o,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([o]).concat(v.config).concat([6,1,2]))},l.mp4a=function(v){var o=v.samplerate;return l.box(l.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,v.channelCount,0,16,0,0,0,0,o>>8&255,o&255,0,0]),l.box(l.types.esds,l.esds(v)))},l.mp3=function(v){var o=v.samplerate;return l.box(l.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,v.channelCount,0,16,0,0,0,0,o>>8&255,o&255,0,0]))},l.stsd=function(v){return v.type==="audio"?!v.isAAC&&v.codec==="mp3"?l.box(l.types.stsd,l.STSD,l.mp3(v)):l.box(l.types.stsd,l.STSD,l.mp4a(v)):l.box(l.types.stsd,l.STSD,l.avc1(v))},l.tkhd=function(v){var o=v.id,a=v.duration*v.timescale,r=v.width,h=v.height,m=Math.floor(a/(D+1)),p=Math.floor(a%(D+1));return l.box(l.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,o>>24&255,o>>16&255,o>>8&255,o&255,0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,p>>24,p>>16&255,p>>8&255,p&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,r>>8&255,r&255,0,0,h>>8&255,h&255,0,0]))},l.traf=function(v,o){var a=l.sdtp(v),r=v.id,h=Math.floor(o/(D+1)),m=Math.floor(o%(D+1));return l.box(l.types.traf,l.box(l.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),l.box(l.types.tfdt,new Uint8Array([1,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,m>>24,m>>16&255,m>>8&255,m&255])),l.trun(v,a.length+16+20+8+16+8+8),a)},l.trak=function(v){return v.duration=v.duration||4294967295,l.box(l.types.trak,l.tkhd(v),l.mdia(v))},l.trex=function(v){var o=v.id;return l.box(l.types.trex,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},l.trun=function(v,o){var a=v.samples||[],r=a.length,h=12+16*r,m=new Uint8Array(h),p,w,g,c,n,s;for(o+=8+h,m.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255],0),p=0;p>>24&255,g>>>16&255,g>>>8&255,g&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*p);return l.box(l.types.trun,m)},l.initSegment=function(v){l.types||l.init();var o=l.moov(v),a=new Uint8Array(l.FTYP.byteLength+o.byteLength);return a.set(l.FTYP),a.set(o,l.FTYP.byteLength),a},l}();f.types=void 0,f.HDLR_TYPES=void 0,f.STTS=void 0,f.STSC=void 0,f.STCO=void 0,f.STSZ=void 0,f.VMHD=void 0,f.SMHD=void 0,f.STSD=void 0,f.FTYP=void 0,f.DINF=void 0,u.default=f},"./src/remux/mp4-remuxer.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return s}),_.d(u,"normalizePts",function(){return d});var D=_("./src/polyfills/number.ts"),f=_("./src/remux/aac-helper.ts"),l=_("./src/remux/mp4-generator.ts"),C=_("./src/events.ts"),v=_("./src/errors.ts"),o=_("./src/utils/logger.ts"),a=_("./src/types/loader.ts"),r=_("./src/utils/timescale-conversion.ts");function h(){return h=Object.assign||function(k){for(var O=1;O0?N:j.pts},E[0].pts);return x&&o.logger.debug("PTS rollover detected"),T},O.remux=function(E,x,T,N,j,L,V,K){var W,G,F,B,H,q,re=j,ee=j,Ce=E.pid>-1,Ee=x.pid>-1,pe=x.samples.length,Me=E.samples.length>0,_e=pe>1,he=(!Ce||Me)&&(!Ee||_e)||this.ISGenerated||V;if(he){this.ISGenerated||(F=this.generateIS(E,x,j));var ce=this.isVideoContiguous,oe=-1;if(_e&&(oe=S(x.samples),!ce&&this.config.forceKeyFrameOnDiscontinuity))if(q=!0,oe>0){o.logger.warn("[mp4-remuxer]: Dropped "+oe+" out of "+pe+" video samples due to a missing keyframe");var Se=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(oe),x.dropped+=oe,ee+=(x.samples[0].pts-Se)/(x.timescale||9e4)}else oe===-1&&(o.logger.warn("[mp4-remuxer]: No keyframe found out of "+pe+" video samples"),q=!1);if(this.ISGenerated){if(Me&&_e){var te=this.getVideoStartPts(x.samples),ue=d(E.samples[0].pts,te)-te,Oe=ue/x.inputTimeScale;re+=Math.max(0,Oe),ee+=Math.max(0,-Oe)}if(Me){if(E.samplerate||(o.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),F=this.generateIS(E,x,j)),G=this.remuxAudio(E,re,this.isAudioContiguous,L,Ee||_e||K===a.PlaylistLevelType.AUDIO?ee:void 0),_e){var le=G?G.endPTS-G.startPTS:0;x.inputTimeScale||(o.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),F=this.generateIS(E,x,j)),W=this.remuxVideo(x,ee,ce,le)}}else _e&&(W=this.remuxVideo(x,ee,ce,0));W&&(W.firstKeyFrame=oe,W.independent=oe!==-1)}}return this.ISGenerated&&(T.samples.length&&(H=this.remuxID3(T,j)),N.samples.length&&(B=this.remuxText(N,j))),{audio:G,video:W,initSegment:F,independent:q,text:B,id3:H}},O.generateIS=function(E,x,T){var N=E.samples,j=x.samples,L=this.typeSupported,V={},K=!Object(D.isFiniteNumber)(this._initPTS),W="audio/mp4",G,F,B;if(K&&(G=F=Infinity),E.config&&N.length&&(E.timescale=E.samplerate,E.isAAC||(L.mpeg?(W="audio/mpeg",E.codec=""):L.mp3&&(E.codec="mp3")),V.audio={id:"audio",container:W,codec:E.codec,initSegment:!E.isAAC&&L.mpeg?new Uint8Array(0):l.default.initSegment([E]),metadata:{channelCount:E.channelCount}},K&&(B=E.inputTimeScale,G=F=N[0].pts-Math.round(B*T))),x.sps&&x.pps&&j.length&&(x.timescale=x.inputTimeScale,V.video={id:"main",container:"video/mp4",codec:x.codec,initSegment:l.default.initSegment([x]),metadata:{width:x.width,height:x.height}},K)){B=x.inputTimeScale;var H=this.getVideoStartPts(j),q=Math.round(B*T);F=Math.min(F,d(j[0].dts,H)-q),G=Math.min(G,H-q)}if(Object.keys(V).length)return this.ISGenerated=!0,K&&(this._initPTS=G,this._initDTS=F),{tracks:V,initPTS:G,timescale:B}},O.remuxVideo=function(E,x,T,N){var j=E.inputTimeScale,L=E.samples,V=[],K=L.length,W=this._initPTS,G=this.nextAvcDts,F=8,B,H,q,re=Number.POSITIVE_INFINITY,ee=Number.NEGATIVE_INFINITY,Ce=0,Ee=!1;if(!T||G===null){var pe=x*j,Me=L[0].pts-d(L[0].dts,L[0].pts);G=pe-Me}for(var _e=0;_ehe.pts){var ce=9e4*.2;Ce=Math.max(Math.min(Ce,he.pts-he.dts),-1*ce)}he.dts0?_e-1:_e].dts&&(Ee=!0)}Ee&&L.sort(function(It,Lt){var _t=It.dts-Lt.dts,rr=It.pts-Lt.pts;return _t||rr}),H=L[0].dts,q=L[L.length-1].dts;var oe=Math.round((q-H)/(K-1));if(Ce<0){if(Ceoe,Q=Oe<-1;if(le||Q){le?o.logger.warn("AVC: "+Object(r.toMsFromMpegTsClock)(Oe,!0)+" ms ("+Oe+"dts) hole between fragments detected, filling it"):o.logger.warn("AVC: "+Object(r.toMsFromMpegTsClock)(-Oe,!0)+" ms ("+Oe+"dts) overlapping between fragments detected"),H=G;var Y=L[0].pts-Oe;L[0].dts=H,L[0].pts=Y,o.logger.log("Video: First PTS/DTS adjusted: "+Object(r.toMsFromMpegTsClock)(Y,!0)+"/"+Object(r.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(r.toMsFromMpegTsClock)(Oe,!0)+" ms")}}n&&(H=Math.max(0,H));for(var Z=0,be=0,ge=0;ge0?De-1:De].dts;if(Te.stretchShortVideoTrack&&this.nextAudioPts!==null){var Pe=Math.floor(Te.maxBufferHole*j),$e=(N?re+N*j:this.nextAudioPts)-rt.pts;$e>Pe?(B=$e-Ae,B<0&&(B=Ae),o.logger.log("[mp4-remuxer]: It is approximately "+$e/90+" ms to the next segment; using duration "+B/90+" ms for the last video frame.")):B=Ae}else B=Ae}var Ke=Math.round(rt.pts-rt.dts);V.push(new y(rt.key,B,Je,Ke))}if(V.length&&g&&g<70){var ct=V[0].flags;ct.dependsOn=2,ct.isNonSync=0}console.assert(B!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=q+B,this.isVideoContiguous=!0;var gt=l.default.moof(E.sequenceNumber++,H,h({},E,{samples:V})),wt="video",vt={data1:gt,data2:ot,startPTS:re/j,endPTS:(ee+B)/j,startDTS:H/j,endDTS:G/j,type:wt,hasAudio:!1,hasVideo:!0,nb:V.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(ot.length,"MDAT length must not be zero"),vt},O.remuxAudio=function(E,x,T,N,j){var L=E.inputTimeScale,V=E.samplerate?E.samplerate:L,K=L/V,W=E.isAAC?p:w,G=W*K,F=this._initPTS,B=!E.isAAC&&this.typeSupported.mpeg,H=[],q=E.samples,re=B?0:8,ee=this.nextAudioPts||-1,Ce=x*L;if(this.isAudioContiguous=T=T||q.length&&ee>0&&(N&&Math.abs(Ce-ee)<9e3||Math.abs(d(q[0].pts-F,Ce)-ee)<20*G),q.forEach(function(Ie){Ie.pts=d(Ie.pts-F,Ce)}),!T||ee<0){if(q=q.filter(function(Ie){return Ie.pts>=0}),!q.length)return;j===0?ee=0:N?ee=Math.max(0,Ce):ee=q[0].pts}if(E.isAAC)for(var Ee=j!==void 0,pe=this.config.maxAudioFramesDrift,Me=0,_e=ee;Me=pe*G&&Se0){be+=re;try{Z=new Uint8Array(be)}catch(Ie){this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:v.ErrorTypes.MUX_ERROR,details:v.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:be,reason:"fail allocating audio mdat "+be});return}if(!B){var ot=new DataView(Z.buffer);ot.setUint32(0,be),Z.set(l.default.types.mdat,4)}}else return;Z.set(et,re);var je=et.byteLength;re+=je,H.push(new y(!0,W,je,0)),Y=nt}var De=H.length;if(!De)return;var rt=H[H.length-1];this.nextAudioPts=ee=Y+K*rt.duration;var lt=B?new Uint8Array(0):l.default.moof(E.sequenceNumber++,Q/K,h({},E,{samples:H}));E.samples=[];var Je=Q/L,tt=ee/L,Ue="audio",ke={data1:lt,data2:Z,startPTS:Je,endPTS:tt,startDTS:Je,endDTS:tt,type:Ue,hasAudio:!0,hasVideo:!1,nb:De};return this.isAudioContiguous=!0,console.assert(Z.length,"MDAT length must not be zero"),ke},O.remuxEmptyAudio=function(E,x,T,N){var j=E.inputTimeScale,L=E.samplerate?E.samplerate:j,V=j/L,K=this.nextAudioPts,W=(K!==null?K:N.startDTS*j)+this._initDTS,G=N.endDTS*j+this._initDTS,F=V*p,B=Math.ceil((G-W)/F),H=f.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);if(o.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){o.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var q=[],re=0;re4294967296;)k+=b;return k}function S(k){for(var O=0;O0?this.lastEndDTS=E:(C.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!k.audio,T=!!k.video,N="";x&&(N+="audio"),T&&(N+="video");var j={data1:y,startPTS:b,startDTS:b,endPTS:E,endDTS:E,type:N,hasAudio:x,hasVideo:T,nb:1,dropped:0};return S.audio=j.type==="audio"?j:void 0,S.video=j.type!=="audio"?j:void 0,S.text=c,S.id3=g,S.initSegment=i,S},r}(),o=function(h,m,p){return Object(f.getStartDTS)(h,m)-p};function a(r,h){var m=r==null?void 0:r.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||h===l.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}u.default=v},"./src/task-loop.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return D});var D=function(){function f(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var l=f.prototype;return l.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},l.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},l.onHandlerDestroyed=function(){},l.hasInterval=function(){return!!this._tickInterval},l.hasNextTick=function(){return!!this._tickTimer},l.setInterval=function(v){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,v),!0)},l.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},l.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},l.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},l.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},l.doTick=function(){},f}()},"./src/types/cmcd.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"CMCDVersion",function(){return D}),_.d(u,"CMCDObjectType",function(){return f}),_.d(u,"CMCDStreamingFormat",function(){return l}),_.d(u,"CMCDStreamType",function(){return C});var D=1,f;(function(v){v.MANIFEST="m",v.AUDIO="a",v.VIDEO="v",v.MUXED="av",v.INIT="i",v.CAPTION="c",v.TIMED_TEXT="tt",v.KEY="k",v.OTHER="o"})(f||(f={}));var l;(function(v){v.DASH="d",v.HLS="h",v.SMOOTH="s",v.OTHER="o"})(l||(l={}));var C;(function(v){v.VOD="v",v.LIVE="l"})(C||(C={}))},"./src/types/level.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"HlsSkip",function(){return l}),_.d(u,"getSkipValue",function(){return C}),_.d(u,"HlsUrlParameters",function(){return v}),_.d(u,"Level",function(){return o});function D(a,r){for(var h=0;hNumber.MAX_SAFE_INTEGER?Infinity:r},v.hexadecimalInteger=function(a){if(this[a]){var r=(this[a]||"0x").slice(2);r=(r.length&1?"0":"")+r;for(var h=new Uint8Array(r.length/2),m=0;mNumber.MAX_SAFE_INTEGER?Infinity:r},v.decimalFloatingPoint=function(a){return parseFloat(this[a])},v.optionalFloat=function(a,r){var h=this[a];return h?parseFloat(h):r},v.enumeratedString=function(a){return this[a]},v.bool=function(a){return this[a]==="YES"},v.decimalResolution=function(a){var r=D.exec(this[a]);return r===null?void 0:{width:parseInt(r[1],10),height:parseInt(r[2],10)}},C.parseAttrList=function(a){var r,h={},m='"';for(f.lastIndex=0;(r=f.exec(a))!==null;){var p=r[2];p.indexOf(m)===0&&p.lastIndexOf(m)===p.length-1&&(p=p.slice(1,-1)),h[r[1]]=p}return h},C}()},"./src/utils/binary-search.ts":function(M,u,_){"use strict";_.r(u);var D={search:function(l,C){for(var v=0,o=l.length-1,a=null,r=null;v<=o;){a=(v+o)/2|0,r=l[a];var h=C(r);if(h>0)v=a+1;else if(h<0)o=a-1;else return r}return null}};u.default=D},"./src/utils/buffer-helper.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"BufferHelper",function(){return l});var D=_("./src/utils/logger.ts"),f={length:0,start:function(){return 0},end:function(){return 0}},l=function(){function C(){}return C.isBuffered=function(o,a){try{if(o){for(var r=C.getBuffered(o),h=0;h=r.start(h)&&a<=r.end(h))return!0}}catch(m){}return!1},C.bufferInfo=function(o,a,r){try{if(o){var h=C.getBuffered(o),m=[],p;for(p=0;pw&&(h[p-1].end=o[m].end):h.push(o[m])}else h.push(o[m])}else h=o;for(var g=0,c,n=a,s=a,d=0;d=S&&a=T&&D.logger.log(this.time+" ["+T+"] "+N)},b}(),g=function(E){for(var x=[],T=0;Tv&&(this.logger.log(p.DEBUG,"Too large cursor position "+this.pos),this.pos=v)},E.moveCursor=function(T){var N=this.pos+T;if(T>1)for(var j=this.pos+1;j=144&&this.backSpace();var N=l(T);if(this.pos>=v){this.logger.log(p.ERROR,"Cannot insert "+T.toString(16)+" ("+N+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(N,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(T){var N;for(N=T;N0&&(T?j="["+N.join(" | ")+"]":j=N.join(` `)),j},E.getTextAndFormat=function(){return this.rows},b}(),S=function(){function b(x,T,N){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=x,this.outputFilter=T,this.mode=null,this.verbose=0,this.displayedMemory=new d(N),this.nonDisplayedMemory=new d(N),this.lastOutputScreen=new d(N),this.currRollUpRow=this.displayedMemory.rows[C-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=N}var E=b.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[C-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(T){this.outputFilter=T},E.setPAC=function(T){this.writeScreen.setPAC(T)},E.setBkgData=function(T){this.writeScreen.setBkgData(T)},E.setMode=function(T){if(T===this.mode)return;this.mode=T,this.logger.log(p.INFO,"MODE="+T),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=T},E.insertChars=function(T){for(var N=0;N=46,N.italics)N.foreground="white";else{var j=Math.floor(T/2)-16,L=["white","green","blue","cyan","red","yellow","magenta"];N.foreground=L[j]}this.logger.log(p.INFO,"MIDROW: "+JSON.stringify(N)),this.writeScreen.setPen(N)},E.outputDataUpdate=function(T){T===void 0&&(T=!1);var N=this.logger.time;if(N===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=N:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,N,this.lastOutputScreen),T&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:N),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(T){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,T,this.displayedMemory),this.cueStartTime=T))},b}(),y=function(){function b(x,T,N){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var j=new w;this.channels=[null,new S(x,T,j),new S(x+1,N,j)],this.cmdHistory=O(),this.logger=j}var E=b.prototype;return E.getHandler=function(T){return this.channels[T].getHandler()},E.setHandler=function(T,N){this.channels[T].setHandler(N)},E.addData=function(T,N){var j,L,V,K=!1;this.logger.time=T;for(var W=0;W ("+g([L,V])+")"),j=this.parseCmd(L,V),j||(j=this.parseMidrow(L,V)),j||(j=this.parsePAC(L,V)),j||(j=this.parseBackgroundAttributes(L,V)),!j&&(K=this.parseChars(L,V),K)){var G=this.currentChannel;if(G&&G>0){var F=this.channels[G];F.insertChars(K)}else this.logger.log(p.WARNING,"No channel found yet. TEXT-MODE?")}!j&&!K&&this.logger.log(p.WARNING,"Couldn't parse cleaned data "+g([L,V])+" orig: "+g([N[W],N[W+1]]))}},E.parseCmd=function(T,N){var j=this.cmdHistory,L=(T===20||T===28||T===21||T===29)&&N>=32&&N<=47,V=(T===23||T===31)&&N>=33&&N<=35;if(!(L||V))return!1;if(k(T,N,j))return i(null,null,j),this.logger.log(p.DEBUG,"Repeated command ("+g([T,N])+") is dropped"),!0;var K=T===20||T===21||T===23?1:2,W=this.channels[K];return T===20||T===21||T===28||T===29?N===32?W.ccRCL():N===33?W.ccBS():N===34?W.ccAOF():N===35?W.ccAON():N===36?W.ccDER():N===37?W.ccRU(2):N===38?W.ccRU(3):N===39?W.ccRU(4):N===40?W.ccFON():N===41?W.ccRDC():N===42?W.ccTR():N===43?W.ccRTD():N===44?W.ccEDM():N===45?W.ccCR():N===46?W.ccENM():N===47&&W.ccEOC():W.ccTO(N-32),i(T,N,j),this.currentChannel=K,!0},E.parseMidrow=function(T,N){var j=0;if((T===17||T===25)&&N>=32&&N<=47){if(T===17?j=1:j=2,j!==this.currentChannel)return this.logger.log(p.ERROR,"Mismatch channel in midrow parsing"),!1;var L=this.channels[j];return L?(L.ccMIDROW(N),this.logger.log(p.DEBUG,"MIDROW ("+g([T,N])+")"),!0):!1}return!1},E.parsePAC=function(T,N){var j,L=this.cmdHistory,V=(T>=17&&T<=23||T>=25&&T<=31)&&N>=64&&N<=127,K=(T===16||T===24)&&N>=64&&N<=95;if(!(V||K))return!1;if(k(T,N,L))return i(null,null,L),!0;var W=T<=23?1:2;N>=64&&N<=95?j=W===1?o[T]:r[T]:j=W===1?a[T]:h[T];var G=this.channels[W];return G?(G.setPAC(this.interpretPAC(j,N)),i(T,N,L),this.currentChannel=W,!0):!1},E.interpretPAC=function(T,N){var j,L={color:null,italics:!1,indent:null,underline:!1,row:T};return N>95?j=N-96:j=N-64,L.underline=(j&1)===1,j<=13?L.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(j/2)]:j<=15?(L.italics=!0,L.color="white"):L.indent=Math.floor((j-16)/2)*4,L},E.parseChars=function(T,N){var j,L=null,V=null;if(T>=25?(j=2,V=T-8):(j=1,V=T),V>=17&&V<=19){var K;V===17?K=N+80:V===18?K=N+112:K=N+144,this.logger.log(p.INFO,"Special char '"+l(K)+"' in channel "+j),L=[K]}else T>=32&&T<=127&&(L=N===0?[T]:[T,N]);if(L){var W=g(L);this.logger.log(p.DEBUG,"Char codes = "+W.join(",")),i(T,N,this.cmdHistory)}return L},E.parseBackgroundAttributes=function(T,N){var j=(T===16||T===24)&&N>=32&&N<=47,L=(T===23||T===31)&&N>=45&&N<=47;if(!(j||L))return!1;var V,K={};T===16||T===24?(V=Math.floor((N-32)/2),K.background=m[V],N%2===1&&(K.background=K.background+"_semi")):N===45?K.background="transparent":(K.foreground="black",N===47&&(K.underline=!0));var W=T<=23?1:2,G=this.channels[W];return G.setBkgData(K),i(T,N,this.cmdHistory),!0},E.reset=function(){for(var T=0;T=16?n--:n++;var i=Object(D.fixLineBreaks)(s.trim()),k=Object(f.generateCueId)(r,h,i);(!a||!a.cues||!a.cues.getCueById(k))&&(g=new d(r,h,i),g.id=k,g.line=S+1,g.align="left",g.position=10+Math.min(80,Math.floor(n*8/32)*10),p.push(g))}return a&&p.length&&(p.sort(function(O,b){return O.line==="auto"||b.line==="auto"?0:O.line>8&&b.line>8?b.line-O.line:O.line-b.line}),p.forEach(function(O){return Object(l.addCueToTrack)(a,O)})),p}};u.default=v},"./src/utils/discontinuities.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"findFirstFragWithCC",function(){return C}),_.d(u,"shouldAlignOnDiscontinuities",function(){return v}),_.d(u,"findDiscontinuousReferenceFrag",function(){return o}),_.d(u,"adjustSlidingStart",function(){return r}),_.d(u,"alignStream",function(){return h}),_.d(u,"alignPDT",function(){return p}),_.d(u,"alignFragmentByPDTDelta",function(){return w}),_.d(u,"alignMediaPlaylistByPDT",function(){return g});var D=_("./src/polyfills/number.ts"),f=_("./src/utils/logger.ts"),l=_("./src/controller/level-helper.ts");function C(c,n){for(var s=null,d=0,S=c.length;ds.startCC||c&&c.cc=this.minWeight_},C.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},C.destroy=function(){},l}();u.default=f},"./src/utils/ewma.ts":function(M,u,_){"use strict";_.r(u);var D=function(){function f(C,v,o){v===void 0&&(v=0),o===void 0&&(o=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=C,this.alpha_=C?Math.exp(Math.log(.5)/C):0,this.estimate_=v,this.totalWeight_=o}var l=f.prototype;return l.sample=function(v,o){var a=Math.pow(this.alpha_,v);this.estimate_=o*(1-a)+a*this.estimate_,this.totalWeight_+=v},l.getTotalWeight=function(){return this.totalWeight_},l.getEstimate=function(){if(this.alpha_){var v=1-Math.pow(this.alpha_,this.totalWeight_);if(v)return this.estimate_/v}return this.estimate_},f}();u.default=D},"./src/utils/fetch-loader.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"fetchSupported",function(){return w});var D=_("./src/polyfills/number.ts"),f=_("./src/loader/load-stats.ts"),l=_("./src/demux/chunk-cache.ts");function C(d,S){d.prototype=Object.create(S.prototype),d.prototype.constructor=d,h(d,S)}function v(d){var S=typeof Map=="function"?new Map:void 0;return v=function(i){if(i===null||!r(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof S!="undefined"){if(S.has(i))return S.get(i);S.set(i,k)}function k(){return o(i,arguments,m(this).constructor)}return k.prototype=Object.create(i.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),h(k,i)},v(d)}function o(d,S,y){return a()?o=Reflect.construct:o=function(k,O,b){var E=[null];E.push.apply(E,O);var x=Function.bind.apply(k,E),T=new x;return b&&h(T,b.prototype),T},o.apply(null,arguments)}function a(){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 r(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function h(d,S){return h=Object.setPrototypeOf||function(i,k){return i.__proto__=k,i},h(d,S)}function m(d){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)},m(d)}function p(){return p=Object.assign||function(d){for(var S=1;S=b&&E(k,O,x.flush(),i)):E(k,O,V,i),j()}).catch(function(){return Promise.reject()})};return N()},d}();function c(d,S){var y={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(p({},d.headers))};return d.rangeEnd&&y.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),y}function n(d,S){return new self.Request(d.url,S)}var s=function(d){C(S,d);function S(y,i,k){var O;return O=d.call(this,y)||this,O.code=void 0,O.details=void 0,O.code=i,O.details=k,O}return S}(v(Error));u.default=g},"./src/utils/imsc1-ttml-parser.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"IMSC1_CODEC",function(){return r}),_.d(u,"parseIMSC1",function(){return w});var D=_("./src/utils/mp4-tools.ts"),f=_("./src/utils/vttparser.ts"),l=_("./src/utils/vttcue.ts"),C=_("./src/demux/id3.ts"),v=_("./src/utils/timescale-conversion.ts"),o=_("./src/utils/webvtt-parser.ts");function a(){return a=Object.assign||function(b){for(var E=1;E"):D}function v(r){for(var h=arguments.length,m=new Array(h>1?h-1:0),p=1;p>24,S[y+1]=i>>16&255,S[y+2]=i>>8&255,S[y+3]=i&255}function h(S,y){var i=[];if(!y.length)return i;var k,O,b;"data"in S?(k=S.data,O=S.start,b=S.end):(k=S,O=0,b=k.byteLength);for(var E=O;E1?E+x:b;if(T===y[0])if(y.length===1)i.push({data:k,start:E+8,end:N});else{var j=h({data:k,start:E+8,end:N},y.slice(1));j.length&&C.apply(i,j)}E=N}return i}function m(S){var y=h(S,["moov"]),i=y[0],k=i?i.end:null,O=h(S,["sidx"]);if(!O||!O[0])return null;var b=[],E=O[0],x=E.data[0],T=x===0?8:16,N=a(E,T);T+=4;var j=0,L=0;x===0?T+=8:T+=16,T+=2;var V=E.end+L,K=o(E,T);T+=2;for(var W=0;W>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var q=a(E,G);G+=4,b.push({referenceSize:B,subsegmentDuration:q,info:{duration:q/N,start:V,end:V+B-1}}),V+=B,G+=4,T=G}return{earliestPresentationTime:j,timescale:N,version:x,referencesCount:K,references:b,moovEndOffset:k}}function p(S){for(var y=[],i=h(S,["moov","trak"]),k=0;kv)&&(this.startTime=v),this.endTime=o,this.screen=a,this.timelineController.createCaptionsTrack(this.trackName)},l.reset=function(){this.cueRanges=[]},f}()},"./src/utils/texttrack-utils.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"sendAddTrackEvent",function(){return f}),_.d(u,"addCueToTrack",function(){return l}),_.d(u,"clearCurrentCues",function(){return C}),_.d(u,"removeCuesInRange",function(){return v}),_.d(u,"getCuesInRange",function(){return a});var D=_("./src/utils/logger.ts");function f(r,h){var m;try{m=new Event("addtrack")}catch(p){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=r,h.dispatchEvent(m)}function l(r,h){var m=r.mode;if(m==="disabled"&&(r.mode="hidden"),r.cues&&!r.cues.getCueById(h.id))try{if(r.addCue(h),!r.cues.getCueById(h.id))throw new Error("addCue is failed for: "+h)}catch(w){D.logger.debug("[texttrack-utils]: "+w);var p=new self.TextTrackCue(h.startTime,h.endTime,h.text);p.id=h.id,r.addCue(p)}m==="disabled"&&(r.mode=m)}function C(r){var h=r.mode;if(h==="disabled"&&(r.mode="hidden"),r.cues)for(var m=r.cues.length;m--;)r.removeCue(r.cues[m]);h==="disabled"&&(r.mode=h)}function v(r,h,m){var p=r.mode;if(p==="disabled"&&(r.mode="hidden"),r.cues&&r.cues.length>0)for(var w=a(r.cues,h,m),g=0;gr[m].endTime)return-1;for(var p=0,w=m;p<=w;){var g=Math.floor((w+p)/2);if(hr[g].startTime&&p-1)for(var g=w,c=r.length;g=h&&n.endTime<=m)p.push(n);else if(n.startTime>m)return p}return p}},"./src/utils/time-ranges.ts":function(M,u,_){"use strict";_.r(u);var D={toString:function(l){for(var C="",v=l.length,o=0;o1?h-1:0),p=1;p100)throw new Error("Position must be between 0 and 100.");b=j,this.hasBeenReset=!0}})),Object.defineProperty(p,"positionAlign",o({},w,{get:function(){return E},set:function(j){var L=v(j);if(!L)throw new SyntaxError("An invalid or illegal string was specified.");E=L,this.hasBeenReset=!0}})),Object.defineProperty(p,"size",o({},w,{get:function(){return x},set:function(j){if(j<0||j>100)throw new Error("Size must be between 0 and 100.");x=j,this.hasBeenReset=!0}})),Object.defineProperty(p,"align",o({},w,{get:function(){return T},set:function(j){var L=v(j);if(!L)throw new SyntaxError("An invalid or illegal string was specified.");T=L,this.hasBeenReset=!0}})),p.displayState=void 0}return a.prototype.getCueAsHTML=function(){var r=self.WebVTT;return r.convertCueToDOMTree(self,this.text)},a}()},"./src/utils/vttparser.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"parseTimeStamp",function(){return l}),_.d(u,"fixLineBreaks",function(){return h}),_.d(u,"VTTParser",function(){return m});var D=_("./src/utils/vttcue.ts"),f=function(){function p(){}var w=p.prototype;return w.decode=function(c,n){if(!c)return"";if(typeof c!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(c))},p}();function l(p){function w(c,n,s,d){return(c|0)*3600+(n|0)*60+(s|0)+parseFloat(d||0)}var g=p.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return g?parseFloat(g[2])>59?w(g[2],g[3],0,g[4]):w(g[1],g[2],g[3],g[4]):null}var C=function(){function p(){this.values=Object.create(null)}var w=p.prototype;return w.set=function(c,n){!this.get(c)&&n!==""&&(this.values[c]=n)},w.get=function(c,n,s){return s?this.has(c)?this.values[c]:n[s]:this.has(c)?this.values[c]:n},w.has=function(c){return c in this.values},w.alt=function(c,n,s){for(var d=0;d=0&&s<=100)return this.set(c,s),!0}return!1},p}();function v(p,w,g,c){var n=c?p.split(c):[p];for(var s in n){if(typeof n[s]!="string")continue;var d=n[s].split(g);if(d.length!==2)continue;var S=d[0],y=d[1];w(S,y)}}var o=new D.default(0,0,""),a=o.align==="middle"?"middle":"center";function r(p,w,g){var c=p;function n(){var S=l(p);if(S===null)throw new Error("Malformed timestamp: "+c);return p=p.replace(/^[^\sa-zA-Z-]+/,""),S}function s(S,y){var i=new C;v(S,function(b,E){var x;switch(b){case"region":for(var T=g.length-1;T>=0;T--)if(g[T].id===E){i.set(b,g[T].region);break}break;case"vertical":i.alt(b,E,["rl","lr"]);break;case"line":x=E.split(","),i.integer(b,x[0]),i.percent(b,x[0])&&i.set("snapToLines",!1),i.alt(b,x[0],["auto"]),x.length===2&&i.alt("lineAlign",x[1],["start",a,"end"]);break;case"position":x=E.split(","),i.percent(b,x[0]),x.length===2&&i.alt("positionAlign",x[1],["start",a,"end","line-left","line-right","auto"]);break;case"size":i.percent(b,E);break;case"align":i.alt(b,E,["start",a,"end","left","right"]);break}},/:/,/\s/),y.region=i.get("region",null),y.vertical=i.get("vertical","");var k=i.get("line","auto");k==="auto"&&o.line===-1&&(k=-1),y.line=k,y.lineAlign=i.get("lineAlign","start"),y.snapToLines=i.get("snapToLines",!0),y.size=i.get("size",100),y.align=i.get("align",a);var O=i.get("position","auto");O==="auto"&&o.position===50&&(O=y.align==="start"||y.align==="left"?0:y.align==="end"||y.align==="right"?100:50),y.position=O}function d(){p=p.replace(/^\s+/,"")}if(d(),w.startTime=n(),d(),p.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+c);p=p.substr(3),d(),w.endTime=n(),d(),s(p,w)}function h(p){return p.replace(//gi,` `)}var m=function(){function p(){this.state="INITIAL",this.buffer="",this.decoder=new f,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var w=p.prototype;return w.parse=function(c){var n=this;c&&(n.buffer+=n.decoder.decode(c,{stream:!0}));function s(){var O=n.buffer,b=0;for(O=h(O);b")===-1){n.cue.id=S;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{r(S,n.cue,n.regionList)}catch(O){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var k=S.indexOf("-->")!==-1;if(!S||k&&(i=!0)){n.oncue&&n.cue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}if(n.cue===null)continue;n.cue.text&&(n.cue.text+=` `),n.cue.text+=S}continue;case"BADCUE":S||(n.state="ID")}}}catch(O){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},w.flush=function(){var c=this;try{if((c.cue||c.state==="HEADER")&&(c.buffer+=` `,c.parse()),c.state==="INITIAL"||c.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(n){c.onparsingerror&&c.onparsingerror(n)}return c.onflush&&c.onflush(),this},p}()},"./src/utils/webvtt-parser.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"generateCueId",function(){return m}),_.d(u,"parseWebVTT",function(){return w});var D=_("./src/polyfills/number.ts"),f=_("./src/utils/vttparser.ts"),l=_("./src/demux/id3.ts"),C=_("./src/utils/timescale-conversion.ts"),v=_("./src/remux/mp4-remuxer.ts"),o=/\r\n|\n\r|\n|\r/g,a=function(c,n,s){return s===void 0&&(s=0),c.substr(s,n.length)===n},r=function(c){var n=parseInt(c.substr(-3)),s=parseInt(c.substr(-6,2)),d=parseInt(c.substr(-9,2)),S=c.length>9?parseInt(c.substr(0,c.indexOf(":"))):0;if(!Object(D.isFiniteNumber)(n)||!Object(D.isFiniteNumber)(s)||!Object(D.isFiniteNumber)(d)||!Object(D.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+c);return n+=1e3*s,n+=60*1e3*d,n+=60*60*1e3*S,n},h=function(c){for(var n=5381,s=c.length;s;)n=n*33^c.charCodeAt(--s);return(n>>>0).toString()};function m(g,c,n){return h(g.toString())+h(c.toString())+h(n)}var p=function(c,n,s){var d=c[n],S=c[d.prevCC];if(!S||!S.new&&d.new){c.ccOffset=c.presentationOffset=d.start,d.new=!1;return}for(;(y=S)!==null&&y!==void 0&&y.new;){var y;c.ccOffset+=d.start-S.start,d.new=!1,d=S,S=c[d.prevCC]}c.presentationOffset=s};function w(g,c,n,s,d,S,y,i){var k=new f.VTTParser,O=Object(l.utf8ArrayToStr)(new Uint8Array(g)).trim().replace(o,` `).split(` `),b=[],E=Object(C.toMpegTsClockFromTimescale)(c,n),x="00:00.000",T=0,N=0,j,L=!0,V=!1;k.oncue=function(K){var W=s[d],G=s.ccOffset,F=(T-E)/9e4;if(W!=null&&W.new&&(N!==void 0?G=s.ccOffset=W.start:p(s,d,F)),F&&(G=F-s.presentationOffset),V){var B=K.endTime-K.startTime,H=Object(v.normalizePts)((K.startTime+G-N)*9e4,S*9e4)/9e4;K.startTime=H,K.endTime=H+B}var q=K.text.trim();K.text=decodeURIComponent(encodeURIComponent(q)),K.id||(K.id=m(K.startTime,K.endTime,q)),K.endTime>0&&b.push(K)},k.onparsingerror=function(K){j=K},k.onflush=function(){if(j){i(j);return}y(b)},O.forEach(function(K){if(L)if(a(K,"X-TIMESTAMP-MAP=")){L=!1,V=!0,K.substr(16).split(",").forEach(function(W){a(W,"LOCAL:")?x=W.substr(6):a(W,"MPEGTS:")&&(T=parseInt(W.substr(7)))});try{N=r(x)/1e3}catch(W){V=!1,j=W}return}else K===""&&(L=!1);k.parse(K+` `)}),k.flush()}},"./src/utils/xhr-loader.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/utils/logger.ts"),f=_("./src/loader/load-stats.ts"),l=/^age:\s*[\d.]+\s*$/m,C=function(){function v(a){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=a?a.xhrSetup:null,this.stats=new f.LoadStats,this.retryDelay=0}var o=v.prototype;return o.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},o.abortInternal=function(){var r=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),r&&(r.onreadystatechange=null,r.onprogress=null,r.readyState!==4&&(this.stats.aborted=!0,r.abort()))},o.abort=function(){var r;this.abortInternal(),(r=this.callbacks)!==null&&r!==void 0&&r.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},o.load=function(r,h,m){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=r,this.config=h,this.callbacks=m,this.retryDelay=h.retryDelay,this.loadInternal()},o.loadInternal=function(){var r=this.config,h=this.context;if(!r)return;var m=this.loader=new self.XMLHttpRequest,p=this.stats;p.loading.first=0,p.loaded=0;var w=this.xhrSetup;try{if(w)try{w(m,h.url)}catch(n){m.open("GET",h.url,!0),w(m,h.url)}m.readyState||m.open("GET",h.url,!0);var g=this.context.headers;if(g)for(var c in g)m.setRequestHeader(c,g[c])}catch(n){this.callbacks.onError({code:m.status,text:n.message},h,m);return}h.rangeEnd&&m.setRequestHeader("Range","bytes="+h.rangeStart+"-"+(h.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=h.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),m.send()},o.readystatechange=function(){var r=this.context,h=this.loader,m=this.stats;if(!r||!h)return;var p=h.readyState,w=this.config;if(m.aborted)return;if(p>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),p===4){h.onreadystatechange=null,h.onprogress=null;var g=h.status;if(g>=200&&g<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var c,n;if(r.responseType==="arraybuffer"?(c=h.response,n=c.byteLength):(c=h.responseText,n=c.length),m.loaded=m.total=n,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(m,r,c,h),!this.callbacks)return;var d={url:h.responseURL,data:c};this.callbacks.onSuccess(d,m,r,h)}else m.retry>=w.maxRetry||g>=400&&g<499?(D.logger.error(g+" while loading "+r.url),this.callbacks.onError({code:g,text:h.statusText},r,h)):(D.logger.warn(g+" while loading "+r.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,w.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),w.timeout)},o.loadtimeout=function(){D.logger.warn("timeout while loading "+this.context.url);var r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))},o.loadprogress=function(r){var h=this.stats;h.loaded=r.loaded,r.lengthComputable&&(h.total=r.total)},o.getCacheAge=function(){var r=null;if(this.loader&&l.test(this.loader.getAllResponseHeaders())){var h=this.loader.getResponseHeader("age");r=h?parseFloat(h):null}return r},v}();u.default=C}}).default})},vHTk:function(I,J,P){I.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},w7YG:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("ETIr"),P("cv67"),P("K3mO"),P("OLod"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.StreamCipher,f=u.algo,l=f.RC4=D.extend({_doReset:function(){for(var o=this._key,a=o.words,r=o.sigBytes,h=this._S=[],m=0;m<256;m++)h[m]=m;for(var m=0,p=0;m<256;m++){var w=m%r,g=a[w>>>2]>>>24-w%4*8&255;p=(p+h[m]+g)%256;var c=h[m];h[m]=h[p],h[p]=c}this._i=this._j=0},_doProcessBlock:function(o,a){o[a]^=C.call(this)},keySize:256/32,ivSize:0});function C(){for(var o=this._S,a=this._i,r=this._j,h=0,m=0;m<4;m++){a=(a+1)%256,r=(r+o[a])%256;var p=o[a];o[a]=o[r],o[r]=p,h|=o[(o[a]+o[r])%256]<<24-m*8}return this._i=a,this._j=r,h}u.RC4=D._createHelper(l);var v=f.RC4Drop=l.extend({cfg:l.cfg.extend({drop:192}),_doReset:function(){l._doReset.call(this);for(var o=this.cfg.drop;o>0;o--)C.call(this)}});u.RC4Drop=D._createHelper(v)}(),M.RC4})},wCXF:function(I,J,P){"use strict";P.d(J,"a",function(){return et});var M=P("rePB"),u=P("VTBJ"),_=P("KQm4"),D=P("U8pU"),f=P("ODXe"),l=P("q1tI"),C=P("TSYQ"),v=P.n(C),o=P("Gytx"),a=P.n(o),r=P("Kwbf"),h=P("t23M"),m=P("qx4F"),p=P("6eGT"),w=P("IBYe"),g=P("Ff2n"),c=P("c+Xe"),n=P("fyJ8"),s=P("biw7");function d(je,De,rt,lt,Je){var tt=rt[je]||{},Ue=rt[De]||{},ke,Ie;tt.fixed==="left"?ke=lt.left[je]:Ue.fixed==="right"&&(Ie=lt.right[De]);var ye=!1,Te=!1,Ae=!1,Pe=!1,$e=rt[De+1],Ke=rt[je-1];if(Je==="rtl"){if(ke!==void 0){var ct=Ke&&Ke.fixed==="left";Pe=!ct}else if(Ie!==void 0){var gt=$e&&$e.fixed==="right";Ae=!gt}}else if(ke!==void 0){var wt=$e&&$e.fixed==="left";ye=!wt}else if(Ie!==void 0){var vt=Ke&&Ke.fixed==="right";Te=!vt}return{fixLeft:ke,fixRight:Ie,lastFixLeft:ye,firstFixRight:Te,lastFixRight:Ae,firstFixLeft:Pe,isSticky:lt.isSticky}}var S=P("sR1s");function y(je){var De=je.cells,rt=je.stickyOffsets,lt=je.flattenColumns,Je=je.rowComponent,tt=je.cellComponent,Ue=je.onHeaderRow,ke=je.index,Ie=l.useContext(s.a),ye=Ie.prefixCls,Te=Ie.direction,Ae;Ue&&(Ae=Ue(De.map(function($e){return $e.column}),ke));var Pe=Object(S.a)(De.map(function($e){return $e.column}));return l.createElement(Je,Object.assign({},Ae),De.map(function($e,Ke){var ct=$e.column,gt=d($e.colStart,$e.colEnd,lt,rt,Te),wt;return ct&&ct.onHeaderCell&&(wt=$e.column.onHeaderCell(ct)),l.createElement(n.a,Object.assign({},$e,{ellipsis:ct.ellipsis,align:ct.align,component:tt,prefixCls:ye,key:Pe[Ke]},gt,{additionalProps:wt,rowType:"header"}))}))}y.displayName="HeaderRow";var i=y;function k(je){var De=[];function rt(Ue,ke){var Ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;De[Ie]=De[Ie]||[];var ye=ke,Te=Ue.filter(Boolean).map(function(Ae){var Pe={key:Ae.key,className:Ae.className||"",children:Ae.title,column:Ae,colStart:ye},$e=1,Ke=Ae.children;return Ke&&Ke.length>0&&($e=rt(Ke,ye,Ie+1).reduce(function(ct,gt){return ct+gt},0),Pe.hasSubColumns=!0),"colSpan"in Ae&&($e=Ae.colSpan),"rowSpan"in Ae&&(Pe.rowSpan=Ae.rowSpan),Pe.colSpan=$e,Pe.colEnd=Pe.colStart+$e-1,De[Ie].push(Pe),ye+=$e,$e});return Te}rt(je,0);for(var lt=De.length,Je=function(ke){De[ke].forEach(function(Ie){!("rowSpan"in Ie)&&!Ie.hasSubColumns&&(Ie.rowSpan=lt-ke)})},tt=0;tt=0;ke-=1){var Ie=De[ke],ye=rt&&rt[ke],Te=ye&&ye[E.a];(Ie||Te||Ue)&&(Je.unshift(l.createElement("col",Object.assign({key:ke,style:{width:Ie,minWidth:Ie}},Te))),Ue=!0)}return l.createElement("colgroup",null,Je)}var T=x;function N(je,De){return Object(l.useMemo)(function(){for(var rt=[],lt=0;lt1?ne-1:0),ie=1;ie=Ae&&(Hr=Ae-Pe),Ue({scrollLeft:Hr/Ae*(Te+2)}),vt.current.x=Ct.pageX},Wt=function(){var Ct=Object(Z.b)(tt.current).top,lr=Ct+tt.current.offsetHeight,Fr=document.documentElement.scrollTop+window.innerHeight;lr-Object(m.a)()<=Fr||Ct>=Fr-ke?wt(function($r){return Object(u.a)(Object(u.a)({},$r),{},{isHiddenScrollBar:!0})}):wt(function($r){return Object(u.a)(Object(u.a)({},$r),{},{isHiddenScrollBar:!1})})},Lr=function(Ct){wt(function(lr){return Object(u.a)(Object(u.a)({},lr),{},{scrollLeft:Ct/Te*Ae||0})})};return l.useImperativeHandle(rt,function(){return{setScrollLeft:Lr}}),l.useEffect(function(){var Cr=Object(Y.a)(document.body,"mouseup",sr,!1),Ct=Object(Y.a)(document.body,"mousemove",cr,!1);return Wt(),function(){Cr.remove(),Ct.remove()}},[Pe,_t]),l.useEffect(function(){var Cr=Object(Y.a)(window,"scroll",Wt,!1),Ct=Object(Y.a)(window,"resize",Wt,!1);return function(){Cr.remove(),Ct.remove()}},[]),l.useEffect(function(){gt.isHiddenScrollBar||wt(function(Cr){var Ct,lr;return Object(u.a)(Object(u.a)({},Cr),{},{scrollLeft:tt.current.scrollLeft/((Ct=tt.current)===null||Ct===void 0?void 0:Ct.scrollWidth)*((lr=tt.current)===null||lr===void 0?void 0:lr.clientWidth)})})},[gt.isHiddenScrollBar]),Te<=Ae||!Pe||gt.isHiddenScrollBar?null:l.createElement("div",{style:{height:Object(m.a)(),width:Ae,bottom:ke},className:"".concat(ye,"-sticky-scroll")},l.createElement("div",{onMouseDown:$t,ref:$e,className:v()("".concat(ye,"-sticky-scroll-bar"),Object(M.a)({},"".concat(ye,"-sticky-scroll-bar-active"),_t)),style:{width:"".concat(Pe,"px"),transform:"translate3d(".concat(gt.scrollLeft,"px, 0, 0)")}}))},ge=l.forwardRef(be);function Re(je,De){return l.useMemo(function(){var rt=!!je;return{isSticky:rt,stickyClassName:rt?"".concat(De,"-sticky-header"):"",offsetHeader:Object(D.a)(je)==="object"&&je.offsetHeader||0,offsetScroll:Object(D.a)(je)==="object"&&je.offsetScroll||0}},[je,De])}var Ze=[],qe={},et="rc-table-internal-hook",nt=l.memo(function(je){var De=je.children;return De},function(je,De){return a()(je.props,De.props)?je.pingLeft!==De.pingLeft||je.pingRight!==De.pingRight:!1});function ut(je){var De,rt=je.prefixCls,lt=je.className,Je=je.rowClassName,tt=je.style,Ue=je.data,ke=je.rowKey,Ie=je.scroll,ye=je.tableLayout,Te=je.direction,Ae=je.title,Pe=je.footer,$e=je.summary,Ke=je.id,ct=je.showHeader,gt=je.components,wt=je.emptyText,vt=je.onRow,It=je.onHeaderRow,Lt=je.internalHooks,_t=je.transformColumns,rr=je.internalRefs,sr=je.sticky,$t=Ue||Ze,cr=!!$t.length,Wt=l.useState(0),Lr=Object(f.a)(Wt,2),Cr=Lr[0],Ct=Lr[1];l.useEffect(function(){Ct(Object(m.a)())});var lr=l.useMemo(function(){return Object(S.c)(gt,{})},[gt]),Fr=l.useCallback(function(Pr,Dr){return Object(S.b)(lr,Pr)||Dr},[lr]),$r=l.useMemo(function(){return typeof ke=="function"?ke:function(Pr){var Dr=Pr&&Pr[ke];return Dr}},[ke]),Hr=Object(E.c)(je),oi=Hr.expandIcon,Tt=Hr.expandedRowKeys,Rt=Hr.defaultExpandedRowKeys,Et=Hr.defaultExpandAllRows,Ar=Hr.expandedRowRender,Br=Hr.onExpand,Xt=Hr.onExpandedRowsChange,Nt=Hr.expandRowByClick,jr=Hr.rowExpandable,bn=Hr.expandIconColumnIndex,zr=Hr.expandedRowClassName,mt=Hr.childrenColumnName,Ut=Hr.indentSize,an=oi||le,xn=mt||"children",On=l.useMemo(function(){return Ar?"row":je.expandable&&Lt===et&&je.expandable.__PARENT_RENDER_ICON__||$t.some(function(Pr){return Pr&&Object(D.a)(Pr)==="object"&&Pr[xn]})?"nest":!1},[!!Ar,$t]),An=l.useState(function(){return Rt||(Et?Q($t,$r,xn):[])}),se=Object(f.a)(An,2),z=se[0],X=se[1],ne=l.useMemo(function(){return new Set(Tt||z||[])},[Tt,z]),de=l.useCallback(function(Pr){var Dr=$r(Pr,$t.indexOf(Pr)),Er,ui=ne.has(Dr);ui?(ne.delete(Dr),Er=Object(_.a)(ne)):Er=[].concat(Object(_.a)(ne),[Dr]),X(Er),Br&&Br(!ui,Pr),Xt&&Xt(Er)},[$r,ne,$t,Br,Xt]),ie=l.useState(0),ze=Object(f.a)(ie,2),ht=ze[0],St=ze[1],Pt=Object(pe.b)(Object(u.a)(Object(u.a)(Object(u.a)({},je),Hr),{},{expandable:!!Ar,expandedKeys:ne,getRowKey:$r,onTriggerExpand:de,expandIcon:an,expandIconColumnIndex:bn,direction:Te}),Lt===et?_t:null),pt=Object(f.a)(Pt,2),Ht=pt[0],zt=pt[1],Mr=l.useMemo(function(){return{columns:Ht,flattenColumns:zt}},[Ht,zt]),on=l.useRef(),Zr=l.useRef(),Qt=l.useRef(),Kr=l.useState(!1),or=Object(f.a)(Kr,2),Yt=or[0],nr=or[1],dr=l.useState(!1),Jr=Object(f.a)(dr,2),un=Jr[0],En=Jr[1],wi=he(new Map),Vi=Object(f.a)(wi,2),Fi=Vi[0],Qn=Vi[1],rn=Object(S.a)(zt),Ri=rn.map(function(Pr){return Fi.get(Pr)}),sn=l.useMemo(function(){return Ri},[Ri.join("_")]),hi=Se(sn,zt.length,Te),Gr=Ie&&Object(S.d)(Ie.y),ir=Ie&&Object(S.d)(Ie.x),qr=ir&&zt.some(function(Pr){var Dr=Pr.fixed;return Dr}),Tr=l.useRef(),dn=Re(sr,rt),_r=dn.isSticky,fi=dn.offsetHeader,hn=dn.offsetScroll,Hn=dn.stickyClassName,Di,yi,Zn;Gr&&(yi={overflowY:"scroll",maxHeight:Ie.y}),ir&&(Di={overflowX:"auto"},Gr||(yi={overflowY:"hidden"}),Zn={width:Ie.x===!0?"auto":Ie.x,minWidth:"100%"});var Si=l.useCallback(function(Pr,Dr){Qn(function(Er){var ui=new Map(Er);return ui.set(Pr,Dr),ui})},[]),jn=ce(null),Ni=Object(f.a)(jn,2),si=Ni[0],pi=Ni[1];function Bi(Pr,Dr){if(!Dr)return;typeof Dr=="function"?Dr(Pr):Dr.scrollLeft!==Pr&&(Dr.scrollLeft=Pr)}var li=function(Dr){var Er=Dr.currentTarget,ui=Dr.scrollLeft,Xi=typeof ui=="number"?ui:Er.scrollLeft,Yi=Er||qe;if(!pi()||pi()===Yi){var er;si(Yi),Bi(Xi,Zr.current),Bi(Xi,Qt.current),Bi(Xi,(er=Tr.current)===null||er===void 0?void 0:er.setScrollLeft)}if(Er){var Mt=Er.scrollWidth,ur=Er.clientWidth;nr(Xi>0),En(Xi0?[].concat(Object(u.a)(g),Object(u.a)(r(d).map(function(S){return Object(_.a)({fixed:s},S)}))):[].concat(Object(u.a)(g),[Object(_.a)(Object(_.a)({},c),{},{fixed:s})])},[])}function h(w){for(var g=!0,c=0;c=0;d-=1){var S=w[d];if(s&&S.fixed!=="right")s=!1;else if(!s&&S.fixed==="right"){Object(C.a)(!1,"Index ".concat(d+1," of `columns` missing `fixed='right'` prop."));break}}}function m(w){return w.map(function(g){var c=g.fixed,n=Object(D.a)(g,["fixed"]),s=c;return c==="left"?s="right":c==="right"&&(s="left"),Object(_.a)({fixed:s},n)})}function p(w,g){var c=w.prefixCls,n=w.columns,s=w.children,d=w.expandable,S=w.expandedKeys,y=w.getRowKey,i=w.onTriggerExpand,k=w.expandIcon,O=w.rowExpandable,b=w.expandIconColumnIndex,E=w.direction,x=w.expandRowByClick,T=f.useMemo(function(){return n||a(s)},[n,s]),N=f.useMemo(function(){if(d){var V,K=b||0,W=T[K],G=(V={},Object(M.a)(V,o.a,{className:"".concat(c,"-expand-icon-col")}),Object(M.a)(V,"title",""),Object(M.a)(V,"fixed",W?W.fixed:null),Object(M.a)(V,"className","".concat(c,"-row-expand-icon-cell")),Object(M.a)(V,"render",function(H,q,re){var ee=y(q,re),Ce=S.has(ee),Ee=O?O(q):!0,pe=k({prefixCls:c,expanded:Ce,expandable:Ee,record:q,onExpand:i});return x?f.createElement("span",{onClick:function(_e){return _e.stopPropagation()}},pe):pe}),V),F=T.slice();return K>=0&&F.splice(K,0,G),F}return T},[d,T,y,S,k,E]),j=f.useMemo(function(){var V=N;return g&&(V=g(V)),V.length||(V=[{render:function(){return null}}]),V},[g,N,E]),L=f.useMemo(function(){return E==="rtl"?m(r(j)):r(j)},[j,E]);return[j,L]}J.b=p},wZgz:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("ETIr"),P("cv67"),P("K3mO"),P("OLod"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.BlockCipher,f=u.algo,l=[],C=[],v=[],o=[],a=[],r=[],h=[],m=[],p=[],w=[];(function(){for(var n=[],s=0;s<256;s++)s<128?n[s]=s<<1:n[s]=s<<1^283;for(var d=0,S=0,s=0;s<256;s++){var y=S^S<<1^S<<2^S<<3^S<<4;y=y>>>8^y&255^99,l[d]=y,C[y]=d;var i=n[d],k=n[i],O=n[k],b=n[y]*257^y*16843008;v[d]=b<<24|b>>>8,o[d]=b<<16|b>>>16,a[d]=b<<8|b>>>24,r[d]=b;var b=O*16843009^k*65537^i*257^d*16843008;h[y]=b<<24|b>>>8,m[y]=b<<16|b>>>16,p[y]=b<<8|b>>>24,w[y]=b,d?(d=i^n[n[n[O^i]]],S^=n[n[S]]):d=S=1}})();var g=[0,1,2,4,8,16,32,64,128,27,54],c=f.AES=D.extend({_doReset:function(){var n;if(this._nRounds&&this._keyPriorReset===this._key)return;for(var s=this._keyPriorReset=this._key,d=s.words,S=s.sigBytes/4,y=this._nRounds=S+6,i=(y+1)*4,k=this._keySchedule=[],O=0;O6&&O%S==4&&(n=l[n>>>24]<<24|l[n>>>16&255]<<16|l[n>>>8&255]<<8|l[n&255]):(n=n<<8|n>>>24,n=l[n>>>24]<<24|l[n>>>16&255]<<16|l[n>>>8&255]<<8|l[n&255],n^=g[O/S|0]<<24),k[O]=k[O-S]^n);for(var b=this._invKeySchedule=[],E=0;E>>24]]^m[l[n>>>16&255]]^p[l[n>>>8&255]]^w[l[n&255]]}},encryptBlock:function(n,s){this._doCryptBlock(n,s,this._keySchedule,v,o,a,r,l)},decryptBlock:function(n,s){var d=n[s+1];n[s+1]=n[s+3],n[s+3]=d,this._doCryptBlock(n,s,this._invKeySchedule,h,m,p,w,C);var d=n[s+1];n[s+1]=n[s+3],n[s+3]=d},_doCryptBlock:function(n,s,d,S,y,i,k,O){for(var b=this._nRounds,E=n[s]^d[0],x=n[s+1]^d[1],T=n[s+2]^d[2],N=n[s+3]^d[3],j=4,L=1;L>>24]^y[x>>>16&255]^i[T>>>8&255]^k[N&255]^d[j++],K=S[x>>>24]^y[T>>>16&255]^i[N>>>8&255]^k[E&255]^d[j++],W=S[T>>>24]^y[N>>>16&255]^i[E>>>8&255]^k[x&255]^d[j++],G=S[N>>>24]^y[E>>>16&255]^i[x>>>8&255]^k[T&255]^d[j++];E=V,x=K,T=W,N=G}var V=(O[E>>>24]<<24|O[x>>>16&255]<<16|O[T>>>8&255]<<8|O[N&255])^d[j++],K=(O[x>>>24]<<24|O[T>>>16&255]<<16|O[N>>>8&255]<<8|O[E&255])^d[j++],W=(O[T>>>24]<<24|O[N>>>16&255]<<16|O[E>>>8&255]<<8|O[x&255])^d[j++],G=(O[N>>>24]<<24|O[E>>>16&255]<<16|O[x>>>8&255]<<8|O[T&255])^d[j++];n[s]=V,n[s+1]=K,n[s+2]=W,n[s+3]=G},keySize:256/32});u.AES=D._createHelper(c)}(),M.AES})},wbyO:function(I,J,P){(function(M,u){I.exports=J=u(P("Ib8C"))})(this,function(M){return function(){var u=M,_=u.lib,D=_.WordArray,f=u.enc,l=f.Base64url={stringify:function(v,o=!0){var a=v.words,r=v.sigBytes,h=o?this._safe_map:this._map;v.clamp();for(var m=[],p=0;p>>2]>>>24-p%4*8&255,g=a[p+1>>>2]>>>24-(p+1)%4*8&255,c=a[p+2>>>2]>>>24-(p+2)%4*8&255,n=w<<16|g<<8|c,s=0;s<4&&p+s*.75>>6*(3-s)&63));var d=h.charAt(64);if(d)for(;m.length%4;)m.push(d);return m.join("")},parse:function(v,o=!0){var a=v.length,r=o?this._safe_map:this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var m=0;m>>6-m%4*2,g=p|w;r[h>>>2]|=g<<24-h%4*8,h++}return D.create(r,h)}}(),M.enc.Base64url})},"y0+3":function(I,J,P){"use strict";P.d(J,"a",function(){return r}),P.d(J,"b",function(){return m});var M=/margin|padding|width|height|max|min|offset/,u={left:!0,top:!0},_={cssFloat:1,styleFloat:1,float:1};function D(p){return p.nodeType===1?p.ownerDocument.defaultView.getComputedStyle(p,null):{}}function f(p,w,g){if(w=w.toLowerCase(),g==="auto"){if(w==="height")return p.offsetHeight;if(w==="width")return p.offsetWidth}return w in u||(u[w]=M.test(w)),u[w]?parseFloat(g)||0:g}function l(p,w){var g=arguments.length,c=D(p);return w=_[w]?"cssFloat"in p.style?"cssFloat":"styleFloat":w,g===1?c:f(p,w,c[w]||p.style[w])}function C(p,w,g){var c=arguments.length;if(w=_[w]?"cssFloat"in p.style?"cssFloat":"styleFloat":w,c===3)return typeof g=="number"&&M.test(w)&&(g="".concat(g,"px")),p.style[w]=g,g;for(var n in w)w.hasOwnProperty(n)&&C(p,n,w[n]);return D(p)}function v(p){return p===document.body?document.documentElement.clientWidth:p.offsetWidth}function o(p){return p===document.body?window.innerHeight||document.documentElement.clientHeight:p.offsetHeight}function a(){var p=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),w=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:p,height:w}}function r(){var p=document.documentElement.clientWidth,w=window.innerHeight||document.documentElement.clientHeight;return{width:p,height:w}}function h(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function m(p){var w=p.getBoundingClientRect(),g=document.documentElement;return{left:w.left+(window.pageXOffset||g.scrollLeft)-(g.clientLeft||document.body.clientLeft||0),top:w.top+(window.pageYOffset||g.scrollTop)-(g.clientTop||document.body.clientTop||0)}}},ynwM:function(I,J,P){var M=P("MFOe"),u=M.Global;I.exports={name:"oldFF-globalStorage",read:D,write:f,each:l,remove:C,clearAll:v};var _=u.globalStorage;function D(o){return _[o]}function f(o,a){_[o]=a}function l(o){for(var a=_.length-1;a>=0;a--){var r=_.key(a);o(_[r],r)}}function C(o){return _.removeItem(o)}function v(){l(function(o,a){delete _[o]})}}}]);