|
|
(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&&/<!\[CDATA\[/.test(N))return 0;var V=N&&/^<(\/)?([\w_:\.-]*)/.exec(N);if(V&&V[1])for(;L;)if(L.tagName==V[2]){L=L.prev;break}else if(C.implicitlyClosed.hasOwnProperty(L.tagName))L=L.prev;else break;else if(V)for(;L;){var K=C.contextGrabbers[L.tagName];if(K&&K.hasOwnProperty(V[2]))L=L.prev;else break}for(;L&&L.prev&&!L.startOfLine;)L=L.prev;return L?L.indent+l:T.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",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<et>>>0?1:0),Y=Y+De,Z=Z+je+(Y>>>0<De>>>0?1:0),Y=Y+ke,Z=Z+Ue+(Y>>>0<ke>>>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<le>>>0?1:0),It=It+ye,Lt=Lt+Ie+(It>>>0<ye>>>0?1:0),It=It+vt,Lt=Lt+wt+(It>>>0<vt>>>0?1:0),It=It+Y,Lt=Lt+Z+(It>>>0<Y>>>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<It>>>0?1:0)|0}O=g.low=O+re,g.high=k+q+(O>>>0<re>>>0?1:0),E=c.low=E+Ce,c.high=b+ee+(E>>>0<Ce>>>0?1:0),T=n.low=T+pe,n.high=x+Ee+(T>>>0<pe>>>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<ce>>>0?1:0),W=S.low=W+Se,S.high=K+oe+(W>>>0<Se>>>0?1:0),F=y.low=F+ue,y.high=G+te+(F>>>0<ue>>>0?1:0),H=i.low=H+le,i.high=B+Oe+(H>>>0<le>>>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<<k)-1;O<32?i^=1<<O:y^=1<<O-32}d&128?d=d<<1^113:d<<=1}h[S]=v.create(y,i)}})();var m=[];(function(){for(var w=0;w<25;w++)m[w]=v.create()})();var p=o.SHA3=l.extend({cfg:l.cfg.extend({outputLength:512}),_doReset:function(){for(var w=this._state=[],g=0;g<25;g++)w[g]=new v.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(w,g){for(var c=this._state,n=this.blockSize/2,s=0;s<n;s++){var d=w[g+2*s],S=w[g+2*s+1];d=(d<<8|d>>>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<<G|W>>>32-G,b=W<<G|K>>>32-G):(O=W<<G-32|K>>>64-G,b=K<<G-32|W>>>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<y;k++){var O=d[k],b=O.high,E=O.low;b=(b<<8|b>>>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<x;N++)T[N]=arguments[N];return E=O.call.apply(O,[this].concat(T)),E.state={goInputText:""},E.buildOptionText=function(j){return"".concat(j," ").concat(E.props.locale.items_per_page)},E.changeSize=function(j){E.props.changeSize(Number(j))},E.handleChange=function(j){E.setState({goInputText:j.target.value})},E.handleBlur=function(j){var L=E.props,V=L.goButton,K=L.quickGo,W=L.rootPrefixCls,G=E.state.goInputText;if(V||G==="")return;if(j.relatedTarget&&(j.relatedTarget.className.indexOf("".concat(W,"-prev"))>=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.current<S(void 0,x.state,x.props)},x.runIfEnter=function(V,K){if(V.key==="Enter"||V.charCode===13){for(var W=arguments.length,G=new Array(W>2?W-2:0),F=2;F<W;F++)G[F-2]=arguments[F];K.apply(void 0,G)}},x.runIfEnterPrev=function(V){x.runIfEnter(V,x.prev)},x.runIfEnterNext=function(V){x.runIfEnter(V,x.next)},x.runIfEnterJumpPrev=function(V){x.runIfEnter(V,x.jumpPrev)},x.runIfEnterJumpNext=function(V){x.runIfEnter(V,x.jumpNext)},x.handleGoTO=function(V){(V.keyCode===p.ENTER||V.type==="click")&&x.handleChange(x.state.currentInputValue)};var T=E.onChange!==n,N="current"in E;N&&!T&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var j=E.defaultCurrent;"current"in E&&(j=E.current);var L=E.defaultPageSize;return"pageSize"in E&&(L=E.pageSize),j=Math.min(j,S(L,void 0,E)),x.state={current:j,currentInputValue:j,pageSize:L},x}return Object(f.a)(b,[{key:"componentDidUpdate",value:function(x,T){var N=this.props.prefixCls;if(T.current!==this.state.current&&this.paginationNode){var j=this.paginationNode.querySelector(".".concat(N,"-item-").concat(T.current));j&&document.activeElement===j&&j.blur()}}},{key:"getValidValue",value:function(x){var T=x.target.value,N=S(void 0,this.state,this.props),j=this.state.currentInputValue,L;return T===""?L=T:isNaN(Number(T))?L=j:T>=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<ue?oe+1:ue,et=Object.keys(this.props).reduce(function(ye,Te){return(Te.substr(0,5)==="data-"||Te.substr(0,5)==="aria-"||Te==="role")&&(ye[Te]=x.props[Te]),ye},{});if(re)return ge&&(typeof ge=="boolean"?be=o.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},G.jump_to_confirm):be=o.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ge),be=o.a.createElement("li",{title:H?"".concat(G.jump_to).concat(oe,"/").concat(ue):null,className:"".concat(N,"-simple-pager")},be)),o.a.createElement("ul",Object(M.a)({className:r()(N,"".concat(N,"-simple"),Object(u.a)({},"".concat(N,"-disabled"),V),j),style:L,ref:this.savePaginationNode},et),o.a.createElement("li",{title:H?G.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:r()("".concat(N,"-prev"),Object(u.a)({},"".concat(N,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Ze)),o.a.createElement("li",{title:H?"".concat(oe,"/").concat(ue):null,className:"".concat(N,"-simple-pager")},o.a.createElement("input",{type:"text",value:te,disabled:V,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),o.a.createElement("span",{className:"".concat(N,"-slash")},"/"),ue),o.a.createElement("li",{title:H?G.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:r()("".concat(N,"-next"),Object(u.a)({},"".concat(N,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(qe)),be);if(ue<=3+Re*2){var nt={locale:G,rootPrefixCls:N,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:H,itemRender:ee};ue||Oe.push(o.a.createElement(m,Object(M.a)({},nt,{key:"noPager",page:ue,className:"".concat(N,"-disabled")})));for(var ut=1;ut<=ue;ut+=1){var ot=oe===ut;Oe.push(o.a.createElement(m,Object(M.a)({},nt,{key:ut,page:ut,active:ot})))}}else{var je=B?G.prev_3:G.prev_5,De=B?G.next_3:G.next_5;Ce&&(le=o.a.createElement("li",{title:H?je:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:r()("".concat(N,"-jump-prev"),Object(u.a)({},"".concat(N,"-jump-prev-custom-icon"),!!Ee))},ee(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Ee,"prev page"))),Q=o.a.createElement("li",{title:H?De:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:r()("".concat(N,"-jump-next"),Object(u.a)({},"".concat(N,"-jump-next-custom-icon"),!!pe))},ee(this.getJumpNextPage(),"jump-next",this.getItemIcon(pe,"next page")))),Z=o.a.createElement(m,{locale:G,last:!0,rootPrefixCls:N,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ue,page:ue,active:!1,showTitle:H,itemRender:ee}),Y=o.a.createElement(m,{locale:G,rootPrefixCls:N,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:H,itemRender:ee});var rt=Math.max(1,oe-Re),lt=Math.min(oe+Re,ue);oe-1<=Re&&(lt=1+Re*2),ue-oe<=Re&&(rt=ue-Re*2);for(var Je=rt;Je<=lt;Je+=1){var tt=oe===Je;Oe.push(o.a.createElement(m,{locale:G,rootPrefixCls:N,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Je,page:Je,active:tt,showTitle:H,itemRender:ee}))}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<M.modeInfo.length;u++){var _=M.modeInfo[u];_.mimes&&(_.mime=_.mimes[0])}M.findModeByMIME=function(D){D=D.toLowerCase();for(var f=0;f<M.modeInfo.length;f++){var l=M.modeInfo[f];if(l.mime==D)return l;if(l.mimes){for(var C=0;C<l.mimes.length;C++)if(l.mimes[C]==D)return l}}if(/\+xml$/.test(D))return M.findModeByMIME("application/xml");if(/\+json$/.test(D))return M.findModeByMIME("application/json")},M.findModeByExtension=function(D){D=D.toLowerCase();for(var f=0;f<M.modeInfo.length;f++){var l=M.modeInfo[f];if(l.ext){for(var C=0;C<l.ext.length;C++)if(l.ext[C]==D)return l}}},M.findModeByFileName=function(D){for(var f=0;f<M.modeInfo.length;f++){var l=M.modeInfo[f];if(l.file&&l.file.test(D))return l}var C=D.lastIndexOf("."),v=C>-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<M.modeInfo.length;f++){var l=M.modeInfo[f];if(l.name.toLowerCase()==D)return l;if(l.alias){for(var C=0;C<l.alias.length;C++)if(l.alias[C].toLowerCase()==D)return l}}}})},"8hTe":function(I,J,P){I.exports={button:"button___1wy9m"}},"9Bee":function(I,J,P){"use strict";var M=P("DYRE"),u=P("zeV3"),_=P("+L6B"),D=P("2/Rp"),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("vg9a"),m=P("DlQD"),p=P.n(m),w=P("rUJ1");function g(se,z){var X=se.match(/^(\s+)(?:```)/);if(X===null)return z;var ne=X[1];return z.split(`
|
|
|
`).map(function(de){var ie=de.match(/^\s+/);if(ie===null)return de;var ze=Object(C.a)(ie,1),ht=ze[0];return ht.length>=ne.length?de.slice(ne.length):de}).join(`
|
|
|
`)}var c=[],n=["<ul>"],s=new p.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function S(){c.length=0,n=["<ul>"]}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("<li><a href='#"+de.anchor+"'>"+de.text+"</a>"),z++;var ie=[];return z=i(se,z,de.level,ie),ie.length>0&&(ne.push("<ul>"),ie.forEach(function(ze){ne.push(ze)}),ne.push("</ul>")),ne.push("</li>"),z=i(se,z,X,ne),z}function k(){return i(c,0,0,n),n.push("</ul>"),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?"<p class='editormd-tex'>".concat(se,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(z,'">').concat(X?se:Object(w.escape)(se,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(X?se:Object(w.escape)(se,!0))+"</code></pre>"},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}),"<h"+z+' id="'+ne+'">'+se+"</h"+z+">"},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]<de[3])){ze.label=pt[1];break}if(pt[0]===6&&ze.label<de[1]){ze.label=de[1],de=pt;break}if(de&&ze.label<de[2]){ze.label=de[2],ze.ops.push(pt);break}de[2]&&ze.ops.pop(),ze.trys.pop();continue}pt=z.call(se,ze)}catch(Ht){pt=[6,Ht],ne=0}finally{X=de=0}if(5&pt[0])throw pt[1];return{value:pt[0]?pt[1]:void 0,done:!0}}([St,Pt])}}}function he(){for(var se=0,z=0,X=arguments.length;z<X;z++)se+=arguments[z].length;var ne=Array(se),de=0;for(z=0;z<X;z++)for(var ie=arguments[z],ze=0,ht=ie.length;ze<ht;ze++,de++)ne[de]=ie[ze];return ne}var ce=function(){function se(){}return se.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},se.setAttributes=function(z,X){for(var ne=0,de=X;ne<de.length;ne++){var ie=de[ne],ze=ie[0],ht=ie[1];z.setAttribute(ze,ht)}},se.createRect=function(z,X,ne){var de=document.createElementNS("http://www.w3.org/2000/svg","rect");return de.setAttribute("width",z.toString()),de.setAttribute("height",X.toString()),ne&&se.setAttributes(de,ne),de},se.createLine=function(z,X,ne,de,ie){var ze=document.createElementNS("http://www.w3.org/2000/svg","line");return ze.setAttribute("x1",z.toString()),ze.setAttribute("y1",X.toString()),ze.setAttribute("x2",ne.toString()),ze.setAttribute("y2",de.toString()),ie&&se.setAttributes(ze,ie),ze},se.createPolygon=function(z,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ne.setAttribute("points",z),X&&se.setAttributes(ne,X),ne},se.createCircle=function(z,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","circle");return ne.setAttribute("cx",(z/2).toString()),ne.setAttribute("cy",(z/2).toString()),ne.setAttribute("r",z.toString()),X&&se.setAttributes(ne,X),ne},se.createEllipse=function(z,X,ne){var de=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return de.setAttribute("cx",(z/2).toString()),de.setAttribute("cy",(X/2).toString()),de.setAttribute("rx",(z/2).toString()),de.setAttribute("ry",(X/2).toString()),ne&&se.setAttributes(de,ne),de},se.createGroup=function(z){var X=document.createElementNS("http://www.w3.org/2000/svg","g");return z&&se.setAttributes(X,z),X},se.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},se.createMarker=function(z,X,ne,de,ie,ze,ht){var St=document.createElementNS("http://www.w3.org/2000/svg","marker");return se.setAttributes(St,[["id",z],["orient",X],["markerWidth",ne.toString()],["markerHeight",de.toString()],["refX",ie.toString()],["refY",ze.toString()]]),St.appendChild(ht),St},se.createText=function(z){var X=document.createElementNS("http://www.w3.org/2000/svg","text");return X.setAttribute("x","0"),X.setAttribute("y","0"),z&&se.setAttributes(X,z),X},se.createTSpan=function(z,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ne.textContent=z,X&&se.setAttributes(ne,X),ne},se.createImage=function(z){var X=document.createElementNS("http://www.w3.org/2000/svg","image");return z&&se.setAttributes(X,z),X},se.createPoint=function(z,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ne.x=z,ne.y=X,ne},se.createPath=function(z,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","path");return ne.setAttribute("d",z),X&&se.setAttributes(ne,X),ne},se}(),oe=function(){function se(){}return se.addKey=function(z){se.key=z},Object.defineProperty(se,"isLicensed",{get:function(){return!!se.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(se.key)},enumerable:!1,configurable:!0}),se}(),Se=function(){function se(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return se.prototype.rasterize=function(z,X,ne){var de=this;return new Promise(function(ie){var ze=ne!==void 0?ne:document.createElement("canvas");z===null&&(de.markersOnly=!0,de.naturalSize=!1);var ht=document.createElementNS("http://www.w3.org/2000/svg","svg");ht.setAttribute("xmlns","http://www.w3.org/2000/svg"),ht.setAttribute("width",X.width.baseVal.valueAsString),ht.setAttribute("height",X.height.baseVal.valueAsString),ht.setAttribute("viewBox","0 0 "+X.viewBox.baseVal.width.toString()+" "+X.viewBox.baseVal.height.toString()),ht.innerHTML=X.innerHTML,de.naturalSize===!0?(ht.width.baseVal.value=z.naturalWidth,ht.height.baseVal.value=z.naturalHeight):de.width!==void 0&&de.height!==void 0&&(ht.width.baseVal.value=de.width,ht.height.baseVal.value=de.height),ze.width=ht.width.baseVal.value,ze.height=ht.height.baseVal.value;var St=ht.outerHTML,Pt=ze.getContext("2d");de.markersOnly!==!0&&Pt.drawImage(z,0,0,ze.width,ze.height);var pt=window.URL,Ht=new Image(ze.width,ze.height);Ht.setAttribute("crossOrigin","anonymous");var zt=new Blob([St],{type:"image/svg+xml"}),Mr=pt.createObjectURL(zt);Ht.onload=function(){Pt.drawImage(Ht,0,0),pt.revokeObjectURL(Mr);var on=ze.toDataURL(de.imageType,de.imageQuality);ie(on)},Ht.src=Mr})},se}(),te=function(){},ue=function(){function se(z){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+z+"_"}return Object.defineProperty(se.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),se.prototype.addClass=function(z){return this.styleSheet===void 0&&this.addStyleSheet(),z.name=""+this.classNamePrefix+z.localName,this.classes.push(z),this.styleSheet.sheet.insertRule("."+z.name+" {"+z.style+"}",this.styleSheet.sheet.cssRules.length),z},se.prototype.addRule=function(z){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(z),this.styleSheet.sheet.insertRule(z.selector+" {"+z.style+"}",this.styleSheet.sheet.cssRules.length)},se.prototype.addStyleSheet=function(){var z;this.styleSheet=document.createElement("style"),((z=this.styleSheetRoot)!==null&&z!==void 0?z:document.head).appendChild(this.styleSheet),this.addRule(new Oe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Oe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new Oe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new le("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new le("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},se.prototype.removeStyleSheet=function(){var z;this.styleSheet&&(((z=this.styleSheetRoot)!==null&&z!==void 0?z:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},se}(),Oe=function(se,z){this.selector=se,this.style=z},le=function(se,z){this.localName=se,this.style=z},Q=function(){function se(z,X,ne,de,ie){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=z,this.displayMode=X,this.markerItems=ne,this.uiStyleSettings=de,this.styles=ie,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return se.prototype.show=function(z){var X=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=z,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var ne=document.createElement("div");ne.className=this.toolbarBlockStyleClass.name,ne.style.whiteSpace="nowrap",this.uiContainer.appendChild(ne),this.addActionButton(ne,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(ne,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ne,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ne,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ne,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ne,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ne,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ne,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(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='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var 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,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(de,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},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;X<this.markerButtons.length;X++)X<z||X===z&&this.markerButtons.length-1===z?this.markerButtonBlock.appendChild(this.markerButtons[X]):(X===z&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[X]))}},se.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},se.prototype.resetButtonStyles=function(){var z=this;this.buttons.forEach(function(X){X.className=X.className.replace(z.uiStyleSettings.toolbarButtonStyleColorsClassName?z.uiStyleSettings.toolbarButtonStyleColorsClassName:z.toolbarButtonStyleColorsClass.name,"").trim(),X.className=X.className.replace(z.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?z.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:z.toolbarActiveButtonStyleColorsClass.name,"").trim(),X.className+=" "+(z.uiStyleSettings.toolbarButtonStyleColorsClassName?z.uiStyleSettings.toolbarButtonStyleColorsClassName:z.toolbarButtonStyleColorsClass.name)})},se.prototype.addActionButton=function(z,X,ne){var de=this,ie=document.createElement("div");switch(ie.className=""+this.toolbarButtonStyleClass.name,ie.innerHTML=X,ie.setAttribute("data-action",ne),ie.addEventListener("click",function(){de.actionToolbarButtonClicked(ie,ne)}),ne){case"select":ie.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":ie.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":ie.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":ie.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":ie.style.fill=this.uiStyleSettings.closeButtonColor}z.appendChild(ie),this.buttons.push(ie)},se.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new le("toolbar",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new le("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new le("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new le("toolbar-overflow-block",`
|
|
|
position: absolute;
|
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
z-index: 10;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new le("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var z=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new le("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*z)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*z)+`px;
|
|
|
padding: `+z+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new le("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new le("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new Oe("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new Oe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},se.prototype.markerToolbarButtonClicked=function(z,X){this.setActiveButton(z),this.buttonClickListeners&&this.buttonClickListeners.length>0&&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||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return 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=`<svg viewBox="0 0 24 24">
|
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
|
</svg>`),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||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||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||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return 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=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+X.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(de!==""?'stroke-dasharray="'+de+'"':"")+` />
|
|
|
</svg>`;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='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',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='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',z}(rt),Je=function(se){function z(X,ne,de,ie){var ze=se.call(this,X,ie||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return 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='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',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;Pt<this.canvasElement.height;Pt++)for(var pt=0;pt<this.canvasElement.width;pt++)X.data[Pt*this.canvasElement.width*4+4*pt+3]>0&&(St=!0,Pt<ie&&(ie=Pt),pt<de&&(de=pt),Pt>ht&&(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='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',z}(et),ke=function(se){function z(X,ne,de){var ie=se.call(this,X,de||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||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=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,5 10,0 10,10" fill="`+(ie.uiStyleSettings!==void 0?ie.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,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=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,0 10,5 0,10" fill="`+(ie.uiStyleSettings!==void 0?ie.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,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='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',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='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',z}(nt),Te=function(se){function z(X,ne,de,ie){var ze=se.call(this,X,ie||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return 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='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',z}(ye),Pe='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',$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,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),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.height/2?ie<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(de=this.width/5,ne=Math.min(this.width/2,15),this.tipBase1Position={x:ne,y:0},this.tipBase2Position={x:ne+de,y:0}):(this.tipBase1Position={x:0,y:ne},this.tipBase2Position={x:0,y:ne+de}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?ie<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(de=this.width/5,ne=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ne-de,y:0},this.tipBase2Position={x:this.width-ne,y:0}):(this.tipBase1Position={x:this.width,y:ne},this.tipBase2Position={x:this.width,y:ne+de}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?ie<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(de=this.width/5,ne=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ne-de,y:this.height},this.tipBase2Position={x:this.width-ne,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ne-de},this.tipBase2Position={x:this.width,y:this.height-ne}):ie<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(de=this.width/5,ne=Math.min(this.width/2,15),this.tipBase1Position={x:ne,y:this.height},this.tipBase2Position={x:ne+de,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ne},this.tipBase2Position={x:0,y:this.height-ne-de})},z.prototype.resize=function(X){se.prototype.resize.call(this,X),this.positionTip()},z.prototype.positionTip=function(){ce.setAttributes(this.tip,[["points",this.getTipPoints()]]);var X=this.tipGrip.visual.transform.baseVal.getItem(0);X.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(X,0)},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),z.prototype.select=function(){this.positionTip(),se.prototype.select.call(this)},z.prototype.getState=function(){var X=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},se.prototype.getState.call(this));return X.typeName=z.typeName,X},z.prototype.restoreState=function(X){var ne=X;this.bgColor=ne.bgColor,this.tipPosition=ne.tipPosition,se.prototype.restoreState.call(this,X),this.createTip(),this.setTipPoints()},z.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.tipPosition={x:this.tipPosition.x*X,y:this.tipPosition.y*ne},this.positionTip()},z.typeName="CalloutMarker",z.title="Callout marker",z.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',z}(tt),Ke=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.strokeColor=de.defaultColor,ie.strokeWidth=de.defaultStrokeWidth,ie.strokeDasharray=de.defaultStrokeDasharray,ie.fillColor=de.defaultFillColor,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.setOpacity=ie.setOpacity.bind(ie),ie.createVisual=ie.createVisual.bind(ie),ie.strokePanel=new be("Line color",he(de.defaultColorSet,["transparent"]),de.defaultColor),ie.strokePanel.onColorChanged=ie.setStrokeColor,ie.fillPanel=new be("Fill color",he(de.defaultColorSet,["transparent"]),ie.fillColor,Pe),ie.fillPanel.onColorChanged=ie.setFillColor,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.opacityPanel=new Te("Opacity",de.defaultOpacitySteps,ie.opacity),ie.opacityPanel.onOpacityChanged=ie.setOpacity,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.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},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,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).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.fillColorChanged(X),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.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.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var X=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},se.prototype.getState.call(this));return X.typeName=z.typeName,X},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.typeName="EllipseMarker",z.title="Ellipse marker",z.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',z}(et),ct=function(se){function z(X,ne,de){return se.call(this,X,ne,de)||this}return pe(z,se),Object.defineProperty(z.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),z.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.tip1&&X!==this.tip2)},z.prototype.createTips=function(){this.tip1=ce.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ce.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.tip2)},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.tip1&&this.tip2&&(ce.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var 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='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',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='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',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='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',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;ne<arguments.length;ne++)X[ne]=arguments[ne];(z=this._availableMarkerTypes).push.apply(z,X)},se.prototype.addRenderEventListener=function(z){this.addEventListener("render",function(X){z(X.dataUrl,X.state)})},se.prototype.removeRenderEventListener=function(z){},se.prototype.addCloseEventListener=function(z){this.addEventListener("close",function(){z()})},se.prototype.removeCloseEventListener=function(z){},se.prototype.setupResizeObserver=function(){var z=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){z.resize(z.target.clientWidth,z.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return z.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},se.prototype.onPopupTargetResize=function(){var z=1*this.target.clientWidth/this.target.clientHeight,X=this.editorCanvas.clientWidth/z>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*z:this.editorCanvas.clientWidth,ne=X<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/z;this.resize(X,ne)},se.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},se.prototype.resize=function(z,X){this._isResizing=!0;var ne=z/this.imageWidth,de=X/this.imageHeight;this.imageWidth=Math.round(z),this.imageHeight=Math.round(X),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(ne,de),this._isResizing=!1},se.prototype.scaleMarkers=function(z,X){var ne,de=this;this._currentMarker&&this._currentMarker instanceof tt?this._currentMarker.scale(z,X):(ne=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(ie){ie!==de._currentMarker&&ie.scale(z,X)}),ne!==void 0&&this.setCurrentMarker(ne)},se.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},se.prototype.setTopLeft=function(){var z=this.editingTarget.getBoundingClientRect(),X=this.editorCanvas.getBoundingClientRect();this.left=z.left-X.left,this.top=z.top-X.top},se.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},se.prototype.addDefs=function(){for(var z,X=[],ne=0;ne<arguments.length;ne++)X[ne]=arguments[ne];this.defs=ce.createDefs(),this.addDefsToImage(),(z=this.defs).append.apply(z,X)},se.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},se.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},se.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},se.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},se.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},se.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},se.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},se.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var z=document.createElement("a");z.href="https://markerjs.com/",z.target="_blank",z.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',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<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Y(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},se.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},se.prototype.removeMarker=function(z){this.markerImage.removeChild(z.container),this.markers.indexOf(z)>-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),de<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(ie){return ie(new It(z))})}else this.undoRedoManager.replaceLastUndoStep(X),this.eventListeners.statechange.forEach(function(ie){return ie(new It(z))})}},se.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},se.prototype.undoStep=function(){var z=this,X=this.undoRedoManager.undo();X!==void 0&&(this.restoreState(X),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ne){return ne(new It(z))}))},se.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},se.prototype.redoStep=function(){var z=this,X=this.undoRedoManager.redo();X!==void 0&&(this.restoreState(X),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ne){return ne(new It(z))}))},se.prototype.stepZoom=function(){var z=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=z<this.zoomSteps.length-1?this.zoomSteps[z+1]:this.zoomSteps[0]},se.prototype.panTo=function(z){this.contentDiv.scrollBy({left:this.prevPanPoint.x-z.x,top:this.prevPanPoint.y-z.y}),this.prevPanPoint=z},se.prototype.startRenderAndClose=function(){return Me(this,void 0,void 0,function(){var z,X,ne=this;return _e(this,function(de){switch(de.label){case 0:return[4,this.render()];case 1:return z=de.sent(),X=this.getState(),this.eventListeners.render.forEach(function(ie){return ie(new Lt(ne,z,X))}),this.close(!0),[2]}})})},se.prototype.getState=function(z){z===!0&&this.setCurrentMarker();var X={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ne){return X.markers.push(ne.getState())}),X},se.prototype.restoreState=function(z){var X=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);z.markers.forEach(function(ne){var de=X._availableMarkerTypes.find(function(ze){return ze.typeName===ne.typeName});if(de!==void 0){var ie=X.addNewMarker(de);ie.restoreState(ne),X.markers.push(ie)}}),z.width&&z.height&&(z.width!==this.imageWidth||z.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/z.width,this.imageHeight/z.height),this.eventListeners.restorestate.forEach(function(ne){return ne(new It(X))})},se.prototype.addNewMarker=function(z){var X=ce.createGroup();return this.markerImage.appendChild(X),new z(X,this.overlayContainer,this.settings)},se.prototype.createNewMarker=function(z){var X,ne=this;(X=typeof z=="string"?this._availableMarkerTypes.find(function(de){return de.typeName===z}):z)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(X),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(X.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(de){return de(new _t(ne,ne._currentMarker))}))},se.prototype.markerCreated=function(z){var X=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(z),this.setCurrentMarker(z),z instanceof Ue&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ue):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ne){return ne(new _t(X,X._currentMarker))})},se.prototype.colorChanged=function(z){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=z,this.settings.defaultStrokeColor=z)},se.prototype.fillColorChanged=function(z){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=z)},se.prototype.markerStateChanged=function(z){var X=this;this.eventListeners.markerchange.forEach(function(ne){return ne(new _t(X,z))})},se.prototype.setCurrentMarker=function(z){var X=this;this._currentMarker!==z&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(ne){return ne(new _t(X,X._currentMarker))})),this._currentMarker=z,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(ne){return ne(new _t(X,X._currentMarker))}))},se.prototype.onPointerDown=function(z){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||z.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var X=this.markers.find(function(ne){return ne.ownsTarget(z.target)});X!==void 0?(this.setCurrentMarker(X),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(z.clientX,z.clientY),z.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:z.clientX,y:z.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(z.clientX,z.clientY))},se.prototype.onDblClick=function(z){if(this._isFocused||this.focus(),this.mode==="select"){var X=this.markers.find(function(ne){return ne.ownsTarget(z.target)});X!==void 0&&X!==this._currentMarker&&this.setCurrentMarker(X),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(z.clientX,z.clientY),z.target):this.setCurrentMarker()}},se.prototype.onPointerMove=function(z){this.touchPoints!==1&&z.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||z.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(z.clientX,z.clientY)):this.zoomLevel>1&&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]<de[3])){ze.label=pt[1];break}if(pt[0]===6&&ze.label<de[1]){ze.label=de[1],de=pt;break}if(de&&ze.label<de[2]){ze.label=de[2],ze.ops.push(pt);break}de[2]&&ze.ops.pop(),ze.trys.pop();continue}pt=z.call(se,ze)}catch(Ht){pt=[6,Ht],ne=0}finally{X=de=0}if(5&pt[0])throw pt[1];return{value:pt[0]?pt[1]:void 0,done:!0}}([St,Pt])}}}var Cr=function(){function se(){}return se.addKey=function(z){se.key=z},Object.defineProperty(se,"isLicensed",{get:function(){return!!se.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(se.key)},enumerable:!1,configurable:!0}),se}(),Ct=function(){function se(){}return se.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},se.setAttributes=function(z,X){for(var ne=0,de=X;ne<de.length;ne++){var ie=de[ne],ze=ie[0],ht=ie[1];z.setAttribute(ze,ht)}},se.createRect=function(z,X,ne){var de=document.createElementNS("http://www.w3.org/2000/svg","rect");return de.setAttribute("width",z.toString()),de.setAttribute("height",X.toString()),ne&&se.setAttributes(de,ne),de},se.createLine=function(z,X,ne,de,ie){var ze=document.createElementNS("http://www.w3.org/2000/svg","line");return ze.setAttribute("x1",z.toString()),ze.setAttribute("y1",X.toString()),ze.setAttribute("x2",ne.toString()),ze.setAttribute("y2",de.toString()),ie&&se.setAttributes(ze,ie),ze},se.createPolygon=function(z,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ne.setAttribute("points",z),X&&se.setAttributes(ne,X),ne},se.createCircle=function(z,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","circle");return ne.setAttribute("cx",(z/2).toString()),ne.setAttribute("cy",(z/2).toString()),ne.setAttribute("r",z.toString()),X&&se.setAttributes(ne,X),ne},se.createEllipse=function(z,X,ne){var de=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return de.setAttribute("cx",(z/2).toString()),de.setAttribute("cy",(X/2).toString()),de.setAttribute("rx",(z/2).toString()),de.setAttribute("ry",(X/2).toString()),ne&&se.setAttributes(de,ne),de},se.createGroup=function(z){var X=document.createElementNS("http://www.w3.org/2000/svg","g");return z&&se.setAttributes(X,z),X},se.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},se.createMarker=function(z,X,ne,de,ie,ze,ht){var St=document.createElementNS("http://www.w3.org/2000/svg","marker");return se.setAttributes(St,[["id",z],["orient",X],["markerWidth",ne.toString()],["markerHeight",de.toString()],["refX",ie.toString()],["refY",ze.toString()]]),St.appendChild(ht),St},se.createText=function(z){var X=document.createElementNS("http://www.w3.org/2000/svg","text");return X.setAttribute("x","0"),X.setAttribute("y","0"),z&&se.setAttributes(X,z),X},se.createTSpan=function(z,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ne.textContent=z,X&&se.setAttributes(ne,X),ne},se.createImage=function(z){var X=document.createElementNS("http://www.w3.org/2000/svg","image");return z&&se.setAttributes(X,z),X},se.createPoint=function(z,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ne.x=z,ne.y=X,ne},se.createPath=function(z,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","path");return ne.setAttribute("d",z),X&&se.setAttributes(ne,X),ne},se.createElement=function(z,X){var ne=document.createElementNS("http://www.w3.org/2000/svg",z);return X&&se.setAttributes(ne,X),ne},se.getHollowRectanglePath=function(z,X,ne,de,ie,ze,ht,St){return"M"+z+","+X+"V"+(X+de)+"H"+(z+ne)+"V"+X+"H"+ie+"V"+ze+"H"+(ie+ht)+"V"+(ze+St)+"H"+ie+"V"+X+"Z"},se}(),lr=function(){function se(z){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+z+"_"}return Object.defineProperty(se.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),se.prototype.addClass=function(z){return this.styleSheet===void 0&&this.addStyleSheet(),z.name=""+this.classNamePrefix+z.localName,this.classes.push(z),this.styleSheet.sheet.insertRule("."+z.name+" {"+z.style+"}",this.styleSheet.sheet.cssRules.length),z},se.prototype.addRule=function(z){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(z),this.styleSheet.sheet.insertRule(z.selector+" {"+z.style+"}",this.styleSheet.sheet.cssRules.length)},se.prototype.addStyleSheet=function(){var z;this.styleSheet=document.createElement("style"),((z=this.styleSheetRoot)!==null&&z!==void 0?z:document.head).appendChild(this.styleSheet),this.addRule(new Fr("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Fr("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new Fr("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new $r("_fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new $r("_fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},se.prototype.removeStyleSheet=function(){var z;this.styleSheet&&(((z=this.styleSheetRoot)!==null&&z!==void 0?z:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},se}(),Fr=function(se,z){this.selector=se,this.style=z},$r=function(se,z){this.localName=se,this.style=z},Hr=function(){function se(){this.blocks=[],this.display=""}return se.prototype.addButtonBlock=function(z){z.className=this.blockClassName,z.buttonClassName=this.buttonClassName,z.buttonColorsClassName=this.buttonColorsClassName,z.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(z)},se.prototype.addElementBlock=function(z){z.className===void 0&&(z.className=this.blockClassName),this.blocks.push(z)},se.prototype.getUI=function(){var z=document.createElement("div");return z.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,z.style.display=this.display,this.blocks.forEach(function(X){return z.appendChild(X.getUI())}),z},se}(),oi=function(){function se(){}return se.prototype.getUI=function(){var z=document.createElement("div");if(z.className=this.className,this.minWidth!==void 0&&(z.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":z.style.justifyContent="flex-start";break;case"center":z.style.justifyContent="center";break;case"end":z.style.justifyContent="flex-end"}return z.style.whiteSpace="nowrap",z},se}(),Tt=function(se){function z(){var X=se!==null&&se.apply(this,arguments)||this;return X.buttons=[],X}return cr(z,se),z.prototype.addButton=function(X){X.className=this.buttonClassName,X.colorsClassName=this.buttonColorsClassName,X.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(X)},z.prototype.getUI=function(){var X=se.prototype.getUI.call(this);return this.buttons.forEach(function(ne){return X.appendChild(ne.getUI())}),X},z}(oi),Rt=function(){function se(z,X){this._isActive=!1,this._isHidden=!1,this._icon=z,this.title=X,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(se.prototype,"icon",{get:function(){return this._icon},set:function(z){this._icon=z,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isActive",{get:function(){return this._isActive},set:function(z){this._isActive=z,this.adjustClassName()},enumerable:!1,configurable:!0}),se.prototype.getUI=function(){var z=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return z.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},se.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},se.prototype.hide=function(){this._isHidden=!0},se}(),Et=function(se){function z(){var X=se!==null&&se.apply(this,arguments)||this;return X.elements=[],X}return cr(z,se),z.prototype.addElement=function(X){this.elements.push(X)},z.prototype.getUI=function(){var X=se.prototype.getUI.call(this);return this.elements.forEach(function(ne){return X.appendChild(ne)}),X},z}(oi),Ar=function(){function se(z,X){this.horizontal=z,this.vertical=X}return Object.defineProperty(se.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),se.prototype.getVerticalLength=function(z){return z/this.ratio},se.prototype.getHorizontalLength=function(z){return z*this.ratio},se}(),Br=function(){function se(){}return se.getIcon=function(z,X){if(z>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'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},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;X<this.numberOfGridLines;X++)this.horizontalGridLines.push(Ct.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ct.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ne){return z.gridContainer.appendChild(ne)}),this.verticalGridLines.forEach(function(ne){return z.gridContainer.appendChild(ne)}),this.cropRectElement=Ct.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Nt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Nt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Nt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Nt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},se.prototype.setCropRectangle=function(z){this.cropRect=z;var X=Object.assign({},this.cropRect);this.zoomFactor!==1&&(X.width=this.cropRect.width*this.zoomFactor,X.height=this.cropRect.height*this.zoomFactor,X.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-X.width/2,X.y=this.cropRect.height/this.cropRect.width>this.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+ne<this.margin&&(ne=this.margin-X.x),X.x+=ne,X.width=this.cropRect.x+this.cropRect.width-X.x;break;case this.bottomRightGrip:case this.topRightGrip:X.width+ne>this.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.canvasWidth<de/this.canvasHeight?this.cropRect.width=ne:this.cropRect.height=de,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=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_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/z;this.resize(X,ne)}},se.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},se.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Ct.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},se.prototype.resize=function(z,X){this.imageWidth=Math.round(z),this.imageHeight=Math.round(X),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},se.prototype.setEditingTarget=function(){var z=document.createElement("canvas");z.width=this.target.naturalWidth,z.height=this.target.naturalHeight,z.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var X=z.toDataURL();Ct.setAttributes(this.editingTarget,[["href",X]]),this.setEditingTargetSize()},se.prototype.setTopLeft=function(){var z=this.target.getBoundingClientRect(),X=this.editorCanvas.getBoundingClientRect();this.left=z.left-X.left-this.CANVAS_MARGIN,this.top=z.top-X.top-this.CANVAS_MARGIN},se.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Ct.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ct.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ct.createGroup(),this.editingTargetRotationScaleContainer=Ct.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var z=Ct.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(z);var X=Ct.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(X),this.editingTargetContainer=Ct.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},se.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},se.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ct.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new jr(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},se.prototype.zoomToCrop=function(){if(this.cropRect){var z=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,X=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=z+"px "+X+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-z+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-X+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},se.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},se.prototype.cropRectChanged=function(z){this.cropRect=z,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},se.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},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.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var z=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,X=this.target.offsetTop>z+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('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");de.isActive=this.isGridVisible,de.onClick=function(){z.isGridVisible=!z.isGridVisible,de.isActive=z.isGridVisible},X.addButton(de);var ie=new Rt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(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='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',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('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");pt.onClick=this.startRenderAndClose,Pt.addButton(pt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(pt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ht=new Rt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");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('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");ne.onClick=this.rotateLeftButtonClicked,X.addButton(ne);var de=new Rt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");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('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");ht.onClick=this.flipHorizontallyButtonClicked,ze.addButton(ht);var St=new Rt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");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=/<pre[^>]*>/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("(?<!\\n)\\n(?!\\n)","g"),`
|
|
|
`)}catch(fi){}var Tr=G(Zr),dn=N();if(Zr.match(/\[TOC\]/)&&(Tr=Tr.replace("<p>[TOC]</p>",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<C;r++)D[f+r]^=a[r]}});return u.Decryptor=_,u}(),M.mode.CTR})},"9VGf":function(I,J,P){"use strict";P.d(J,"a",function(){return _});var M=P("q1tI"),u=P.n(M);function _(D,f){var l=Object(M.useRef)();Object(M.useEffect)(function(){l.current=D}),Object(M.useEffect)(function(){function C(){l.current()}if(f!==null){var v=setInterval(C,f);return function(){return clearInterval(v)}}},[f])}},ALsQ:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(M){return M.mode.CFB=function(){var u=M.lib.BlockCipherMode.extend();u.Encryptor=u.extend({processBlock:function(D,f){var l=this._cipher,C=l.blockSize;_.call(this,D,f,C,l),this._prevBlock=D.slice(f,f+C)}}),u.Decryptor=u.extend({processBlock:function(D,f){var l=this._cipher,C=l.blockSize,v=D.slice(f,f+C);_.call(this,D,f,C,l),this._prevBlock=v}});function _(D,f,l,C){var v,o=this._iv;o?(v=o.slice(0),this._iv=void 0):v=this._prevBlock,C.encryptBlock(v,0);for(var a=0;a<l;a++)D[f+a]^=v[a]}return u}(),M.mode.CFB})},B7Ph:function(I,J,P){"use strict";P.d(J,"a",function(){return L});var M=P("5NDa"),u=P("5rEg"),_=P("+L6B"),D=P("2/Rp"),f=P("2qtc"),l=P("kLXV"),C=P("k1fw"),v=P("miYZ"),o=P("tsqr"),a=P("9og8"),r=P("tJVT"),h=P("oBTY"),m=P("DZo9"),p=P("8z0m"),w=P("WmNS"),g=P.n(w),c=P("q1tI"),n=P.n(c),s=P("Bvq2"),d=P.n(s),S=P("nj2k"),y=P.n(S),i=P("mxV5"),k=P.n(i),O=P("KhGG"),b=P("ErOA"),E=P("7Cbv"),x=P("1vsH"),T=p.a.Dragger,N=function(K){for(var W=function(pe){return pe&&pe.substring(0,pe.lastIndexOf("."))},G=Object(h.a)(K),F=0,B=[],H=0;H<G.length;H++){for(var q="",re=0;re<B.length;re++)if(W(B[re][0].name)==W(G[H].name)){F=1,q=re;break}if(F==1)B[q].push(G[H]),F=0;else if(F==0){var ee=new Array;ee.push(G[H]),B.push(ee)}}var Ce=B.map(function(Ee){if(Ee[0].name.includes(".in"))return Ee.length===2?Ee:[Ee[0],{}];if(Ee[0].name.includes(".out"))return Ee.length===2?Ee.reverse():[{},Ee[0]]});return Ce},j=function(K){var W=K.onClose,G=K.onOK,F=K.visible,B=K.wrapClassName,H=K.rootIdentifier,q=Object(c.useState)([]),re=Object(r.a)(q,2),ee=re[0],Ce=re[1],Ee=Object(c.useState)({}),pe=Object(r.a)(Ee,2),Me=pe[0],_e=pe[1],he=Object(c.useState)(!1),ce=Object(r.a)(he,2),oe=ce[0],Se=ce[1],te=Object(c.useRef)([]),ue=Object(c.useRef)(0),Oe=function(){W()};Object(c.useEffect)(function(){le()},[]),Object(c.useEffect)(function(){F&&(te.current=[],ue.current=0,Ce([]))},[F]);var le=function(){var Ze=Object(a.a)(g.a.mark(function qe(){var et,nt;return g.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.prev=0,ot.next=3,Object(b.a)("/api/buckets/get_upload_token_for_big_files",{method:"get"});case 3:et=ot.sent,nt=JSON.parse(Object(O.a)(et.data)),_e(nt),ot.next=11;break;case 8:ot.prev=8,ot.t0=ot.catch(0),o.b.error(ot.t0);case 11:case"end":return ot.stop()}},qe,null,[[0,8]])}));return function(){return Ze.apply(this,arguments)}}(),Q=function(qe){return qe&&qe.substring(0,qe.lastIndexOf("."))},Y=function(qe){var et,nt,ut=Q((et=qe[0])===null||et===void 0?void 0:et.name)||Q((nt=qe[1])===null||nt===void 0?void 0:nt.name),ot=ee.filter(function(je){return Q(je.name)!==ut});te.current=Object(h.a)(ot),Ce(Object(h.a)(ot))},Z=function(qe){var et=new k.a({endpoint:Me.end_point,region:Me.region,accessKeyId:Me.access_key_id,accessKeySecret:Me.access_key_secret,bucket:Me.bucket,stsToken:Me.security_token}),nt=qe.name,ut={container_type:"TestSet",file_name:nt},ot=Object(E.a)(),je="testsets/".concat(H,"/").concat(ot).concat(nt.indexOf(".")>-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;m<a.length;m++){if(!a[m].empty())return M.Pass;var p=a[m].head,w=o.getTokenAt(p),g=M.innerMode(o.getMode(),w.state),c=g.state,n=g.mode.xmlCurrentTag&&g.mode.xmlCurrentTag(c),s=n&&n.name;if(!s)return M.Pass;var d=g.mode.configuration=="html",S=typeof h=="object"&&h.dontCloseTags||d&&u,y=typeof h=="object"&&h.indentTags||d&&_;w.end>p.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?`
|
|
|
|
|
|
`:"")+"</"+s+">",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?"/":"</",p=o.getOption("autoCloseTags"),w=typeof p=="object"&&p.dontIndentOnSlash,g=0;g<r.length;g++){if(!r[g].empty())return M.Pass;var c=r[g].head,n=o.getTokenAt(c),s=M.innerMode(o.getMode(),n.state),d=s.state;if(a&&(n.type=="string"||n.string.charAt(0)!="<"||n.start!=c.ch-1))return M.Pass;var S,y=s.mode.name!="xml"&&o.getMode().name=="htmlmixed";if(y&&s.mode.name=="javascript")S=m+"script";else if(y&&s.mode.name=="css")S=m+"style";else{var i=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(d);if(!i||i.length&&v(o,i,i[i.length-1],c))return M.Pass;S=m+i[i.length-1]}o.getLine(c.line).charAt(n.end)!=">"&&(S+=">"),h[g]=S}if(o.replaceSelections(h),r=o.listSelections(),!w)for(var g=0;g<r.length;g++)(g==r.length-1||r[g].head.line<r[g+1].head.line)&&o.indentLine(r[g].head.line)}function l(o){return o.getOption("disableInput")?M.Pass:f(o,!0)}M.commands.closeTag=function(o){return f(o)};function C(o,a){if(o.indexOf)return o.indexOf(a);for(var r=0,h=o.length;r<h;++r)if(o[r]==a)return r;return-1}function v(o,a,r,h,m){if(!M.scanForClosingTag)return!1;var p=Math.min(o.lastLine()+1,h.line+500),w=M.scanForClosingTag(o,h,null,p);if(!w||w.tag!=r)return!1;for(var g=m?1:0,c=a.length-1;c>=0&&a[c]==r;c--)++g;h=w.to;for(var c=1;c<g;c++){var n=M.scanForClosingTag(o,h,null,p);if(!n||n.tag!=r)return!1;h=n.to}return!0}})},BjJ7:function(I,J,P){"use strict";P.d(J,"d",function(){return u}),P.d(J,"c",function(){return _}),P.d(J,"e",function(){return D}),P.d(J,"b",function(){return f}),P.d(J,"a",function(){return C});var M=P("m3rI");function u(v){var o=!0;if(v.length>0){for(var a=0;a<v.length;a++)if(v[a].compile_success==0||!v[a].compile_success){o=!1;break}}else o=!1;return o}function _(v){for(var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=[],r=0;r<v.length;r++){var h=v[r],m=o?"".concat(o,"/").concat(h.name):"".concat(h.name);a.push({title:h.name,isLeaf:!(h.type==="tree"),key:m})}return a}function D(v,o,a){for(var r=0;r<v.length;r++){var h=v[r];if(h.key===o){h.children=a;break}h.children&&D(h.children,o,a)}return v}function f(v,o,a){var r;return function(){var h=this,m=arguments,p=function(){r=null,a||v.apply(h,m)},w=a&&!r;clearTimeout(r),r=setTimeout(p,o),w&&v.apply(h,m)}}var l=!0,C=M.a.API_SERVER},Bvq2:function(I,J,P){I.exports={wrap:"wrap___2zRY4",colorBlue:"colorBlue___XalpT",repeatedName:"repeatedName___2Tfh4",text:"text___1sYHg",noData:"noData___3pdB4",btn:"btn___3WWjB",btnS:"btnS___2M_9t",head:"head____NWmz",list:"list___2fE4M",del:"del___2BO6Y",info:"info___3GJ70"}},"C+DQ":function(I,J,P){},CrYA:function(I,J,P){var M=P("MFOe"),u=M.Global;I.exports={name:"sessionStorage",read:D,write:f,each:l,remove:C,clearAll:v};function _(){return u.sessionStorage}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()}},DlQD:function(I,J,P){(function(M,u){I.exports=u()})(this,function(){"use strict";function M(Ue,ke){for(var Ie=0;Ie<ke.length;Ie++){var ye=ke[Ie];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty(Ue,ye.key,ye)}}function u(Ue,ke,Ie){return ke&&M(Ue.prototype,ke),Ie&&M(Ue,Ie),Ue}function _(Ue,ke){if(!Ue)return;if(typeof Ue=="string")return D(Ue,ke);var Ie=Object.prototype.toString.call(Ue).slice(8,-1);if(Ie==="Object"&&Ue.constructor&&(Ie=Ue.constructor.name),Ie==="Map"||Ie==="Set")return Array.from(Ue);if(Ie==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ie))return D(Ue,ke)}function D(Ue,ke){(ke==null||ke>Ue.length)&&(ke=Ue.length);for(var Ie=0,ye=new Array(ke);Ie<ke;Ie++)ye[Ie]=Ue[Ie];return ye}function f(Ue,ke){var Ie;if(typeof Symbol=="undefined"||Ue[Symbol.iterator]==null){if(Array.isArray(Ue)||(Ie=_(Ue))||ke&&Ue&&typeof Ue.length=="number"){Ie&&(Ue=Ie);var ye=0;return function(){return ye>=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<arguments.length;ke++){Ie=arguments[ke];for(ye in Ie)Object.prototype.hasOwnProperty.call(Ie,ye)&&(Ue[ye]=Ie[ye])}return Ue}function L(Ue,ke){var Ie=Ue.replace(/\|/g,function(Ae,Pe,$e){for(var Ke=!1,ct=Pe;--ct>=0&&$e[ct]==="\\";)Ke=!Ke;return Ke?"|":" |"}),ye=Ie.split(/ \|/),Te=0;if(ye.length>ke)ye.splice(ke);else for(;ye.length<ke;)ye.push("");for(;Te<ye.length;Te++)ye[Te]=ye[Te].trim().replace(/\\\|/g,"|");return ye}function V(Ue,ke,Ie){var ye=Ue.length;if(ye===0)return"";for(var Te=0;Te<ye;){var Ae=Ue.charAt(ye-Te-1);if(Ae===ke&&!Ie)Te++;else if(Ae!==ke&&Ie)Te++;else break}return Ue.substr(0,ye-Te)}function K(Ue,ke){if(Ue.indexOf(ke[1])===-1)return-1;for(var Ie=Ue.length,ye=0,Te=0;Te<Ie;Te++)if(Ue[Te]==="\\")Te++;else if(Ue[Te]===ke[0])ye++;else if(Ue[Te]===ke[1]&&(ye--,ye<0))return Te;return-1}function W(Ue){Ue&&Ue.sanitize&&!Ue.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var G={escape:c,unescape:s,edit:S,cleanUrl:k,resolveUrl:T,noopTest:N,merge:j,splitCells:L,rtrim:V,findClosingBracket:K,checkSanitizeDeprecation:W},F=C.defaults,B=G.rtrim,H=G.splitCells,q=G.escape,re=G.findClosingBracket;function ee(Ue,ke,Ie){var ye=ke.href,Te=ke.title?q(ke.title):null,Ae=Ue[1].replace(/\\([\[\]])/g,"$1");return Ue[0].charAt(0)!=="!"?{type:"link",raw:Ie,href:ye,title:Te,text:Ae}:{type:"image",raw:Ie,href:ye,title:Te,text:q(Ae)}}function Ce(Ue,ke){var Ie=Ue.match(/^(\s+)(?:```)/);if(Ie===null)return ke;var ye=Ie[1];return ke.split(`
|
|
|
`).map(function(Te){var Ae=Te.match(/^\s+/);if(Ae===null)return Te;var Pe=Ae[0];return Pe.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<Pe;$e++)/^ *-+: *$/.test(Ae.align[$e])?Ae.align[$e]="right":/^ *:-+: *$/.test(Ae.align[$e])?Ae.align[$e]="center":/^ *:-+ *$/.test(Ae.align[$e])?Ae.align[$e]="left":Ae.align[$e]=null;for(Pe=Ae.cells.length,$e=0;$e<Pe;$e++)Ae.cells[$e]=H(Ae.cells[$e],Ae.header.length);return Ae}}},ke.hr=function(ye){var Te=this.rules.block.hr.exec(ye);if(Te)return{type:"hr",raw:Te[0]}},ke.blockquote=function(ye){var Te=this.rules.block.blockquote.exec(ye);if(Te){var Ae=Te[0].replace(/^ *> ?/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;Wt<cr;Wt++)vt=gt[Wt],Ae=vt,It=vt.length,vt=vt.replace(/^ *([*+-]|\d+[.)]) */,""),~vt.indexOf(`
|
|
|
`)&&(It-=vt.length,vt=this.options.pedantic?vt.replace(/^ {1,4}/gm,""):vt.replace(new RegExp("^ {1,"+It+"}","gm"),"")),Wt!==cr-1&&(Lt=this.rules.block.bullet.exec(gt[Wt+1])[0],($e?Lt.length===1||!Ke&&Lt[Lt.length-1]===")":Lt.length>1||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<Pe;$e++)/^ *-+: *$/.test(Ae.align[$e])?Ae.align[$e]="right":/^ *:-+: *$/.test(Ae.align[$e])?Ae.align[$e]="center":/^ *:-+ *$/.test(Ae.align[$e])?Ae.align[$e]="left":Ae.align[$e]=null;for(Pe=Ae.cells.length,$e=0;$e<Pe;$e++)Ae.cells[$e]=H(Ae.cells[$e].replace(/^ *\| *| *\| *$/g,""),Ae.header.length);return Ae}}},ke.lheading=function(ye){var Te=this.rules.block.lheading.exec(ye);if(Te)return{type:"heading",raw:Te[0],depth:Te[2].charAt(0)==="="?1:2,text:Te[1]}},ke.paragraph=function(ye){var Te=this.rules.block.paragraph.exec(ye);if(Te)return{type:"paragraph",raw:Te[0],text:Te[1].charAt(Te[1].length-1)===`
|
|
|
`?Te[1].slice(0,-1):Te[1]}},ke.text=function(ye,Te){var Ae=this.rules.block.text.exec(ye);if(Ae){var Pe=Te[Te.length-1];return Pe&&Pe.type==="text"?{raw:Ae[0],text:Ae[0]}:{type:"text",raw:Ae[0],text:Ae[0]}}},ke.escape=function(ye){var Te=this.rules.inline.escape.exec(ye);if(Te)return{type:"escape",raw:Te[0],text:q(Te[1])}},ke.tag=function(ye,Te,Ae){var Pe=this.rules.inline.tag.exec(ye);if(Pe)return!Te&&/^<a /i.test(Pe[0])?Te=!0:Te&&/^<\/a>/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]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable: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=/<!--(?!-?>)[\s\S]*?-->/,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","</?(?:tag)(?: +|\\n|/?>)|<(?: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","</?(?:tag)(?: +|\\n|/?>)|<(?: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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.pedantic=_e({},he.normal,{html:Me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\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:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:pe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",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]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ce.gfm.url=Me(ce.gfm.url,"i").replace("email",ce.gfm._extended_email).getRegex(),ce.breaks=_e({},ce.gfm,{br:Me(ce.br).replace("{2,}","*").getRegex(),text:Me(ce.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var oe={block:he,inline:ce},Se=C.defaults,te=oe.block,ue=oe.inline;function Oe(Ue){return Ue.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function le(Ue){var ke="",Ie,ye,Te=Ue.length;for(Ie=0;Ie<Te;Ie++)ye=Ue.charCodeAt(Ie),Math.random()>.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;$e<Ke;$e++)Pe.items[$e].tokens=this.blockTokens(Pe.items[$e].text,[],!1);Te.push(Pe);continue}if(Pe=this.tokenizer.html(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Ae&&(Pe=this.tokenizer.def(ye))){ye=ye.substring(Pe.raw.length),this.tokens.links[Pe.tag]||(this.tokens.links[Pe.tag]={href:Pe.href,title:Pe.title});continue}if(Pe=this.tokenizer.table(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.lheading(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Ae&&(Pe=this.tokenizer.paragraph(ye))){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.text(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(ye){var gt="Infinite loop on byte: "+ye.charCodeAt(0);if(this.options.silent){console.error(gt);break}else throw new Error(gt)}}return Te},ke.inline=function(ye){var Te,Ae,Pe,$e,Ke,ct,gt=ye.length;for(Te=0;Te<gt;Te++){ct=ye[Te];switch(ct.type){case"paragraph":case"text":case"heading":{ct.tokens=[],this.inlineTokens(ct.text,ct.tokens);break}case"table":{for(ct.tokens={header:[],cells:[]},$e=ct.header.length,Ae=0;Ae<$e;Ae++)ct.tokens.header[Ae]=[],this.inlineTokens(ct.header[Ae],ct.tokens.header[Ae]);for($e=ct.cells.length,Ae=0;Ae<$e;Ae++)for(Ke=ct.cells[Ae],ct.tokens.cells[Ae]=[],Pe=0;Pe<Ke.length;Pe++)ct.tokens.cells[Ae][Pe]=[],this.inlineTokens(Ke[Pe],ct.tokens.cells[Ae][Pe]);break}case"blockquote":{this.inline(ct.tokens);break}case"list":{for($e=ct.items.length,Ae=0;Ae<$e;Ae++)this.inline(ct.items[Ae].tokens);break}}}return ye},ke.inlineTokens=function(ye,Te,Ae,Pe,$e){Te===void 0&&(Te=[]),Ae===void 0&&(Ae=!1),Pe===void 0&&(Pe=!1),$e===void 0&&($e="");var Ke,ct=ye,gt;if(this.tokens.links){var wt=Object.keys(this.tokens.links);if(wt.length>0)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?'<pre><code class="'+this.options.langPrefix+be(Pe,!0)+'">'+(Ae?ye:be(ye,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(Ae?ye:be(ye,!0))+`</code></pre>
|
|
|
`},ke.blockquote=function(ye){return`<blockquote>
|
|
|
`+ye+`</blockquote>
|
|
|
`},ke.html=function(ye){return ye},ke.heading=function(ye,Te,Ae,Pe){return this.options.headerIds?"<h"+Te+' id="'+this.options.headerPrefix+Pe.slug(Ae)+'">'+ye+"</h"+Te+`>
|
|
|
`:"<h"+Te+">"+ye+"</h"+Te+`>
|
|
|
`},ke.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},ke.list=function(ye,Te,Ae){var Pe=Te?"ol":"ul",$e=Te&&Ae!==1?' start="'+Ae+'"':"";return"<"+Pe+$e+`>
|
|
|
`+ye+"</"+Pe+`>
|
|
|
`},ke.listitem=function(ye){return"<li>"+ye+`</li>
|
|
|
`},ke.checkbox=function(ye){return"<input "+(ye?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ke.paragraph=function(ye){return"<p>"+ye+`</p>
|
|
|
`},ke.table=function(ye,Te){return Te&&(Te="<tbody>"+Te+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+ye+`</thead>
|
|
|
`+Te+`</table>
|
|
|
`},ke.tablerow=function(ye){return`<tr>
|
|
|
`+ye+`</tr>
|
|
|
`},ke.tablecell=function(ye,Te){var Ae=Te.header?"th":"td",Pe=Te.align?"<"+Ae+' align="'+Te.align+'">':"<"+Ae+">";return Pe+ye+"</"+Ae+`>
|
|
|
`},ke.strong=function(ye){return"<strong>"+ye+"</strong>"},ke.em=function(ye){return"<em>"+ye+"</em>"},ke.codespan=function(ye){return"<code>"+ye+"</code>"},ke.br=function(){return this.options.xhtml?"<br/>":"<br>"},ke.del=function(ye){return"<del>"+ye+"</del>"},ke.link=function(ye,Te,Ae){if(ye=Z(this.options.sanitize,this.options.baseUrl,ye),ye===null)return Ae;var Pe='<a href="'+be(ye)+'"';return Te&&(Pe+=' title="'+Te+'"'),Pe+=">"+Ae+"</a>",Pe},ke.image=function(ye,Te,Ae){if(ye=Z(this.options.sanitize,this.options.baseUrl,ye),ye===null)return Ae;var Pe='<img src="'+ye+'" alt="'+Ae+'"';return Te&&(Pe+=' title="'+Te+'"'),Pe+=this.options.xhtml?"/>":">",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;Pe<lr;Pe++){_t=ye[Pe];switch(_t.type){case"space":continue;case"hr":{Ae+=this.renderer.hr();continue}case"heading":{Ae+=this.renderer.heading(this.parseInline(_t.tokens),_t.depth,et(this.parseInline(_t.tokens,this.textRenderer)),this.slugger);continue}case"code":{Ae+=this.renderer.code(_t.text,_t.lang,_t.escaped);continue}case"table":{for(It="",vt="",ct=_t.header.length,$e=0;$e<ct;$e++)vt+=this.renderer.tablecell(this.parseInline(_t.tokens.header[$e]),{header:!0,align:_t.align[$e]});for(It+=this.renderer.tablerow(vt),Lt="",ct=_t.cells.length,$e=0;$e<ct;$e++){for(wt=_t.tokens.cells[$e],vt="",gt=wt.length,Ke=0;Ke<gt;Ke++)vt+=this.renderer.tablecell(this.parseInline(wt[Ke]),{header:!1,align:_t.align[Ke]});Lt+=this.renderer.tablerow(vt)}Ae+=this.renderer.table(It,Lt);continue}case"blockquote":{Lt=this.parse(_t.tokens),Ae+=this.renderer.blockquote(Lt);continue}case"list":{for(rr=_t.ordered,sr=_t.start,$t=_t.loose,ct=_t.items.length,Lt="",$e=0;$e<ct;$e++)Wt=_t.items[$e],Lr=Wt.checked,Cr=Wt.task,cr="",Wt.task&&(Ct=this.renderer.checkbox(Lr),$t?Wt.tokens.length>0&&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+1<lr&&ye[Pe+1].type==="text";)_t=ye[++Pe],Lt+=`
|
|
|
`+(_t.tokens?this.parseInline(_t.tokens):_t.text);Ae+=Te?this.renderer.paragraph(Lt):Lt;continue}default:{var Fr='Token with "'+_t.type+'" type was not found.';if(this.options.silent){console.error(Fr);return}else throw new Error(Fr)}}}return Ae},ke.parseInline=function(ye,Te){Te=Te||this.renderer;var Ae="",Pe,$e,Ke=ye.length;for(Pe=0;Pe<Ke;Pe++){$e=ye[Pe];switch($e.type){case"escape":{Ae+=Te.text($e.text);break}case"html":{Ae+=Te.html($e.text);break}case"link":{Ae+=Te.link($e.href,$e.title,this.parseInline($e.tokens,Te));break}case"image":{Ae+=Te.image($e.href,$e.title,$e.text);break}case"strong":{Ae+=Te.strong(this.parseInline($e.tokens,Te));break}case"em":{Ae+=Te.em(this.parseInline($e.tokens,Te));break}case"codespan":{Ae+=Te.codespan($e.text);break}case"br":{Ae+=Te.br();break}case"del":{Ae+=Te.del(this.parseInline($e.tokens,Te));break}case"text":{Ae+=Te.text($e.text);break}default:{var ct='Token with "'+$e.type+'" type was not found.';if(this.options.silent){console.error(ct);return}else throw new Error(ct)}}}return Ae},Ue}(),ut=G.merge,ot=G.checkSanitizeDeprecation,je=G.escape,De=C.getDefaults,rt=C.changeDefaults,lt=C.defaults;function Je(Ue,ke,Ie){if(typeof Ue=="undefined"||Ue===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ue!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ue)+", string expected");if(typeof ke=="function"&&(Ie=ke,ke=null),ke=ut({},Je.defaults,ke||{}),ot(ke),Ie){var ye=ke.highlight,Te;try{Te=Q.lex(Ue,ke)}catch(Ke){return Ie(Ke)}var Ae=function(ct){var gt;if(!ct)try{gt=nt.parse(Te,ke)}catch(wt){ct=wt}return ke.highlight=ye,ct?Ie(ct):Ie(null,gt)};if(!ye||ye.length<3)return Ae();if(delete ke.highlight,!Te.length)return Ae();var Pe=0;Je.walkTokens(Te,function(Ke){Ke.type==="code"&&(Pe++,setTimeout(function(){ye(Ke.text,Ke.lang,function(ct,gt){if(ct)return Ae(ct);gt!=null&>!==Ke.text&&(Ke.text=gt,Ke.escaped=!0),Pe--,Pe===0&&Ae()})},0))}),Pe===0&&Ae();return}try{var $e=Q.lex(Ue,ke);return ke.walkTokens&&Je.walkTokens($e,ke.walkTokens),nt.parse($e,ke)}catch(Ke){if(Ke.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,ke.silent)return"<p>An error occurred:</p><pre>"+je(Ke.message+"",!0)+"</pre>";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<ct;wt++)gt[wt]=arguments[wt];var vt=Ue.renderer[$e].apply(ye,gt);return vt===!1&&(vt=Ke.apply(ye,gt)),vt}};for(var Ae in Ue.renderer)Te(Ae);ke.renderer=ye}(),Ue.tokenizer&&function(){var ye=Je.defaults.tokenizer||new Ee,Te=function($e){var Ke=ye[$e];ye[$e]=function(){for(var ct=arguments.length,gt=new Array(ct),wt=0;wt<ct;wt++)gt[wt]=arguments[wt];var vt=Ue.tokenizer[$e].apply(ye,gt);return vt===!1&&(vt=Ke.apply(ye,gt)),vt}};for(var Ae in Ue.tokenizer)Te(Ae);ke.tokenizer=ye}(),Ue.walkTokens){var Ie=Je.defaults.walkTokens;ke.walkTokens=function(ye){Ue.walkTokens(ye),Ie&&Ie(ye)}}Je.setOptions(ke)},Je.walkTokens=function(Ue,ke){for(var Ie=f(Ue),ye;!(ye=Ie()).done;){var Te=ye.value;ke(Te);switch(Te.type){case"table":{for(var Ae=f(Te.tokens.header),Pe;!(Pe=Ae()).done;){var $e=Pe.value;Je.walkTokens($e,ke)}for(var Ke=f(Te.tokens.cells),ct;!(ct=Ke()).done;)for(var gt=ct.value,wt=f(gt),vt;!(vt=wt()).done;){var It=vt.value;Je.walkTokens(It,ke)}break}case"list":{Je.walkTokens(Te.items,ke);break}default:Te.tokens&&Je.walkTokens(Te.tokens,ke)}}},Je.Parser=nt,Je.parser=nt.parse,Je.Renderer=ge,Je.TextRenderer=Re,Je.Lexer=Q,Je.lexer=Q.lex,Je.Tokenizer=Ee,Je.Slugger=Ze,Je.parse=Je;var tt=Je;return tt})},"DlR+":function(I,J,P){var M=P("MFOe"),u=M.Global,_=M.trim;I.exports={name:"cookieStorage",read:f,write:C,each:l,remove:v,clearAll:o};var D=u.document;function f(r){if(!r||!a(r))return null;var h="(?:^|.*;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(D.cookie.replace(new RegExp(h),"$1"))}function l(r){for(var h=D.cookie.split(/; ?/g),m=h.length-1;m>=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<C[0]>>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0<C[1]>>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0<C[2]>>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0<C[3]>>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0<C[4]>>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0<C[5]>>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0<C[6]>>>0?1:0)|0,this._b=h[7]>>>0<C[7]>>>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<w.length;g++){var c=w.charAt(g),n="'"+c+"'";f[n]||(f[n]=C(c))}}l(u.pairs+"`");function C(w){return function(g){return h(g,w)}}function v(w){var g=w.state.closeBrackets;if(!g||g.override)return g;var c=w.getModeAt(w.getCursor());return c.closeBrackets||g}function o(w){var g=v(w);if(!g||w.getOption("disableInput"))return M.Pass;for(var c=D(g,"pairs"),n=w.listSelections(),s=0;s<n.length;s++){if(!n[s].empty())return M.Pass;var d=m(w,n[s].head);if(!d||c.indexOf(d)%2!=0)return M.Pass}for(var s=n.length-1;s>=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;s<n.length;s++){if(!n[s].empty())return M.Pass;var d=m(w,n[s].head);if(!d||c.indexOf(d)%2!=0)return M.Pass}w.operation(function(){var S=w.lineSeparator()||`
|
|
|
`;w.replaceSelection(S+S,null),w.execCommand("goCharLeft"),n=w.listSelections();for(var y=0;y<n.length;y++){var i=n[y].head.line;w.indentLine(i,null,!0),w.indentLine(i+1,null,!0)}})}function r(w){var g=M.cmpPos(w.anchor,w.head)>0;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<i.length;b++){var E=i[b],x=E.head,T,N=w.getRange(x,_(x.line,x.ch+1));if(k&&!E.empty())T="surround";else if((y||!k)&&N==g)y&&p(w,x)?T="both":S.indexOf(g)>=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<W.length;K++)W[K]=L+W[K]+V;w.replaceSelections(W,"around"),W=w.listSelections().slice();for(var K=0;K<W.length;K++)W[K]=r(W[K]);w.setSelections(W)}else O=="both"?(w.replaceSelection(L+V,null),w.triggerElectric(L+V),w.execCommand("goCharLeft")):O=="addFour"&&(w.replaceSelection(L+L+L+L,"before"),w.execCommand("goCharRight"))})}function m(w,g){var c=w.getRange(_(g.line,g.ch-1),_(g.line,g.ch+1));return c.length==2?c:null}function p(w,g){var c=w.getTokenAt(_(g.line,g.ch+1));return/\bstring/.test(c.type)&&c.start==g.ch&&(g.ch==0||!/\bstring/.test(w.getTokenTypeAt(g)))}})},ELcG:function(I,J,P){(function(M,u){I.exports=J=u(P("Ib8C"))})(this,function(M){/** @preserve
|
|
|
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
|
|
|
|
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
|
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
*/return function(u){var _=M,D=_.lib,f=D.WordArray,l=D.Hasher,C=_.algo,v=f.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=f.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),a=f.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),r=f.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=f.create([0,1518500249,1859775393,2400959708,2840853838]),m=f.create([1352829926,1548603684,1836072691,2053994217,0]),p=C.RIPEMD160=l.extend({_doReset:function(){this._hash=f.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(S,y){for(var i=0;i<16;i++){var k=y+i,O=S[k];S[k]=(O<<8|O>>>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<<y|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<a;m+=3)for(var p=o[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<a;n++)h.push(r.charAt(c>>>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<a.length;h++)r[a.charCodeAt(h)]=h}var m=a.charAt(64);if(m){var p=v.indexOf(m);p!==-1&&(o=p)}return C(v,o,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function C(v,o,a){for(var r=[],h=0,m=0;m<o;m++)if(m%4){var p=a[v.charCodeAt(m-1)]<<m%4*2,w=a[v.charCodeAt(m)]>>>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<v;a++)o[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<arguments.length;F++){var B=arguments[F];for(var H in B)Object.prototype.hasOwnProperty.call(B,H)&&(G[H]=B[H])}return G},c=function(){function G(F,B){var H=[],q=!0,re=!1,ee=void 0;try{for(var Ce=F[Symbol.iterator](),Ee;!(q=(Ee=Ce.next()).done)&&!(H.push(Ee.value),B&&H.length===B);q=!0);}catch(pe){re=!0,ee=pe}finally{try{!q&&Ce.return&&Ce.return()}finally{if(re)throw ee}}return H}return function(F,B){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return G(F,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=function(){function G(F,B){for(var H=0;H<B.length;H++){var q=B[H];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(F,q.key,q)}}return function(F,B,H){return B&&G(F.prototype,B),H&&G(F,H),F}}();function s(G,F,B){return F in G?Object.defineProperty(G,F,{value:B,enumerable:!0,configurable:!0,writable:!0}):G[F]=B,G}function d(G,F){var B={};for(var H in G){if(F.indexOf(H)>=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<ee;Ee++)Ce[Ee]=arguments[Ee];return re=(H=(q=y(this,(B=F.__proto__||Object.getPrototypeOf(F)).call.apply(B,[this].concat(Ce))),q),q.state={uid:a()},q.reqs={},q.onChange=function(pe){var Me=pe.target.files;q.uploadFiles(Me),q.reset()},q.onClick=function(pe){var Me=q.fileInput;if(!Me)return;var _e=q.props,he=_e.children,ce=_e.onClick;he&&he.type==="button"&&(Me.parentNode.focus(),Me.parentNode.querySelector("button").blur()),Me.click(),ce&&ce(pe)},q.onKeyDown=function(pe){pe.key==="Enter"&&q.onClick()},q.onFileDrop=function(pe){var Me=q.props.multiple;if(pe.preventDefault(),pe.type==="dragover")return;if(q.props.directory)w(Array.prototype.slice.call(pe.dataTransfer.items),q.uploadFiles,function(he){return h(he,q.props.accept)});else{var _e=Array.prototype.slice.call(pe.dataTransfer.files).filter(function(he){return h(he,q.props.accept)});Me===!1&&(_e=_e.slice(0,1)),q.uploadFiles(_e)}},q.uploadFiles=function(pe){var Me=Array.prototype.slice.call(pe);Me.map(function(_e){return _e.uid=a(),_e}).forEach(function(_e){q.upload(_e,Me)})},q.saveFileInput=function(pe){q.fileInput=pe},H),y(q,re)}return n(F,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(H,q){var re=this,ee=this.props;if(!ee.beforeUpload)return setTimeout(function(){return re.post(H)},0);var Ce=ee.beforeUpload(H,q);Ce&&Ce.then?Ce.then(function(Ee){var pe=Object.prototype.toString.call(Ee);return pe==="[object File]"||pe==="[object Blob]"?re.post(Ee):re.post(H)}).catch(function(Ee){console.log(Ee)}):Ce!==!1&&setTimeout(function(){return re.post(H)},0);return}},{key:"post",value:function(H){var q=this;if(!this._isMounted)return;var re=this.props,ee=re.onStart,Ce=re.onProgress,Ee=re.transformFile,pe=Ee===void 0?function(Me){return Me}:Ee;new Promise(function(Me){var _e=re.action;return typeof _e=="function"&&(_e=_e(H)),Me(_e)}).then(function(Me){var _e=H.uid,he=re.customRequest||C,ce=Promise.resolve(pe(H)).then(function(oe){var Se=re.data;return typeof Se=="function"&&(Se=Se(oe)),Promise.all([oe,Se])}).catch(function(oe){console.error(oe)});ce.then(function(oe){var Se=c(oe,2),te=Se[0],ue=Se[1],Oe={action:Me,filename:re.name,data:ue,file:te,headers:re.headers,withCredentials:re.withCredentials,method:re.method||"post",onProgress:Ce?function(le){Ce(le,H)}:null,onSuccess:function(Q,Y){delete q.reqs[_e],re.onSuccess(Q,H,Y)},onError:function(Q,Y){delete q.reqs[_e],re.onError(Q,Y,H)}};ee(H),q.reqs[_e]=he(Oe)})})}},{key:"reset",value:function(){this.setState({uid:a()})}},{key:"abort",value:function(H){var q=this.reqs;if(H){var re=H;H&&H.uid&&(re=H.uid),q[re]&&q[re].abort&&q[re].abort(),delete q[re]}else Object.keys(q).forEach(function(ee){q[ee]&&q[ee].abort&&q[ee].abort(),delete q[ee]})}},{key:"render",value:function(){var H,q=this.props,re=q.component,ee=q.prefixCls,Ce=q.className,Ee=q.disabled,pe=q.id,Me=q.style,_e=q.multiple,he=q.accept,ce=q.children,oe=q.directory,Se=q.openFileDialogOnClick,te=q.onMouseEnter,ue=q.onMouseLeave,Oe=d(q,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),le=D()((H={},s(H,ee,!0),s(H,ee+"-disabled",Ee),s(H,Ce,Ce),H)),Q=Ee?{}:{onClick:Se?this.onClick:function(){},onKeyDown:Se?this.onKeyDown:function(){},onMouseEnter:te,onMouseLeave:ue,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return u.a.createElement(re,g({},Q,{className:le,role:"button",style:Me}),u.a.createElement("input",g({},k(Oe),{id:pe,type:"file",ref:this.saveFileInput,onClick:function(Z){return Z.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:he,directory:oe?"directory":null,webkitdirectory:oe?"webkitdirectory":null,multiple:_e,onChange:this.onChange})),ce)}}]),F}(M.Component),b=O,E=Object.assign||function(G){for(var F=1;F<arguments.length;F++){var B=arguments[F];for(var H in B)Object.prototype.hasOwnProperty.call(B,H)&&(G[H]=B[H])}return G},x=function(){function G(F,B){for(var H=0;H<B.length;H++){var q=B[H];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(F,q.key,q)}}return function(F,B,H){return B&&G(F.prototype,B),H&&G(F,H),F}}();function T(G,F){if(!(G instanceof F))throw new TypeError("Cannot call a class as a function")}function N(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 j(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)}function L(){}var V=function(G){j(F,G);function F(){var B,H,q,re;T(this,F);for(var ee=arguments.length,Ce=Array(ee),Ee=0;Ee<ee;Ee++)Ce[Ee]=arguments[Ee];return re=(H=(q=N(this,(B=F.__proto__||Object.getPrototypeOf(F)).call.apply(B,[this].concat(Ce))),q),q.saveUploader=function(pe){q.uploader=pe},H),N(q,re)}return x(F,[{key:"abort",value:function(H){this.uploader.abort(H)}},{key:"render",value:function(){return u.a.createElement(b,E({},this.props,{ref:this.saveUploader}))}}]),F}(M.Component);V.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:L,onError:L,onSuccess:L,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var K=V,W=J.a=K},HmJG:function(I,J,P){},IBYe:function(I,J,P){"use strict";function M(u){return null}J.a=M},Ib8C:function(I,J,P){(function(M){(function(u,_){I.exports=J=_()})(this,function(){var u=u||function(_,D){var f;if(typeof window!="undefined"&&window.crypto&&(f=window.crypto),typeof self!="undefined"&&self.crypto&&(f=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(f=globalThis.crypto),!f&&typeof window!="undefined"&&window.msCrypto&&(f=window.msCrypto),!f&&typeof M!="undefined"&&M.crypto&&(f=M.crypto),!f&&!0)try{f=P(4)}catch(s){}var l=function(){if(f){if(typeof f.getRandomValues=="function")try{return f.getRandomValues(new Uint32Array(1))[0]}catch(s){}if(typeof f.randomBytes=="function")try{return f.randomBytes(4).readInt32LE()}catch(s){}}throw new Error("Native crypto module could not be used to get secure random number.")},C=Object.create||function(){function s(){}return function(d){var S;return s.prototype=d,S=new s,s.prototype=null,S}}(),v={},o=v.lib={},a=o.Base=function(){return{extend:function(s){var d=C(this);return s&&d.mixIn(s),(!d.hasOwnProperty("init")||this.init===d.init)&&(d.init=function(){d.$super.init.apply(this,arguments)}),d.init.prototype=d,d.$super=this,d},create:function(){var s=this.extend();return s.init.apply(s,arguments),s},init:function(){},mixIn:function(s){for(var d in s)s.hasOwnProperty(d)&&(this[d]=s[d]);s.hasOwnProperty("toString")&&(this.toString=s.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),r=o.WordArray=a.extend({init:function(s,d){s=this.words=s||[],d!=D?this.sigBytes=d:this.sigBytes=s.length*4},toString:function(s){return(s||m).stringify(this)},concat:function(s){var d=this.words,S=s.words,y=this.sigBytes,i=s.sigBytes;if(this.clamp(),y%4)for(var k=0;k<i;k++){var O=S[k>>>2]>>>24-k%4*8&255;d[y+k>>>2]|=O<<24-(y+k)%4*8}else for(var b=0;b<i;b+=4)d[y+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<s;S+=4)d.push(l());return new r.init(d,s)}}),h=v.enc={},m=h.Hex={stringify:function(s){for(var d=s.words,S=s.sigBytes,y=[],i=0;i<S;i++){var k=d[i>>>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<d;y+=2)S[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<S;i++){var k=d[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<d;y++)S[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<E;T+=k)this._doProcessBlock(y,T);d=y.splice(0,E),S.sigBytes-=x}return new r.init(d,x)},clone:function(){var s=a.clone.call(this);return s._data=this._data.clone(),s},_minBufferSize:0}),c=o.Hasher=g.extend({cfg:a.extend(),init:function(s){this.cfg=this.cfg.extend(s),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(s){return this._append(s),this._process(),this},finalize:function(s){s&&this._append(s);var d=this._doFinalize();return d},blockSize:512/32,_createHelper:function(s){return function(d,S){return new s.init(S).finalize(d)}},_createHmacHelper:function(s){return function(d,S){return new n.HMAC.init(s,S).finalize(d)}}}),n=v.algo={};return v}(Math);return u})}).call(this,P("IyRk"))},J66h:function(I,J,P){(function(M){var u,_;(function(D,f){I.exports=f(D)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof M!="undefined"?M:this,function(D){"use strict";D=D||{};var f=D.Base64,l="2.6.4",C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v=function(L){for(var V={},K=0,W=L.length;K<W;K++)V[L.charAt(K)]=K;return V}(C),o=String.fromCharCode,a=function(L){if(L.length<2){var V=L.charCodeAt(0);return V<128?L:V<2048?o(192|V>>>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<G;W+=3){var F=L[W],B=L[W+1],H=L[W+2],q=F<<16|B<<8|H;K+=C.charAt(q>>>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.length<g;){r&&m.update(r),r=m.update(o).finalize(a),m.reset();for(var n=1;n<c;n++)r=m.finalize(r),m.reset();p.concat(r)}return p.sigBytes=g*4,p}});u.EvpKDF=function(o,a,r){return v.create(r).compute(o,a)}}(),M.EvpKDF})},KhGG:function(I,J,P){"use strict";P.d(J,"a",function(){return i}),P.d(J,"c",function(){return O});var M=P("0Owb"),u=P("miYZ"),_=P("tsqr"),D=P("oBTY"),f=P("tJVT"),l=P("PpiC"),C=P("k1fw"),v=P("9og8"),o=P("DZo9"),a=P("8z0m"),r=P("WmNS"),h=P.n(r),m=P("q1tI"),p=P.n(m),w=P("ErOA"),g=P("NFKh"),c=P.n(g),n=P("7Cbv"),s=P("9kvl"),d=P("mxV5"),S=P.n(d),y=a.a.Dragger,i=function(x){var T="bf3c199c2470cb477d907b1e0917c17b",N="5183666c72eec9e4",j=c.a.enc.Utf8.parse(T),L=c.a.enc.Utf8.parse(N),V=c.a.AES.decrypt(x,j,{iv:L,mode:c.a.mode.CBC});return V.toString(c.a.enc.Utf8)},k,O=function(){var E=Object(v.a)(h.a.mark(function x(T,N,j){var L,V,K,W,G,F,B,H,q;return h.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return N.file_name=T.name,ee.next=3,Object(w.a)("/api/buckets/get_upload_token.json",{method:"get"});case 3:return B=ee.sent,console.log("decrypt(res.data):",i(B.data)),B.data=JSON.parse(i(B.data)),H=Object(n.a)(),q=new S.a({endpoint:B==null||((L=B.data)===null||L===void 0)?void 0:L.end_point,region:B==null||((V=B.data)===null||V===void 0)?void 0:V.region,accessKeyId:B==null||((K=B.data)===null||K===void 0)?void 0:K.access_key_id,accessKeySecret:B==null||((W=B.data)===null||W===void 0)?void 0:W.access_key_secret,bucket:B==null||((G=B.data)===null||G===void 0)?void 0:G.bucket,stsToken:B==null||((F=B.data)===null||F===void 0)?void 0:F.security_token}),ee.abrupt("return",new Promise(function(Ce,Ee){var pe;q.multipartUpload("".concat(H),new Blob([T],{type:T.type}),Object(C.a)(Object(C.a)({timeout:200*1e3,partSize:102400},j),{},{callback:{url:B==null||((pe=B.data)===null||pe===void 0)?void 0:pe.callback_url,host:B==null?void 0:B.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(w.e)(N)}})).then(function(Me){var _e;T.response=(_e=Me.data)===null||_e===void 0?void 0:_e.data,Ce(Me==null?void 0:Me.data)}).catch(function(Me){Ee(Me),console.log("err:",Me)})}));case 9:case"end":return ee.stop()}},x)}));return function(T,N,j){return E.apply(this,arguments)}}(),b=function(x){var T=x.user,N=x.cancelUpload,j=Object(l.a)(x,["user","cancelUpload"]),L=Object(m.useState)([]),V=Object(f.a)(L,2),K=V[0],W=V[1],G=Object(m.useState)(),F=Object(f.a)(G,2),B=F[0],H=F[1],q={onRemove:function(Ce){W(Object(D.a)(K.filter(function(Ee){return Ee.name!==Ce.name}))),j.onChange(K.filter(function(Ee){return Ee.name!==Ce.name}))},disabled:j.disabled,multiple:!0,fileList:K==null?void 0:K.map(function(ee){return ee.file}),customRequest:function(){},beforeUpload:function(){var ee=Object(v.a)(h.a.mark(function Ee(pe){var Me;return h.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:if(Me=j.maxSize||1024*1024*1024*1,!K.filter(function(ce){return ce.name===pe.name}).length){he.next=4;break}return _.b.info("".concat(pe.name,"\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9")),he.abrupt("return");case 4:if(!((pe==null?void 0:pe.size)>Me)){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;ye<Ie;ye+=1){var Te=(Ue+ye*ke+Ie)%Ie,Ae=Re[Te],Pe=Ae.group,$e=Ae.data;if(!Pe&&!$e.disabled)return Te}return-1},ut=f.useState(function(){return nt(0)}),ot=Object(v.a)(ut,2),je=ot[0],De=ot[1],rt=function(Ue){De(Ue);var ke=Re[Ue];if(!ke){Y(null,-1);return}Y(ke.data.value,Ue)};f.useEffect(function(){rt(he!==!1?nt(0):-1)},[Re.length,Me]),f.useEffect(function(){var tt=setTimeout(function(){if(!_e&&te&&pe.size===1){var Ue=Array.from(pe)[0],ke=Re.findIndex(function(Ie){var ye=Ie.data;return ye.value===Ue});rt(ke),et(ke)}});return function(){return clearTimeout(tt)}},[te]);var lt=function(Ue){Ue!==void 0&&le(Ue,{selected:!pe.has(Ue)}),_e||Q(!1)};if(f.useImperativeHandle(q,function(){return{onKeyDown:function(Ue){var ke=Ue.which;switch(ke){case o.a.UP:case o.a.DOWN:{var Ie=0;if(ke===o.a.UP?Ie=-1:ke===o.a.DOWN&&(Ie=1),Ie!==0){var ye=nt(je+Ie,Ie);et(ye),rt(ye)}break}case o.a.ENTER:{var Te=Re[je];Te&&!Te.data.disabled?lt(Te.data.value):lt(void 0),te&&Ue.preventDefault();break}case o.a.ESC:Q(!1)}},onKeyUp:function(){},scrollTo:function(Ue){et(Ue)}}}),Re.length===0)return f.createElement("div",{role:"listbox",id:"".concat(ee,"_list"),className:"".concat(ge,"-empty"),onMouseDown:qe},Se);function Je(tt){var Ue=Re[tt];if(!Ue)return null;var ke=Ue.data||{},Ie=ke.value,ye=ke.label,Te=ke.children,Ae=Object(a.a)(ke,!0),Pe=Ee?Te:ye;return Ue?f.createElement("div",Object.assign({"aria-label":typeof Pe=="string"?Pe:null},Ae,{key:tt,role:"option",id:"".concat(ee,"_list_").concat(tt),"aria-selected":pe.has(Ie)}),Ie):null}return f.createElement(f.Fragment,null,f.createElement("div",{role:"listbox",id:"".concat(ee,"_list"),style:{height:0,width:0,overflow:"hidden"}},Je(je-1),Je(je),Je(je+1)),f.createElement(p.a,{itemKey:"key",ref:Ze,data:Re,height:ce,itemHeight:oe,fullHeight:!1,onMouseDown:qe,onScroll:Z,virtual:Oe,onMouseEnter:be},function(tt,Ue){var ke,Ie=tt.group,ye=tt.groupOption,Te=tt.data,Ae=Te.label,Pe=Te.key;if(Ie)return f.createElement("div",{className:m()(ge,"".concat(ge,"-group"))},Ae!==void 0?Ae:Pe);var $e=Te.disabled,Ke=Te.value,ct=Te.title,gt=Te.children,wt=Te.style,vt=Te.className,It=Object(C.a)(Te,["disabled","value","title","children","style","className"]),Lt=pe.has(Ke),_t="".concat(ge,"-option"),rr=m()(ge,_t,vt,(ke={},Object(l.a)(ke,"".concat(_t,"-grouped"),ye),Object(l.a)(ke,"".concat(_t,"-active"),je===Ue&&!$e),Object(l.a)(ke,"".concat(_t,"-disabled"),$e),Object(l.a)(ke,"".concat(_t,"-selected"),Lt),ke)),sr=Ee?gt:Ae,$t=!ue||typeof ue=="function"||Lt;return f.createElement("div",Object.assign({},It,{"aria-selected":Lt,className:rr,title:ct,onMouseMove:function(){if(je===Ue||$e)return;rt(Ue)},onClick:function(){$e||lt(Ke)},style:wt}),f.createElement("div",{className:"".concat(_t,"-content")},sr||Ke),f.isValidElement(ue)||Lt,$t&&f.createElement(w.a,{className:"".concat(ge,"-option-state"),customizeIcon:ue,customizeIconProps:{isSelected:Lt}},Lt?"\u2713":null))}))},c=f.forwardRef(g);c.displayName="OptionList";var n=c,s=function(){return null};s.isSelectOption=!0;var d=s,S=function(){return null};S.isSelectOptGroup=!0;var y=S,i=P("VTBJ"),k=P("Zm9Q");function O(B){var H=B.key,q=B.props,re=q.children,ee=q.value,Ce=Object(C.a)(q,["children","value"]);return Object(i.a)({key:H,value:ee!==void 0?ee:H,children:re},Ce)}function b(B){var H=arguments.length>1&&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<arguments.length;y++)r(Object(arguments[y]),function(i,k){n[k]=i});return n}}function C(){if(Object.create)return function(s,d,S,y){var i=a(arguments,1);return u.apply(this,[Object.create(s)].concat(i))};{function c(){}return function(s,d,S,y){var i=a(arguments,1);return c.prototype=s,u.apply(this,[new c].concat(i))}}}function v(){return String.prototype.trim?function(n){return String.prototype.trim.call(n)}:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function o(c,n){return function(){return n.apply(c,Array.prototype.slice.call(arguments,0))}}function a(c,n){return Array.prototype.slice.call(c,n||0)}function r(c,n){m(c,function(s,d){return n(s,d),!1})}function h(c,n){var s=p(c)?[]:{};return m(c,function(d,S){return s[S]=n(d,S),!1}),s}function m(c,n){if(p(c)){for(var s=0;s<c.length;s++)if(n(c[s],s))return c[s]}else for(var d in c)if(c.hasOwnProperty(d)&&n(c[d],d))return c[d]}function p(c){return c!=null&&typeof c!="function"&&typeof c.length=="number"}function w(c){return c&&{}.toString.call(c)==="[object Function]"}function g(c){return c&&{}.toString.call(c)==="[object Object]"}}).call(this,P("IyRk"))},MlIO: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.Base,l=D.WordArray,C=_.x64={},v=C.Word=f.extend({init:function(a,r){this.high=a,this.low=r}}),o=C.WordArray=f.extend({init:function(a,r){a=this.words=a||[],r!=u?this.sigBytes=r:this.sigBytes=a.length*8},toX32:function(){for(var a=this.words,r=a.length,h=[],m=0;m<r;m++){var p=a[m];h.push(p.high),h.push(p.low)}return l.create(h,this.sigBytes)},clone:function(){for(var a=f.clone.call(this),r=a.words=this.words.slice(0),h=r.length,m=0;m<h;m++)r[m]=r[m].clone();return a}})}(),M})},NFKh:function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("MlIO"),P("F+F2"),P("qM6L"),P("ETIr"),P("wbyO"),P("cv67"),P("3y9D"),P("lPiR"),P("GRuw"),P("1uat"),P("uGsb"),P("5hvy"),P("ELcG"),P("WYAk"),P("e7zE"),P("K3mO"),P("OLod"),P("ALsQ"),P("9OqN"),P("qu8F"),P("S6kV"),P("gb/T"),P("qBft"),P("oRuE"),P("jO9C"),P("KmYQ"),P("uGxW"),P("bQjk"),P("wZgz"),P("pA7S"),P("w7YG"),P("E4JC"),P("PVpz"))})(this,function(M){return M})},NvD2:function(I,J,P){"use strict";P.d(J,"a",function(){return l});var M=P("Kwbf");function u(C,v){var o=new Set;return C.forEach(function(a){v.has(a)||o.add(a)}),o}function _(C){var v=C||{},o=v.disabled,a=v.disableCheckbox,r=v.checkable;return!!(o||a)||r===!1}function D(C,v,o,a){for(var r=new Set(C),h=new Set,m=0;m<=o;m+=1){var p=v.get(m)||new Set;p.forEach(function(n){var s=n.key,d=n.node,S=n.children,y=S===void 0?[]:S;r.has(s)&&!a(d)&&y.filter(function(i){return!a(i.node)}).forEach(function(i){r.add(i.key)})})}for(var w=new Set,g=o;g>=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<L;W++)N[j+W]^=V[W]}return x}(),n=_.pad={},s=n.Pkcs7={pad:function(x,T){for(var N=T*4,j=N-x.sigBytes%N,L=j<<24|j<<16|j<<8|j,V=[],K=0;K<j;K+=4)V.push(L);var W=l.create(V,j);x.concat(W)},unpad:function(x){var T=x.words[x.sigBytes-1>>>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(".concat(vr.content_type,")")):vr.content_type.indexOf("video")>-1?de.replaceSelection('<video width="100%" controls src="'.concat(T.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):vr.content_type.indexOf("pdf")>-1?de.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(vr.id,"?type=").concat(vr.content_type,'&disposition=inline" target="_blank">').concat(vr.name,"</a>")):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(".concat(Rr.content_type,")")):(mr==null||((mi=mr.type)===null||mi===void 0)?void 0:mi.indexOf("video"))>-1?Ft.replaceSelection('<video width="100%" controls src="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Rr.id,'"></video>')):(mr==null||((qn=mr.type)===null||qn===void 0)?void 0:qn.indexOf("pdf"))>-1?Ft.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Rr.id,"?type=").concat(mr.type,'&disposition=inline" target="_blank">').concat(mr.name,"</a>")):Te.includes(ji)?Ft.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Rr.id,'?type=office&disposition=inline" target="_blank">').concat(mr.name,"</a>")):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(".concat(Rr.content_type,")")):(mr==null||((mi=mr.type)===null||mi===void 0)?void 0:mi.indexOf("video"))>-1?Ft.replaceSelection('<video width="100%" controls src="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Rr.id,'"></video>')):(mr==null||((qn=mr.type)===null||qn===void 0)?void 0:qn.indexOf("pdf"))>-1?Ft.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Rr.id,"?type=").concat(mr.type,'&disposition=inline" target="_blank">').concat(mr.name,"</a>")):Te.includes(ji)?Ft.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Rr.id,'?type=office&disposition=inline" target="_blank">').concat(mr.name,"</a>")):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;vr<xr.length;vr++)Vr(vr)}}),ie(Ft),function(){Ft.off("paste",Jt)}}},[]);var Di=Object(r.useCallback)(function(){if(_r.current)try{}catch(Ft){console.log(Ft,"---- to set md editor body height")}},[Qn,_r,Qt]);Object(r.useEffect)(function(){function Ft(){var Gt=new w.default(function(hr){var xr=Object(_.a)(hr),Vr;try{for(xr.s();!(Vr=xr.n()).done;){var vr=Vr.value;(vr.target.offsetHeight>0||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);Gt<hr.length;Gt++){var xr;Jt()}return Tr.current=setInterval(function(){qr.current&&Hn()},4e3),function(){clearInterval(Tr.current);var Vr=Object(_.a)(Ft),vr;try{for(Vr.s();!(vr=Vr.n()).done;){var _n=vr.value;de.removeKeyMap(_n)}}catch(zn){Vr.e(zn)}finally{Vr.f()}}}},[de]),Object(r.useEffect)(function(){Nt!==Qt&&Kr(Nt)},[Nt]),Object(ot.a)(function(){if(!Tt&&En>0){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(`<br/>
|
|
|
`),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||"",'" )')):Vr.indexOf("type=application/pdf")>-1?de.replaceSelection('<a href="'.concat(Vr,'&disposition=inline" target="_blank">').concat(_n,"</a>")):de.replaceSelection('<a href="'.concat(Vr,'" target="_blank">').concat(_n,"</a>")),de.focus();case et:for(var zn=Ft.row,mr=Ft.col,ji=Ft.align,Rr=`
|
|
|
`,Mn=0;Mn<zn;Mn++){for(var mi=[],qn=[],Pr=0;Pr<mr;Pr++)Mn===1&&qn.push(ut[ji]),mi.push(" ");Mn===1&&(Rr+="| ".concat(qn.join(" | "),` |
|
|
|
`)),Rr+="| ".concat(mi.join(mr===1?"":" | "),` |
|
|
|
`)}return de.replaceSelection(Rr+`
|
|
|
`),de.focus();default:throw new Error}},[de,nr]),Si=Object(r.useMemo)(function(){switch(nr){case Re:return h.a.createElement(re,{callback:Zn,onCancel:jn});case qe:return h.a.createElement(ee.b,{callback:Zn,onCancel:jn});case Ze:return h.a.createElement(ce,{callback:Zn,onCancel:jn});case et:return h.a.createElement(Z,{callback:Zn,onCancel:jn});default:return null}},[nr]);function jn(){dr("")}Object(r.useEffect)(function(){if(fi.current){var Ft=fi.current,Jt=!1,Gt=0;function hr(vr){Jt=!0,Gt=vr.pageY}function xr(){Jt=!1}function Vr(vr){if(Jt){var _n=vr.pageY-Gt;_n<0&&(_n=0),_n>300&&(_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<C[0]>>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0<C[1]>>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0<C[2]>>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0<C[3]>>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0<C[4]>>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0<C[5]>>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0<C[6]>>>0?1:0)|0,this._b=h[7]>>>0<C[7]>>>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</"+w+'><iframe src="/favicon.ico"></iframe>'),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<C;a++)D[f+a]^=o[a]}});return u.Decryptor=_,u}(),M.mode.OFB})},"SA+Z":function(I,J,P){var M=P("wTVA"),u=P("EbDI"),_=P("ZhPi"),D=P("wkBT");function f(l){return M(l)||u(l)||_(l)||D()}I.exports=f,I.exports.__esModule=!0,I.exports.default=I.exports},SJMd:function(I,J){/**
|
|
|
* @license
|
|
|
* Copyright (C) 2006 Google Inc.
|
|
|
*
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
* You may obtain a copy of the License at
|
|
|
*
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
*
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
* See the License for the specific language governing permissions and
|
|
|
* limitations under the License.
|
|
|
*/var P,M,u,_=!1,D,f;window.PR_SHOULD_USE_CONTINUATION=!0;var l,C;(function(){var v=window,o=["break,continue,do,else,for,if,return,while"],a=[o,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],r=[a,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],h=[r,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],m=[r,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],p=[r,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],w="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",g=[r,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],c="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",n=[o,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[o,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],d=[o,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[h,p,m,g,c,n,s,d],y=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,i="str",k="kwd",O="com",b="typ",E="lit",x="pun",T="pln",N="tag",j="dec",L="src",V="atn",K="atv",W="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|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;be<ge;++be){var Re=le[be];if(Re.ignoreCase)Z=!0;else if(/[a-z]/i.test(Re.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Y=!0,Z=!1;break}}var Ze={b:8,t:9,n:10,v:11,f:12,r:13};function qe(je){var De=je.charCodeAt(0);if(De!==92)return De;var rt=je.charAt(1);return De=Ze[rt],De||("0"<=rt&&rt<="7"?parseInt(je.substring(1),8):rt==="u"||rt==="x"?parseInt(je.substring(2),16):je.charCodeAt(1))}function et(je){if(je<32)return(je<16?"\\x0":"\\x")+je.toString(16);var De=String.fromCharCode(je);return De==="\\"||De==="-"||De==="]"||De==="^"?"\\"+De:De}function nt(je){var De=je.substring(1,je.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),rt=[],lt=De[0]==="^",Je=["["];lt&&Je.push("^");for(var tt=lt?1:0,Ue=De.length;tt<Ue;++tt){var ke=De[tt];if(/\\[bdsw]/i.test(ke))Je.push(ke);else{var Ie=qe(ke),ye;tt+2<Ue&&De[tt+1]==="-"?(ye=qe(De[tt+2]),tt+=2):ye=Ie,rt.push([Ie,ye]),ye<65||Ie>122||(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;tt<rt.length;++tt){var Pe=rt[tt];Pe[0]<=Ae[1]+1?Ae[1]=Math.max(Ae[1],Pe[1]):Te.push(Ae=Pe)}for(var tt=0;tt<Te.length;++tt){var Pe=Te[tt];Je.push(et(Pe[0])),Pe[1]>Pe[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<rt;++Je){var Ue=De[Je];if(Ue==="(")++tt;else if(Ue.charAt(0)==="\\"){var ke=+Ue.substring(1);ke&&(ke<=tt?lt[ke]=-1:De[Je]=et(ke))}}for(var Je=1;Je<lt.length;++Je)lt[Je]===-1&&(lt[Je]=++Q);for(var Je=0,tt=0;Je<rt;++Je){var Ue=De[Je];if(Ue==="(")++tt,lt[tt]||(De[Je]="(?:");else if(Ue.charAt(0)==="\\"){var ke=+Ue.substring(1);ke&&ke<=tt&&(De[Je]="\\"+lt[ke])}}for(var Je=0;Je<rt;++Je)De[Je]==="^"&&De[Je+1]!=="^"&&(De[Je]="");if(je.ignoreCase&&Y)for(var Je=0;Je<rt;++Je){var Ue=De[Je],Ie=Ue.charAt(0);Ue.length>=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<ge;++be){var Re=le[be];if(Re.global||Re.multiline)throw new Error(""+Re);ot.push("(?:"+ut(Re)+")")}return new RegExp(ot.join("|"),Z?"gi":"g")}function B(le,Q){var Y=/(?:^|\s)nocode(?:\s|$)/,Z=[],be=0,ge=[],Re=0;function Ze(qe){var et=qe.nodeType;if(et==1){if(Y.test(qe.className))return;for(var nt=qe.firstChild;nt;nt=nt.nextSibling)Ze(nt);var ut=qe.nodeName.toLowerCase();(ut==="br"||ut==="li")&&(Z[Re]=`
|
|
|
`,ge[Re<<1]=be++,ge[Re++<<1|1]=qe)}else if(et==3||et==4){var ot=qe.nodeValue;ot.length&&(Q?ot=ot.replace(/\r\n?/g,`
|
|
|
`):ot=ot.replace(/[ \t\r\n]+/g," "),Z[Re]=ot,ge[Re<<1]=be,be+=ot.length,ge[Re++<<1|1]=qe)}}return Ze(le),{sourceCode:Z.join("").replace(/\n$/,""),spans:ge}}function H(le,Q,Y,Z,be){if(!Y)return;var ge={sourceNode:le,pre:1,langExtension:null,numberLines:null,sourceCode:Y,spans:null,basePos:Q,decorations:null};Z(ge),be.push.apply(be,ge.decorations)}var q=/\S/;function re(le){for(var Q=void 0,Y=le.firstChild;Y;Y=Y.nextSibling){var Z=Y.nodeType;Q=Z===1?Q?le:Y:Z===3&&q.test(Y.nodeValue)?le:Q}return Q===le?void 0:Q}function ee(le,Q){var Y={},Z;(function(){for(var Re=le.concat(Q),Ze=[],qe={},et=0,nt=Re.length;et<nt;++et){var ut=Re[et],ot=ut[3];if(ot)for(var je=ot.length;--je>=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<rt;++De){var lt=ot[De],Je=je[lt],tt=void 0,Ue;if(typeof Je=="string")Ue=!1;else{var ke=Y[lt.charAt(0)];if(ke)tt=lt.match(ke[1]),Je=ke[0];else{for(var Ie=0;Ie<be;++Ie)if(ke=Q[Ie],tt=lt.match(ke[1]),tt){Je=ke[0];break}tt||(Je=T)}Ue=Je.length>=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<Ze.length;++nt)qe(Ze[nt]);Q===(Q|0)&&Ze[0].setAttribute("value",Q);var ut=ge.createElement("ol");ut.className="linenums";for(var ot=Math.max(0,Q-1|0)||0,nt=0,je=Ze.length;nt<je;++nt)Re=Ze[nt],Re.className="L"+(nt+ot)%10,Re.firstChild||Re.appendChild(ge.createTextNode("\xA0")),ut.appendChild(Re);le.appendChild(ut)}function Me(le){var Q=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Q=Q&&+Q[1]<=8;var Y=/\n/g,Z=le.sourceCode,be=Z.length,ge=0,Re=le.spans,Ze=Re.length,qe=0,et=le.decorations,nt=et.length,ut=0;et[nt]=be;var ot,je;for(je=ot=0;je<nt;)et[je]!==et[je+2]?(et[ot++]=et[je++],et[ot++]=et[je++]):je+=2;for(nt=ot,je=ot=0;je<nt;){for(var De=et[je],rt=et[je+1],lt=je+2;lt+2<=nt&&et[lt+1]===rt;)lt+=2;et[ot++]=De,et[ot++]=rt,je=lt}nt=et.length=ot;var Je=le.sourceNode,tt="";Je&&(tt=Je.style.display,Je.style.display="none");try{for(var Ue=null;qe<Ze;){var ke=Re[qe],Ie=Re[qe+2]||be,ye=et[ut+2]||be,lt=Math.min(Ie,ye),Te=Re[qe+1],Ae;if(Te.nodeType!==1&&(Ae=Z.substring(ge,lt))){Q&&(Ae=Ae.replace(Y,"\r")),Te.nodeValue=Ae;var Pe=Te.ownerDocument,$e=Pe.createElement("span");$e.className=et[ut+1];var Ke=Te.parentNode;Ke.replaceChild($e,Te),$e.appendChild(Te),ge<Ie&&(Re[qe+1]=Te=Pe.createTextNode(Z.substring(lt,Ie)),Ke.insertBefore(Te,$e.nextSibling))}ge=lt,ge>=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*</.test(Q)?"default-markup":"default-code"),_e[le]}he(Ee,["default-code"]),he(ee([],[[T,/^[^<?]+/],[j,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),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="<pre>"+le+"</pre>",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<ge.length;++Ze)for(var qe=0,et=ge[Ze].length;qe<et;++qe)Re.push(ge[Ze][qe]);ge=null;var nt=Date;nt.now||(nt={now:function(){return+new Date}});var ut=0,ot=/\blang(?:uage)?-([\w.]+)(?!\S)/,je=/\bprettyprint\b/,De=/\bprettyprinted\b/,rt=/pre|xmp/i,lt=/^code$/i,Je=/^(?:pre|code|xmp)$/i,tt={};function Ue(){for(var ke=v.PR_SHOULD_USE_CONTINUATION?nt.now()+250:Infinity;ut<Re.length&&nt.now()<ke;ut++){for(var Ie=Re[ut],ye=tt,Te=Ie;Te=Te.previousSibling;){var Ae=Te.nodeType,Pe=(Ae===7||Ae===8)&&Te.nodeValue;if(Pe?!/^\??prettify\b/.test(Pe):Ae!==3||/\S/.test(Te.nodeValue))break;if(Pe){ye={},Pe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(cr,Wt,Lr){ye[Wt]=Lr});break}}var $e=Ie.className;if((ye!==tt||je.test($e))&&!De.test($e)){for(var Ke=!1,ct=Ie.parentNode;ct;ct=ct.parentNode){var gt=ct.tagName;if(Je.test(gt)&&ct.className&&je.test(ct.className)){Ke=!0;break}}if(!Ke){Ie.className+=" prettyprinted";var wt=ye.lang;if(!wt){wt=$e.match(ot);var vt;!wt&&(vt=re(Ie))&<.test(vt.tagName)&&(wt=vt.className.match(ot)),wt&&(wt=wt[1])}var It;if(rt.test(Ie.tagName))It=1;else{var Lt=Ie.currentStyle,_t=Z.defaultView,rr=Lt?Lt.whiteSpace:_t&&_t.getComputedStyle?_t.getComputedStyle(Ie,null).getPropertyValue("white-space"):0;It=rr&&rr.substring(0,3)==="pre"}var sr=ye.linenums;(sr=sr==="true"||+sr)||(sr=$e.match(/\blinenums\b(?::(\d+))?/),sr=sr?sr[1]&&sr[1].length?+sr[1]:!0:!1),sr&&pe(Ie,sr,It);var $t={langExtension:wt,sourceNode:Ie,numberLines:sr,pre:It,sourceCode:null,basePos:null,spans:null,decorations:null};oe($t)}}}ut<Re.length?v.setTimeout(Ue,250):typeof le=="function"&&le()}Ue()}var ue=v.PR={createSimpleLexer:ee,registerLangHandler:he,sourceDecorator:Ce,PR_ATTRIB_NAME:V,PR_ATTRIB_VALUE:K,PR_COMMENT:O,PR_DECLARATION:j,PR_KEYWORD:k,PR_LITERAL:E,PR_NOCODE:W,PR_PLAIN:T,PR_PUNCTUATION:x,PR_SOURCE:L,PR_STRING:i,PR_TAG:N,PR_TYPE:b,prettyPrintOne:_?v.prettyPrintOne=Se:l=Se,prettyPrint:C=_?v.prettyPrint=te:C=te},Oe=v.define;typeof Oe=="function"&&Oe.amd&&Oe("google-code-prettify",[],function(){return ue})})()},"VrN/":function(I,J,P){(function(M,u){I.exports=u()})(this,function(){"use strict";var M=navigator.userAgent,u=navigator.platform,_=/gecko\/\d/i.test(M),D=/MSIE \d/.test(M),f=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(M),l=/Edge\/(\d+)/.exec(M),C=D||f||l,v=C&&(D?document.documentMode||6:+(l||f)[1]),o=!l&&/WebKit\//.test(M),a=o&&/Qt\/\d+\.\d+/.test(M),r=!l&&/Chrome\//.test(M),h=/Opera\//.test(M),m=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(M),w=/PhantomJS/.test(M),g=!l&&/AppleWebKit/.test(M)&&/Mobile\/\w+/.test(M),c=/Android/.test(M),n=g||c||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(M),s=g||/Mac/.test(u),d=/\bCrOS\b/.test(M),S=/win/i.test(u),y=h&&M.match(/Version\/(\d*\.\d*)/);y&&(y=Number(y[1])),y&&y>=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.length;++$)U.appendChild(t[$]);return U}function N(e,t,R,A){var U=T(e,t,R,A);return U.setAttribute("role","presentation"),U}var j;document.createRange?j=function(e,t,R,A){var U=document.createRange();return U.setEnd(A||e,R),U.setStart(e,t),U}:j=function(e,t,R){var A=document.body.createTextRange();try{A.moveToElementText(e.parentNode)}catch(U){return A}return A.collapse(!0),A.moveEnd("character",R),A.moveStart("character",t),A};function L(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function V(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function K(e,t){var R=e.className;O(t).test(R)||(e.className+=(R?" ":"")+t)}function W(e,t){for(var R=e.split(" "),A=0;A<R.length;A++)R[A]&&!O(R[A]).test(t)&&(t+=" "+R[A]);return t}var G=function(e){e.select()};g?G=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:C&&(G=function(e){try{e.select()}catch(t){}});function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function B(e,t,R){t||(t={});for(var A in e)e.hasOwnProperty(A)&&(R!==!1||!t.hasOwnProperty(A))&&(t[A]=e[A]);return t}function H(e,t,R,A,U){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var $=A||0,ae=U||0;;){var fe=e.indexOf(" ",$);if(fe<0||fe>=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<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=R)};function re(e,t){for(var R=0;R<e.length;++R)if(e[R]==t)return R;return-1}var ee=50,Ce={toString:function(){return"CodeMirror.Pass"}},Ee={scroll:!1},pe={origin:"*mouse"},Me={origin:"+move"};function _e(e,t,R){for(var A=0,U=0;;){var $=e.indexOf(" ",A);$==-1&&($=e.length);var ae=$-A;if($==e.length||U+ae>=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<e.length;A++)R[A]=t(e[A],A);return R}function te(e,t,R){for(var A=0,U=R(t);A<e.length&&R(e[A])<=U;)A++;e.splice(A,0,t)}function ue(){}function Oe(e,t){var R;return Object.create?R=Object.create(e):(ue.prototype=e,R=new ue),t&&B(t,R),R}var le=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Q(e){return/\w/.test(e)||e>"\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:t<e.length)&&ge(e.charAt(t));)t+=R;return t}function Ze(e,t,R){for(var A=t>R?-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;$<e.length;++$){var ae=e[$];(ae.from<R&&ae.to>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;U<e.length;++U){var $=e[U];if($.from<t&&$.to>t)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<st;++ft)at.push(R(xe.charCodeAt(ft)));for(var yt=0,Ot=Ge;yt<st;++yt){var Dt=at[yt];Dt=="m"?at[yt]=Ot:Ot=Dt}for(var jt=0,kt=Ge;jt<st;++jt){var Bt=at[jt];Bt=="1"&&kt=="r"?at[jt]="n":$.test(Bt)&&(kt=Bt,Bt=="r"&&(at[jt]="R"))}for(var ar=1,qt=at[0];ar<st-1;++ar){var kr=at[ar];kr=="+"&&qt=="1"&&at[ar+1]=="1"?at[ar]="1":kr==","&&qt==at[ar+1]&&(qt=="1"||qt=="n")&&(at[ar]=qt),qt=kr}for(var Tn=0;Tn<st;++Tn){var ci=at[Tn];if(ci==",")at[Tn]="N";else if(ci=="%"){var Un=void 0;for(Un=Tn+1;Un<st&&at[Un]=="%";++Un);for(var Ui=Tn&&at[Tn-1]=="!"||Un<st&&at[Un]=="1"?"1":"N",Mi=Tn;Mi<Un;++Mi)at[Mi]=Ui;Tn=Un-1}}for(var $n=0,Pi=Ge;$n<st;++$n){var vi=at[$n];Pi=="L"&&vi=="1"?at[$n]="L":$.test(vi)&&(Pi=vi)}for(var ai=0;ai<st;++ai)if(U.test(at[ai])){var Jn=void 0;for(Jn=ai+1;Jn<st&&U.test(at[Jn]);++Jn);for(var Wn=(ai?at[ai-1]:Ge)=="L",Ii=(Jn<st?at[Jn]:Ge)=="L",Za=Wn==Ii?Wn?"L":"R":Ge,_a=ai;_a<Jn;++_a)at[_a]=Za;ai=Jn-1}for(var Ei=[],ua,di=0;di<st;)if(ae.test(at[di])){var ps=di;for(++di;di<st&&ae.test(at[di]);++di);Ei.push(new me(0,ps,di))}else{var ga=di,La=Ei.length,Ma=We=="rtl"?1:0;for(++di;di<st&&at[di]!="L";++di);for(var Ai=ga;Ai<di;)if(fe.test(at[Ai])){ga<Ai&&(Ei.splice(La,0,new me(1,ga,Ai)),La+=Ma);var qa=Ai;for(++Ai;Ai<di&&fe.test(at[Ai]);++Ai);Ei.splice(La,0,new me(2,qa,Ai)),La+=Ma,ga=Ai}else++Ai;ga<di&&Ei.splice(La,0,new me(1,ga,di))}return We=="ltr"&&(Ei[0].level==1&&(ua=xe.match(/^\s+/))&&(Ei[0].from=ua[0].length,Ei.unshift(new me(0,0,ua[0].length))),oe(Ei).level==1&&(ua=xe.match(/\s+$/))&&(oe(Ei).to-=ua[0].length,Ei.push(new me(0,st-ua[0].length,st)))),We=="rtl"?Ei.reverse():Ei}}();function ot(e,t){var R=e.order;return R==null&&(R=e.order=ut(e.text,t)),R}var je=[],De=function(e,t,R){if(e.addEventListener)e.addEventListener(t,R,!1);else if(e.attachEvent)e.attachEvent("on"+t,R);else{var A=e._handlers||(e._handlers={});A[t]=(A[t]||je).concat(R)}};function rt(e,t){return e._handlers&&e._handlers[t]||je}function lt(e,t,R){if(e.removeEventListener)e.removeEventListener(t,R,!1);else if(e.detachEvent)e.detachEvent("on"+t,R);else{var A=e._handlers,U=A&&A[t];if(U){var $=re(U,R);$>-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;U<R.length;++U)R[U].apply(null,A)}function tt(e,t,R){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Je(e,R||t.type,e,t),Ae(t)||t.codemirrorIgnore}function Ue(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var R=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),A=0;A<t.length;++A)re(R,t[A])==-1&&R.push(t[A])}function ke(e,t){return rt(e,t).length>0}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.pos<this.string.length)return this.string.charAt(this.pos++)},Rt.prototype.eat=function(e){var t=this.string.charAt(this.pos),R;if(typeof e=="string"?R=t==e:R=t&&(e.test?e.test(t):e(t)),R)return++this.pos,t},Rt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},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.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Rt.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Rt.prototype.match=function(e,t,R){if(typeof e=="string"){var A=function(ae){return R?ae.toLowerCase():ae},U=this.string.substr(this.pos,e.length);if(A(U)==A(e))return t!==!1&&(this.pos+=e.length),!0}else{var $=this.string.slice(this.pos).match(e);return $&&$.index>0?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.children.length;++A){var U=e.children[A],$=U.height;if(t<$){e=U;continue e}t-=$,R+=U.chunkSize()}return R}while(!e.lines);for(var ae=0;ae<e.lines.length;++ae){var fe=e.lines[ae],me=fe.height;if(t<me)break;t-=me}return R+ae}function bn(e,t){return t>=e.first&&t<e.first+e.size}function zr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function mt(e,t,R){if(R===void 0&&(R=null),!(this instanceof mt))return new mt(e,t,R);this.line=e,this.ch=t,this.sticky=R}function Ut(e,t){return e.line-t.line||e.ch-t.ch}function an(e,t){return e.sticky==t.sticky&&Ut(e,t)==0}function xn(e){return mt(e.line,e.ch)}function On(e,t){return Ut(e,t)<0?t:e}function An(e,t){return Ut(e,t)<0?e:t}function se(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function z(e,t){if(t.line<e.first)return mt(e.first,0);var R=e.first+e.size-1;return t.line>R?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;A<t.length;A++)R[A]=z(e,t[A]);return R}var de=function(e,t){this.state=e,this.lookAhead=t},ie=function(e,t,R,A){this.state=t,this.doc=e,this.line=R,this.maxLookAhead=A||0,this.baseTokens=null,this.baseTokenPos=1};ie.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.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;st<at;){var Ot=U[Ge];Ot>at&&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(;yt<Ge;yt+=2){var Dt=U[yt+1];U[yt+1]=(Dt?Dt+" ":"")+"overlay "+ft}},$),R.state=ae,R.baseTokens=null,R.baseTokenPos=1},me=0;me<e.state.overlays.length;++me)fe(me);return{styles:U,classes:$.bgClass||$.textClass?$:null}}function ht(e,t,R){if(!t.styles||t.styles[0]!=e.state.modeGen){var A=St(e,Nt(t)),U=t.text.length>e.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&&xe<U.viewTo?fe.save():null,fe.nextLine()}),R&&(A.modeFrontier=fe.line),fe}function Pt(e,t,R,A){var U=e.doc.mode,$=new Rt(t,e.options.tabSize,R);for($.start=$.pos=A||0,t==""&&pt(U,R.state);!$.eol();)Ht(U,$,R.state),$.start=$.pos}function pt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var R=oi(e,t);if(R.mode.blankLine)return R.mode.blankLine(R.state)}function Ht(e,t,R,A){for(var U=0;U<10;U++){A&&(A[0]=oi(e,R).mode);var $=e.token(t,R);if(t.pos>t.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.pos<t.ch)&&!xe.eol();)xe.start=xe.pos,ae=Ht($,xe,me.state),A&&We.push(new zt(xe,ae,Hr(U.mode,me.state)));return A?We:new zt(xe,ae,me.state)}function on(e,t){if(e)for(;;){var R=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!R)break;e=e.slice(0,R.index)+e.slice(R.index+R[0].length);var A=R[1]?"bgClass":"textClass";t[A]==null?t[A]=R[2]:new RegExp("(?:^|\\s)"+R[2]+"(?:$|\\s)").test(t[A])||(t[A]+=" "+R[2])}return e}function Zr(e,t,R,A,U,$,ae){var fe=R.flattenSpans;fe==null&&(fe=e.options.flattenSpans);var me=0,xe=null,We=new Rt(t,e.options.tabSize,A),Ge,st=e.options.addModeClass&&[null];for(t==""&&on(pt(R,A.state),$);!We.eol();){if(We.pos>e.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(;me<We.start;)me=Math.min(We.start,me+5e3),U(me,xe);xe=Ge}We.start=We.pos}for(;me<We.pos;){var ft=Math.min(We.pos,me+5e3);U(ft,xe),me=ft}}function Qt(e,t,R){for(var A,U,$=e.doc,ae=R?-1:t-(e.doc.mode.innerMode?1e3:100),fe=t;fe>ae;--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.highlightFrontier<t-10)return;for(var R=e.first,A=t-1;A>R;A--){var U=Et(e,A).stateAfter;if(U&&(!(U instanceof de)||A+U.lookAhead<t)){R=A+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,R)}var or=!1,Yt=!1;function nr(){or=!0}function dr(){Yt=!0}function Jr(e,t,R){this.marker=e,this.from=t,this.to=R}function un(e,t){if(e)for(var R=0;R<e.length;++R){var A=e[R];if(A.marker==t)return A}}function En(e,t){for(var R,A=0;A<e.length;++A)e[A]!=t&&(R||(R=[])).push(e[A]);return R}function wi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Vi(e,t,R){var A;if(e)for(var U=0;U<e.length;++U){var $=e[U],ae=$.marker,fe=$.from==null||(ae.inclusiveLeft?$.from<=t:$.from<t);if(fe||$.from==t&&ae.type=="bookmark"&&(!R||!$.marker.insertLeft)){var me=$.to==null||(ae.inclusiveRight?$.to>=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<e.length;++U){var $=e[U],ae=$.marker,fe=$.to==null||(ae.inclusiveRight?$.to>=t:$.to>t);if(fe||$.from==t&&ae.type=="bookmark"&&(!R||$.marker.insertLeft)){var me=$.from==null||(ae.inclusiveLeft?$.from<=t:$.from<t);(A||(A=[])).push(new Jr(ae,me?null:$.from-t,$.to==null?null:$.to-t))}}return A}function Qn(e,t){if(t.full)return null;var R=bn(e,t.from.line)&&Et(e,t.from.line).markedSpans,A=bn(e,t.to.line)&&Et(e,t.to.line).markedSpans;if(!R&&!A)return null;var U=t.from.ch,$=t.to.ch,ae=Ut(t.from,t.to)==0,fe=Vi(R,U,ae),me=Fi(A,$,ae),xe=t.text.length==1,We=oe(t.text).length+(xe?U:0);if(fe)for(var Ge=0;Ge<fe.length;++Ge){var st=fe[Ge];if(st.to==null){var at=un(me,st.marker);at?xe&&(st.to=at.to==null?null:at.to+We):st.to=U}}if(me)for(var ft=0;ft<me.length;++ft){var yt=me[ft];if(yt.to!=null&&(yt.to+=We),yt.from==null){var Ot=un(fe,yt.marker);Ot||(yt.from=We,xe&&(fe||(fe=[])).push(yt))}else yt.from+=We,xe&&(fe||(fe=[])).push(yt)}fe&&(fe=rn(fe)),me&&me!=fe&&(me=rn(me));var Dt=[fe];if(!xe){var jt=t.text.length-2,kt;if(jt>0&&fe)for(var Bt=0;Bt<fe.length;++Bt)fe[Bt].to==null&&(kt||(kt=[])).push(new Jr(fe[Bt].marker,null,null));for(var ar=0;ar<jt;++ar)Dt.push(kt);Dt.push(me)}return Dt}function rn(e){for(var t=0;t<e.length;++t){var R=e[t];R.from!=null&&R.from==R.to&&R.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ri(e,t,R){var A=null;if(e.iter(t.line,R.line+1,function(at){if(at.markedSpans)for(var ft=0;ft<at.markedSpans.length;++ft){var yt=at.markedSpans[ft].marker;yt.readOnly&&(!A||re(A,yt)==-1)&&(A||(A=[])).push(yt)}}),!A)return null;for(var U=[{from:t,to:R}],$=0;$<A.length;++$)for(var ae=A[$],fe=ae.find(0),me=0;me<U.length;++me){var xe=U[me];if(Ut(xe.to,fe.from)<0||Ut(xe.from,fe.to)>0)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;R<t.length;++R)t[R].marker.detachLine(e);e.markedSpans=null}function hi(e,t){if(!t)return;for(var R=0;R<t.length;++R)t[R].marker.attachLine(e);e.markedSpans=t}function Gr(e){return e.inclusiveLeft?-1:0}function ir(e){return e.inclusiveRight?1:0}function qr(e,t){var R=e.lines.length-t.lines.length;if(R!=0)return R;var A=e.find(),U=t.find(),$=Ut(A.from,U.from)||Gr(e)-Gr(t);if($)return-$;var ae=Ut(A.to,U.to)||ir(e)-ir(t);return ae||t.id-e.id}function Tr(e,t){var R=Yt&&e.markedSpans,A;if(R)for(var U=void 0,$=0;$<R.length;++$)U=R[$],U.marker.collapsed&&(t?U.from:U.to)==null&&(!A||qr(A,U.marker)<0)&&(A=U.marker);return A}function dn(e){return Tr(e,!0)}function _r(e){return Tr(e,!1)}function fi(e,t){var R=Yt&&e.markedSpans,A;if(R)for(var U=0;U<R.length;++U){var $=R[U];$.marker.collapsed&&($.from==null||$.from<t)&&($.to==null||$.to>t)&&(!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<ae.length;++fe){var me=ae[fe];if(!me.marker.collapsed)continue;var xe=me.marker.find(0),We=Ut(xe.from,R)||Gr(me.marker)-Gr(U),Ge=Ut(xe.to,A)||ir(me.marker)-ir(U);if(We>=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;U<R.length;++U){if(A=R[U],!A.marker.collapsed)continue;if(A.from==null)return!0;if(A.marker.widgetNode)continue;if(A.from==0&&A.marker.inclusiveLeft&&Ni(e,t,A))return!0}}function Ni(e,t,R){if(R.to==null){var A=R.marker.find(1,!0);return Ni(e,A.line,un(A.line.markedSpans,R.marker))}if(R.marker.inclusiveRight&&R.to==t.text.length)return!0;for(var U=void 0,$=0;$<t.markedSpans.length;++$)if(U=t.markedSpans[$],U.marker.collapsed&&!U.marker.widgetNode&&U.from==R.to&&(U.to==null||U.to!=R.from)&&(U.marker.inclusiveLeft||R.marker.inclusiveRight)&&Ni(e,t,U))return!0}function si(e){e=Hn(e);for(var t=0,R=e.parent,A=0;A<R.lines.length;++A){var U=R.lines[A];if(U==e)break;t+=U.height}for(var $=R.parent;$;R=$,$=R.parent)for(var ae=0;ae<$.children.length;++ae){var fe=$.children[ae];if(fe==R)break;t+=fe.height}return t}function pi(e){if(e.height==0)return 0;for(var t=e.text.length,R,A=e;R=dn(A);){var U=R.find(0,!0);A=U.from.line,t+=U.from.ch-U.to.ch}for(A=e;R=_r(A);){var $=R.find(0,!0);t-=A.text.length-$.from.ch,A=$.to.line,t+=A.text.length-$.to.ch}return t}function Bi(e){var t=e.display,R=e.doc;t.maxLine=Et(R,R.first),t.maxLineLength=pi(t.maxLine),t.maxLineChanged=!0,R.iter(function(A){var U=pi(A);U>t.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;U<e.length;U++){var $=e.charAt(U);$==" "&&R&&(U==e.length-1||e.charCodeAt(U+1)==32)&&($="\xA0"),A+=$,R=$==" "}return A}function _n(e,t){return function(R,A,U,$,ae,fe,me){U=U?U+" cm-force-border":"cm-force-border";for(var xe=R.pos,We=xe+A.length;;){for(var Ge=void 0,st=0;st<t.length&&!(Ge=t[st],Ge.to>xe&&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;ae<R.length;ae+=2)t.addToken(t,U.slice($,$=R[ae]),Gt(R[ae+1],t.cm.options));return}for(var fe=U.length,me=0,xe=1,We="",Ge,st,at=0,ft,yt,Ot,Dt,jt;;){if(at==me){ft=yt=Ot=st="",jt=null,Dt=null,at=Infinity;for(var kt=[],Bt=void 0,ar=0;ar<A.length;++ar){var qt=A[ar],kr=qt.marker;if(kr.type=="bookmark"&&qt.from==me&&kr.widgetNode)kt.push(kr);else if(qt.from<=me&&(qt.to==null||qt.to>me||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<Bt.length;ci+=2)Bt[ci+1]==at&&(yt+=" "+Bt[ci]);if(!Dt||Dt.from==me)for(var Un=0;Un<kt.length;++Un)zn(t,0,kt[Un]);if(Dt&&(Dt.from||0)==me){if(zn(t,(Dt.to==null?fe+1:Dt.to)-me,Dt.marker,Dt.from==null),Dt.to==null)return;Dt.to==me&&(Dt=!1)}}if(me>=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;$<R;$=U){var ae=new ji(e.doc,Et(e.doc,$),$);U=$+ae.size,A.push(ae)}return A}var Mn=null;function mi(e){Mn?Mn.ops.push(e):e.ownsGroup=Mn={ops:[e],delayedCallbacks:[]}}function qn(e){var t=e.delayedCallbacks,R=0;do{for(;R<t.length;R++)t[R].call(null);for(var A=0;A<e.ops.length;A++){var U=e.ops[A];if(U.cursorActivityHandlers)for(;U.cursorActivityCalled<U.cursorActivityHandlers.length;)U.cursorActivityHandlers[U.cursorActivityCalled++].call(null,U.cm)}}while(R<t.length)}function Pr(e,t){var R=e.ownsGroup;if(!R)return;try{qn(R)}finally{Mn=null,t(R)}}var Dr=null;function Er(e,t){var R=rt(e,t);if(!R.length)return;var A=Array.prototype.slice.call(arguments,2),U;Mn?U=Mn.delayedCallbacks:Dr?U=Dr:(U=Dr=[],setTimeout(ui,0));for(var $=function(fe){U.push(function(){return R[fe].apply(null,A)})},ae=0;ae<R.length;++ae)$(ae)}function ui(){var e=Dr;Dr=null;for(var t=0;t<e.length;++t)e[t]()}function Xi(e,t,R,A){for(var U=0;U<t.changes.length;U++){var $=t.changes[U];$=="text"?ur(e,t):$=="gutter"?tn(e,t,R,A):$=="class"?fr(e,t):$=="widget"&&wr(e,t,A)}t.changes=null}function Yi(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),C&&v<8&&(e.node.style.zIndex=2)),e.node}function er(e,t){var R=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(R&&(R+=" CodeMirror-linebackground"),t.background)R?t.background.className=R:(t.background.parentNode.removeChild(t.background),t.background=null);else if(R){var A=Yi(t);t.background=A.insertBefore(T("div",null,R),A.firstChild),e.display.input.setUneditable(t.background)}}function Mt(e,t){var R=e.display.externalMeasured;return R&&R.line==t.line?(e.display.externalMeasured=null,t.measure=R.measure,R.built):hr(e,t)}function ur(e,t){var R=t.text.className,A=Mt(e,t);t.text==t.node&&(t.node=A.pre),t.text.parentNode.replaceChild(A.pre,t.text),t.text=A.pre,A.bgClass!=t.bgClass||A.textClass!=t.textClass?(t.bgClass=A.bgClass,t.textClass=A.textClass,fr(e,t)):R&&(t.text.className=R)}function fr(e,t){er(e,t),t.line.wrapClass?Yi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var R=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=R||""}function tn(e,t,R,A){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var U=Yi(t);t.gutterBackground=T("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?A.fixedPos:-A.gutterTotalWidth)+"px; width: "+A.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),U.insertBefore(t.gutterBackground,t.text)}var $=t.line.gutterMarkers;if(e.options.lineNumbers||$){var ae=Yi(t),fe=t.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?A.fixedPos:-A.gutterTotalWidth)+"px");if(e.display.input.setUneditable(fe),ae.insertBefore(fe,t.text),t.line.gutterClass&&(fe.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!$||!$["CodeMirror-linenumbers"])&&(t.lineNumber=fe.appendChild(T("div",zr(e.options,R),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+A.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),$)for(var me=0;me<e.display.gutterSpecs.length;++me){var xe=e.display.gutterSpecs[me].className,We=$.hasOwnProperty(xe)&&$[xe];We&&fe.appendChild(T("div",[We],"CodeMirror-gutter-elt","left: "+A.gutterLeft[xe]+"px; width: "+A.gutterWidth[xe]+"px"))}}}function wr(e,t,R){t.alignable&&(t.alignable=null);for(var A=O("CodeMirror-linewidget"),U=t.node.firstChild,$=void 0;U;U=$)$=U.nextSibling,A.test(U.className)&&t.node.removeChild(U);wn(e,t,R)}function Rn(e,t,R,A){var U=Mt(e,t);return t.text=t.node=U.pre,U.bgClass&&(t.bgClass=U.bgClass),U.textClass&&(t.textClass=U.textClass),fr(e,t),tn(e,t,R,A),wn(e,t,A),t.node}function wn(e,t,R){if(ki(e,t.line,t,R,!0),t.rest)for(var A=0;A<t.rest.length;A++)ki(e,t.rest[A],t,R,!1)}function ki(e,t,R,A,U){if(!t.widgets)return;for(var $=Yi(R),ae=0,fe=t.widgets;ae<fe.length;++ae){var me=fe[ae],xe=T("div",[me.node],"CodeMirror-linewidget"+(me.className?" "+me.className:""));me.handleMouseEvents||xe.setAttribute("cm-ignore-events","true"),Fn(me,xe,R,A),e.display.input.setUneditable(xe),U&&me.above?$.insertBefore(xe,R.gutter||R.text):$.appendChild(xe),Er(me,"redraw")}}function Fn(e,t,R,A){if(e.noHScroll){(R.alignable||(R.alignable=[])).push(t);var U=A.wrapperWidth;t.style.left=A.fixedPos+"px",e.coverGutter||(U-=A.gutterTotalWidth,t.style.paddingLeft=A.gutterTotalWidth+"px"),t.style.width=U+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-A.gutterTotalWidth+"px"))}function Kn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!L(document.body,e.node)){var R="position: relative;";e.coverGutter&&(R+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(R+="width: "+t.display.wrapper.clientWidth+"px;"),x(t.display.measure,T("div",[e.node],null,R))}return e.height=e.node.parentNode.offsetHeight}function Yn(e,t){for(var R=$e(t);R!=e.wrapper;R=R.parentNode)if(!R||R.nodeType==1&&R.getAttribute("cm-ignore-events")=="true"||R.parentNode==e.sizer&&R!=e.mover)return!0}function $i(e){return e.lineSpace.offsetTop}function Ne(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ve(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=x(e.measure,T("pre","x","CodeMirror-line-like")),R=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,A={left:parseInt(R.paddingLeft),right:parseInt(R.paddingRight)};return!isNaN(A.left)&&!isNaN(A.right)&&(e.cachedPaddingH=A),A}function Qe(e){return ee-e.display.nativeBarWidth}function Fe(e){return e.display.scroller.clientWidth-Qe(e)-e.display.barWidth}function ve(e){return e.display.scroller.clientHeight-Qe(e)-e.display.barHeight}function Le(e,t,R){var A=e.options.lineWrapping,U=A&&Fe(e);if(!t.measure.heights||A&&t.measure.width!=U){var $=t.measure.heights=[];if(A){t.measure.width=U;for(var ae=t.text.firstChild.getClientRects(),fe=0;fe<ae.length-1;fe++){var me=ae[fe],xe=ae[fe+1];Math.abs(me.bottom-xe.bottom)>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;A<e.rest.length;A++)if(e.rest[A]==t)return{map:e.measure.maps[A],cache:e.measure.caches[A]};for(var U=0;U<e.rest.length;U++)if(Nt(e.rest[U])>R)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<e.display.viewTo)return e.display.view[Cn(e,t)];var R=e.display.externalMeasured;if(R&&t>=R.lineN&&t<R.lineN+R.size)return R}function Xe(e,t){var R=Nt(t),A=Ye(e,R);A&&!A.text?A=null:A&&A.changes&&(Xi(e,A,R,Pn(e)),e.curOp.forceUpdate=!0),A||(A=Be(e,t));var U=we(A,t,R);return{line:t,view:A,rect:null,map:U.map,cache:U.cache,before:U.before,hasHeights:!1}}function it(e,t,R,A,U){t.before&&(R=-1);var $=R+(A||""),ae;return t.cache.hasOwnProperty($)?ae=t.cache[$]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Le(e,t.view,t.rect),t.hasHeights=!0),ae=At(e,t,R,A),ae.bogus||(t.cache[$]=ae)),{left:ae.left,right:ae.right,top:U?ae.rtop:ae.top,bottom:U?ae.rbottom:ae.bottom}}var dt={left:0,right:0,top:0,bottom:0};function xt(e,t,R){for(var A,U,$,ae,fe,me,xe=0;xe<e.length;xe+=3)if(fe=e[xe],me=e[xe+1],t<fe?(U=0,$=1,ae="left"):t<me?(U=t-fe,$=U+1):(xe==e.length-3||t==me&&e[xe+3]>t)&&($=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<e.length-3&&e[xe+3]==e[xe+4]&&!e[xe+5].insertLeft;)A=e[(xe+=3)+2],ae="right";break}return{node:A,start:U,end:$,collapse:ae,coverStart:fe,coverEnd:me}}function bt(e,t){var R=dt;if(t=="left")for(var A=0;A<e.length&&!((R=e[A]).left!=R.right);A++);else for(var U=e.length-1;U>=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+fe<U.coverEnd&&ge(t.line.text.charAt(U.coverStart+fe));)++fe;if(C&&v<9&&ae==0&&fe==U.coverEnd-U.coverStart?xe=$.parentNode.getBoundingClientRect():xe=bt(j($,ae,fe).getClientRects(),A),xe.left||xe.right||ae==0)break;fe=ae,ae=ae-1,me="right"}C&&v<11&&(xe=Vt(e.display.measure,xe))}else{ae>0&&(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<Ot.length-1&&!(yt<Ot[Dt]);Dt++);var jt=Dt?Ot[Dt-1]:0,kt=Ot[Dt],Bt={left:(me=="right"?xe.right:xe.left)-t.rect.left,right:(me=="left"?xe.left:xe.right)-t.rect.left,top:jt,bottom:kt};return!xe.left&&!xe.right&&(Bt.bogus=!0),e.options.singleCursorHeightPerLine||(Bt.rtop=at,Bt.rbottom=ft),Bt}function Vt(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!$t(e))return t;var R=screen.logicalXDPI/screen.deviceXDPI,A=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*R,right:t.right*R,top:t.top*A,bottom:t.bottom*A}}function pr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function gr(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)pr(e.display.view[t])}function yr(e){gr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Or(){return r&&c?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Sr(){return r&&c?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function br(e){var t=0;if(e.widgets)for(var R=0;R<e.widgets.length;++R)e.widgets[R].above&&(t+=Kn(e.widgets[R]));return t}function Xr(e,t,R,A,U){if(!U){var $=br(t);R.top+=$,R.bottom+=$}if(A=="line")return R;A||(A="local");var ae=si(t);if(A=="local"?ae+=$i(e.display):ae-=e.display.viewOffset,A=="page"||A=="window"){var fe=e.display.lineSpace.getBoundingClientRect();ae+=fe.top+(A=="window"?0:Sr());var me=fe.left+(A=="window"?0:Or());R.left+=me,R.right+=me}return R.top+=ae,R.bottom+=ae,R}function Ir(e,t,R){if(R=="div")return t;var A=t.left,U=t.top;if(R=="page")A-=Or(),U-=Sr();else if(R=="local"||!R){var $=e.display.sizer.getBoundingClientRect();A+=$.left,U+=$.top}var ae=e.display.lineSpace.getBoundingClientRect();return{left:A-ae.left,top:U-ae.top}}function Dn(e,t,R,A,U){return A||(A=Et(e.doc,t.line)),Xr(e,A,He(e,A,t.ch,U),R)}function Nr(e,t,R,A,U,$){A=A||Et(e.doc,t.line),U||(U=Xe(e,A));function ae(ft,yt){var Ot=it(e,U,ft,yt?"right":"left",$);return yt?Ot.left=Ot.right:Ot.right=Ot.left,Xr(e,A,Ot,R)}var fe=ot(A,e.doc.direction),me=t.ch,xe=t.sticky;if(me>=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<at.right-A,kt=jt==xe;ft=st+(kt?0:1),Ot=kt?"after":"before",yt=jt?at.left:at.right}else{!xe&&(ft==me||ft==fe)&&ft++,Ot=ft==0?"after":ft==t.text.length?"before":it(e,$,ft-(xe?1:0)).bottom+ae<=U==xe?"after":"before";var Bt=Nr(e,mt(R,ft,Ot),"line",t,$);yt=Bt.left,Dt=U<Bt.top?-1:U>=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<U.length;st++){var at=U[st];if(at.from>=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.from<me&&(We={from:me,to:We.to,level:We.level}),We.to>xe&&(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;ae<U.widgets.length;ae++)U.widgets[ae].height&&($+=U.widgets[ae].height);return R?$+(Math.ceil(U.text.length/A)||1)*t:$+t}}function Ci(e){var t=e.doc,R=Wi(e);t.iter(function(A){var U=R(A);U!=A.height&&Xt(A,U)})}function ti(e,t,R,A){var U=e.display;if(!R&&$e(t).getAttribute("cm-not-content")=="true")return null;var $,ae,fe=U.lineSpace.getBoundingClientRect();try{$=t.clientX-fe.left,ae=t.clientY-fe.top}catch(Ge){return null}var me=Ur(e,$,ae),xe;if(A&&me.xRel>0&&(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;A<R.length;A++)if(t-=R[A].size,t<0)return A}function vn(e,t,R,A){t==null&&(t=e.doc.first),R==null&&(R=e.doc.first+e.doc.size),A||(A=0);var U=e.display;if(A&&R<U.viewTo&&(U.updateLineNumbers==null||U.updateLineNumbers>t)&&(U.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=U.viewTo)Yt&&Zn(e.doc,t)<U.viewTo&&Ln(e);else if(R<=U.viewFrom)Yt&&Si(e.doc,R+A)>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<xe.lineN?xe.lineN+=A:t<xe.lineN+xe.size&&(U.externalMeasured=null))}function In(e,t,R){e.curOp.viewChanged=!0;var A=e.display,U=e.display.externalMeasured;if(U&&t>=U.lineN&&t<U.lineN+U.size&&(A.externalMeasured=null),t<A.viewFrom||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;me<U;me++)fe+=ae[me].size;if(fe!=t){if(A>0){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.viewFrom<t&&(A.view=A.view.slice(Cn(e,t))),A.viewFrom=t,A.viewTo<R?A.view=A.view.concat(Rr(e,A.viewTo,R)):A.viewTo>R&&(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<t.length;A++){var U=t[A];!U.hidden&&(!U.node||U.changes)&&++R}return R}function mn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ji(e,t){t===void 0&&(t=!0);for(var R=e.doc,A={},U=A.cursors=document.createDocumentFragment(),$=A.selection=document.createDocumentFragment(),ae=0;ae<R.sel.ranges.length;ae++){if(!t&&ae==R.sel.primIndex)continue;var fe=R.sel.ranges[ae];if(fe.from().line>=e.display.viewTo||fe.to().line<e.display.viewFrom)continue;var me=fe.empty();(me||e.options.showCursorWhenSelecting)&&ia(e,fe.head,U),me||fn(e,fe,$)}return A}function ia(e,t,R){var A=Nr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),U=R.appendChild(T("div","\xA0","CodeMirror-cursor"));if(U.style.left=A.left+"px",U.style.top=A.top+"px",U.style.height=Math.max(0,A.bottom-A.top)*e.options.cursorHeight+"px",A.other){var $=R.appendChild(T("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));$.style.display="",$.style.left=A.other.left+"px",$.style.top=A.other.top+"px",$.style.height=(A.other.bottom-A.other.top)*.85+"px"}}function Sn(e,t){return e.top-t.top||e.left-t.left}function fn(e,t,R){var A=e.display,U=e.doc,$=document.createDocumentFragment(),ae=Ve(e.display),fe=ae.left,me=Math.max(A.sizerWidth,Fe(e)-A.sizer.offsetLeft)-ae.right,xe=U.direction=="ltr";function We(kt,Bt,ar,qt){Bt<0&&(Bt=0),Bt=Math.round(Bt),qt=Math.round(qt),$.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+kt+`px;
|
|
|
top: `+Bt+"px; width: "+(ar==null?me-kt:ar)+`px;
|
|
|
height: `+(qt-Bt)+"px"))}function Ge(kt,Bt,ar){var qt=Et(U,kt),kr=qt.text.length,Tn,ci;function Un($n,Pi){return Dn(e,mt(kt,$n),"div",qt,Pi)}function Ui($n,Pi,vi){var ai=Kt(e,qt,null,$n),Jn=Pi=="ltr"==(vi=="after")?"left":"right",Wn=vi=="after"?ai.begin:ai.end-(/\s/.test(qt.text.charAt(ai.end-1))?2:1);return Un(Wn,Jn)[Jn]}var Mi=ot(qt,U.direction);return qe(Mi,Bt||0,ar==null?kr:ar,function($n,Pi,vi,ai){var Jn=vi=="ltr",Wn=Un($n,Jn?"left":"right"),Ii=Un(Pi-1,Jn?"right":"left"),Za=Bt==null&&$n==0,_a=ar==null&&Pi==kr,Ei=ai==0,ua=!Mi||ai==Mi.length-1;if(Ii.top-Wn.top<=3){var di=(xe?Za:_a)&&Ei,ps=(xe?_a:Za)&&ua,ga=di?fe:(Jn?Wn:Ii).left,La=ps?me:(Jn?Ii:Wn).right;We(ga,Wn.top,La-ga,Wn.bottom)}else{var Ma,Ai,qa,ms;Jn?(Ma=xe&&Za&&Ei?fe:Wn.left,Ai=xe?me:Ui($n,vi,"before"),qa=xe?fe:Ui(Pi,vi,"after"),ms=xe&&_a&&ua?me:Ii.right):(Ma=xe?Ui($n,vi,"before"):fe,Ai=!xe&&Za&&Ei?me:Wn.right,qa=!xe&&_a&&ua?fe:Ii.left,ms=xe?Ui(Pi,vi,"after"):me),We(Ma,Wn.top,Ai-Ma,Wn.bottom),Wn.bottom<Ii.top&&We(fe,Wn.bottom,null,Ii.top),We(qa,Ii.top,ms-qa,Ii.bottom)}(!Tn||Sn(Wn,Tn)<0)&&(Tn=Wn),Sn(Ii,Tn)<0&&(Tn=Ii),(!ci||Sn(Wn,ci)<0)&&(ci=Wn),Sn(Ii,ci)<0&&(ci=Ii)}),{start:Tn,end:ci}}var st=t.from(),at=t.to();if(st.line==at.line)Ge(st.line,st.ch,at.ch);else{var ft=Et(U,st.line),yt=Et(U,at.line),Ot=Hn(ft)==Hn(yt),Dt=Ge(st.line,st.ch,Ot?ft.text.length+1:null).end,jt=Ge(at.line,Ot?0:null,at.ch).start;Ot&&(Dt.top<jt.top-2?(We(Dt.right,Dt.top,null,Dt.bottom),We(fe,jt.top,jt.left,jt.bottom)):We(Dt.right,Dt.top,jt.left-Dt.right,Dt.bottom)),Dt.bottom<jt.top&&We(fe,Dt.bottom,null,jt.top)}R.appendChild($)}function ri(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var R=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?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<t.view.length;A++){var U=t.view[A],$=e.options.lineWrapping,ae=void 0,fe=0;if(U.hidden)continue;if(C&&v<8){var me=U.node.offsetTop+U.node.offsetHeight;ae=me-R,R=me}else{var xe=U.node.getBoundingClientRect();ae=xe.bottom-xe.top,!$&&U.text.firstChild&&(fe=U.text.firstChild.getBoundingClientRect().right-xe.left-1)}var We=U.line.height-ae;if((We>.005||We<-.005)&&(Xt(U.line,ae),to(U.line),U.rest))for(var Ge=0;Ge<U.rest.length;Ge++)to(U.rest[Ge]);if(fe>e.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<e.widgets.length;++t){var R=e.widgets[t],A=R.node.parentNode;A&&(R.height=A.offsetHeight)}}function Ia(e,t,R){var A=R&&R.top!=null?Math.max(0,R.top):e.scroller.scrollTop;A=Math.floor(A-$i(e));var U=R&&R.bottom!=null?R.bottom:A+e.wrapper.clientHeight,$=jr(t,A),ae=jr(t,U);if(R&&R.ensure){var fe=R.ensure.from.line,me=R.ensure.to.line;fe<$?($=fe,ae=jr(t,si(Et(t,fe))+e.wrapper.clientHeight)):Math.min(me,t.lastLine())>=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.top<A,xe=t.bottom>fe-A;if(t.top<U)ae.scrollTop=me?0:t.top;else if(t.bottom>U+$){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.left<st?ae.scrollLeft=Math.max(0,t.left+Ge-(ft?0:10)):t.right>at+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.ops.length;A++)R.ops[A].cm.curOp=null;Oo(R)})}function Oo(e){for(var t=e.ops,R=0;R<t.length;R++)Jo(t[R]);for(var A=0;A<t.length;A++)Qo(t[A]);for(var U=0;U<t.length;U++)Zo(t[U]);for(var $=0;$<t.length;$++)oo(t[$]);for(var ae=0;ae<t.length;ae++)qo(t[ae])}function Jo(e){var t=e.cm,R=t.display;Ao(t),e.updateMaxLine&&Bi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<R.viewFrom||e.scrollToPos.to.line>=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<t.doc.scrollLeft&&zi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var R=e.focus&&e.focus==V();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,R),(e.updatedDisplay||e.startHeight!=t.doc.height)&&da(t,e.barMeasure),e.updatedDisplay&&cn(t,e.barMeasure),e.selectionChanged&&ri(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),R&&To(e.cm)}function qo(e){var t=e.cm,R=t.display,A=t.doc;if(e.updatedDisplay&&Fa(t,e.update),R.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(R.wheelStartX=R.wheelStartY=null),e.scrollTop!=null&&Ea(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&zi(t,e.scrollLeft,!0,!0),e.scrollToPos){var U=Yo(t,z(A,e.scrollToPos.from),z(A,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,U)}var $=e.maybeHiddenMarkers,ae=e.maybeUnhiddenMarkers;if($)for(var fe=0;fe<$.length;++fe)$[fe].lines.length||Je($[fe],"hide");if(ae)for(var me=0;me<ae.length;++me)ae[me].lines.length&&Je(ae[me],"unhide");R.wrapper.offsetHeight&&(A.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Je(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ti(e,t){if(e.curOp)return t();sa(e);try{return t()}finally{ha(e)}}function Gn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);sa(e);try{return t.apply(e,arguments)}finally{ha(e)}}}function gi(e){return function(){if(this.curOp)return e.apply(this,arguments);sa(this);try{return e.apply(this,arguments)}finally{ha(this)}}}function Vn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);sa(t);try{return e.apply(this,arguments)}finally{ha(t)}}}function Ra(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,F(es,e))}function es(e){var t=e.doc;if(t.highlightFrontier>=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&&st<ae.length;++st)Ge=ae[st]!=$.styles[st];Ge&&U.push(A.line),$.stateAfter=A.save(),A.nextLine()}else $.text.length<=e.options.maxHighlightLength&&Pt(e,$.text,A),$.stateAfter=A.line%5==0?A.save():null,A.nextLine();if(+new Date>R)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;$<U.length;$++)In(e,U[$],"text")})}var Ki=function(e,t,R){var A=e.display;this.viewport=t,this.visible=Ia(A,e.doc,t),this.editorIsHidden=!A.wrapper.offsetWidth,this.wrapperHeight=A.wrapper.clientHeight,this.wrapperWidth=A.wrapper.clientWidth,this.oldDisplayWidth=Fe(e),this.force=R,this.dims=Pn(e),this.events=[]};Ki.prototype.signal=function(e,t){ke(e,t)&&this.events.push(arguments)},Ki.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Je.apply(null,this.events[e])};function Ao(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Qe(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Qe(e)+"px",t.scrollbarsClipped=!0)}function Ro(e){if(e.hasFocus())return null;var t=V();if(!t||!L(e.display.lineDiv,t))return null;var R={activeElt:t};if(window.getSelection){var A=window.getSelection();A.anchorNode&&A.extend&&L(e.display.lineDiv,A.anchorNode)&&(R.anchorNode=A.anchorNode,R.anchorOffset=A.anchorOffset,R.focusNode=A.focusNode,R.focusOffset=A.focusOffset)}return R}function Do(e){if(!e||!e.activeElt||e.activeElt==V())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&L(document.body,e.anchorNode)&&L(document.body,e.focusNode)){var t=window.getSelection(),R=document.createRange();R.setEnd(e.anchorNode,e.anchorOffset),R.collapse(!1),t.removeAllRanges(),t.addRange(R),t.extend(e.focusNode,e.focusOffset)}}function fa(e,t){var R=e.display,A=e.doc;if(t.editorIsHidden)return Ln(e),!1;if(!t.force&&t.visible.from>=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<me.length;We++){var Ge=me[We];if(!Ge.hidden)if(!Ge.node||Ge.node.parentNode!=$){var st=Rn(e,Ge,xe,R);$.insertBefore(st,ae)}else{for(;ae!=Ge.node;)ae=fe(ae);var at=U&&t!=null&&t<=xe&&Ge.lineNumber;Ge.changes&&(re(Ge.changes,"gutter")>-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;ae<R.length;ae++)if(!R[ae].hidden){e.options.fixedGutter&&(R[ae].gutter&&(R[ae].gutter.style.left=$),R[ae].gutterBackground&&(R[ae].gutterBackground.style.left=$));var fe=R[ae].alignable;if(fe)for(var me=0;me<fe.length;me++)fe[me].style.left=$}e.options.fixedGutter&&(t.gutters.style.left=A+U+"px")}function ni(e){if(!e.options.lineNumbers)return!1;var t=e.doc,R=zr(e.options,t.first+t.size-1),A=e.display;if(R.length!=A.lineNumChars){var U=A.measure.appendChild(T("div",[T("div",R)],"CodeMirror-linenumber CodeMirror-gutter-elt")),$=U.firstChild.offsetWidth,ae=U.offsetWidth-$;return A.lineGutter.style.width="",A.lineNumInnerWidth=Math.max($,A.lineGutter.offsetWidth-ae)+1,A.lineNumWidth=A.lineNumInnerWidth+ae,A.lineNumChars=A.lineNumInnerWidth?R.length:-1,A.lineGutter.style.width=A.lineNumWidth+"px",Ba(e.display),!0}return!1}function _i(e,t){for(var R=[],A=!1,U=0;U<e.length;U++){var $=e[U],ae=null;if(typeof $!="string"&&(ae=$.style,$=$.className),$=="CodeMirror-linenumbers")if(t)A=!0;else continue;R.push({className:$,style:ae})}return t&&!A&&R.push({className:"CodeMirror-linenumbers",style:null}),R}function wa(e){var t=e.gutters,R=e.gutterSpecs;E(t),e.lineGutter=null;for(var A=0;A<R.length;++A){var U=R[A],$=U.className,ae=U.style,fe=t.appendChild(T("div",null,"CodeMirror-gutter "+$));ae&&(fe.style.cssText=ae),$=="CodeMirror-linenumbers"&&(e.lineGutter=fe,fe.style.width=(e.lineNumWidth||1)+"px")}t.style.display=R.length?"":"none",Ba(e)}function Zi(e){wa(e.display),vn(e),Wr(e)}function ka(e,t,R,A){var U=this;this.input=R,U.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),U.scrollbarFiller.setAttribute("cm-not-content","true"),U.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),U.gutterFiller.setAttribute("cm-not-content","true"),U.lineDiv=N("div",null,"CodeMirror-code"),U.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),U.cursorDiv=T("div",null,"CodeMirror-cursors"),U.measure=T("div",null,"CodeMirror-measure"),U.lineMeasure=T("div",null,"CodeMirror-measure"),U.lineSpace=N("div",[U.measure,U.lineMeasure,U.selectionDiv,U.cursorDiv,U.lineDiv],null,"position: relative; outline: none");var $=N("div",[U.lineSpace],"CodeMirror-lines");U.mover=T("div",[$],null,"position: relative"),U.sizer=T("div",[U.mover],"CodeMirror-sizer"),U.sizerWidth=null,U.heightForcer=T("div",null,null,"position: absolute; height: "+ee+"px; width: 1px;"),U.gutters=T("div",null,"CodeMirror-gutters"),U.lineGutter=null,U.scroller=T("div",[U.sizer,U.heightForcer,U.gutters],"CodeMirror-scroll"),U.scroller.setAttribute("tabIndex","-1"),U.wrapper=T("div",[U.scrollbarFiller,U.gutterFiller,U.scroller],"CodeMirror"),C&&v<8&&(U.gutters.style.zIndex=-1,U.scroller.style.paddingRight=0),!o&&!(_&&n)&&(U.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(U.wrapper):e(U.wrapper)),U.viewFrom=U.viewTo=t.first,U.reportedViewFrom=U.reportedViewTo=t.first,U.view=[],U.renderedView=null,U.externalMeasured=null,U.viewOffset=0,U.lastWrapHeight=U.lastWrapWidth=0,U.updateLineNumbers=null,U.nativeBarWidth=U.barHeight=U.barWidth=0,U.scrollbarsClipped=!1,U.lineNumWidth=U.lineNumInnerWidth=U.lineNumChars=null,U.alignWidgets=!1,U.cachedCharWidth=U.cachedTextHeight=U.cachedPaddingH=null,U.maxLine=null,U.maxLineLength=0,U.maxLineChanged=!1,U.wheelDX=U.wheelDY=U.wheelStartX=U.wheelStartY=null,U.shift=!1,U.selForContextMenu=null,U.activeTouch=null,U.gutterSpecs=_i(A.gutters,A.lineNumbers),wa(U),R.init(U)}var la=0,ii=null;C?ii=-.53:_?ii=15:r?ii=-.7:m&&(ii=-1/3);function Wa(e){var t=e.wheelDeltaX,R=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),R==null&&e.detail&&e.axis==e.VERTICAL_AXIS?R=e.detail:R==null&&(R=e.wheelDelta),{x:t,y:R}}function so(e){var t=Wa(e);return t.x*=ii,t.y*=ii,t}function lo(e,t){var R=Wa(t),A=R.x,U=R.y,$=e.display,ae=$.scroller,fe=ae.scrollWidth>ae.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<We.length;Ge++)if(We[Ge].node==xe){e.display.currentWheelTarget=xe;break e}}if(A&&!_&&!h&&ii!=null){U&&me&&xa(e,Math.max(0,ae.scrollTop+U*ii)),zi(e,Math.max(0,ae.scrollLeft+A*ii)),(!U||U&&me)&&ye(t),$.wheelStartX=null;return}if(U&&ii!=null){var st=U*ii,at=e.doc.scrollTop,ft=at+$.wrapper.clientHeight;st<0?at=Math.max(0,at+st-50):ft=Math.min(e.doc.height,ft+st+50),Da(e,{top:at,bottom:ft})}la<20&&($.wheelStartX==null?($.wheelStartX=ae.scrollLeft,$.wheelStartY=ae.scrollTop,$.wheelDX=A,$.wheelDY=U,setTimeout(function(){if($.wheelStartX==null)return;var yt=ae.scrollLeft-$.wheelStartX,Ot=ae.scrollTop-$.wheelStartY,Dt=Ot&&$.wheelDY&&Ot/$.wheelDY||yt&&$.wheelDX&&yt/$.wheelDX;if($.wheelStartX=$.wheelStartY=null,!Dt)return;ii=(ii*la+Dt)/(la+1),++la},200)):($.wheelDX+=A,$.wheelDY+=U))}var Oi=function(e,t){this.ranges=e,this.primIndex=t};Oi.prototype.primary=function(){return this.ranges[this.primIndex]},Oi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var R=this.ranges[t],A=e.ranges[t];if(!an(R.anchor,A.anchor)||!an(R.head,A.head))return!1}return!0},Oi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new ln(xn(this.ranges[t].anchor),xn(this.ranges[t].head));return new Oi(e,this.primIndex)},Oi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Oi.prototype.contains=function(e,t){t||(t=e);for(var R=0;R<this.ranges.length;R++){var A=this.ranges[R];if(Ut(t,A.from())>=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;$<t.length;$++){var ae=t[$],fe=t[$-1],me=Ut(fe.to(),ae.from());if(A&&!ae.empty()?me>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;A<e.sel.ranges.length;A++){var U=e.sel.ranges[A];R.push(new ln(uo(U.anchor,t),uo(U.head,t)))}return Gi(e.cm,R,e.sel.primIndex)}function Lo(e,t,R){return e.line==t.line?mt(R.line,e.ch-t.ch+R.ch):mt(R.line+(e.line-t.line),e.ch)}function Mo(e,t,R){for(var A=[],U=mt(e.first,0),$=U,ae=0;ae<t.length;ae++){var fe=t[ae],me=Lo(fe.from,U,$),xe=Lo(ea(fe),U,$);if(U=fe.to,$=xe,R=="around"){var We=e.sel.ranges[ae],Ge=Ut(We.head,We.anchor)<0;A[ae]=new ln(Ge?xe:me,Ge?me:xe)}else A[ae]=new ln(me,me)}return new Oi(A,e.sel.primIndex)}function pa(e){e.doc.mode=lr(e.options,e.doc.modeOption),co(e)}function co(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ra(e,100),e.state.modeGen++,e.curOp&&vn(e)}function gs(e,t){return t.from.ch==0&&t.to.ch==0&&oe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,t,R,A){function U(jt){return R?R[jt]:null}function $(jt,kt,Bt){en(jt,kt,Bt,A),Er(jt,"change",jt,t)}function ae(jt,kt){for(var Bt=[],ar=jt;ar<kt;++ar)Bt.push(new li(xe[ar],U(ar),A));return Bt}var fe=t.from,me=t.to,xe=t.text,We=Et(e,fe.line),Ge=Et(e,me.line),st=oe(xe),at=U(xe.length-1),ft=me.line-fe.line;if(t.full)e.insert(0,ae(0,xe.length)),e.remove(xe.length,e.size-xe.length);else if(gs(e,t)){var yt=ae(0,xe.length-1);$(Ge,Ge.text,at),ft&&e.remove(fe.line,ft),yt.length&&e.insert(fe.line,yt)}else if(We==Ge)if(xe.length==1)$(We,We.text.slice(0,fe.ch)+st+We.text.slice(me.ch),at);else{var Ot=ae(1,xe.length-1);Ot.push(new li(st+We.text.slice(me.ch),at,A)),$(We,We.text.slice(0,fe.ch)+xe[0],U(0)),e.insert(fe.line+1,Ot)}else if(xe.length==1)$(We,We.text.slice(0,fe.ch)+xe[0]+Ge.text.slice(me.ch),U(0)),e.remove(fe.line+1,ft);else{$(We,We.text.slice(0,fe.ch)+xe[0],U(0)),$(Ge,st+Ge.text.slice(me.ch),at);var Dt=ae(1,xe.length-1);ft>1&&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;fe<U.linked.length;++fe){var me=U.linked[fe];if(me.doc==$)continue;var xe=ae&&me.sharedHist;if(R&&!xe)continue;t(me.doc,xe),A(me.doc,U,xe)}}A(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ci(e),pa(e),ys(e),e.options.lineWrapping||Bi(e),e.options.mode=t.modeOption,vn(e)}function ys(e){(e.doc.direction=="rtl"?K:b)(e.display.lineDiv,"CodeMirror-rtl")}function pl(e){Ti(e,function(){ys(e),vn(e)})}function Po(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function rs(e,t){var R={from:xn(t.from),to:ea(t),text:Ar(e,t.from,t.to)};return Es(e,R,t.from.line,t.to.line+1),Sa(e,function(A){return Es(A,R,t.from.line,t.to.line+1)},!0),R}function bs(e){for(;e.length;){var t=oe(e);if(t.ranges)e.pop();else break}}function ml(e,t){if(t)return bs(e.done),oe(e.done);if(e.done.length&&!oe(e.done).ranges)return oe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),oe(e.done)}function 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<e.length;++R)e[R].marker.explicitlyCleared?t||(t=e.slice(0,R)):t&&t.push(e[R]);return t?t.length?t:null:e}function bl(e,t){var R=t["spans_"+e.id];if(!R)return null;for(var A=[],U=0;U<t.text.length;++U)A.push(yl(R[U]));return A}function ws(e,t){var R=bl(e,t),A=Qn(e,t);if(!R)return A;if(!A)return R;for(var U=0;U<R.length;++U){var $=R[U],ae=A[U];if($&&ae){e:for(var fe=0;fe<ae.length;++fe){for(var me=ae[fe],xe=0;xe<$.length;++xe)if($[xe].marker==me.marker)continue e;$.push(me)}}else ae&&(R[U]=ae)}return R}function za(e,t,R){for(var A=[],U=0;U<e.length;++U){var $=e[U];if($.ranges){A.push(R?Oi.prototype.deepCopy.call($):$);continue}var ae=$.changes,fe=[];A.push({changes:fe});for(var me=0;me<ae.length;++me){var xe=ae[me],We=void 0;if(fe.push({from:xe.from,to:xe.to,text:xe.text}),t)for(var Ge in xe)(We=Ge.match(/^spans_(\d+)$/))&&(re(t,Number(We[1]))>-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;$<e.sel.ranges.length;$++)A[$]=ns(e.sel.ranges[$],t[$],null,U);var ae=Gi(e.cm,A,e.sel.primIndex);xi(e,ae,R)}function is(e,t,R,A){var U=e.sel.ranges.slice(0);U[t]=R,xi(e,Gi(e.cm,U,e.sel.primIndex),A)}function Cs(e,t,R,A){xi(e,qi(t,R),A)}function xl(e,t,R){var A={ranges:t.ranges,update:function(U){this.ranges=[];for(var $=0;$<U.length;$++)this.ranges[$]=new ln(z(e,U[$].anchor),z(e,U[$].head))},origin:R&&R.origin};return Je(e,"beforeSelectionChange",e,A),e.cm&&Je(e.cm,"beforeSelectionChange",e.cm,A),A.ranges!=t.ranges?Gi(e.cm,A.ranges,A.ranges.length-1):t}function Ts(e,t,R){var A=e.history.done,U=oe(A);U&&U.ranges?(A[A.length-1]=t,jo(e,t,R)):xi(e,t,R)}function xi(e,t,R){jo(e,t,R),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,R)}function jo(e,t,R){(ke(e,"beforeSelectionChange")||e.cm&&ke(e.cm,"beforeSelectionChange"))&&(t=xl(e,t,R));var A=R&&R.bias||(Ut(t.primary().head,e.sel.primary().head)<0?-1:1);_s(e,As(e,t,A,!0)),!(R&&R.scroll===!1)&&e.cm&&ya(e.cm)}function _s(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ue(e.cm)),Er(e,"cursorActivity",e)}function Os(e){_s(e,As(e,e.sel,null,!1))}function As(e,t,R,A){for(var U,$=0;$<t.ranges.length;$++){var ae=t.ranges[$],fe=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[$],me=Uo(e,ae.anchor,fe&&fe.anchor,R,A),xe=Uo(e,ae.head,fe&&fe.head,R,A);(U||me!=ae.anchor||xe!=ae.head)&&(U||(U=t.ranges.slice(0,$)),U[$]=new ln(me,xe))}return U?Gi(e.cm,U,t.primIndex):t}function Ka(e,t,R,A,U){var $=Et(e,t.line);if($.markedSpans)for(var ae=0;ae<$.markedSpans.length;++ae){var fe=$.markedSpans[ae],me=fe.marker,xe="selectLeft"in me?!me.selectLeft:me.inclusiveLeft,We="selectRight"in me?!me.selectRight:me.inclusiveRight;if((fe.from==null||(xe?fe.from<=t.ch:fe.from<t.ch))&&(fe.to==null||(We?fe.to>=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<e.first+e.size-1?mt(t.line+1,0):null:new mt(t.line,t.ch+R)}function Ds(e){e.setSelection(mt(e.firstLine(),0),mt(e.lastLine()),Ee)}function ks(e,t,R){var A={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return A.canceled=!0}};return R&&(A.update=function(U,$,ae,fe){U&&(A.from=z(e,U)),$&&(A.to=z(e,$)),ae&&(A.text=ae),fe!==void 0&&(A.origin=fe)}),Je(e,"beforeChange",e,A),e.cm&&Je(e.cm,"beforeChange",e.cm,A),A.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:A.from,to:A.to,text:A.text,origin:A.origin}}function Ga(e,t,R){if(e.cm){if(!e.cm.curOp)return Gn(e.cm,Ga)(e,t,R);if(e.cm.state.suppressEdits)return}if((ke(e,"beforeChange")||e.cm&&ke(e.cm,"beforeChange"))&&(t=ks(e,t,!0),!t))return;var A=or&&!R&&Ri(e,t.from,t.to);if(A)for(var U=A.length-1;U>=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<fe.length&&!($=fe[xe],R?$.ranges&&!$.equals(e.sel):!$.ranges);xe++);if(xe==fe.length)return;for(U.lastOrigin=U.lastSelOrigin=null;;)if($=fe.pop(),$.ranges){if(Io($,me),R&&!$.equals(e.sel)){xi(e,$,{clearRedo:!1});return}ae=$}else if(A){fe.push($);return}else break;var We=[];Io(ae,me),me.push({changes:We,generation:U.generation}),U.generation=$.generation||++U.maxGeneration;for(var Ge=ke(e,"beforeChange")||e.cm&&ke(e.cm,"beforeChange"),st=function(yt){var Ot=$.changes[yt];if(Ot.origin=t,Ge&&!ks(e,Ot,!1))return fe.length=0,{};We.push(rs(e,Ot));var Dt=yt?Ha(e,Ot):oe(fe);ho(e,Ot,Dt,ws(e,Ot)),!yt&&e.cm&&e.cm.scrollIntoView({from:Ot.from,to:ea(Ot)});var jt=[];Sa(e,function(kt,Bt){!Bt&&re(jt,kt.history)==-1&&(Ns(kt.history,Ot),jt.push(kt.history)),ho(kt,Ot,null,ws(kt,Ot))})},at=$.changes.length-1;at>=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;A<R.viewTo;A++)In(e.cm,A,"gutter")}}function ho(e,t,R,A){if(e.cm&&!e.cm.curOp)return Gn(e.cm,ho)(e,t,R,A);if(t.to.line<e.first){Ms(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var U=t.text.length-1-(e.first-t.from.line);Ms(e,U),t={from:mt(e.first,0),to:mt(t.to.line+U,t.to.ch),text:[oe(t.text)],origin:t.origin}}var $=e.lastLine();t.to.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){R<e.line?e.line+=A:t<e.line&&(e.line=t,e.ch=0)}function Is(e,t,R,A){for(var U=0;U<e.length;++U){var $=e[U],ae=!0;if($.ranges){$.copied||($=e[U]=$.deepCopy(),$.copied=!0);for(var fe=0;fe<$.ranges.length;fe++)Ps($.ranges[fe].anchor,t,R,A),Ps($.ranges[fe].head,t,R,A);continue}for(var me=0;me<$.changes.length;++me){var xe=$.changes[me];if(R<xe.from.line)xe.from=mt(xe.from.line+A,xe.from.ch),xe.to=mt(xe.to.line+A,xe.to.ch);else if(t<=xe.to.line){ae=!1;break}}ae||(e.splice(0,U+1),U=0)}}function Ns(e,t){var R=t.from.line,A=t.to.line,U=t.text.length-(A-R)-1;Is(e.done,R,A,U),Is(e.undone,R,A,U)}function fo(e,t,R,A){var U=t,$=t;return typeof t=="number"?$=Et(e,se(e,t)):U=Nt(t),U==null?null:(A($,U)&&e.cm&&In(e.cm,U,R),$)}function po(e){this.lines=e,this.parent=null;for(var t=0,R=0;R<e.length;++R)e[R].parent=this,t+=e[R].height;this.height=t}po.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var R=e,A=e+t;R<A;++R){var U=this.lines[R];this.height-=U.height,Qi(U),Er(U,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,R){this.height+=R,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var A=0;A<t.length;++A)t[A].parent=this},iterN:function(e,t,R){for(var A=e+t;e<A;++e)if(R(this.lines[e]))return!0}};function mo(e){this.children=e;for(var t=0,R=0,A=0;A<e.length;++A){var U=e[A];t+=U.chunkSize(),R+=U.height,U.parent=this}this.size=t,this.height=R,this.parent=null}mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var R=0;R<this.children.length;++R){var A=this.children[R],U=A.chunkSize();if(e<U){var $=Math.min(t,U-e),ae=A.height;if(A.removeInner(e,$),this.height-=ae-A.height,U==$&&(this.children.splice(R--,1),A.parent=null),(t-=$)==0)break;e=0}else e-=U}if(this.size-t<25&&(this.children.length>1||!(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;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,R){this.size+=t.length,this.height+=R;for(var A=0;A<this.children.length;++A){var U=this.children[A],$=U.chunkSize();if(e<=$){if(U.insertInner(e,t,R),U.lines&&U.lines.length>50){for(var ae=U.lines.length%25+25,fe=ae;fe<U.lines.length;){var me=new po(U.lines.slice(fe,fe+=25));U.height-=me.height,this.children.splice(++A,0,me),me.parent=this}U.lines=U.lines.slice(0,ae),this.maybeSpill()}break}e-=$}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),R=new mo(t);if(e.parent){e.size-=R.size,e.height-=R.height;var U=re(e.parent.children,e);e.parent.children.splice(U+1,0,R)}else{var A=new mo(e.children);A.parent=e,e.children=[A,R],e=A}R.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,R){for(var A=0;A<this.children.length;++A){var U=this.children[A],$=U.chunkSize();if(e<$){var ae=Math.min(t,$-e);if(U.iterN(e,ae,R))return!0;if((t-=ae)==0)break;e=0}else e-=$}}};var go=function(e,t,R){if(R)for(var A in R)R.hasOwnProperty(A)&&(this[A]=R[A]);this.doc=e,this.node=t};go.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,R=this.line,A=Nt(R);if(A==null||!t)return;for(var U=0;U<t.length;++U)t[U]==this&&t.splice(U--,1);t.length||(R.widgets=null);var $=Kn(this);Xt(R,Math.max(0,R.height-$)),e&&(Ti(e,function(){js(e,R,-$),In(e,A,"widget")}),Er(e,"lineWidgetCleared",e,this,A))},go.prototype.changed=function(){var e=this,t=this.height,R=this.doc.cm,A=this.line;this.height=null;var U=Kn(this)-t;if(!U)return;jn(this.doc,A)||Xt(A,A.height+U),R&&Ti(R,function(){R.curOp.forceUpdate=!0,js(R,A,U),Er(R,"lineWidgetChanged",R,e,Nt(A))})},Ie(go);function js(e,t,R){si(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&no(e,R)}function wl(e,t,R,A){var U=new go(e,R,A),$=e.cm;return $&&U.noHScroll&&($.display.alignWidgets=!0),fo(e,t,"widget",function(ae){var fe=ae.widgets||(ae.widgets=[]);if(U.insertAt==null?fe.push(U):fe.splice(Math.min(fe.length-1,Math.max(0,U.insertAt)),0,U),U.line=ae,$&&!jn(e,ae)){var me=si(ae)<e.scrollTop;Xt(ae,ae.height+Kn(U)),me&&no($,U.height),$.curOp.forceUpdate=!0}return!0}),$&&Er($,"lineWidgetAdded",$,U,typeof t=="number"?t:Nt(t)),U}var Us=0,Ca=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Us};Ca.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&sa(e),ke(this,"clear")){var R=this.find();R&&Er(this,"clear",R.from,R.to)}for(var A=null,U=null,$=0;$<this.lines.length;++$){var ae=this.lines[$],fe=un(ae.markedSpans,this);e&&!this.collapsed?In(e,Nt(ae),"text"):e&&(fe.to!=null&&(U=Nt(ae)),fe.from!=null&&(A=Nt(ae))),ae.markedSpans=En(ae.markedSpans,fe),fe.from==null&&this.collapsed&&!jn(this.doc,ae)&&e&&Xt(ae,Bn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var me=0;me<this.lines.length;++me){var xe=Hn(this.lines[me]),We=pi(xe);We>e.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;U<this.lines.length;++U){var $=this.lines[U],ae=un($.markedSpans,this);if(ae.from!=null&&(R=mt(t?$:Nt($),ae.from),e==-1))return R;if(ae.to!=null&&(A=mt(t?$:Nt($),ae.to),e==1))return A}return R&&{from:R,to:A}},Ca.prototype.changed=function(){var e=this,t=this.find(-1,!0),R=this,A=this.doc.cm;if(!t||!A)return;Ti(A,function(){var U=t.line,$=Nt(t.line),ae=Ye(A,$);if(ae&&(pr(ae),A.curOp.selectionChanged=A.curOp.forceUpdate=!0),A.curOp.updateMaxLine=!0,!jn(R.doc,U)&&R.height!=null){var fe=R.height;R.height=null;var me=Kn(R)-fe;me&&Xt(U,U.height+me)}Er(A,"markerChanged",A,e)})},Ca.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||re(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ca.prototype.detachLine=function(e){if(this.lines.splice(re(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ie(Ca);function Xa(e,t,R,A,U){if(A&&A.shared)return Sl(e,t,R,A,U);if(e.cm&&!e.cm.curOp)return Gn(e.cm,Xa)(e,t,R,A,U);var $=new Ca(e,U),ae=Ut(t,R);if(A&&B(A,$,!1),ae>0||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<e.length;++R)e[R].parent=this};vo.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Er(this,"clear")},vo.prototype.find=function(e,t){return this.primary.find(e,t)},Ie(vo);function Sl(e,t,R,A,U){A=B(A),A.shared=!1;var $=[Xa(e,t,R,A,U)],ae=$[0],fe=A.widgetNode;return Sa(e,function(me){fe&&(A.widgetNode=fe.cloneNode(!0)),$.push(Xa(me,z(me,t),z(me,R),A,U));for(var xe=0;xe<me.linked.length;++xe)if(me.linked[xe].isParent)return;ae=oe($)}),new vo($,ae)}function Fs(e){return e.findMarks(mt(e.first,0),e.clipPos(mt(e.lastLine())),function(t){return t.parent})}function Cl(e,t){for(var R=0;R<t.length;R++){var A=t[R],U=A.find(),$=e.clipPos(U.from),ae=e.clipPos(U.to);if(Ut($,ae)){var fe=Xa(e,$,ae,A.primary,A.primary.type);A.markers.push(fe),fe.parent=A}}}function Tl(e){for(var t=function(A){var U=e[A],$=[U.primary.doc];Sa(U.primary.doc,function(me){return $.push(me)});for(var ae=0;ae<U.markers.length;ae++){var fe=U.markers[ae];re($,fe.doc)==-1&&(fe.parent=null,U.markers.splice(ae--,1))}},R=0;R<e.length;R++)t(R)}var _l=0,Li=function(e,t,R,A,U){if(!(this instanceof Li))return new Li(e,t,R,A,U);R==null&&(R=0),mo.call(this,[new po([new li("",null)])]),this.first=R,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=R;var $=mt(R,0);this.sel=qi($),this.history=new Po(null),this.id=++_l,this.modeOption=t,this.lineSep=A,this.direction=U=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ts(this,{from:$,to:$,text:e}),xi(this,qi($),Ee)};Li.prototype=Oe(mo.prototype,{constructor:Li,iter:function(e,t,R){R?this.iterN(e-this.first,t-e,R):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var R=0,A=0;A<t.length;++A)R+=t[A].height;this.insertInner(e-this.first,t,R)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Br(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Vn(function(e){var t=mt(this.first,0),R=this.first+this.size-1;Ga(this,{from:t,to:mt(R,Et(this,R).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ba(this.cm,0,0),xi(this,qi(t),Ee)}),replaceRange:function(e,t,R,A){t=z(this,t),R=R?z(this,R):t,Va(this,e,t,R,A)},getRange:function(e,t,R){var A=Ar(this,z(this,e),z(this,t));return R===!1?A:A.join(R||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(bn(this,e))return Et(this,e)},getLineNumber:function(e){return Nt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Et(this,e)),Hn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return z(this,e)},getCursor:function(e){var t=this.sel.primary(),R;return e==null||e=="head"?R=t.head:e=="anchor"?R=t.anchor:e=="end"||e=="to"||e===!1?R=t.to():R=t.from(),R},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Vn(function(e,t,R){Cs(this,z(this,typeof e=="number"?mt(e,t||0):e),null,R)}),setSelection:Vn(function(e,t,R){Cs(this,z(this,e),z(this,t||e),R)}),extendSelection:Vn(function(e,t,R){No(this,z(this,e),t&&z(this,t),R)}),extendSelections:Vn(function(e,t){Ss(this,ne(this,e),t)}),extendSelectionsBy:Vn(function(e,t){var R=Se(this.sel.ranges,e);Ss(this,ne(this,R),t)}),setSelections:Vn(function(e,t,R){if(!e.length)return;for(var A=[],U=0;U<e.length;U++)A[U]=new ln(z(this,e[U].anchor),z(this,e[U].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),xi(this,Gi(this.cm,A,t),R)}),addSelection:Vn(function(e,t,R){var A=this.sel.ranges.slice(0);A.push(new ln(z(this,e),z(this,t||e))),xi(this,Gi(this.cm,A,A.length-1),R)}),getSelection:function(e){for(var t=this.sel.ranges,R,A=0;A<t.length;A++){var U=Ar(this,t[A].from(),t[A].to());R=R?R.concat(U):U}return e===!1?R:R.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],R=this.sel.ranges,A=0;A<R.length;A++){var U=Ar(this,R[A].from(),R[A].to());e!==!1&&(U=U.join(e||this.lineSeparator())),t[A]=U}return t},replaceSelection:function(e,t,R){for(var A=[],U=0;U<this.sel.ranges.length;U++)A[U]=e;this.replaceSelections(A,t,R||"+input")},replaceSelections:Vn(function(e,t,R){for(var A=[],U=this.sel,$=0;$<U.ranges.length;$++){var ae=U.ranges[$];A[$]={from:ae.from(),to:ae.to(),text:this.splitLines(e[$]),origin:R}}for(var fe=t&&t!="end"&&Mo(this,A,t),me=A.length-1;me>=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.done.length;A++)e.done[A].ranges||++t;for(var U=0;U<e.undone.length;U++)e.undone[U].ranges||++R;return{undo:t,redo:R}},clearHistory:function(){var e=this;this.history=new Po(this.history.maxGeneration),Sa(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:za(this.history.done),undone:za(this.history.undone)}},setHistory:function(e){var t=this.history=new Po(this.history.maxGeneration);t.done=za(e.done.slice(0),null,!0),t.undone=za(e.undone.slice(0),null,!0)},setGutterMarker:Vn(function(e,t,R){return fo(this,e,"gutter",function(A){var U=A.gutterMarkers||(A.gutterMarkers={});return U[t]=R,!R&&Z(U)&&(A.gutterMarkers=null),!0})}),clearGutter:Vn(function(e){var t=this;this.iter(function(R){R.gutterMarkers&&R.gutterMarkers[e]&&fo(t,R,"gutter",function(){return R.gutterMarkers[e]=null,Z(R.gutterMarkers)&&(R.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!bn(this,e))return null;if(t=e,e=Et(this,e),!e)return null}else if(t=Nt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Vn(function(e,t,R){return fo(this,e,t=="gutter"?"gutter":"class",function(A){var U=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!A[U])A[U]=R;else{if(O(R).test(A[U]))return!1;A[U]+=" "+R}return!0})}),removeLineClass:Vn(function(e,t,R){return fo(this,e,t=="gutter"?"gutter":"class",function(A){var U=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",$=A[U];if($)if(R==null)A[U]=null;else{var ae=$.match(O(R));if(!ae)return!1;var fe=ae.index+ae[0].length;A[U]=$.slice(0,ae.index)+(!ae.index||fe==$.length?"":" ")+$.slice(fe)||null}else return!1;return!0})}),addLineWidget:Vn(function(e,t,R){return wl(this,e,t,R)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,R){return Xa(this,z(this,e),z(this,t),R,R&&R.type||"range")},setBookmark:function(e,t){var R={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=z(this,e),Xa(this,e,e,R,"bookmark")},findMarksAt:function(e){e=z(this,e);var t=[],R=Et(this,e.line).markedSpans;if(R)for(var A=0;A<R.length;++A){var U=R[A];(U.from==null||U.from<=e.ch)&&(U.to==null||U.to>=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<ae.length;fe++){var me=ae[fe];!(me.to!=null&&U==e.line&&e.ch>=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;A<R.length;++A)R[A].from!=null&&e.push(R[A].marker)}),e},posFromIndex:function(e){var t,R=this.first,A=this.lineSeparator().length;return this.iter(function(U){var $=U.text.length+A;if($>e)return t=e,!0;e-=$,++R}),z(this,mt(R,t))},indexFromPos:function(e){e=z(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var R=this.lineSeparator().length;return this.iter(this.first,e.line,function(A){t+=A.text.length+R}),t},copy:function(e){var t=new Li(Br(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,R=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<R&&(R=e.to);var A=new Li(Br(this,t,R),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(A.history=this.history),(this.linked||(this.linked=[])).push({doc:A,sharedHist:e.sharedHist}),A.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cl(A,Fs(this)),A},unlinkDoc:function(e){if(e instanceof Nn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var R=this.linked[t];if(R.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(Fs(this));break}if(e.history==this.history){var A=[e.id];Sa(e,function(U){return A.push(U.id)},!0),e.history=new Po(null),e.history.done=za(this.history.done,A),e.history.undone=za(this.history.undone,A)}},iterLinkedDocs:function(e){Sa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Lt(e)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:Vn(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&pl(this.cm)})}),Li.prototype.eachLine=Li.prototype.iter;var Bs=0;function Ol(e){var t=this;if(Ws(t),tt(t,e)||Yn(t.display,e))return;ye(e),C&&(Bs=+new Date);var R=ti(t,e,!0),A=e.dataTransfer.files;if(!R||t.isReadOnly())return;if(A&&A.length&&window.FileReader&&window.File)for(var U=A.length,$=Array(U),ae=0,fe=function(){++ae==U&&Gn(t,function(){R=z(t.doc,R);var at={from:R,to:R,text:t.doc.splitLines($.filter(function(ft){return ft!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ga(t.doc,at),Ts(t.doc,qi(z(t.doc,R),z(t.doc,ea(at))))})()},me=function(at,ft){if(t.options.allowDropFileTypes&&re(t.options.allowDropFileTypes,at.type)==-1){fe();return}var yt=new FileReader;yt.onerror=function(){return fe()},yt.onload=function(){var Ot=yt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ot)){fe();return}$[ft]=Ot,fe()},yt.readAsText(at)},xe=0;xe<A.length;xe++)me(A[xe],xe);else{if(t.state.draggingText&&t.doc.sel.contains(R)>-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<Ge.length;++st)Va(t.doc,"",Ge[st].anchor,Ge[st].head,"drag");t.replaceSelection(We,"around","paste"),t.display.input.focus()}}catch(at){}}}function Al(e,t){if(C&&(!e.state.draggingText||+new Date-Bs<100)){Pe(t);return}if(tt(e,t)||Yn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var R=T("img",null,null,"position: fixed; left: 0; top: 0;");R.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(R.width=R.height=1,e.display.wrapper.appendChild(R),R._top=R.offsetTop),t.dataTransfer.setDragImage(R,0,0),h&&R.parentNode.removeChild(R)}}function Rl(e,t){var R=ti(e,t);if(!R)return;var A=document.createDocumentFragment();ia(e,R,A),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),x(e.display.dragCursor,A)}function Ws(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Hs(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),R=[],A=0;A<t.length;A++){var U=t[A].CodeMirror;U&&R.push(U)}R.length&&R[0].operation(function(){for(var $=0;$<R.length;$++)e(R[$])})}var zs=!1;function Dl(){if(zs)return;kl(),zs=!0}function kl(){var e;De(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Hs(Ll)},100))}),De(window,"blur",function(){return Hs(va)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ta={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},yo=0;yo<10;yo++)Ta[yo+48]=Ta[yo+96]=String(yo);for(var Bo=65;Bo<=90;Bo++)Ta[Bo]=String.fromCharCode(Bo);for(var bo=1;bo<=12;bo++)Ta[bo+111]=Ta[bo+63235]="F"+bo;var ma={};ma.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ma.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ma.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ma.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ma.default=s?ma.macDefault:ma.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var R,A,U,$,ae=0;ae<t.length-1;ae++){var fe=t[ae];if(/^(cmd|meta|m)$/i.test(fe))$=!0;else if(/^a(lt)?$/i.test(fe))R=!0;else if(/^(c|ctrl|control)$/i.test(fe))A=!0;else if(/^s(hift)?$/i.test(fe))U=!0;else throw new Error("Unrecognized modifier name: "+fe)}return R&&(e="Alt-"+e),A&&(e="Ctrl-"+e),$&&(e="Cmd-"+e),U&&(e="Shift-"+e),e}function Pl(e){var t={};for(var R in e)if(e.hasOwnProperty(R)){var A=e[R];if(/^(name|fallthrough|(de|at)tach)$/.test(R))continue;if(A=="..."){delete e[R];continue}for(var U=Se(R.split(" "),Ml),$=0;$<U.length;$++){var ae=void 0,fe=void 0;$==U.length-1?(fe=U.join(" "),ae=A):(fe=U.slice(0,$+1).join(" "),ae="...");var me=t[fe];if(!me)t[fe]=ae;else if(me!=ae)throw new Error("Inconsistent bindings for "+fe)}delete e[R]}for(var xe in t)e[xe]=t[xe];return e}function Ya(e,t,R,A){t=Wo(t);var U=t.call?t.call(e,A):t[e];if(U===!1)return"nothing";if(U==="...")return"multi";if(U!=null&&R(U))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ya(e,t.fallthrough,R,A);for(var $=0;$<t.fallthrough.length;$++){var ae=Ya(e,t.fallthrough[$],R,A);if(ae)return ae}}}function Ks(e){var t=typeof e=="string"?e:Ta[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Gs(e,t,R){var A=e;return t.altKey&&A!="Alt"&&(e="Alt-"+e),(i?t.metaKey:t.ctrlKey)&&A!="Ctrl"&&(e="Ctrl-"+e),(i?t.ctrlKey:t.metaKey)&&A!="Mod"&&(e="Cmd-"+e),!R&&t.shiftKey&&A!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(h&&e.keyCode==34&&e.char)return!1;var R=Ta[e.keyCode];return R==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(R=e.code),Gs(R,e,t))}function Wo(e){return typeof e=="string"?ma[e]:e}function $a(e,t){for(var R=e.doc.sel.ranges,A=[],U=0;U<R.length;U++){for(var $=t(R[U]);A.length&&Ut($.from,oe(A).to)<=0;){var ae=A.pop();if(Ut(ae.from,$.from)<0){$.from=ae.from;break}}A.push($)}Ti(e,function(){for(var fe=A.length-1;fe>=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<R.ch))return os(t,R,A);var fe=function(Dt,jt){return as(t,Dt instanceof mt?Dt.ch:Dt,jt)},me,xe=function(Dt){return e.options.lineWrapping?(me=me||Xe(e,t),Kt(e,t,me,Dt)):{begin:0,end:t.text.length}},We=xe(R.sticky=="before"?fe(R,-1):R.ch);if(e.doc.direction=="rtl"||ae.level==1){var Ge=ae.level==1==A<0,st=fe(R,Ge?1:-1);if(st!=null&&(Ge?st<=ae.to&&st<=We.end:st>=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&&Dt<U.length;Dt+=jt){var ar=U[Dt],qt=jt>0==(ar.level!=1),kr=qt?kt.begin:fe(kt.end,-1);if(ar.from<=kr&&kr<ar.to)return Bt(kr,qt);if(kr=qt?ar.from:fe(ar.to,-1),kt.begin<=kr&&kr<kt.end)return Bt(kr,qt)}},yt=ft($+A,A,We);if(yt)return yt;var Ot=A>0?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.line<e.lastLine()?{from:t.head,to:mt(t.head.line+1,0)}:{from:t.head,to:mt(t.head.line,R)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return $a(e,function(t){return{from:mt(t.from().line,0),to:z(e.doc,mt(t.to().line+1,0))}})},delLineLeft:function(e){return $a(e,function(t){return{from:mt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return $a(e,function(t){var R=e.charCoords(t.head,"div").top+5,A=e.coordsChar({left:0,top:R},"div");return{from:A,to:t.from()}})},delWrappedLineRight:function(e){return $a(e,function(t){var R=e.charCoords(t.head,"div").top+5,A=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:R},"div");return{from:t.from(),to:A}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(mt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(mt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Xs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var R=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:R},"div")},Me)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var R=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:R},"div")},Me)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var R=e.cursorCoords(t.head,"div").top+5,A=e.coordsChar({left:0,top:R},"div");return A.ch<e.getLine(A.line).search(/\S/)?Ys(e,t.head):A},Me)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],R=e.listSelections(),A=e.options.tabSize,U=0;U<R.length;U++){var $=R[U].from(),ae=H(e.getLine($.line),$.ch,A);t.push(ce(A-ae%A))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ti(e,function(){for(var t=e.listSelections(),R=[],A=0;A<t.length;A++){if(!t[A].empty())continue;var U=t[A].head,$=Et(e.doc,U.line).text;if($){if(U.ch==$.length&&(U=new mt(U.line,U.ch-1)),U.ch>0)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;A<t.length;A++)e.indentLine(t[A].from().line,null,!0);ya(e)})},openLine:function(e){return e.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xs(e,t){var R=Et(e.doc,t),A=Hn(R);return A!=R&&(t=Nt(A)),ss(!0,e,A,t,1)}function Nl(e,t){var R=Et(e.doc,t),A=Di(R);return A!=R&&(t=Nt(A)),ss(!0,e,R,t,-1)}function Ys(e,t){var R=Xs(e,t.line),A=Et(e.doc,R.line),U=ot(A,e.doc.direction);if(!U||U[0].level==0){var $=Math.max(R.ch,A.text.search(/\S/)),ae=t.line==R.line&&t.ch<=$&&t.ch;return mt(R.line,ae?0:$,R.sticky)}return R}function Ho(e,t,R){if(typeof t=="string"&&(t=xo[t],!t))return!1;e.display.input.ensurePolled();var A=e.display.shift,U=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),R&&(e.display.shift=!1),U=t(e)!=Ce}finally{e.display.shift=A,e.state.suppressEdits=!1}return U}function jl(e,t,R){for(var A=0;A<e.state.keyMaps.length;A++){var U=Ya(t,e.state.keyMaps[A],R,e);if(U)return U}return e.options.extraKeys&&Ya(t,e.options.extraKeys,R,e)||Ya(t,e.options.keyMap,R,e)}var Ul=new q;function Eo(e,t,R,A){var U=e.state.keySeq;if(U){if(Ks(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==U&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,U+" "+t,R,A))return!0}return $s(e,t,R,A)}function $s(e,t,R,A){var U=jl(e,t,A);return U=="multi"&&(e.state.keySeq=t),U=="handled"&&Er(e,"keyHandled",e,t,R),(U=="handled"||U=="multi")&&(ye(R),ri(e)),!!U}function Js(e,t){var R=Vs(t,!0);return R?t.shiftKey&&!e.state.keySeq?Eo(e,"Shift-"+R,t,function(A){return Ho(e,A,!0)})||Eo(e,R,t,function(A){if(typeof A=="string"?/^go[A-Z]/.test(A):A.motion)return Ho(e,A)}):Eo(e,R,t,function(A){return Ho(e,A)}):!1}function Fl(e,t,R){return Eo(e,"'"+R+"'",t,function(A){return Ho(e,A,!0)})}var ls=null;function Qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=V(),tt(t,e))return;C&&v<11&&e.keyCode==27&&(e.returnValue=!1);var R=e.keyCode;t.display.shift=R==16||e.shiftKey;var A=Js(t,e);h&&(ls=A?R:null,!A&&R==88&&!rr&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),_&&!s&&!A&&R==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),R==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;K(t,"CodeMirror-crosshair");function R(A){(A.keyCode==18||!A.altKey)&&(b(t,"CodeMirror-crosshair"),lt(document,"keyup",R),lt(document,"mouseover",R))}De(document,"keyup",R),De(document,"mouseover",R)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),tt(this,e)}function el(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Yn(t.display,e)||tt(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var R=e.keyCode,A=e.charCode;if(h&&R==ls){ls=null,ye(e);return}if(h&&(!e.which||e.which<10)&&Js(t,e))return;var U=String.fromCharCode(A==null?R:A);if(U=="\b")return;if(Fl(t,e,U))return;t.display.input.onKeyPress(e)}var Wl=400,us=function(e,t,R){this.time=e,this.pos=t,this.button=R};us.prototype.compare=function(e,t,R){return this.time+Wl>e&&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.line<qt.from)&&setTimeout(Gn(e,function(){ft==Bt&&yt(kt)}),150)}else{var kr=kt.clientY<at.top?-20:kt.clientY>at.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<e.display.gutterSpecs.length;++me){var xe=ae.gutters.childNodes[me];if(xe&&xe.getBoundingClientRect().right>=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;fe<ds.length;++fe)ds[fe](this);ha(this),o&&t.lineWrapping&&getComputedStyle($.lineDiv).textRendering=="optimizelegibility"&&($.lineDiv.style.textRendering="auto")}Nn.defaults=ol,Nn.optionHandlers=zo;function ql(e){var t=e.display;De(t.scroller,"mousedown",Gn(e,tl)),C&&v<11?De(t.scroller,"dblclick",Gn(e,function(me){if(tt(e,me))return;var xe=ti(e,me);if(!xe||cs(e,me)||Yn(e.display,me))return;ye(me);var We=e.findWordAt(xe);No(e.doc,We.anchor,We.head)})):De(t.scroller,"dblclick",function(me){return tt(e,me)||ye(me)}),De(t.scroller,"contextmenu",function(me){return il(e,me)}),De(t.input.getField(),"contextmenu",function(me){t.scroller.contains(me.target)||il(e,me)});var R,A={end:0};function U(){t.activeTouch&&(R=setTimeout(function(){return t.activeTouch=null},1e3),A=t.activeTouch,A.end=+new Date)}function $(me){if(me.touches.length!=1)return!1;var xe=me.touches[0];return xe.radiusX<=1&&xe.radiusY<=1}function ae(me,xe){if(xe.left==null)return!0;var We=xe.left-me.left,Ge=xe.top-me.top;return We*We+Ge*Ge>20*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(st<We&&(Ge+=ce(We-st)),Ge!=xe)return Va(U,Ge,mt(t,0),mt(t,xe.length),"+input"),fe.stateAfter=null,!0;for(var ft=0;ft<U.sel.ranges.length;ft++){var yt=U.sel.ranges[ft];if(yt.head.line==t&&yt.head.ch<xe.length){var Ot=mt(t,xe.length);is(U,ft,new ln(Ot,Ot));break}}}var ta=null;function Ko(e){ta=e}function hs(e,t,R,A,U){var $=e.doc;e.display.shift=!1,A||(A=$.sel);var ae=+new Date-200,fe=U=="paste"||e.state.pasteIncoming>ae,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<ta.text.length;We++)xe.push($.splitLines(ta.text[We]))}}else me.length==A.ranges.length&&e.options.pasteLinesPerSelection&&(xe=Se(me,function(Dt){return[Dt]}));for(var Ge=e.curOp.updateInput,st=A.ranges.length-1;st>=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<e.doc.sel.ranges.length;A++){var U=e.doc.sel.ranges[A].head.line,$={anchor:mt(U,0),head:mt(U+1,0)};R.push($),t.push(e.getRange($.anchor,$.head))}return{text:t,ranges:R}}function cl(e,t,R,A){e.setAttribute("autocorrect",R?"":"off"),e.setAttribute("autocapitalize",A?"":"off"),e.setAttribute("spellcheck",!!t)}function dl(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return o?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),cl(e),t}function eu(e){var t=e.optionHandlers,R=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(A,U){var $=this.options,ae=$[A];if($[A]==U&&A!="mode")return;$[A]=U,t.hasOwnProperty(A)&&Gn(this,t[A])(this,U,ae),Je(this,"optionChange",this,A)},getOption:function(A){return this.options[A]},getDoc:function(){return this.doc},addKeyMap:function(A,U){this.state.keyMaps[U?"push":"unshift"](Wo(A))},removeKeyMap:function(A){for(var U=this.state.keyMaps,$=0;$<U.length;++$)if(U[$]==A||U[$].name==A)return U.splice($,1),!0},addOverlay:gi(function(A,U){var $=A.token?A:e.getMode(this.options,A);if($.startState)throw new Error("Overlays may not be stateful.");te(this.state.overlays,{mode:$,modeSpec:A,opaque:U&&U.opaque,priority:U&&U.priority||0},function(ae){return ae.priority}),this.state.modeGen++,vn(this)}),removeOverlay:gi(function(A){for(var U=this.state.overlays,$=0;$<U.length;++$){var ae=U[$].modeSpec;if(ae==A||typeof A=="string"&&ae.name==A){U.splice($,1),this.state.modeGen++,vn(this);return}}}),indentLine:gi(function(A,U,$){typeof U!="string"&&typeof U!="number"&&(U==null?U=this.options.smartIndent?"smart":"prev":U=U?"add":"subtract"),bn(this.doc,A)&&Co(this,A,U,$)}),indentSelection:gi(function(A){for(var U=this.doc.sel.ranges,$=-1,ae=0;ae<U.length;ae++){var fe=U[ae];if(fe.empty())fe.head.line>$&&(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]<fe)$=xe+1;else{me=U[xe*2+2];break}}var We=me?me.indexOf("overlay "):-1;return We<0?me:We==0?null:me.slice(0,We-1)},getModeAt:function(A){var U=this.doc.mode;return U.innerMode?e.innerMode(U,this.getTokenAt(A).state).mode:U},getHelper:function(A,U){return this.getHelpers(A,U)[0]},getHelpers:function(A,U){var $=[];if(!R.hasOwnProperty(U))return $;var ae=R[U],fe=this.getModeAt(A);if(typeof fe[U]=="string")ae[fe[U]]&&$.push(ae[fe[U]]);else if(fe[U])for(var me=0;me<fe[U].length;me++){var xe=ae[fe[U][me]];xe&&$.push(xe)}else fe.helperType&&ae[fe.helperType]?$.push(ae[fe.helperType]):ae[fe.name]&&$.push(ae[fe.name]);for(var We=0;We<ae._global.length;We++){var Ge=ae._global[We];Ge.pred(fe,this)&&re($,Ge.val)==-1&&$.push(Ge.val)}return $},getStateAfter:function(A,U){var $=this.doc;return A=se($,A==null?$.first+$.size-1:A),St(this,A+1,U).state},cursorCoords:function(A,U){var $,ae=this.doc.sel.primary();return A==null?$=ae.head:typeof A=="object"?$=z(this.doc,A):$=A?ae.from():ae.to(),Nr(this,$,U||"page")},charCoords:function(A,U){return Dn(this,z(this.doc,A),U||"page")},coordsChar:function(A,U){return A=Ir(this,A,U||"page"),Ur(this,A.left,A.top)},lineAtHeight:function(A,U){return A=Ir(this,{top:A,left:0},U||"page").top,jr(this.doc,A+this.display.viewOffset)},heightAtLine:function(A,U,$){var ae=!1,fe;if(typeof A=="number"){var me=this.doc.first+this.doc.size-1;A<this.doc.first?A=this.doc.first:A>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;xe<U&&!(me=fs(this.doc,me,fe,$,ae),me.hitSide);++xe);return me},moveH:gi(function(A,U){var $=this;this.extendSelectionsBy(function(ae){return $.display.shift||$.doc.extend||ae.empty()?fs($.doc,ae.head,A,U,$.options.rtlMoveVisually):A<0?ae.from():ae.to()},Me)}),deleteH:gi(function(A,U){var $=this.doc.sel,ae=this.doc;$.somethingSelected()?ae.replaceSelection("",null,"+delete"):$a(this,function(fe){var me=fs(ae,fe.head,A,U,!1);return A<0?{from:me,to:fe.head}:{from:fe.head,to:me}})}),findPosV:function(A,U,$,ae){var fe=1,me=ae;U<0&&(fe=-1,U=-U);for(var xe=z(this.doc,A),We=0;We<U;++We){var Ge=Nr(this,xe,"div");if(me==null?me=Ge.left:Ge.left=me,xe=hl(this,Ge,fe,$),xe.hitSide)break}return xe},moveV:gi(function(A,U){var $=this,ae=this.doc,fe=[],me=!this.display.shift&&!ae.extend&&ae.sel.somethingSelected();if(ae.extendSelectionsBy(function(We){if(me)return A<0?We.from():We.to();var Ge=Nr($,We.head,"div");We.goalColumn!=null&&(Ge.left=We.goalColumn),fe.push(Ge.left);var st=hl($,Ge,A,U);return U=="page"&&We==ae.sel.primary()&&no($,Dn($,st,"div").top-Ge.top),st},Me),fe.length)for(var xe=0;xe<ae.sel.ranges.length;xe++)ae.sel.ranges[xe].goalColumn=fe[xe]}),findWordAt:function(A){var U=this.doc,$=Et(U,A.line).text,ae=A.ch,fe=A.ch;if($){var me=this.getHelper(A,"wordChars");(A.sticky=="before"||fe==$.length)&&ae?--ae:++fe;for(var xe=$.charAt(ae),We=Y(xe,me)?function(Ge){return Y(Ge,me)}:/\s/.test(xe)?function(Ge){return/\s/.test(Ge)}:function(Ge){return!/\s/.test(Ge)&&!Y(Ge)};ae>0&&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<me.widgets.length;xe++)if(me.widgets[xe].noHScroll){In($,fe,"widget");break}}++fe}),this.curOp.forceUpdate=!0,Je(this,"refresh",this)}),operation:function(A){return Ti(this,A)},startOperation:function(){return sa(this)},endOperation:function(){return ha(this)},refresh:gi(function(){var A=this.display.cachedTextHeight;vn(this),this.curOp.forceUpdate=!0,yr(this),ba(this,this.doc.scrollLeft,this.doc.scrollTop),Ba(this.display),(A==null||Math.abs(A-Bn(this.display))>.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||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){e.removeAllRanges();return}var $=Go(t,e.anchorNode,e.anchorOffset),ae=Go(t,e.focusNode,e.focusOffset);if($&&!$.bad&&ae&&!ae.bad&&Ut(An($,ae),A)==0&&Ut(On($,ae),U)==0)return;var fe=t.display.view,me=A.line>=t.display.viewFrom&&fl(t,A)||{node:fe[0].measure.map[2],offset:0},xe=U.line<t.display.viewTo&&fl(t,U);if(!xe){var We=fe[fe.length-1].measure,Ge=We.maps?We.maps[We.maps.length-1]:We.map;xe={node:Ge[Ge.length-1],offset:Ge[Ge.length-2]-Ge[Ge.length-3]}}if(!me||!xe){e.removeAllRanges();return}var st=e.rangeCount&&e.getRangeAt(0),at;try{at=j(me.node,me.offset,xe.offset,xe.node)}catch(ft){}at&&(!_&&t.state.focused?(e.collapse(me.node,me.offset),at.collapsed||(e.removeAllRanges(),e.addRange(at))):(e.removeAllRanges(),e.addRange(at)),st&&e.anchorNode==null?e.addRange(st):_&&this.startGracePeriod()),this.rememberSelection()},yn.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},yn.prototype.showMultipleSelections=function(e){x(this.cm.display.cursorDiv,e.cursors),x(this.cm.display.selectionDiv,e.selection)},yn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},yn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return L(this.div,t)},yn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},yn.prototype.blur=function(){this.div.blur()},yn.prototype.getField=function(){return this.div},yn.prototype.supportsTouch=function(){return!0},yn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ti(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},yn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},yn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(c&&r&&this.cm.display.gutterSpecs.length&&tu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var R=Go(t,e.anchorNode,e.anchorOffset),A=Go(t,e.focusNode,e.focusOffset);R&&A&&Ti(t,function(){xi(t.doc,qi(R,A),Ee),(R.bad||A.bad)&&(t.curOp.selectionChanged=!0)})},yn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,R=e.doc.sel.primary(),A=R.from(),U=R.to();if(A.ch==0&&A.line>e.firstLine()&&(A=mt(A.line-1,Et(e.doc,A.line-1).length)),U.ch==Et(e.doc,U.line).text.length&&U.line<e.lastLine()&&(U=mt(U.line+1,0)),A.line<t.viewFrom||U.line>t.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);at<Dt&&yt.charCodeAt(at)==Ot.charCodeAt(at);)++at;for(var jt=oe(Ge),kt=oe(st),Bt=Math.min(jt.length-(Ge.length==1?at:0),kt.length-(st.length==1?at:0));ft<Bt&&jt.charCodeAt(jt.length-ft-1)==kt.charCodeAt(kt.length-ft-1);)++ft;if(Ge.length==1&&st.length==1&&ae==A.line)for(;at&&at>A.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<at.childNodes.length;kt++)st(at.childNodes[kt]);/^(pre|p)$/i.test(at.nodeName)&&(me=!0),jt&&(ae=!0)}else at.nodeType==3&&Ge(at.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(st(t),t==R);)t=t.nextSibling,me=!1;return $}function Go(e,t,R){var A;if(t==e.display.lineDiv){if(A=e.display.lineDiv.childNodes[R],!A)return Qa(e.clipPos(mt(e.display.viewTo-1)),!0);t=null,R=0}else for(A=t;;A=A.parentNode){if(!A||A==e.display.lineDiv)return null;if(A.parentNode&&A.parentNode==e.display.lineDiv)break}for(var U=0;U<e.display.view.length;U++){var $=e.display.view[U];if($.node==A)return nu($,t,R)}}function nu(e,t,R){var A=e.text.firstChild,U=!1;if(!t||!L(A,t))return Qa(mt(Nt(e.line),0),!0);if(t==A&&(U=!0,t=A.childNodes[R],R=0,!t)){var $=e.rest?oe(e.rest):e.line;return Qa(mt(Nt($),$.text.length),U)}var ae=t.nodeType==3?t:null,fe=t;for(!ae&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(ae=t.firstChild,R&&(R=ae.nodeValue.length));fe.parentNode!=A;)fe=fe.parentNode;var me=e.measure,xe=me.maps;function We(Ot,Dt,jt){for(var kt=-1;kt<(xe?xe.length:0);kt++)for(var Bt=kt<0?me.map:xe[kt],ar=0;ar<Bt.length;ar+=3){var qt=Bt[ar+2];if(qt==Ot||qt==Dt){var kr=Nt(kt<0?e.line:e.rest[kt]),Tn=Bt[ar]+jt;return(jt<0||qt!=Ot)&&(Tn=Bt[ar+(jt?1:0)]),mt(kr,Tn)}}}var Ge=We(ae,fe,R);if(Ge)return Qa(Ge,U);for(var st=fe.nextSibling,at=ae?ae.nodeValue.length-R:0;st;st=st.nextSibling){if(Ge=We(st,st.firstChild,0),Ge)return Qa(mt(Ge.line,Ge.ch-at),U);at+=st.textContent.length}for(var ft=fe.previousSibling,yt=R;ft;ft=ft.previousSibling){if(Ge=We(ft,ft.firstChild,-1),Ge)return Qa(mt(Ge.line,Ge.ch+yt),U);yt+=ft.textContent.length}}var Xn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new q,this.hasSelection=!1,this.composing=null};Xn.prototype.init=function(e){var t=this,R=this,A=this.cm;this.createField(e);var U=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(U.style.width="0px"),De(U,"input",function(){C&&v>=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);ae<fe&&A.charCodeAt(ae)==U.charCodeAt(ae);)++ae;return Ti(t,function(){hs(t,U.slice(ae),A.length-ae,null,e.composing?"*compose":null),U.length>1e3||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;c<r;c++)w[c]^=1549556828,g[c]^=909522486;m.sigBytes=p.sigBytes=h,this.reset()},reset:function(){var o=this._hasher;o.reset(),o.update(this._iKey)},update:function(o){return this._hasher.update(o),this},finalize:function(o){var a=this._hasher,r=a.finalize(o);a.reset();var h=a.finalize(this._oKey.clone().concat(r));return h}})})()})},WaYH:function(I,J,P){"use strict";var M=P("rePB"),u=P("Ff2n"),_=P("VTBJ"),D=P("1OyB"),f=P("vuIU"),l=P("JX7q"),C=P("Ji7U"),v=P("LK+K"),o=P("q1tI"),a=P("TSYQ"),r=P.n(a),h=P("sboe"),m=P("OZM5"),p=function(k){var O=k.prefixCls,b=k.level,E=k.isStart,x=k.isEnd;if(!b)return null;for(var T="".concat(O,"-indent-unit"),N=[],j=0;j<b;j+=1){var L;N.push(o.createElement("span",{key:j,className:r()(T,(L={},Object(M.a)(L,"".concat(T,"-start"),E[j+1]),Object(M.a)(L,"".concat(T,"-end"),x[j+1]),Object(M.a)(L,"".concat(T,"-end-first-level"),!j&&x[0]),L))}))}return o.createElement("span",{"aria-hidden":"true",className:"".concat(O,"-indent")},N)},w=p,g=P("815F"),c="open",n="close",s="---",d=function(i){Object(C.a)(O,i);var k=Object(v.a)(O);function O(){var b;return Object(D.a)(this,O),b=k.apply(this,arguments),b.state={dragNodeHighlight:!1},b.onSelectorClick=function(E){var x=b.props.context.onNodeClick;x(E,Object(g.b)(b.props)),b.isSelectable()?b.onSelect(E):b.onCheck(E)},b.onSelectorDoubleClick=function(E){var x=b.props.context.onNodeDoubleClick;x(E,Object(g.b)(b.props))},b.onSelect=function(E){if(b.isDisabled())return;var x=b.props.context.onNodeSelect;E.preventDefault(),x(E,Object(g.b)(b.props))},b.onCheck=function(E){if(b.isDisabled())return;var x=b.props,T=x.disableCheckbox,N=x.checked,j=b.props.context.onNodeCheck;if(!b.isCheckable()||T)return;E.preventDefault();var L=!N;j(E,Object(g.b)(b.props),L)},b.onMouseEnter=function(E){var x=b.props.context.onNodeMouseEnter;x(E,Object(g.b)(b.props))},b.onMouseLeave=function(E){var x=b.props.context.onNodeMouseLeave;x(E,Object(g.b)(b.props))},b.onContextMenu=function(E){var x=b.props.context.onNodeContextMenu;x(E,Object(g.b)(b.props))},b.onDragStart=function(E){var x=b.props.context.onNodeDragStart;E.stopPropagation(),b.setState({dragNodeHighlight:!0}),x(E,Object(l.a)(b));try{E.dataTransfer.setData("text/plain","")}catch(T){}},b.onDragEnter=function(E){var x=b.props.context.onNodeDragEnter;E.preventDefault(),E.stopPropagation(),x(E,Object(l.a)(b))},b.onDragOver=function(E){var x=b.props.context.onNodeDragOver;E.preventDefault(),E.stopPropagation(),x(E,Object(l.a)(b))},b.onDragLeave=function(E){var x=b.props.context.onNodeDragLeave;E.stopPropagation(),x(E,Object(l.a)(b))},b.onDragEnd=function(E){var x=b.props.context.onNodeDragEnd;E.stopPropagation(),b.setState({dragNodeHighlight:!1}),x(E,Object(l.a)(b))},b.onDrop=function(E){var x=b.props.context.onNodeDrop;E.preventDefault(),E.stopPropagation(),b.setState({dragNodeHighlight:!1}),x(E,Object(l.a)(b))},b.onExpand=function(E){var x=b.props.context.onNodeExpand;x(E,Object(g.b)(b.props))},b.setSelectHandle=function(E){b.selectHandle=E},b.getNodeState=function(){var E=b.props.expanded;return b.isLeaf()?null:E?c:n},b.hasChildren=function(){var E=b.props.eventKey,x=b.props.context.keyEntities,T=x[E]||{},N=T.children;return!!(N||[]).length},b.isLeaf=function(){var E=b.props,x=E.isLeaf,T=E.loaded,N=b.props.context.loadData,j=b.hasChildren();return x===!1?!1:x||!N&&!j||N&&T&&!j},b.isDisabled=function(){var E=b.props.disabled,x=b.props.context.disabled;return!!(x||E)},b.isCheckable=function(){var E=b.props.checkable,x=b.props.context.checkable;return!x||E===!1?!1:x},b.syncLoadData=function(E){var x=E.expanded,T=E.loading,N=E.loaded,j=b.props.context,L=j.loadData,V=j.onNodeLoad;if(T)return;L&&x&&!b.isLeaf()&&(!b.hasChildren()&&!N&&V(Object(g.b)(b.props)))},b.renderSwitcher=function(){var E=b.props,x=E.expanded,T=E.switcherIcon,N=b.props.context,j=N.prefixCls,L=N.switcherIcon,V=T||L;if(b.isLeaf())return o.createElement("span",{className:r()("".concat(j,"-switcher"),"".concat(j,"-switcher-noop"))},typeof V=="function"?V(Object(_.a)(Object(_.a)({},b.props),{},{isLeaf:!0})):V);var K=r()("".concat(j,"-switcher"),"".concat(j,"-switcher_").concat(x?c:n));return o.createElement("span",{onClick:b.onExpand,className:K},typeof V=="function"?V(Object(_.a)(Object(_.a)({},b.props),{},{isLeaf:!1})):V)},b.renderCheckbox=function(){var E=b.props,x=E.checked,T=E.halfChecked,N=E.disableCheckbox,j=b.props.context.prefixCls,L=b.isDisabled(),V=b.isCheckable();if(!V)return null;var K=typeof V!="boolean"?V:null;return o.createElement("span",{className:r()("".concat(j,"-checkbox"),x&&"".concat(j,"-checkbox-checked"),!x&&T&&"".concat(j,"-checkbox-indeterminate"),(L||N)&&"".concat(j,"-checkbox-disabled")),onClick:b.onCheck},K)},b.renderIcon=function(){var E=b.props.loading,x=b.props.context.prefixCls;return o.createElement("span",{className:r()("".concat(x,"-iconEle"),"".concat(x,"-icon__").concat(b.getNodeState()||"docu"),E&&"".concat(x,"-icon_loading"))})},b.renderSelector=function(){var E=b.state.dragNodeHighlight,x=b.props,T=x.title,N=x.selected,j=x.icon,L=x.loading,V=x.data,K=b.props.context,W=K.prefixCls,G=K.showIcon,F=K.icon,B=K.draggable,H=K.loadData,q=K.titleRender,re=b.isDisabled(),ee="".concat(W,"-node-content-wrapper"),Ce;if(G){var Ee=j||F;Ce=Ee?o.createElement("span",{className:r()("".concat(W,"-iconEle"),"".concat(W,"-icon__customize"))},typeof Ee=="function"?Ee(b.props):Ee):b.renderIcon()}else H&&L&&(Ce=b.renderIcon());var pe;typeof T=="function"?pe=T(V):q?pe=q(V):pe=T;var Me=o.createElement("span",{className:"".concat(W,"-title")},pe);return o.createElement("span",{ref:b.setSelectHandle,title:typeof T=="string"?T:"",className:r()("".concat(ee),"".concat(ee,"-").concat(b.getNodeState()||"normal"),!re&&(N||E)&&"".concat(W,"-node-selected"),!re&&B&&"draggable"),draggable:!re&&B||void 0,"aria-grabbed":!re&&B||void 0,onMouseEnter:b.onMouseEnter,onMouseLeave:b.onMouseLeave,onContextMenu:b.onContextMenu,onClick:b.onSelectorClick,onDoubleClick:b.onSelectorDoubleClick,onDragStart:B?b.onDragStart:void 0},Ce,Me)},b}return Object(f.a)(O,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var E=this.props.selectable,x=this.props.context.selectable;return typeof E=="boolean"?E:x}},{key:"render",value:function(){var E,x=this.props,T=x.eventKey,N=x.className,j=x.style,L=x.dragOver,V=x.dragOverGapTop,K=x.dragOverGapBottom,W=x.isLeaf,G=x.isStart,F=x.isEnd,B=x.expanded,H=x.selected,q=x.checked,re=x.halfChecked,ee=x.loading,Ce=x.domRef,Ee=x.active,pe=x.onMouseMove,Me=Object(u.a)(x,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),_e=this.props.context,he=_e.prefixCls,ce=_e.filterTreeNode,oe=_e.draggable,Se=_e.keyEntities,te=this.isDisabled(),ue=Object(m.f)(Me),Oe=Se[T]||{},le=Oe.level,Q=F[F.length-1];return o.createElement("div",Object.assign({ref:Ce,className:r()(N,"".concat(he,"-treenode"),(E={},Object(M.a)(E,"".concat(he,"-treenode-disabled"),te),Object(M.a)(E,"".concat(he,"-treenode-switcher-").concat(B?"open":"close"),!W),Object(M.a)(E,"".concat(he,"-treenode-checkbox-checked"),q),Object(M.a)(E,"".concat(he,"-treenode-checkbox-indeterminate"),re),Object(M.a)(E,"".concat(he,"-treenode-selected"),H),Object(M.a)(E,"".concat(he,"-treenode-loading"),ee),Object(M.a)(E,"".concat(he,"-treenode-active"),Ee),Object(M.a)(E,"".concat(he,"-treenode-leaf-last"),Q),Object(M.a)(E,"drag-over",!te&&L),Object(M.a)(E,"drag-over-gap-top",!te&&V),Object(M.a)(E,"drag-over-gap-bottom",!te&&K),Object(M.a)(E,"filter-node",ce&&ce(Object(g.b)(this.props))),E)),style:j,onDragEnter:oe?this.onDragEnter:void 0,onDragOver:oe?this.onDragOver:void 0,onDragLeave:oe?this.onDragLeave:void 0,onDrop:oe?this.onDrop:void 0,onDragEnd:oe?this.onDragEnd:void 0,onMouseMove:pe},ue),o.createElement(w,{prefixCls:he,level:le,isStart:G,isEnd:F}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),O}(o.Component),S=function(k){return o.createElement(h.a.Consumer,null,function(O){return o.createElement(d,Object.assign({},k,{context:O}))})};S.displayName="TreeNode",S.defaultProps={title:s},S.isTreeNode=1;var y=J.a=S},XIdC:function(I,J,P){"use strict";var M=P("rePB"),u=P("ODXe"),_=P("Ff2n"),D=P("q1tI"),f=P.n(D),l=P("TSYQ"),C=P.n(l),v=P("6cGi"),o=P("4IlW"),a=D.forwardRef(function(r,h){var m,p=r.prefixCls,w=p===void 0?"rc-switch":p,g=r.className,c=r.checked,n=r.defaultChecked,s=r.disabled,d=r.loadingIcon,S=r.checkedChildren,y=r.unCheckedChildren,i=r.onClick,k=r.onChange,O=r.onKeyDown,b=Object(_.a)(r,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),E=Object(v.a)(!1,{value:c,defaultValue:n}),x=Object(u.a)(E,2),T=x[0],N=x[1];function j(W,G){var F=T;return s||(F=W,N(F),k==null||k(F,G)),F}function L(W){W.which===o.a.LEFT?j(!1,W):W.which===o.a.RIGHT&&j(!0,W),O==null||O(W)}function V(W){var G=j(!T,W);i==null||i(G,W)}var K=C()(w,g,(m={},Object(M.a)(m,"".concat(w,"-checked"),T),Object(M.a)(m,"".concat(w,"-disabled"),s),m));return D.createElement("button",Object.assign({},b,{type:"button",role:"switch","aria-checked":T,disabled:s,className:K,ref:h,onKeyDown:L,onClick:V}),d,D.createElement("span",{className:"".concat(w,"-inner")},T?S:y))});a.displayName="Switch",J.a=a},Y1PL:function(I,J,P){"use strict";P.r(J),P.d(J,"ResizableTextArea",function(){return re});var M=P("wx14"),u=P("1OyB"),_=P("vuIU"),D=P("Ji7U"),f=P("LK+K"),l=P("q1tI"),C=P("VTBJ"),v=P("rePB"),o=P("Zm9Q"),a=P("Kwbf"),r=P("c+Xe"),h=P("m+aA"),m=P("bdgK"),p=new Map;function w(Ee){Ee.forEach(function(pe){var Me,_e=pe.target;(Me=p.get(_e))===null||Me===void 0||Me.forEach(function(he){return he(_e)})})}var g=new m.default(w),c=null,n=null;function s(Ee,pe){p.has(Ee)||(p.set(Ee,new Set),g.observe(Ee)),p.get(Ee).add(pe)}function d(Ee,pe){p.has(Ee)&&(p.get(Ee).delete(pe),p.get(Ee).size||(g.unobserve(Ee),p.delete(Ee)))}var S=function(Ee){Object(D.a)(Me,Ee);var pe=Object(f.a)(Me);function Me(){return Object(u.a)(this,Me),pe.apply(this,arguments)}return Object(_.a)(Me,[{key:"render",value:function(){return this.props.children}}]),Me}(l.Component),y=l.createContext(null);function i(Ee){var pe=Ee.children,Me=Ee.onBatchResize,_e=l.useRef(0),he=l.useRef([]),ce=l.useContext(y),oe=l.useCallback(function(Se,te,ue){_e.current+=1;var Oe=_e.current;he.current.push({size:Se,element:te,data:ue}),Promise.resolve().then(function(){Oe===_e.current&&(Me==null||Me(he.current),he.current=[])}),ce==null||ce(Se,te,ue)},[Me,ce]);return l.createElement(y.Provider,{value:oe},pe)}function k(Ee){var pe=Ee.children,Me=Ee.disabled,_e=l.useRef(null),he=l.useRef(null),ce=l.useContext(y),oe=l.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Se=l.isValidElement(pe)&&Object(r.c)(pe),te=Se?pe.ref:null,ue=l.useMemo(function(){return Object(r.a)(te,_e)},[te,_e]),Oe=l.useRef(Ee);Oe.current=Ee;var le=l.useCallback(function(Q){var Y=Oe.current,Z=Y.onResize,be=Y.data,ge=Q.getBoundingClientRect(),Re=ge.width,Ze=ge.height,qe=Q.offsetWidth,et=Q.offsetHeight,nt=Math.floor(Re),ut=Math.floor(Ze);if(oe.current.width!==nt||oe.current.height!==ut||oe.current.offsetWidth!==qe||oe.current.offsetHeight!==et){var ot={width:nt,height:ut,offsetWidth:qe,offsetHeight:et};oe.current=ot;var je=qe===Math.round(Re)?Re:qe,De=et===Math.round(Ze)?Ze:et,rt=Object(C.a)(Object(C.a)({},ot),{},{offsetWidth:je,offsetHeight:De});ce==null||ce(rt,Q,be),Z&&Promise.resolve().then(function(){Z(rt,Q)})}},[]);return l.useEffect(function(){var Q=Object(h.a)(_e.current)||Object(h.a)(he.current);return Q&&!Me&&s(Q,le),function(){return d(Q,le)}},[_e.current,Me]),l.createElement(S,{ref:he},Se?l.cloneElement(pe,{ref:ue}):pe)}var O="rc-observer-key";function b(Ee){var pe=Ee.children,Me=Object(o.a)(pe);return Me.map(function(_e,he){var ce=(_e==null?void 0:_e.key)||"".concat(O,"-").concat(he);return l.createElement(k,Object(M.a)({},Ee,{key:ce}),_e)})}b.Collection=i;var E=b,x=P("bT9E"),T=P("TSYQ"),N=P.n(T),j=`
|
|
|
min-height:0 !important;
|
|
|
max-height:none !important;
|
|
|
height:0 !important;
|
|
|
visibility:hidden !important;
|
|
|
overflow:hidden !important;
|
|
|
position:absolute !important;
|
|
|
z-index:-1000 !important;
|
|
|
top:0 !important;
|
|
|
right:0 !important
|
|
|
`,L=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],V={},K;function W(Ee){var pe=arguments.length>1&&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;k<y.length;k++){var O=c[y[k]];if(O)return O}return i[0]}return c[i]||i}var s=null,d=J.b=function(y){var i=y.width,k=i===void 0?"100%":i,O=y.height,b=O===void 0?"100%":O,E=y.value,x=y.language,T=x===void 0?"javascript":x,N=y.style,j=N===void 0?{}:N,L=y.options,V=L===void 0?{}:L,K=y.overrideServices,W=K===void 0?{}:K,G=y.theme,F=G===void 0?"vs-dark":G,B=y.onEditBlur,H=y.onSave,q=y.autoHeight,re=q===void 0?!1:q,ee=y.forbidCopy,Ce=ee===void 0?!1:ee,Ee=y.onChange,pe=Ee===void 0?w:Ee,Me=y.editorDidMount,_e=Me===void 0?w:Me,he=y.onFocus,ce=he===void 0?w:he,oe=y.filename,Se=oe===void 0?"educoder.txt":oe,te=Object(l.a)(y,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),ue=Object(C.useRef)(),Oe=Object(C.useRef)({}),le=Object(C.useRef)(),Q=Object(C.useRef)(!1),Y=Object(C.useRef)(),Z=Object(C.useState)(!1),be=Object(f.a)(Z,2),ge=be[0],Re=be[1];function Ze(){var Ae;return ue.current&&(Ae=new o.default(function(Pe){var $e=Object(D.a)(Pe),Ke;try{for($e.s();!(Ke=$e.n()).done;){var ct=Ke.value;(ct.target.offsetHeight>0||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(Pe<b?b:Pe)}else ye(b)};function je(Ae){var Pe=document.createEvent("MouseEvents");Pe.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ae.dispatchEvent(Pe)}function De(Ae,Pe){var $e=window.URL||window.webkitURL||window,Ke=new Blob([Pe]),ct=document.createElementNS("http://www.w3.org/1999/xhtml","a");ct.href=$e.createObjectURL(Ke),ct.download=Ae,je(ct)}Object(C.useEffect)(function(){ot()},[ot]),Object(C.useEffect)(function(){ue.current&&!ge&&P.e(27).then(P.t.bind(null,"M/lh",7)).then(function(Ae){try{s=Ae,Oe.current.instance=s.editor.create(ue.current,{value:E,language:n(T),theme:F,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},W);var Pe=Oe.current.instance;if(_e(Pe,s),setTimeout(function(){ot(),Oe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){De(Se||"educoder.txt",Pe.getValue())}})},500),Oe.current.subscription=Pe.onDidChangeModelContent(function(Ke){Q.current?clearTimeout(Y.current):(ot(),pe(Pe.getValue(),Ke)),Y.current=setTimeout(function(){Q.current=!1},500)}),window.Monaco||r(s),Ce&&(Pe.addCommand(s.KeyMod.CtrlCmd|s.KeyMod.Shift|s.KeyCode.KEY_V,function(){return qe(),null}),Pe.addCommand(s.KeyMod.CtrlCmd|s.KeyCode.KEY_C,function(){return qe(),null})),window.Monaco=s,B&&Pe.onDidBlurEditorWidget(function(){B(Pe.getValue())}),ce&&Pe.onDidFocusEditorText(function(){ce(Pe.getValue())}),Ce){Pe.addCommand(s.KeyMod.CtrlCmd|s.KeyCode.KEY_V,function(){return qe(),null}),Pe.onDidPaste(function(Ke){Oe.current.pastePos=Ke});try{window.addEventListener("paste",nt)}catch(Ke){}}var $e=Ze();return Re(!0),function(){var Ke=Oe.current.instance;Ke.dispose();var ct=Ke.getModel();ct&&ct.dispose(),Oe.current.subscription&&Oe.current.subscription.dispose(),Ce&&window.removeEventListener("paste",nt),$e.unobserve(ue.current)}}catch(Ke){}})},[]),Object(C.useEffect)(function(){var Ae=Oe.current.instance;if(Ae&&ge)return document.addEventListener("keydown",ut,!1),function(){document.removeEventListener("keydown",ut)}},[H,ge]),Object(C.useEffect)(function(){var Ae=Oe.current.instance;if(Ae&&ge){var Pe=n(T);s.editor.setModelLanguage(Ae.getModel(),Pe),console.log("language:",T,Ae.getModel(),Pe)}},[T,ge]),Object(C.useEffect)(function(){var Ae=Oe.current.instance;Ae&&ge&&s.editor.setTheme(F)},[F,ge]),Object(C.useEffect)(function(){var Ae=Oe.current.instance;Ae&&ge&&(Ae.updateOptions(Object(M.a)({},V)),setTimeout(function(){Ae.getModel().updateOptions(Object(M.a)({},V))},200))},[JSON.stringify(V),ge]),Object(C.useEffect)(function(){var Ae=Oe.current.instance;Ae&&ge&&Ae.layout()},[k,b,ge]);var rt=Object(C.useState)(p(k)),lt=Object(f.a)(rt,2),Je=lt[0],tt=lt[1],Ue=Object(C.useState)(p(b)),ke=Object(f.a)(Ue,2),Ie=ke[0],ye=ke[1],Te=Object(M.a)(Object(M.a)({},j),{},{width:Je,height:Ie});return v.a.createElement("div",{className:"my-monaco-editor",ref:ue,style:Te})};function S(y){var i=y.width,k=i===void 0?"100%":i,O=y.height,b=O===void 0?"100%":O,E=y.original,x=y.modified,T=y.language,N=y.options,j=N===void 0?{}:N,L=Object(C.useRef)(),V=Object(C.useState)(null),K=Object(f.a)(V,2),W=K[0],G=K[1];function F(re){var ee;return L.current&&(ee=new o.default(function(Ce){var Ee=Object(D.a)(Ce),pe;try{for(Ee.s();!(pe=Ee.n()).done;){var Me=pe.value;(Me.target.offsetHeight>0||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.clientHeight<r.scrollHeight||r.clientWidth<r.scrollWidth){var m=getComputedStyle(r,null);return u(m.overflowY,h)||u(m.overflowX,h)||function(p){var w=function(g){if(!g.ownerDocument||!g.ownerDocument.defaultView)return null;try{return g.ownerDocument.defaultView.frameElement}catch(c){return null}}(p);return!!w&&(w.clientHeight<p.scrollHeight||w.clientWidth<p.scrollWidth)}(r)}return!1}function D(r,h,m,p,w,g,c,n){return g<r&&c>h||g>r&&c<h?0:g<=r&&n<=m||c>=h&&n>=m?g-r-p:c>h&&n<m||g<r&&n>m?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<S.length;F++){var B=S[F],H=B.getBoundingClientRect(),q=H.height,re=H.width,ee=H.top,Ce=H.right,Ee=H.bottom,pe=H.left;if(p==="if-needed"&&N>=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+(Se<te?6:0);break;case Se:le=(te-oe)/Z+2;break;case te:le=(oe-Se)/Z+4;break}le/=6}return{h:le,s:Q,l:Y}}function p(oe,Se,te){var ue,Oe,le;oe=F(oe,360),Se=F(Se,100),te=F(te,100);function Q(be,ge,Re){return Re<0&&(Re+=1),Re>1&&(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<te?6:0);break;case Se:le=(te-oe)/Z+2;break;case te:le=(oe-Se)/Z+4;break}le/=6}return{h:le,s:Q,v:Y}}function g(oe,Se,te){oe=F(oe,360)*6,Se=F(Se,100),te=F(te,100);var ue=u.floor(oe),Oe=oe-ue,le=te*(1-Se),Q=te*(1-Oe*Se),Y=te*(1-(1-Oe)*Se),Z=ue%6,be=[te,Q,le,le,Y,te][Z],ge=[Y,te,te,Q,le,le][Z],Re=[le,le,Y,te,te,Q][Z];return{r:be*255,g:ge*255,b:Re*255}}function c(oe,Se,te,ue){var Oe=[ee(l(oe).toString(16)),ee(l(Se).toString(16)),ee(l(te).toString(16))];return ue&&Oe[0].charAt(0)==Oe[0].charAt(1)&&Oe[1].charAt(0)==Oe[1].charAt(1)&&Oe[2].charAt(0)==Oe[2].charAt(1)?Oe[0].charAt(0)+Oe[1].charAt(0)+Oe[2].charAt(0):Oe.join("")}function n(oe,Se,te,ue,Oe){var le=[ee(l(oe).toString(16)),ee(l(Se).toString(16)),ee(l(te).toString(16)),ee(Ee(ue))];return Oe&&le[0].charAt(0)==le[0].charAt(1)&&le[1].charAt(0)==le[1].charAt(1)&&le[2].charAt(0)==le[2].charAt(1)&&le[3].charAt(0)==le[3].charAt(1)?le[0].charAt(0)+le[1].charAt(0)+le[2].charAt(0)+le[3].charAt(0):le.join("")}function s(oe,Se,te,ue){var Oe=[ee(Ee(ue)),ee(l(oe).toString(16)),ee(l(Se).toString(16)),ee(l(te).toString(16))];return Oe.join("")}a.equals=function(oe,Se){return!oe||!Se?!1:a(oe).toRgbString()==a(Se).toRgbString()},a.random=function(){return a.fromRatio({r:o(),g:o(),b:o()})};function d(oe,Se){Se=Se===0?0:Se||10;var te=a(oe).toHsl();return te.s-=Se/100,te.s=B(te.s),a(te)}function S(oe,Se){Se=Se===0?0:Se||10;var te=a(oe).toHsl();return te.s+=Se/100,te.s=B(te.s),a(te)}function y(oe){return a(oe).desaturate(100)}function i(oe,Se){Se=Se===0?0:Se||10;var te=a(oe).toHsl();return te.l+=Se/100,te.l=B(te.l),a(te)}function k(oe,Se){Se=Se===0?0:Se||10;var te=a(oe).toRgb();return te.r=v(0,C(255,te.r-l(255*-(Se/100)))),te.g=v(0,C(255,te.g-l(255*-(Se/100)))),te.b=v(0,C(255,te.b-l(255*-(Se/100)))),a(te)}function O(oe,Se){Se=Se===0?0:Se||10;var te=a(oe).toHsl();return te.l-=Se/100,te.l=B(te.l),a(te)}function b(oe,Se){var te=a(oe).toHsl(),ue=(te.h+Se)%360;return te.h=ue<0?360+ue:ue,a(te)}function E(oe){var Se=a(oe).toHsl();return Se.h=(Se.h+180)%360,a(Se)}function x(oe){var Se=a(oe).toHsl(),te=Se.h;return[a(oe),a({h:(te+120)%360,s:Se.s,l:Se.l}),a({h:(te+240)%360,s:Se.s,l:Se.l})]}function T(oe){var Se=a(oe).toHsl(),te=Se.h;return[a(oe),a({h:(te+90)%360,s:Se.s,l:Se.l}),a({h:(te+180)%360,s:Se.s,l:Se.l}),a({h:(te+270)%360,s:Se.s,l:Se.l})]}function N(oe){var Se=a(oe).toHsl(),te=Se.h;return[a(oe),a({h:(te+72)%360,s:Se.s,l:Se.l}),a({h:(te+216)%360,s:Se.s,l:Se.l})]}function j(oe,Se,te){Se=Se||6,te=te||30;var ue=a(oe).toHsl(),Oe=360/te,le=[a(oe)];for(ue.h=(ue.h-(Oe*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;be<Se.length;be++)le=a.readability(oe,Se[be]),le>Oe&&(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<<s|S>>>32-s)+w}function r(p,w,g,c,n,s,d){var S=p+(w&c|g&~c)+n+d;return(S<<s|S>>>32-s)+w}function h(p,w,g,c,n,s,d){var S=p+(w^g^c)+n+d;return(S<<s|S>>>32-s)+w}function m(p,w,g,c,n,s,d){var S=p+(g^(w|~c))+n+d;return(S<<s|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;T<arguments.length;T++){var N=arguments[T]!=null?arguments[T]:{};T%2?m(Object(N),!0).forEach(function(j){Object(u.a)(x,j,N[j])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(N)):m(Object(N)).forEach(function(j){Object.defineProperty(x,j,Object.getOwnPropertyDescriptor(N,j))})}return x}function w(x){var T=g();return function(){var j=Object(C.a)(x),L;if(T){var V=Object(C.a)(this).constructor;L=Reflect.construct(j,arguments,V)}else L=j.apply(this,arguments);return Object(l.a)(this,L)}}function g(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(x){return!1}}function c(){}function n(x){x.preventDefault()}var s=function(T){return T.replace(/[^\w.-]+/g,"")},d=200,S=600,y=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,i=function(T){return T!=null},k=function(T,N){return N===T||typeof N=="number"&&typeof T=="number"&&isNaN(N)&&isNaN(T)},O=function(x){Object(f.a)(N,x);var T=w(N);function N(j){var L;Object(_.a)(this,N),L=T.call(this,j),L.onKeyDown=function(W){var G=L.props,F=G.onKeyDown,B=G.onPressEnter;if(W.keyCode===h.a.UP){var H=L.getRatio(W);L.up(W,H,null),L.stop()}else if(W.keyCode===h.a.DOWN){var q=L.getRatio(W);L.down(W,q,null),L.stop()}else W.keyCode===h.a.ENTER&&B&&B(W);if(L.recordCursorPosition(),L.lastKeyCode=W.keyCode,F){for(var re=arguments.length,ee=new Array(re>1?re-1:0),Ce=1;Ce<re;Ce++)ee[Ce-1]=arguments[Ce];F.apply(void 0,[W].concat(ee))}},L.onKeyUp=function(W){var G=L.props.onKeyUp;if(L.stop(),L.recordCursorPosition(),G){for(var F=arguments.length,B=new Array(F>1?F-1:0),H=1;H<F;H++)B[H-1]=arguments[H];G.apply(void 0,[W].concat(B))}},L.onChange=function(W){var G=L.props.onChange;L.state.focused&&(L.inputting=!0),L.rawInput=L.props.parser(L.getValueFromEvent(W)),L.setState({inputValue:L.rawInput}),G(L.toNumber(L.rawInput))},L.onMouseUp=function(){var W=L.props.onMouseUp;L.recordCursorPosition(),W&&W.apply(void 0,arguments)},L.onFocus=function(){var W;L.setState({focused:!0}),(W=L.props).onFocus.apply(W,arguments)},L.onBlur=function(){var W=L.props.onBlur;L.inputting=!1,L.setState({focused:!1});var G=L.getCurrentValidValue(L.state.inputValue),F=L.setValue(G,c);if(W){var B=L.input.value,H=L.getInputDisplayValue({focus:!1,value:F});L.input.value=H&&Number(H),W.apply(void 0,arguments),L.input.value=B}},L.getRatio=function(W){var G=1;return W.metaKey||W.ctrlKey?G=.1:W.shiftKey&&(G=10),G},L.getFullNum=function(W){return isNaN(W)?W:/e/i.test(String(W))?Number(W).toFixed(18).replace(/\.?0+$/,""):W},L.getPrecision=function(W){if(i(L.props.precision))return L.props.precision;var G=String(W);if(G.indexOf("e-")>=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"&&re<F&&W&&W(F)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ee=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===h.a.BACKSPACE?ee=this.cursorStart-1:this.lastKeyCode===h.a.DELETE&&(ee=this.cursorStart):ee=this.input.value.length,this.fixCaret(ee,ee)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case h.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case h.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ce){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(L){var V=L;return V===""?V="":this.isNotCompleteNumber(parseFloat(V))?V=this.state.value:V=this.getValidValue(V),this.toNumber(V)}},{key:"getValueFromEvent",value:function(L){var V=L.target.value.trim().replace(/。/g,".");return i(this.props.decimalSeparator)&&(V=V.replace(this.props.decimalSeparator,".")),V}},{key:"getValidValue",value:function(L){var V=arguments.length>1&&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:(W<V&&(W=V),W>K&&(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||H<F.min;if(H>F.max?H=F.max:H<F.min&&(H=F.min),this.setValue(H,null),this.setState({focused:!0},function(){K.pressingUpOrDown=!1}),q)return;this.autoStepTimer=setTimeout(function(){K[L](V,W,!0)},G?d:S)}},{key:"fixCaret",value:function(L,V){if(L===void 0||V===void 0||!this.input||!this.input.value)return;try{var K=this.input.selectionStart,W=this.input.selectionEnd;(L!==K||V!==W)&&this.input.setSelectionRange(L,V)}catch(G){}}},{key:"render",value:function(){var L,V=this.props,K=V.prefixCls,W=V.disabled,G=V.readOnly,F=V.useTouch,B=V.autoComplete,H=V.upHandler,q=V.downHandler,re=V.className,ee=V.max,Ce=V.min,Ee=V.style,pe=V.title,Me=V.onMouseEnter,_e=V.onMouseLeave,he=V.onMouseOver,ce=V.onMouseOut,oe=V.required,Se=V.onClick,te=V.tabIndex,ue=V.type,Oe=V.placeholder,le=V.id,Q=V.inputMode,Y=V.pattern,Z=V.step,be=V.maxLength,ge=V.autoFocus,Re=V.name,Ze=V.onPaste,qe=V.onInput,et=Object(M.a)(V,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),nt=this.state,ut=nt.value,ot=nt.focused,je=r()(K,(L={},Object(u.a)(L,re,!!re),Object(u.a)(L,"".concat(K,"-disabled"),W),Object(u.a)(L,"".concat(K,"-focused"),ot),L)),De={};Object.keys(et).forEach(function(Pe){(Pe.substr(0,5)==="data-"||Pe.substr(0,5)==="aria-"||Pe==="role")&&(De[Pe]=et[Pe])});var rt=!G&&!W,lt=this.getInputDisplayValue(null),Je=(ut||ut===0)&&(isNaN(ut)||Number(ut)>=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<n;){var d=m.update(r).finalize(w);m.reset();for(var S=d.words,y=S.length,i=d,k=1;k<s;k++){i=m.finalize(i),m.reset();for(var O=i.words,b=0;b<y;b++)S[b]^=O[b]}p.concat(d),c[0]++}return p.sigBytes=n*4,p}});u.PBKDF2=function(a,r,h){return o.create(h).compute(a,r)}}(),M.PBKDF2})},eRFJ:function(I,J,P){I.exports={header:"header___2DEfS",field:"field___2KFR1","oj-form-container":"oj-form-container___11-CJ","oj-left-panel":"oj-left-panel___2_COu","oj-form-info":"oj-form-info___3RmjJ",footer:"footer___13GF0",result:"result___2TPH2",passText:"passText___m4yU3",noPassText:"noPassText___bU8yW",pass:"pass___1qwzN",noPass:"noPass___35fR7","test-case-name":"test-case-name___JX6gg","btn-remove-case":"btn-remove-case___20q0s","icon-tag":"icon-tag___ahN2d",btn_back:"btn_back___2GR2u",testJi:"testJi___lY3ok",upBtn:"upBtn___14ov-","oj-problems":"oj-problems___3xexO",row:"row____2CFx",a:"a___1o_MZ",b:"b___2s_8T",inputTwo:"inputTwo___2QE50",inputOne:"inputOne___3VLjS",cusModal:"cusModal___3HaCu","oj-custom-large-spin":"oj-custom-large-spin___18Uw5",MdEditor:"MdEditor___2TQ6G"}},fcSX:function(I,J,P){"use strict";var M=P("Ff2n"),u=P("1OyB"),_=P("vuIU"),D=P("Ji7U"),f=P("md7G"),l=P("foSv"),C=P("1W/9"),v=P("q1tI"),o=P("rePB"),a=P("JX7q"),r=P("TSYQ"),h=P.n(r),m=P("qx4F"),p=P("4IlW");function w(W){return Array.isArray(W)?W:[W]}var g={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},c=Object.keys(g).filter(function(W){if(typeof document=="undefined")return!1;var G=document.getElementsByTagName("html")[0];return W in(G?G.style:{})})[0],n=g[c];function s(W,G,F,B){W.addEventListener?W.addEventListener(G,F,B):W.attachEvent&&W.attachEvent("on".concat(G),F)}function d(W,G,F,B){W.removeEventListener?W.removeEventListener(G,F,B):W.attachEvent&&W.detachEvent("on".concat(G),F)}function S(W,G){var F=typeof W=="function"?W(G):W;return Array.isArray(F)?F.length===2?F:[F[0],F[1]]:[F]}var y=function(G){return!isNaN(parseFloat(G))&&isFinite(G)},i=!(typeof window!="undefined"&&window.document&&window.document.createElement),k=function W(G,F,B,H){if(!F||F===document||F instanceof Document)return!1;if(F===G.parentNode)return!0;var q=Math.max(Math.abs(B),Math.abs(H))===Math.abs(H),re=Math.max(Math.abs(B),Math.abs(H))===Math.abs(B),ee=F.scrollHeight-F.clientHeight,Ce=F.scrollWidth-F.clientWidth,Ee=document.defaultView.getComputedStyle(F),pe=Ee.overflowY==="auto"||Ee.overflowY==="scroll",Me=Ee.overflowX==="auto"||Ee.overflowX==="scroll",_e=ee&&pe,he=Ce&&Me;return q&&(!_e||_e&&(F.scrollTop>=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;M<P;M+=1)indent+=" ";else typeof P=="string"&&(indent=P);if(rep=J,J&&typeof J!="function"&&(typeof J!="object"||typeof J.length!="number"))throw new Error("JSON.stringify");return str("",{"":I})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(I,J){var P,M,u=I[J];if(u&&typeof u=="object")for(P in u)Object.prototype.hasOwnProperty.call(u,P)&&(M=walk(u,P),M!==void 0?u[P]=M:delete u[P]);return reviver.call(I,J,u)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(I){return"\\u"+("0000"+I.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},"gb/T":function(I,J,P){(function(M,u,_){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(M){return M.mode.ECB=function(){var u=M.lib.BlockCipherMode.extend();return u.Encryptor=u.extend({processBlock:function(_,D){this._cipher.encryptBlock(_,D)}}),u.Decryptor=u.extend({processBlock:function(_,D){this._cipher.decryptBlock(_,D)}}),u}(),M.mode.ECB})},h78n:function(I,J,P){"use strict";P.d(J,"a",function(){return L});var M=P("q1tI"),u=P.n(M),_=P("TSYQ"),D=P.n(_),f={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},l=function(W){var G=W.map(function(){return Object(M.useRef)()}),F=Object(M.useRef)();return Object(M.useEffect)(function(){var B=Date.now(),H=!1;Object.keys(G).forEach(function(q){var re=G[q].current;if(!re)return;H=!0;var ee=re.style;ee.transitionDuration=".3s, .3s, .3s, .06s",F.current&&B-F.current<100&&(ee.transitionDuration="0s, 0s")}),H&&(F.current=Date.now())}),[G]};function C(){return C=Object.assign||function(K){for(var W=1;W<arguments.length;W++){var G=arguments[W];for(var F in G)Object.prototype.hasOwnProperty.call(G,F)&&(K[F]=G[F])}return K},C.apply(this,arguments)}function v(K,W){return m(K)||h(K,W)||a(K,W)||o()}function o(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(K,W){if(!K)return;if(typeof K=="string")return r(K,W);var G=Object.prototype.toString.call(K).slice(8,-1);if(G==="Object"&&K.constructor&&(G=K.constructor.name),G==="Map"||G==="Set")return Array.from(K);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return r(K,W)}function r(K,W){(W==null||W>K.length)&&(W=K.length);for(var G=0,F=new Array(W);G<W;G++)F[G]=K[G];return F}function h(K,W){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(K)))return;var G=[],F=!0,B=!1,H=void 0;try{for(var q=K[Symbol.iterator](),re;!(F=(re=q.next()).done)&&!(G.push(re.value),W&&G.length===W);F=!0);}catch(ee){B=!0,H=ee}finally{try{!F&&q.return!=null&&q.return()}finally{if(B)throw H}}return G}function m(K){if(Array.isArray(K))return K}function p(K,W){if(K==null)return{};var G=w(K,W),F,B;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(K);for(B=0;B<H.length;B++){if(F=H[B],W.indexOf(F)>=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<F.length;H++){if(B=F[H],W.indexOf(B)>=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;W<arguments.length;W++){var G=arguments[W];for(var F in G)Object.prototype.hasOwnProperty.call(G,F)&&(K[F]=G[F])}return K},n.apply(this,arguments)}function s(K,W){return k(K)||i(K,W)||S(K,W)||d()}function d(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S(K,W){if(!K)return;if(typeof K=="string")return y(K,W);var G=Object.prototype.toString.call(K).slice(8,-1);if(G==="Object"&&K.constructor&&(G=K.constructor.name),G==="Map"||G==="Set")return Array.from(K);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return y(K,W)}function y(K,W){(W==null||W>K.length)&&(W=K.length);for(var G=0,F=new Array(W);G<W;G++)F[G]=K[G];return F}function i(K,W){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(K)))return;var G=[],F=!0,B=!1,H=void 0;try{for(var q=K[Symbol.iterator](),re;!(F=(re=q.next()).done)&&!(G.push(re.value),W&&G.length===W);F=!0);}catch(ee){B=!0,H=ee}finally{try{!F&&q.return!=null&&q.return()}finally{if(B)throw H}}return G}function k(K){if(Array.isArray(K))return K}function O(K,W){if(K==null)return{};var G=b(K,W),F,B;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(K);for(B=0;B<H.length;B++){if(F=H[B],W.indexOf(F)>=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<F.length;H++){if(B=F[H],W.indexOf(B)>=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;we<ve;we++)Le[we]=arguments[we];Qe.current||(h.a.cancel(Ve.current),Ve.current=h()(function(){Ne.apply(void 0,Le)}))}return Object(f.useEffect)(function(){return function(){Qe.current=!0,h.a.cancel(Ve.current)}},[]),Fe}function w(Ne){var Ve=Object(f.useRef)([]),Qe=Object(f.useState)({}),Fe=Object(u.a)(Qe,2),ve=Fe[1],Le=Object(f.useRef)(typeof Ne=="function"?Ne():Ne),we=p(function(){var He=Le.current;Ve.current.forEach(function(Ye){He=Ye(He)}),Ve.current=[],Le.current=He,ve({})});function Be(He){Ve.current.push(He),we()}return[Le.current,Be]}var g=P("4IlW");function c(Ne,Ve){var Qe,Fe=Ne.prefixCls,ve=Ne.id,Le=Ne.active,we=Ne.rtl,Be=Ne.tab,He=Be.key,Ye=Be.tab,Xe=Be.disabled,it=Be.closeIcon,dt=Ne.tabBarGutter,xt=Ne.tabPosition,bt=Ne.closable,At=Ne.renderWrapper,Vt=Ne.removeAriaLabel,pr=Ne.editable,gr=Ne.onClick,yr=Ne.onRemove,Or=Ne.onFocus,Sr="".concat(Fe,"-tab");f.useEffect(function(){return yr},[]);var br={};xt==="top"||xt==="bottom"?br[we?"marginLeft":"marginRight"]=dt:br.marginBottom=dt;var Xr=pr&&bt!==!1&&!Xe;function Ir(tr){if(Xe)return;gr(tr)}function Dn(tr){tr.preventDefault(),tr.stopPropagation(),pr.onEdit("remove",{key:He,event:tr})}var Nr=f.createElement("div",{key:He,ref:Ve,className:C()(Sr,(Qe={},Object(M.a)(Qe,"".concat(Sr,"-with-remove"),Xr),Object(M.a)(Qe,"".concat(Sr,"-active"),Le),Object(M.a)(Qe,"".concat(Sr,"-disabled"),Xe),Qe)),style:br,onClick:Ir},f.createElement("div",{role:"tab","aria-selected":Le,id:ve&&"".concat(ve,"-tab-").concat(He),className:"".concat(Sr,"-btn"),"aria-controls":ve&&"".concat(ve,"-panel-").concat(He),"aria-disabled":Xe,tabIndex:Xe?null:0,onClick:function(Zt){Zt.stopPropagation(),Ir(Zt)},onKeyDown:function(Zt){[g.a.SPACE,g.a.ENTER].includes(Zt.which)&&(Zt.preventDefault(),Ir(Zt))},onFocus:Or},Ye),Xr&&f.createElement("button",{type:"button","aria-label":Vt||"remove",tabIndex:0,className:"".concat(Sr,"-remove"),onClick:function(Zt){Zt.stopPropagation(),Dn(Zt)}},it||pr.removeIcon||"\xD7"));return At&&(Nr=At(Nr)),Nr}var n=f.forwardRef(c),s={width:0,height:0,left:0,top:0};function d(Ne,Ve,Qe){return Object(f.useMemo)(function(){for(var Fe,ve=new Map,Le=Ve.get((Fe=Ne[0])===null||Fe===void 0?void 0:Fe.key)||s,we=Le.left+Le.width,Be=0;Be<Ne.length;Be+=1){var He=Ne[Be].key,Ye=Ve.get(He);if(!Ye){var Xe;Ye=Ve.get((Xe=Ne[Be-1])===null||Xe===void 0?void 0:Xe.key)||s}var it=ve.get(He)||Object(D.a)({},Ye);it.right=we-it.left-it.width,ve.set(He,it)}return ve},[Ne.map(function(Fe){return Fe.key}).join("_"),Ve,Qe])}var S={width:0,height:0,left:0,top:0,right:0};function y(Ne,Ve,Qe,Fe,ve){var Le=ve.tabs,we=ve.tabPosition,Be=ve.rtl,He,Ye,Xe;["top","bottom"].includes(we)?(He="width",Ye=Be?"right":"left",Xe=Math.abs(Ve.left)):(He="height",Ye="top",Xe=-Ve.top);var it=Ve[He],dt=Qe[He],xt=Fe[He],bt=it;return dt+xt>it&&(bt=it-xt),Object(f.useMemo)(function(){if(!Le.length)return[0,0];for(var At=Le.length,Vt=At,pr=0;pr<At;pr+=1){var gr=Ne.get(Le[pr].key)||S;if(gr[Ye]+gr[He]>Xe+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]<Xe){yr=Or+1;break}}return[yr,Vt]},[Ne,Xe,bt,we,Le.map(function(At){return At.key}).join("_"),Be])}var i=P("wx14"),k=P("1OyB"),O=P("vuIU"),b=P("JX7q"),E=P("Ji7U"),x=P("LK+K"),T=P("I8Z2"),N=P("bT9E"),j=P("2GS6"),L=P("Gytx"),V=P.n(L),K=P("U8pU"),W=/iPhone/i,G=/iPod/i,F=/iPad/i,B=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,q=/\bAndroid(?:.+)SD4930UR\b/i,re=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,ee=/Windows Phone/i,Ce=/\bWindows(?:.+)ARM\b/i,Ee=/BlackBerry/i,pe=/BB10/i,Me=/Opera Mini/i,_e=/\b(CriOS|Chrome)(?:.+)Mobile/i,he=/Mobile(?:.+)Firefox\b/i;function ce(Ne,Ve){return Ne.test(Ve)}function oe(Ne){var Ve=Ne||(typeof navigator!="undefined"?navigator.userAgent:""),Qe=(Ve||"").split("[FBAN");if(typeof Qe[1]!="undefined"){var Fe=Qe,ve=Object(u.a)(Fe,1);Ve=ve[0]}if(Qe=Ve.split("Twitter"),typeof Qe[1]!="undefined"){var Le=Qe,we=Object(u.a)(Le,1);Ve=we[0]}var Be={apple:{phone:ce(W,Ve)&&!ce(ee,Ve),ipod:ce(G,Ve),tablet:!ce(W,Ve)&&ce(F,Ve)&&!ce(ee,Ve),device:(ce(W,Ve)||ce(G,Ve)||ce(F,Ve))&&!ce(ee,Ve)},amazon:{phone:ce(q,Ve),tablet:!ce(q,Ve)&&ce(re,Ve),device:ce(q,Ve)||ce(re,Ve)},android:{phone:!ce(ee,Ve)&&ce(q,Ve)||!ce(ee,Ve)&&ce(B,Ve),tablet:!ce(ee,Ve)&&!ce(q,Ve)&&!ce(B,Ve)&&(ce(re,Ve)||ce(H,Ve)),device:!ce(ee,Ve)&&(ce(q,Ve)||ce(re,Ve)||ce(B,Ve)||ce(H,Ve))||ce(/\bokhttp\b/i,Ve)},windows:{phone:ce(ee,Ve),tablet:ce(Ce,Ve),device:ce(ee,Ve)||ce(Ce,Ve)},other:{blackberry:ce(Ee,Ve),blackberry10:ce(pe,Ve),opera:ce(Me,Ve),firefox:ce(he,Ve),chrome:ce(_e,Ve),device:ce(Ee,Ve)||ce(pe,Ve)||ce(Me,Ve)||ce(he,Ve)||ce(_e,Ve)},any:null,phone:null,tablet:null};return Be.any=Be.apple.device||Be.android.device||Be.windows.device||Be.other.device,Be.phone=Be.apple.phone||Be.android.phone||Be.windows.phone,Be.tablet=Be.apple.tablet||Be.android.tablet||Be.windows.tablet,Be}var Se=Object(D.a)(Object(D.a)({},oe()),{},{isMobile:oe}),te=Se;function ue(){}function Oe(Ne,Ve,Qe){var Fe=Ve||"";return Ne.key||"".concat(Fe,"item_").concat(Qe)}function le(Ne){return"".concat(Ne,"-menu-")}function Q(Ne,Ve){var Qe=-1;f.Children.forEach(Ne,function(Fe){Qe+=1,Fe&&Fe.type&&Fe.type.isMenuItemGroup?f.Children.forEach(Fe.props.children,function(ve){Qe+=1,Ve(ve,Qe)}):Ve(Fe,Qe)})}function Y(Ne,Ve,Qe){if(!Ne||Qe.find)return;f.Children.forEach(Ne,function(Fe){if(Fe){var ve=Fe.type;if(!ve||!(ve.isSubMenu||ve.isMenuItem||ve.isMenuItemGroup))return;Ve.indexOf(Fe.key)!==-1?Qe.find=!0:Fe.props.children&&Y(Fe.props.children,Ve,Qe)}})}var Z=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],be=function(Ve){var Qe=arguments.length>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;we<Le.length;we+=1){var Be=Le[we];if(lt(Ne[Be].points,ve,Fe))return"".concat(Ve,"-placement-").concat(Be)}return""}var Ue=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Ne=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ne)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ne==null?void 0:Ne.substr(0,4)))},ke=P("MNnm");function Ie(Ne,Ve){var Qe={};return Qe[Ne.toLowerCase()]=Ve.toLowerCase(),Qe["Webkit".concat(Ne)]="webkit".concat(Ve),Qe["Moz".concat(Ne)]="moz".concat(Ve),Qe["ms".concat(Ne)]="MS".concat(Ve),Qe["O".concat(Ne)]="o".concat(Ve.toLowerCase()),Qe}function ye(Ne,Ve){var Qe={animationend:Ie("Animation","AnimationEnd"),transitionend:Ie("Transition","TransitionEnd")};return Ne&&("AnimationEvent"in Ve||delete Qe.animationend.animation,"TransitionEvent"in Ve||delete Qe.transitionend.transition),Qe}var Te=ye(Object(ke.a)(),typeof window!="undefined"?window:{}),Ae={};if(Object(ke.a)()){var Pe=document.createElement("div");Ae=Pe.style}var $e={};function Ke(Ne){if($e[Ne])return $e[Ne];var Ve=Te[Ne];if(Ve)for(var Qe=Object.keys(Ve),Fe=Qe.length,ve=0;ve<Fe;ve+=1){var Le=Qe[ve];if(Object.prototype.hasOwnProperty.call(Ve,Le)&&Le in Ae)return $e[Ne]=Ve[Le],$e[Ne]}return""}var ct=Ke("animationend"),gt=Ke("transitionend"),wt=!!(ct&>),vt=ct||"animationend",It=gt||"transitionend";function Lt(Ne,Ve){if(!Ne)return null;if(Object(K.a)(Ne)==="object"){var Qe=Ve.replace(/-\w/g,function(Fe){return Fe[1].toUpperCase()});return Ne[Qe]}return"".concat(Ne,"-").concat(Ve)}var _t="none",rr="appear",sr="enter",$t="leave",cr="none",Wt="prepare",Lr="start",Cr="active",Ct="end";function lr(Ne){var Ve=Object(f.useRef)(!1),Qe=Object(f.useState)(Ne),Fe=Object(u.a)(Qe,2),ve=Fe[0],Le=Fe[1];function we(Be){Ve.current||Le(Be)}return Object(f.useEffect)(function(){return function(){Ve.current=!0}},[]),[ve,we]}var Fr=Object(ke.a)()?f.useLayoutEffect:f.useEffect,$r=Fr,Hr=function(){var Ne=f.useRef(null);function Ve(){nt.a.cancel(Ne.current)}function Qe(Fe){var ve=arguments.length>1&&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;it<ve;it+=1){var dt=we[it];if(dt.key===Ye.key){Fe<it&&(Qe=Qe.concat(we.slice(Fe,it).map(function(xt){return Object(D.a)(Object(D.a)({},xt),{},{status:mt})})),Fe=it),Qe.push(Object(D.a)(Object(D.a)({},dt),{},{status:Ut})),Fe+=1,Xe=!0;break}}Xe||Qe.push(Object(D.a)(Object(D.a)({},Ye),{},{status:an}))}),Fe<ve&&(Qe=Qe.concat(we.slice(Fe).map(function(Ye){return Object(D.a)(Object(D.a)({},Ye),{},{status:mt})})));var Be={};Qe.forEach(function(Ye){var Xe=Ye.key;Be[Xe]=(Be[Xe]||0)+1});var He=Object.keys(Be).filter(function(Ye){return Be[Ye]>1});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;ei<Bn;ei+=1){pn=(pn+nn+Bn)%Bn;var Pn=gn[pn];if(!Pn.disabled){Xr(Pn.key);return}}}function Yr(nn){var gn=nn.which;if(!gr){[g.a.DOWN,g.a.SPACE,g.a.ENTER].includes(gn)&&(yr(!0),nn.preventDefault());return}switch(gn){case g.a.UP:Ur(-1),nn.preventDefault();break;case g.a.DOWN:Ur(1),nn.preventDefault();break;case g.a.ESC:yr(!1);break;case g.a.SPACE:case g.a.ENTER:br!==null&&At(br,nn);break}}Object(f.useEffect)(function(){var nn=document.getElementById(Nr);nn&&nn.scrollIntoView&&nn.scrollIntoView(!1)},[br]),Object(f.useEffect)(function(){gr||Xr(null)},[gr]);var Kt=Object(M.a)({},bt?"marginLeft":"marginRight",xt);ve.length||(Kt.visibility="hidden",Kt.order=1);var Qr=C()(Object(M.a)({},"".concat(Dn,"-rtl"),bt)),kn=we?null:f.createElement(mr.a,{prefixCls:Dn,overlay:Zt,trigger:["hover"],visible:gr,transitionName:Ye,onVisibleChange:yr,overlayClassName:Qr,mouseEnterDelay:.1,mouseLeaveDelay:.1},f.createElement("button",{type:"button",className:"".concat(Qe,"-nav-more"),style:Kt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Ir,id:"".concat(Fe,"-more"),"aria-expanded":gr,onKeyDown:Yr},He));return f.createElement("div",{className:C()("".concat(Qe,"-nav-operations"),it),style:Xe,ref:Ve},kn,f.createElement(Rr,{prefixCls:Qe,locale:Le,editable:dt}))}var mi=f.forwardRef(Mn),qn=Object(f.createContext)(null),Pr=.1,Dr=.01,Er=20,ui=Math.pow(.995,Er);function Xi(){var Ne=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ne)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ne.substr(0,4)))}function Yi(Ne,Ve){var Qe=Object(f.useState)(),Fe=Object(u.a)(Qe,2),ve=Fe[0],Le=Fe[1],we=Object(f.useState)(0),Be=Object(u.a)(we,2),He=Be[0],Ye=Be[1],Xe=Object(f.useState)(0),it=Object(u.a)(Xe,2),dt=it[0],xt=it[1],bt=Object(f.useState)(),At=Object(u.a)(bt,2),Vt=At[0],pr=At[1],gr=Object(f.useRef)();function yr(tr){var Zt=tr.touches[0],Ur=Zt.screenX,Yr=Zt.screenY;Le({x:Ur,y:Yr}),window.clearInterval(gr.current)}function Or(tr){if(!ve)return;tr.preventDefault();var Zt=tr.touches[0],Ur=Zt.screenX,Yr=Zt.screenY;Le({x:Ur,y:Yr});var Kt=Ur-ve.x,Qr=Yr-ve.y;Ve(Kt,Qr);var kn=Date.now();Ye(kn),xt(kn-He),pr({x:Kt,y:Qr})}function Sr(){if(!ve)return;if(Le(null),pr(null),Vt){var tr=Vt.x/dt,Zt=Vt.y/dt,Ur=Math.abs(tr),Yr=Math.abs(Zt);if(Math.max(Ur,Yr)<Pr)return;var Kt=tr,Qr=Zt;gr.current=window.setInterval(function(){if(Math.abs(Kt)<Dr&&Math.abs(Qr)<Dr){window.clearInterval(gr.current);return}Kt*=ui,Qr*=ui,Ve(Kt*Er,Qr*Er)},Er)}}var br=Object(f.useRef)(0),Xr=Object(f.useRef)(!1),Ir=Object(f.useRef)();function Dn(tr){var Zt=tr.deltaX,Ur=tr.deltaY,Yr=0,Kt=Math.abs(Zt),Qr=Math.abs(Ur);Kt===Qr?Yr=Ir.current==="x"?Zt:Ur:Kt>Qr?(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 cn<Ea?[Ea,!1]:cn>zi?[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.right<Kt?ni=Wr.right:Wr.right+Wr.width>Kt+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<Pn):(Fa=Kt<0,Da=-Kt+fn<Pn):(ko=gn<0,Ba=-gn+aa<ti),f.createElement("div",{ref:Ve,role:"tablist",className:C()("".concat(ve,"-nav"),we),style:Be,onKeyDown:function(){Ua()}},f.createElement(ur,{position:"left",extra:dt,prefixCls:ve}),f.createElement(m.a,{onResize:oo},f.createElement("div",{className:C()(fa,(Qe={},Object(M.a)(Qe,"".concat(fa,"-ping-left"),Fa),Object(M.a)(Qe,"".concat(fa,"-ping-right"),Da),Object(M.a)(Qe,"".concat(fa,"-ping-top"),ko),Object(M.a)(Qe,"".concat(fa,"-ping-bottom"),Ba),Qe)),ref:Or},f.createElement(m.a,{onResize:oo},f.createElement("div",{ref:Sr,className:"".concat(ve,"-nav-list"),style:{transform:"translate(".concat(Kt,"px, ").concat(gn,"px)"),transition:ja?"none":void 0}},Zo,f.createElement(Rr,{ref:Xr,prefixCls:ve,locale:bt,editable:xt,style:{visibility:Do?"hidden":null}}),f.createElement("div",{className:C()("".concat(ve,"-ink-bar"),Object(M.a)({},"".concat(ve,"-ink-bar-animated"),Ye.inkBar)),style:Ra}))))),f.createElement(mi,Object.assign({},Ne,{ref:br,prefixCls:ve,tabs:Gn,className:!Do&&xa})),f.createElement(ur,{position:"right",extra:dt,prefixCls:ve}))}var tn=f.forwardRef(fr);function wr(Ne){var Ve=Ne.id,Qe=Ne.activeKey,Fe=Ne.animated,ve=Ne.tabPosition,Le=Ne.rtl,we=Ne.destroyInactiveTabPane,Be=f.useContext(qn),He=Be.prefixCls,Ye=Be.tabs,Xe=Fe.tabPane,it=Ye.findIndex(function(dt){return dt.key===Qe});return f.createElement("div",{className:C()("".concat(He,"-content-holder"))},f.createElement("div",{className:C()("".concat(He,"-content"),"".concat(He,"-content-").concat(ve),Object(M.a)({},"".concat(He,"-content-animated"),Xe)),style:it&&Xe?Object(M.a)({},Le?"marginRight":"marginLeft","-".concat(it,"00%")):null},Ye.map(function(dt){return f.cloneElement(dt.node,{key:dt.key,prefixCls:He,tabKey:dt.key,id:Ve,animated:Xe,active:dt.key===Qe,destroyInactiveTabPane:we})})))}function Rn(Ne){var Ve=Ne.prefixCls,Qe=Ne.forceRender,Fe=Ne.className,ve=Ne.style,Le=Ne.id,we=Ne.active,Be=Ne.animated,He=Ne.destroyInactiveTabPane,Ye=Ne.tabKey,Xe=Ne.children,it=f.useState(Qe),dt=Object(u.a)(it,2),xt=dt[0],bt=dt[1];f.useEffect(function(){we?bt(!0):He&&bt(!1)},[we,He]);var At={};return we||(Be?(At.visibility="hidden",At.height=0,At.overflowY="hidden"):At.display="none"),f.createElement("div",{id:Le&&"".concat(Le,"-panel-").concat(Ye),role:"tabpanel",tabIndex:we?0:-1,"aria-labelledby":Le&&"".concat(Le,"-tab-").concat(Ye),"aria-hidden":!we,style:Object(D.a)(Object(D.a)({},At),ve),className:C()("".concat(Ve,"-tabpane"),we&&"".concat(Ve,"-tabpane-active"),Fe)},(we||xt||Qe)&&Xe)}var wn=0;function ki(Ne){return Object(v.a)(Ne).map(function(Ve){if(f.isValidElement(Ve)){var Qe=Ve.key!==void 0?String(Ve.key):void 0;return Object(D.a)(Object(D.a)({key:Qe},Ve.props),{},{node:Ve})}return null}).filter(function(Ve){return Ve})}function Fn(Ne,Ve){var Qe,Fe=Ne.id,ve=Ne.prefixCls,Le=ve===void 0?"rc-tabs":ve,we=Ne.className,Be=Ne.children,He=Ne.direction,Ye=Ne.activeKey,Xe=Ne.defaultActiveKey,it=Ne.editable,dt=Ne.animated,xt=Ne.tabPosition,bt=xt===void 0?"top":xt,At=Ne.tabBarGutter,Vt=Ne.tabBarStyle,pr=Ne.tabBarExtraContent,gr=Ne.locale,yr=Ne.moreIcon,Or=Ne.moreTransitionName,Sr=Ne.destroyInactiveTabPane,br=Ne.renderTabBar,Xr=Ne.onChange,Ir=Ne.onTabClick,Dn=Ne.onTabScroll,Nr=Object(_.a)(Ne,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),tr=ki(Be),Zt=He==="rtl",Ur;dt===!1?Ur={inkBar:!1,tabPane:!1}:Ur=Object(D.a)({inkBar:!0,tabPane:!1},dt!==!0?dt:null);var Yr=Object(f.useState)(!1),Kt=Object(u.a)(Yr,2),Qr=Kt[0],kn=Kt[1];Object(f.useEffect)(function(){kn(Xi())},[]);var nn=Object(o.a)(function(){var mn;return(mn=tr[0])===null||mn===void 0?void 0:mn.key},{value:Ye,defaultValue:Xe}),gn=Object(u.a)(nn,2),pn=gn[0],Bn=gn[1],ei=Object(f.useState)(function(){return tr.findIndex(function(mn){return mn.key===pn})}),Pn=Object(u.a)(ei,2),bi=Pn[0],Wi=Pn[1];Object(f.useEffect)(function(){var mn=tr.findIndex(function(ia){return ia.key===pn});if(mn===-1){var Ji;mn=Math.max(0,Math.min(bi,tr.length-1)),Bn((Ji=tr[mn])===null||Ji===void 0?void 0:Ji.key)}Wi(mn)},[tr.map(function(mn){return mn.key}).join("_"),pn,bi]);var Ci=Object(o.a)(null,{value:Fe}),ti=Object(u.a)(Ci,2),Cn=ti[0],vn=ti[1],In=bt;Qr&&!["left","right"].includes(bt)&&(In="top"),Object(f.useEffect)(function(){Fe||(vn("rc-tabs-".concat(wn)),wn+=1)},[]);function Ln(mn,Ji){Ir==null||Ir(mn,Ji),Bn(mn),Xr==null||Xr(mn)}var Hi={id:Cn,activeKey:pn,animated:Ur,tabPosition:In,rtl:Zt,mobile:Qr},ra,na=Object(D.a)(Object(D.a)({},Hi),{},{editable:it,locale:gr,moreIcon:yr,moreTransitionName:Or,tabBarGutter:At,onTabClick:Ln,onTabScroll:Dn,extra:pr,style:Vt,panes:Be});return br?ra=br(na,tn):ra=f.createElement(tn,Object.assign({},na)),f.createElement(qn.Provider,{value:{tabs:tr,prefixCls:Le}},f.createElement("div",Object.assign({ref:Ve,id:Fe,className:C()(Le,"".concat(Le,"-").concat(In),(Qe={},Object(M.a)(Qe,"".concat(Le,"-mobile"),Qr),Object(M.a)(Qe,"".concat(Le,"-editable"),it),Object(M.a)(Qe,"".concat(Le,"-rtl"),Zt),Qe),we)},Nr),ra,f.createElement(wr,Object.assign({destroyInactiveTabPane:Sr},Hi,{animated:Ur}))))}var Kn=f.forwardRef(Fn);Kn.TabPane=Rn;var Yn=Kn,$i=J.b=Yn},kSUc:function(I,J,P){},lOMy:function(I,J,P){},lPiR: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=[],o=[];(function(){function h(g){for(var c=u.sqrt(g),n=2;n<=c;n++)if(!(g%n))return!1;return!0}function m(g){return(g-(g|0))*4294967296|0}for(var p=2,w=0;w<64;)h(p)&&(w<8&&(v[w]=m(u.pow(p,1/2))),o[w]=m(u.pow(p,1/3)),w++),p++})();var a=[],r=C.SHA256=l.extend({_doReset:function(){this._hash=new f.init(v.slice(0))},_doProcessBlock:function(h,m){for(var p=this._hash.words,w=p[0],g=p[1],c=p[2],n=p[3],s=p[4],d=p[5],S=p[6],y=p[7],i=0;i<64;i++){if(i<16)a[i]=h[m+i]|0;else{var k=a[i-15],O=(k<<25|k>>>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<B.listStack[B.listStack.length-1];)B.listStack.pop(),B.listStack.length?B.indentation=B.listStack[B.listStack.length-1]:B.list=!1;B.list!==!1&&(B.indentationDiff=pe-B.listStack[B.listStack.length-1])}var Me=!q&&!ee&&!B.prevLine.header&&(!Ce||!re)&&!B.prevLine.fencedCodeEnd,_e=(B.list===!1||ee||q)&&B.indentation<=Ee&&F.match(o),he=null;if(B.indentationDiff>=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<H,re=H+3;if(B.fencedEndRE&&B.indentation<=re&&(q||F.match(B.fencedEndRE))){_.highlightFormatting&&(B.formatting="code-block");var ee;return q||(ee=b(B)),B.localMode=B.localState=null,B.block=i,B.f=x,B.fencedEndRE=null,B.code=0,B.thisLine.fencedCodeEnd=!0,q?d(F,B,B.block):ee}else return B.localMode?B.localMode.token(F,B.localState):(F.skipToEnd(),C.code)}function b(F){var B=[];if(F.formatting){B.push(C.formatting),typeof F.formatting=="string"&&(F.formatting=[F.formatting]);for(var H=0;H<F.formatting.length;H++)B.push(C.formatting+"-"+F.formatting[H]),F.formatting[H]==="header"&&B.push(C.formatting+"-"+F.formatting[H]+"-"+F.header),F.formatting[H]==="quote"&&(!_.maxBlockquoteDepth||_.maxBlockquoteDepth>=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:"<!--",blockCommentEnd:"-->",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;D<M.length;D++)u(M[D]);return u}return I}()({1:[function(I,J,P){"use strict";var M=I("./browser/client");M.Buffer=I("buffer").Buffer,M.urllib=I("../shims/xhr"),M.version=I("./browser/version").version,J.exports=M},{"../shims/xhr":291,"./browser/client":2,"./browser/version":5,buffer:73}],2:[function(I,J,P){(function(M,u){"use strict";var _=I("babel-runtime/core-js/promise"),D=o(_),f=I("babel-runtime/regenerator"),l=o(f),C=I("babel-runtime/core-js/object/assign"),v=o(C);function o(V){return V&&V.__esModule?V:{default:V}}var a=I("debug")("ali-oss"),r=I("copy-to"),h=I("xml2js"),m=I("agentkeepalive"),p=I("merge-descriptors"),w=I("url"),g=I("is-type-of"),c=I("platform"),n=I("utility"),s=I("urllib"),d=I("./version"),S=I("bowser"),y=I("../common/signUtils"),i=I("../common/utils/isIP"),k=i.isIP,O=I("../common/client/initOptions"),b=I("../common/utils/createRequest"),E=b.createRequest,x=new m;function T(){var V=c.name,K=c.version;V&&V.toLowerCase&&V.toLowerCase()==="ie"&&K.split(".")[0]<10&&console.warn("ali-oss does not support the current browser")}function N(){return location&&location.protocol==="https:"}function j(V,K){if(T(),!(this instanceof j))return new j(V,K);V&&V.inited?this.options=V:this.options=j.initOptions(V),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=s,this.agent=this.options.agent||x),this.ctx=K,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}J.exports=j,j.initOptions=function(K){K.stsToken||console.warn("Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html");var W=(0,v.default)({secure:N(),useFetch:!1},K);return O(W)};var L=j.prototype;L.debug=a,p(L,I("./object")),p(L,I("../common/bucket/getBucketWebsite")),p(L,I("../common/bucket/putBucketWebsite")),p(L,I("../common/bucket/deleteBucketWebsite")),p(L,I("../common/bucket/getBucketLifecycle")),p(L,I("../common/bucket/putBucketLifecycle")),p(L,I("../common/bucket/deleteBucketLifecycle")),p(L,I("../common/bucket/putBucketVersioning")),p(L,I("../common/bucket/getBucketVersioning")),p(L,I("./managed-upload")),p(L,I("../common/multipart")),p(L,I("../common/parallel")),L.signature=function(K){return this.debug("authorization stringToSign: %s",K,"info"),y.computeSignature(this.options.accessKeySecret,K)},L.authorization=function(K,W,G,F){var B=y.buildCanonicalString(K.toUpperCase(),W,{headers:F,parameters:G});return y.authorization(this.options.accessKeyId,this.options.accessKeySecret,B)},L.request=function(K){var W,G,F,B,H,q;return l.default.async(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return W=E.call(this,K),this.options.useFetch||(W.params.mode="disable-fetch"),G=void 0,F=void 0,B=!!K.stream,ee.prev=5,ee.next=8,l.default.awrap(this.urllib.request(W.url,W.params));case 8:G=ee.sent,this.debug("response %s %s, got %s, headers: %j",K.method,W.url,G.status,G.headers,"info"),ee.next=15;break;case 12:ee.prev=12,ee.t0=ee.catch(5),F=ee.t0;case 15:if(H=void 0,!(G&&K.successStatuses&&K.successStatuses.indexOf(G.status)===-1)){ee.next=28;break}return ee.next=19,l.default.awrap(this.requestError(G));case 19:if(H=ee.sent,!(H.code==="RequestTimeTooSkewed"&&!B)){ee.next=25;break}return this.options.amendTimeSkewed=+new Date(H.serverTime)-new Date,ee.next=24,l.default.awrap(this.request(K));case 24:return ee.abrupt("return",ee.sent);case 25:H.params=K,ee.next=32;break;case 28:if(!F){ee.next=32;break}return ee.next=31,l.default.awrap(this.requestError(F));case 31:H=ee.sent;case 32:if(!H){ee.next=34;break}throw H;case 34:if(!K.xmlResponse){ee.next=39;break}return ee.next=37,l.default.awrap(this.parseXML(G.data));case 37:q=ee.sent,G.data=q;case 39:return ee.abrupt("return",G);case 40:case"end":return ee.stop()}},null,this,[[5,12]])},L._getResource=function(K){var W="/";return K.bucket&&(W+=K.bucket+"/"),K.object&&(W+=K.object),W},L._isIP=k,L._escape=function(K){return n.encodeURIComponent(K).replace(/%2F/g,"/")},L._getReqUrl=function(K){var W={};r(this.options.endpoint).to(W);var G=this._isIP(W.hostname),F=this.options.cname;K.bucket&&!F&&!G&&(W.host=K.bucket+"."+W.host);var B="/";K.bucket&&G&&(B+=K.bucket+"/"),K.object&&(B+=this._escape(K.object).replace(/\+/g,"%2B")),W.pathname=B;var H={};if(K.query&&p(H,K.query),K.subres){var q={};g.string(K.subres)?q[K.subres]="":g.array(K.subres)?K.subres.forEach(function(re){q[re]=""}):q=K.subres,p(H,q)}return W.query=H,w.format(W)},L._getUserAgent=function(){var K=u&&u.browser?"js":"nodejs",W="aliyun-sdk-"+K+"/"+d.version,G=c.description;return!G&&u&&(G="Node.js "+u.version.slice(1)+" on "+u.platform+" "+u.arch),this._checkUserAgent(W+" "+G)},L._checkUserAgent=function(K){var W=K.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta");return W},L.checkBrowserAndVersion=function(K,W){return S.name===K&&S.version.split(".")[0]===W},L.parseXML=function(K){return new D.default(function(W,G){M.isBuffer(K)&&(K=K.toString()),h.parseString(K,{explicitRoot:!1,explicitArray:!1},function(F,B){F?G(F):W(B)})})},L.requestError=function(K){var W,G,F,B;return l.default.async(function(q){for(;;)switch(q.prev=q.next){case 0:if(W=null,!(!K.data||!K.data.length)){q.next=5;break}K.status===-1||K.status===-2?(W=new Error(K.message),W.name=K.name,W.status=K.status,W.code=K.name):(K.status===404?(W=new Error("Object not exists"),W.name="NoSuchKeyError",W.status=404,W.code="NoSuchKey"):K.status===412?(W=new Error("Pre condition failed"),W.name="PreconditionFailedError",W.status=412,W.code="PreconditionFailed"):(W=new Error("Unknow error, status: "+K.status),W.name="UnknowError",W.status=K.status),W.requestId=K.headers["x-oss-request-id"],W.host=""),q.next=33;break;case 5:return G=String(K.data),this.debug("request response error data: %s",G,"error"),F=void 0,q.prev=8,q.next=11,l.default.awrap(this.parseXML(G));case 11:if(q.t0=q.sent,q.t0){q.next=14;break}q.t0={};case 14:F=q.t0,q.next=24;break;case 17:return q.prev=17,q.t1=q.catch(8),this.debug(G,"error"),q.t1.message+=`
|
|
|
raw xml: `+G,q.t1.status=K.status,q.t1.requestId=K.headers["x-oss-request-id"],q.abrupt("return",q.t1);case 24:B=F.Message||"unknow request error, status: "+K.status,F.Condition&&(B+=" (condition: "+F.Condition+")"),W=new Error(B),W.name=F.Code?F.Code+"Error":"UnknowError",W.status=K.status,W.code=F.Code,W.requestId=F.RequestId,W.hostId=F.HostId,W.serverTime=F.ServerTime;case 33:return this.debug("generate error %j",W,"error"),q.abrupt("return",W);case 35:case"end":return q.stop()}},null,this,[[8,17]])}}).call(this,{isBuffer:I("../../node_modules/is-buffer/index.js")},I("_process"))},{"../../node_modules/is-buffer/index.js":197,"../common/bucket/deleteBucketLifecycle":6,"../common/bucket/deleteBucketWebsite":7,"../common/bucket/getBucketLifecycle":8,"../common/bucket/getBucketVersioning":9,"../common/bucket/getBucketWebsite":10,"../common/bucket/putBucketLifecycle":11,"../common/bucket/putBucketVersioning":12,"../common/bucket/putBucketWebsite":13,"../common/client/initOptions":15,"../common/multipart":18,"../common/parallel":33,"../common/signUtils":34,"../common/utils/createRequest":38,"../common/utils/isIP":45,"./managed-upload":3,"./object":4,"./version":5,_process:208,agentkeepalive:48,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,bowser:70,"copy-to":76,debug:288,"is-type-of":289,"merge-descriptors":200,platform:206,url:238,urllib:291,utility:290,xml2js:249}],3:[function(I,J,P){(function(M){"use strict";var u=I("babel-runtime/core-js/array/from"),_=v(u),D=I("babel-runtime/core-js/promise"),f=v(D),l=I("babel-runtime/regenerator"),C=v(l);function v(y){return y&&y.__esModule?y:{default:y}}var o=I("is-type-of"),a=I("util"),r=I("path"),h=I("mime"),m=I("copy-to"),p=I("../common/utils/isBlob"),w=p.isBlob,g=I("../common/utils/isFile"),c=g.isFile,n=P;n.multipartUpload=function(i,k,O){var b,E,x,T,N,j,L,V,K;return C.default.async(function(G){for(;;)switch(G.prev=G.next){case 0:if(this.resetCancelFlag(),O=O||{},!(O.checkpoint&&O.checkpoint.uploadId)){G.next=6;break}return G.next=5,C.default.awrap(this._resumeMultipart(O.checkpoint,O));case 5:return G.abrupt("return",G.sent);case 6:return b=100*1024,O.mime||(c(k)?O.mime=h.getType(r.extname(k.name)):w(k)?O.mime=k.type:O.mime=h.getType(r.extname(k))),O.headers=O.headers||{},this._convertMetaToHeaders(O.meta,O.headers),G.next=12,C.default.awrap(this._getFileSize(k));case 12:if(E=G.sent,!(E<b)){G.next=25;break}return x=this._createStream(k,0,E),O.contentLength=E,G.next=18,C.default.awrap(this.putStream(i,x,O));case 18:if(T=G.sent,!(O&&O.progress)){G.next=22;break}return G.next=22,C.default.awrap(O.progress(1));case 22:return N={res:T.res,bucket:this.options.bucket,name:i,etag:T.res.headers.etag},(O.headers&&O.headers["x-oss-callback"]||O.callback)&&(N.data=T.data),G.abrupt("return",N);case 25:if(!(O.partSize&&!(parseInt(O.partSize,10)===O.partSize))){G.next=27;break}throw new Error("partSize must be int number");case 27:if(!(O.partSize&&O.partSize<b)){G.next=29;break}throw new Error("partSize must not be smaller than "+b);case 29:return G.next=31,C.default.awrap(this.initMultipartUpload(i,O));case 31:if(j=G.sent,L=j.uploadId,V=this._getPartSize(E,O.partSize),K={file:k,name:i,fileSize:E,partSize:V,uploadId:L,doneParts:[]},!(O&&O.progress)){G.next=38;break}return G.next=38,C.default.awrap(O.progress(0,K,j.res));case 38:return G.next=40,C.default.awrap(this._resumeMultipart(K,O));case 40:return G.abrupt("return",G.sent);case 41:case"end":return G.stop()}},null,this)},n._resumeMultipart=function(i,k){var O,b,E,x,T,N,j,L,V,K,W,G,F,B,H,q,re,ee;return C.default.async(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:if(O=this,!this.isCancel()){Ee.next=3;break}throw this._makeCancelEvent();case 3:return b=i.file,E=i.fileSize,x=i.partSize,T=i.uploadId,N=i.doneParts,j=i.name,L=[],N.length>0&&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.start<this.fileBuffer.length;){var O=this.start,b=O+i;b=b>this.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;E<O;E++){var x=k*E,T=Math.min(x+k,i);b.push({start:x,end:T})}return b}}).call(this,I("buffer").Buffer)},{"../common/utils/isBlob":43,"../common/utils/isFile":44,"babel-runtime/core-js/array/from":52,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,buffer:73,"copy-to":76,"is-type-of":289,mime:202,path:205,stream:230,util:243}],4:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/promise"),u=o(M),_=I("babel-runtime/core-js/object/keys"),D=o(_),f=I("babel-runtime/core-js/object/assign"),l=o(f),C=I("babel-runtime/regenerator"),v=o(C);function o(O){return O&&O.__esModule?O:{default:O}}var a=I("utility"),r=I("fs"),h=I("is-type-of"),m=I("url"),p=I("copy-to"),w=I("path"),g=I("mime"),c=I("../common/callback"),n=I("../common/signUtils"),s=I("merge-descriptors"),d=I("../common/utils/isBlob"),S=d.isBlob,y=I("../common/utils/isFile"),i=y.isFile,k=P;k.append=function(b,E,x){var T;return v.default.async(function(j){for(;;)switch(j.prev=j.next){case 0:return x=x||{},x.position===void 0&&(x.position="0"),x.subres={append:"",position:x.position},x.method="POST",j.next=6,v.default.awrap(this.put(b,E,x));case 6:return T=j.sent,T.nextAppendPosition=T.res.headers["x-oss-next-append-position"],j.abrupt("return",T);case 9:case"end":return j.stop()}},null,this)},k.put=function(b,E,x){var T,N,j,L,V,K,W;return v.default.async(function(F){for(;;)switch(F.prev=F.next){case 0:if(T=void 0,x=x||{},b=this._objectName(b),!h.buffer(E)){F.next=7;break}T=E,F.next=33;break;case 7:if(!(S(E)||i(E))){F.next=32;break}return x.mime||(i(E)?x.mime=g.getType(w.extname(E.name)):x.mime=E.type),N=this._createStream(E,0,E.size),F.next=12,v.default.awrap(this._getFileSize(E));case 12:return x.contentLength=F.sent,F.prev=13,F.next=16,v.default.awrap(this.putStream(b,N,x));case 16:return j=F.sent,F.abrupt("return",j);case 20:if(F.prev=20,F.t0=F.catch(13),!(F.t0.code==="RequestTimeTooSkewed")){F.next=29;break}return this.options.amendTimeSkewed=+new Date(F.t0.serverTime)-new Date,F.next=26,v.default.awrap(this.put(b,E,x));case 26:return F.abrupt("return",F.sent);case 29:throw F.t0;case 30:F.next=33;break;case 32:throw new TypeError("Must provide Buffer/Blob/File for put.");case 33:return x.headers=x.headers||{},this._convertMetaToHeaders(x.meta,x.headers),L=x.method||"PUT",V=this._objectRequestParams(L,b,x),c.encodeCallback(V,x),V.mime=x.mime,V.content=T,V.successStatuses=[200],F.next=43,v.default.awrap(this.request(V));case 43:return K=F.sent,W={name:b,url:this._objectUrl(b),res:K.res},V.headers&&V.headers["x-oss-callback"]&&(W.data=JSON.parse(K.data.toString())),F.abrupt("return",W);case 47:case"end":return F.stop()}},null,this,[[13,20]])},k.putStream=function(b,E,x){var T,N,j,L;return v.default.async(function(K){for(;;)switch(K.prev=K.next){case 0:return x=x||{},x.headers=x.headers||{},b=this._objectName(b),x.contentLength?x.headers["Content-Length"]=x.contentLength:x.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(x.meta,x.headers),T=x.method||"PUT",N=this._objectRequestParams(T,b,x),c.encodeCallback(N,x),N.mime=x.mime,N.stream=E,N.successStatuses=[200],K.next=13,v.default.awrap(this.request(N));case 13:return j=K.sent,L={name:b,url:this._objectUrl(b),res:j.res},N.headers&&N.headers["x-oss-callback"]&&(L.data=JSON.parse(j.data.toString())),K.abrupt("return",L);case 17:case"end":return K.stop()}},null,this)},s(k,I("../common/object/copyObject")),s(k,I("../common/object/getObjectTagging")),s(k,I("../common/object/putObjectTagging")),s(k,I("../common/object/deleteObjectTagging")),s(k,I("../common/image")),s(k,I("../common/object/getBucketVersions")),s(k,I("../common/object/getACL")),s(k,I("../common/object/putACL")),s(k,I("../common/object/head")),s(k,I("../common/object/delete")),s(k,I("../common/object/get")),s(k,I("../common/object/putSymlink")),s(k,I("../common/object/getSymlink")),s(k,I("../common/object/deleteMulti")),s(k,I("../common/object/getObjectMeta")),k.putMeta=function(b,E,x){var T;return v.default.async(function(j){for(;;)switch(j.prev=j.next){case 0:return j.next=2,v.default.awrap(this.copy(b,b,{meta:E||{},timeout:x&&x.timeout,ctx:x&&x.ctx}));case 2:return T=j.sent,j.abrupt("return",T);case 4:case"end":return j.stop()}},null,this)},k.list=function(b,E){var x,T,N,j,L;return v.default.async(function(K){for(;;)switch(K.prev=K.next){case 0:return x=this._objectRequestParams("GET","",E),x.query=b,x.xmlResponse=!0,x.successStatuses=[200],K.next=6,v.default.awrap(this.request(x));case 6:return T=K.sent,N=T.data.Contents,j=this,N&&(Array.isArray(N)||(N=[N]),N=N.map(function(W){return{name:W.Key,url:j._objectUrl(W.Key),lastModified:W.LastModified,etag:W.ETag,type:W.Type,size:Number(W.Size),storageClass:W.StorageClass,owner:{id:W.Owner.ID,displayName:W.Owner.DisplayName}}})),L=T.data.CommonPrefixes||null,L&&(Array.isArray(L)||(L=[L]),L=L.map(function(W){return W.Prefix})),K.abrupt("return",{res:T.res,objects:N,prefixes:L,nextMarker:T.data.NextMarker||null,isTruncated:T.data.IsTruncated==="true"});case 13:case"end":return K.stop()}},null,this)},k.restore=function(b,E){var x,T;return v.default.async(function(j){for(;;)switch(j.prev=j.next){case 0:return E=E||{},E.subres=(0,l.default)({restore:""},E.subres),E.versionId&&(E.subres.versionId=E.versionId),x=this._objectRequestParams("POST",b,E),x.successStatuses=[202],j.next=7,v.default.awrap(this.request(x));case 7:return T=j.sent,j.abrupt("return",{res:T.res});case 9:case"end":return j.stop()}},null,this)},k.signatureUrl=function(b,E){E=E||{},b=this._objectName(b),E.method=E.method||"GET";var x=a.timestamp()+(E.expires||1800),T={bucket:this.options.bucket,object:b},N=this._getResource(T);this.options.stsToken&&(E["security-token"]=this.options.stsToken);var j=n._signatureForURL(this.options.accessKeySecret,E,N,x),L=m.parse(this._getReqUrl(T));return L.query={OSSAccessKeyId:this.options.accessKeyId,Expires:x,Signature:j.Signature},p(j.subResource).to(L.query),L.format()},k.getObjectUrl=function(b,E){return E?E[E.length-1]!=="/"&&(E+="/"):E=this.options.endpoint.format(),E+this._escape(this._objectName(b))},k._objectUrl=function(b){return this._getReqUrl({bucket:this.options.bucket,object:b})},k.generateObjectUrl=function(O,b){if(b)b[b.length-1]!=="/"&&(b+="/");else{b=this.options.endpoint.format();var E=m.parse(b),x=this.options.bucket;E.hostname=x+"."+E.hostname,E.host=x+"."+E.host,b=E.format()}return b+this._escape(this._objectName(O))},k._objectRequestParams=function(b,E,x){if(!this.options.bucket)throw new Error("Please create a bucket first");x=x||{},E=this._objectName(E);var T={object:E,bucket:this.options.bucket,method:b,subres:x&&x.subres,timeout:x&&x.timeout,ctx:x&&x.ctx};return x.headers&&(T.headers={},p(x.headers).to(T.headers)),T},k._objectName=function(b){return b.replace(/^\/+/,"")},k._convertMetaToHeaders=function(b,E){if(!b)return;(0,D.default)(b).forEach(function(x){E["x-oss-meta-"+x]=b[x]})},k._deleteFileSafe=function(b){var E=this;return new u.default(function(x){r.exists(b,function(T){T?r.unlink(b,function(N){N&&E.debug("unlink %j error: %s",b,N,"error"),x()}):x()})})}},{"../common/callback":14,"../common/image":16,"../common/object/copyObject":19,"../common/object/delete":20,"../common/object/deleteMulti":21,"../common/object/deleteObjectTagging":22,"../common/object/get":23,"../common/object/getACL":24,"../common/object/getBucketVersions":25,"../common/object/getObjectMeta":26,"../common/object/getObjectTagging":27,"../common/object/getSymlink":28,"../common/object/head":29,"../common/object/putACL":30,"../common/object/putObjectTagging":31,"../common/object/putSymlink":32,"../common/signUtils":34,"../common/utils/isBlob":43,"../common/utils/isFile":44,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,"copy-to":76,fs:71,"is-type-of":289,"merge-descriptors":200,mime:202,path:205,url:238,utility:290}],5:[function(I,J,P){"use strict";P.version="6.10.0"},{}],6:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=_(M);function _(C){return C&&C.__esModule?C:{default:C}}var D=I("../utils/checkBucketName"),f=D.checkBucketName,l=P;l.deleteBucketLifecycle=function(v,o){var a,r;return u.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return f(v),a=this._bucketRequestParams("DELETE",v,"lifecycle",o),a.successStatuses=[204],m.next=5,u.default.awrap(this.request(a));case 5:return r=m.sent,m.abrupt("return",{res:r.res});case 7:case"end":return m.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],7:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=_(M);function _(C){return C&&C.__esModule?C:{default:C}}var D=I("../utils/checkBucketName"),f=D.checkBucketName,l=P;l.deleteBucketWebsite=function(v,o){var a,r;return u.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return f(v),a=this._bucketRequestParams("DELETE",v,"website",o),a.successStatuses=[204],m.next=5,u.default.awrap(this.request(a));case 5:return r=m.sent,m.abrupt("return",{res:r.res});case 7:case"end":return m.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],8:[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/isArray"),C=l.isArray,v=I("../utils/formatObjKey"),o=v.formatObjKey,a=P;a.getBucketLifecycle=function(h,m){var p,w,g;return u.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return f(h),p=this._bucketRequestParams("GET",h,"lifecycle",m),p.successStatuses=[200],p.xmlResponse=!0,n.next=6,u.default.awrap(this.request(p));case 6:return w=n.sent,g=w.data.Rule||null,g&&(C(g)||(g=[g]),g=g.map(function(s){return s.ID&&(s.id=s.ID,delete s.ID),s.Tag&&!C(s.Tag)&&(s.Tag=[s.Tag]),o(s,"firstLowerCase")})),n.abrupt("return",{rules:g,res:w.res});case 10:case"end":return n.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/formatObjKey":40,"../utils/isArray":42,"babel-runtime/regenerator":68}],9:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=_(M);function _(C){return C&&C.__esModule?C:{default:C}}var D=I("../utils/checkBucketName"),f=D.checkBucketName,l=P;l.getBucketVersioning=function(v,o){var a,r,h;return u.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return f(v),a=this._bucketRequestParams("GET",v,"versioning",o),a.xmlResponse=!0,a.successStatuses=[200],p.next=6,u.default.awrap(this.request(a));case 6:return r=p.sent,h=r.data.Status,p.abrupt("return",{status:r.status,versionStatus:h,res:r.res});case 9:case"end":return p.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],10:[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/isObject"),C=l.isObject,v=P;v.getBucketWebsite=function(a,r){var h,m,p;return u.default.async(function(g){for(;;)switch(g.prev=g.next){case 0:return f(a),h=this._bucketRequestParams("GET",a,"website",r),h.successStatuses=[200],h.xmlResponse=!0,g.next=6,u.default.awrap(this.request(h));case 6:return m=g.sent,p=[],m.data.RoutingRules&&m.data.RoutingRules.RoutingRule&&(C(m.data.RoutingRules.RoutingRule)?p=[m.data.RoutingRules.RoutingRule]:p=m.data.RoutingRules.RoutingRule),g.abrupt("return",{index:m.data.IndexDocument&&m.data.IndexDocument.Suffix||"",supportSubDir:m.data.IndexDocument&&m.data.IndexDocument.SupportSubDir||"false",type:m.data.IndexDocument&&m.data.IndexDocument.Type,routingRules:p,error:m.data.ErrorDocument&&m.data.ErrorDocument.Key||null,res:m.res});case 10:case"end":return g.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/isObject":46,"babel-runtime/regenerator":68}],11:[function(I,J,P){"use strict";var M=I("babel-runtime/regenerator"),u=_(M);function _(i){return i&&i.__esModule?i:{default:i}}var D=I("../utils/checkBucketName"),f=D.checkBucketName,l=I("../utils/isArray"),C=l.isArray,v=I("../utils/deepCopy"),o=v.deepCopy,a=I("../utils/isObject"),r=a.isObject,h=I("../utils/obj2xml"),m=h.obj2xml,p=I("../utils/checkObjectTag"),w=p.checkObjectTag,g=I("../utils/getStrBytesCount"),c=g.getStrBytesCount,n=P;n.putBucketLifecycle=function(k,O,b){var E,x,T,N,j;return u.default.async(function(V){for(;;)switch(V.prev=V.next){case 0:if(f(k),C(O)){V.next=3;break}throw new Error("rules must be Array");case 3:return E=this._bucketRequestParams("PUT",k,"lifecycle",b),x=[],T={LifecycleConfiguration:{Rule:x}},O.forEach(function(K){s(K),y(K),K.id&&(K.ID=K.id,delete K.id),x.push(K)}),N=m(T,{headers:!0,firstUpperCase:!0}),E.content=N,E.mime="xml",E.successStatuses=[200],V.next=13,u.default.awrap(this.request(E));case 13:return j=V.sent,V.abrupt("return",{res:j.res});case 15:case"end":return V.stop()}},null,this)};function s(i){i.days&&(i.expiration={days:i.days}),i.date&&(i.expiration={createdBeforeDate:i.date})}function d(i,k){var O=i.days,b=i.createdBeforeDate;if(!O&&!b)throw new Error(k+" must includes days or createdBeforeDate");if(O&&!/^[1-9][0-9]*$/.test(O))throw new Error("days must be a positive integer");if(b&&!/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(b))throw new Error("createdBeforeDate must be date and conform to iso8601 format")}function S(i){if(!C(i)&&!r(i))throw new Error("tag must be Object or Array");i=r(i)?[i]:i;var k={},O=o(i);O.forEach(function(b){k[b.key]=b.value}),w(k)}function y(i){if(i.id&&c(i.id)>255)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=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<CompleteMultipartUpload>
|
|
|
`,g=0;g<p.length;g++)c=p[g],w+=`<Part>
|
|
|
`,w+="<PartNumber>"+c.number+`</PartNumber>
|
|
|
`,w+="<ETag>"+c.etag+`</ETag>
|
|
|
`,w+=`</Part>
|
|
|
`;return w+="</CompleteMultipartUpload>",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;p<r.length;p++)w={},typeof r[p]=="string"?w.Key=l.escape(this._objectName(r[p])):(g=r[p],c=g.key,n=g.versionId,w.Key=l.escape(this._objectName(c)),w.VersionId=n),m.push(w);return s={Delete:{Quiet:!!h.quiet,Object:m}},d=v(s,{headers:!0}),h.subres=(0,D.default)({delete:""},h.subres),h.versionId&&(h.subres.versionId=h.versionId),S=this._objectRequestParams("POST","",h),S.mime="xml",S.content=d,S.xmlResponse=!0,S.successStatuses=[200],b.next=15,u.default.awrap(this.request(S));case 15:return y=b.sent,i=y.data,k=i&&i.Deleted||null,k&&(Array.isArray(k)||(k=[k])),b.abrupt("return",{res:y.res,deleted:k||[]});case 20:case"end":return b.stop()}},null,this)}},{"../utils/obj2xml":47,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,utility:290}],22:[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.deleteObjectTagging=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)({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(!(s<v.length)){S.next=26;break}if(!h.isCancel()){S.next=11;break}return S.abrupt("break",26);case 11:if(r?p.push(a(h,v[s],r)):p.push(a(h,v[s])),!(p.length===o||n===c&&s===v.length-1)){S.next=23;break}return S.prev=13,n+=1,S.next=17,u.default.awrap(D.default.all(p));case 17:S.next=22;break;case 19:S.prev=19,S.t0=S.catch(13),m.push(S.t0);case 22:p=[];case 23:s++,S.next=8;break;case 26:return S.abrupt("return",m);case 27:case"end":return S.stop()}},null,this,[[13,19]])},l._parallel=function(v,o,a){var r=this;return new D.default(function(h){var m=[];if(o<=0||!v){h(m);return}function p(i){return function(){if(i===null)throw new Error("Callback was already called.");var k=i;i=null;for(var O=arguments.length,b=Array(O),E=0;E<O;E++)b[E]=arguments[E];k.apply(this,b)}}function w(i){var k=-1,O=i.length;return function(){return++k<O&&!r.isCancel()?{value:i[k],key:k}:null}}var g=w(v),c=!1,n=0,s=!1;function d(i,k){n-=1,i?(c=!0,m.push(i),h(m)):k==={}||c&&n<=0?(c=!0,h(m)):s||(r.isCancel()?h(m):y())}function S(i,k){a(i).then(function(O){k(null,O)}).catch(function(O){k(O)})}function y(){for(s=!0;n<o&&!c&&!r.isCancel();){var i=g();if(i===null||m.length>0){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]<n[0]?-1:0},w=function(c){h+=m+c,r[c]&&(h+="="+r[c]),m="&"};(0,f.default)(r).sort(p).forEach(w)}return h},P.buildCanonicalString=function(a,r,h,m){h=h||{};var p=h.headers||{},w="x-oss-",g=[],c={},n=[a.toUpperCase(),p["Content-Md5"]||"",p["Content-Type"]||p["Content-Type".toLowerCase()],m||p["x-oss-date"]];return(0,f.default)(p).forEach(function(s){var d=s.toLowerCase();d.indexOf(w)===0&&(c[d]=String(p[s]).trim())}),(0,f.default)(c).sort().forEach(function(s){g.push(s+":"+c[s])}),n=n.concat(g),n.push(this.buildCanonicalizedResource(r,h.parameters)),n.join(`
|
|
|
`)},P.computeSignature=function(a,r){var h=C.createHmac("sha1",a);return h.update(M.from(r,"utf8")).digest("base64")},P.authorization=function(a,r,h){return"OSS "+a+":"+this.computeSignature(r,h)},P._signatureForURL=function(a){var r=arguments.length>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.length;r++)a.push(l(v[r],o))}else a={},(0,u.default)(v).forEach(function(h){a[C(h,o)]=l(v[h],o)});return a}P.formatObjKey=l;function C(v,o){return o==="firstUpperCase"?v=v.replace(/^./,function(a){return a.toUpperCase()}):o==="firstLowerCase"&&(v=v.replace(/^./,function(a){return a.toLowerCase()})),v}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],41:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.getStrBytesCount=void 0;function M(u){for(var _=0,D=0;D<u.length;D++){var f=u.charAt(D);/^[\u00-\uff]$/.test(f)?_+=1:_+=2}return _}P.getStrBytesCount=M},{}],42:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.isArray=void 0,P.isArray=function(M){return Object.prototype.toString.call(M)==="[object Array]"}},{}],43:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.isBlob=void 0;function M(u){return typeof Blob!="undefined"&&u instanceof Blob}P.isBlob=M},{}],44:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.isFile=void 0,P.isFile=function(M){return typeof File!="undefined"&&M instanceof File}},{}],45:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.isIP=void 0,P.isIP=function(M){var u=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,_=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;return u.test(M)||_.test(M)}},{}],46:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.isObject=void 0,P.isObject=function(M){return Object.prototype.toString.call(M)==="[object Object]"}},{}],47:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/keys"),u=_(M);function _(C){return C&&C.__esModule?C:{default:C}}Object.defineProperty(P,"__esModule",{value:!0}),P.obj2xml=void 0;var D=I("./formatObjKey");function f(C){return Object.prototype.toString.call(C).replace(/(.*? |])/g,"").toLowerCase()}function l(C,v){var o="";return v&&v.headers&&(o=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
`),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]+"</"+a+">":f(C[a])==="object"?o+="<"+a+">"+l(C[a])+"</"+a+">":f(C[a])==="array"?o+=C[a].map(function(r){return"<"+a+">"+l(r)+"</"+a+">"}).join(""):o+="<"+a+">"+C[a].toString()+"</"+a+">"}):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;f<l;++f)M[f]=D[f],u[D.charCodeAt(f)]=f;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63;function C(p){var w=p.length;if(w%4>0)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<S;y+=4)w=u[p.charCodeAt(y)]<<18|u[p.charCodeAt(y+1)]<<12|u[p.charCodeAt(y+2)]<<6|u[p.charCodeAt(y+3)],s[d++]=w>>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;s<g;s+=3)c=(p[s]<<16&16711680)+(p[s+1]<<8&65280)+(p[s+2]&255),n.push(r(c));return n.join("")}function m(p){for(var w,g=p.length,c=g%3,n=[],s=16383,d=0,S=g-c;d<S;d+=s)n.push(h(p,d,d+s>S?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<o.length;++a){var r=o[a];if(typeof r=="string"&&r in _)return!0}return!1};function D(o){return o.split(".").length}function f(o,a){var r=[],h;if(Array.prototype.map)return Array.prototype.map.call(o,a);for(h=0;h<o.length;h++)r.push(a(o[h]));return r}function l(o){for(var a=Math.max(D(o[0]),D(o[1])),r=f(o,function(h){var m=a-D(h);return h=h+new Array(m+1).join(".0"),f(h.split("."),function(p){return new Array(20-p.length).join("0")+p}).reverse()});--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<this.charLength)return"";v=v.slice(a,v.length),o=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var h=o.charCodeAt(o.length-1);if(h>=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 <http://feross.org>
|
|
|
* @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()<Q)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(le=new Uint8Array(Q),le.__proto__=u.prototype):(le===null&&(le=new u(Q)),le.length=Q),le}function u(le,Q,Y){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(le,Q,Y);if(typeof le=="number"){if(typeof Q=="string")throw new Error("If encoding is specified then the first argument must be a string");return h(this,le)}return o(this,le,Q,Y)}u.poolSize=8192,u._augment=function(le){return le.__proto__=u.prototype,le};function o(le,Q,Y,Z){if(typeof Q=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&Q instanceof ArrayBuffer?w(le,Q,Y,Z):typeof Q=="string"?m(le,Q,Y):g(le,Q)}u.from=function(le,Q,Y){return o(null,le,Q,Y)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0}));function a(le){if(typeof le!="number")throw new TypeError('"size" argument must be a number');if(le<0)throw new RangeError('"size" argument must not be negative')}function r(le,Q,Y,Z){return a(Q),Q<=0?v(le,Q):Y!==void 0?typeof Z=="string"?v(le,Q).fill(Y,Z):v(le,Q).fill(Y):v(le,Q)}u.alloc=function(le,Q,Y){return r(null,le,Q,Y)};function h(le,Q){if(a(Q),le=v(le,Q<0?0:c(Q)|0),!u.TYPED_ARRAY_SUPPORT)for(var Y=0;Y<Q;++Y)le[Y]=0;return le}u.allocUnsafe=function(le){return h(null,le)},u.allocUnsafeSlow=function(le){return h(null,le)};function m(le,Q,Y){if((typeof Y!="string"||Y==="")&&(Y="utf8"),!u.isEncoding(Y))throw new TypeError('"encoding" must be a valid string encoding');var Z=s(Q,Y)|0;le=v(le,Z);var be=le.write(Q,Y);return be!==Z&&(le=le.slice(0,be)),le}function p(le,Q){var Y=Q.length<0?0:c(Q.length)|0;le=v(le,Y);for(var Z=0;Z<Y;Z+=1)le[Z]=Q[Z]&255;return le}function w(le,Q,Y,Z){if(Q.byteLength,Y<0||Q.byteLength<Y)throw new RangeError("'offset' is out of bounds");if(Q.byteLength<Y+(Z||0))throw new RangeError("'length' is out of bounds");return Y===void 0&&Z===void 0?Q=new Uint8Array(Q):Z===void 0?Q=new Uint8Array(Q,Y):Q=new Uint8Array(Q,Y,Z),u.TYPED_ARRAY_SUPPORT?(le=Q,le.__proto__=u.prototype):le=p(le,Q),le}function g(le,Q){if(u.isBuffer(Q)){var Y=c(Q.length)|0;return le=v(le,Y),le.length===0||Q.copy(le,0,0,Y),le}if(Q){if(typeof ArrayBuffer!="undefined"&&Q.buffer instanceof ArrayBuffer||"length"in Q)return typeof Q.length!="number"||Oe(Q.length)?v(le,0):p(le,Q);if(Q.type==="Buffer"&&f(Q.data))return p(le,Q.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function c(le){if(le>=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<Re;++ge)if(Q[ge]!==Y[ge]){Z=Q[ge],be=Y[ge];break}return Z<be?-1:be<Z?1:0},u.isEncoding=function(Q){switch(String(Q).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(Q,Y){if(!f(Q))throw new TypeError('"list" argument must be an Array of Buffers');if(Q.length===0)return u.alloc(0);var Z;if(Y===void 0)for(Y=0,Z=0;Z<Q.length;++Z)Y+=Q[Z].length;var be=u.allocUnsafe(Y),ge=0;for(Z=0;Z<Q.length;++Z){var Re=Q[Z];if(!u.isBuffer(Re))throw new TypeError('"list" argument must be an Array of Buffers');Re.copy(be,ge),ge+=Re.length}return be};function s(le,Q){if(u.isBuffer(le))return le.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(le)||le instanceof ArrayBuffer))return le.byteLength;typeof le!="string"&&(le=""+le);var Y=le.length;if(Y===0)return 0;for(var Z=!1;;)switch(Q){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":case void 0:return ce(le).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y*2;case"hex":return Y>>>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;Y<Q;Y+=2)S(this,Y,Y+1);return this},u.prototype.swap32=function(){var Q=this.length;if(Q%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var Y=0;Y<Q;Y+=4)S(this,Y,Y+3),S(this,Y+1,Y+2);return this},u.prototype.swap64=function(){var Q=this.length;if(Q%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var Y=0;Y<Q;Y+=8)S(this,Y,Y+7),S(this,Y+1,Y+6),S(this,Y+2,Y+5),S(this,Y+3,Y+4);return this},u.prototype.toString=function(){var Q=this.length|0;return Q===0?"":arguments.length===0?j(this,0,Q):d.apply(this,arguments)},u.prototype.equals=function(Q){if(!u.isBuffer(Q))throw new TypeError("Argument must be a Buffer");return this===Q?!0:u.compare(this,Q)===0},u.prototype.inspect=function(){var Q="",Y=P.INSPECT_MAX_BYTES;return this.length>0&&(Q=this.toString("hex",0,Y).match(/.{2}/g).join(" "),this.length>Y&&(Q+=" ... ")),"<Buffer "+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;ut<qe;++ut)if(et[ut]!==nt[ut]){Re=et[ut],Ze=nt[ut];break}return Re<Ze?-1:Ze<Re?1:0};function y(le,Q,Y,Z,be){if(le.length===0)return-1;if(typeof Y=="string"?(Z=Y,Y=0):Y>2147483647?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;et<Re;et++)if(qe(le,et)===qe(Q,nt===-1?0:et-nt)){if(nt===-1&&(nt=et),et-nt+1===Ze)return nt*ge}else nt!==-1&&(et-=et-nt),nt=-1}else for(Y+Ze>Re&&(Y=Re-Ze),et=Y;et>=0;et--){for(var ut=!0,ot=0;ot<Ze;ot++)if(qe(le,et+ot)!==qe(Q,ot)){ut=!1;break}if(ut)return et}return-1}u.prototype.includes=function(Q,Y,Z){return this.indexOf(Q,Y,Z)!==-1},u.prototype.indexOf=function(Q,Y,Z){return y(this,Q,Y,Z,!0)},u.prototype.lastIndexOf=function(Q,Y,Z){return y(this,Q,Y,Z,!1)};function k(le,Q,Y,Z){Y=Number(Y)||0;var be=le.length-Y;Z?(Z=Number(Z),Z>be&&(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;Re<Z;++Re){var Ze=parseInt(Q.substr(Re*2,2),16);if(isNaN(Ze))return Re;le[Y+Re]=Ze}return Re}function O(le,Q,Y,Z){return ue(ce(Q,le.length-Y),le,Y,Z)}function b(le,Q,Y,Z){return ue(oe(Q),le,Y,Z)}function E(le,Q,Y,Z){return b(le,Q,Y,Z)}function x(le,Q,Y,Z){return ue(te(Q),le,Y,Z)}function T(le,Q,Y,Z){return ue(Se(Q,le.length-Y),le,Y,Z)}u.prototype.write=function(Q,Y,Z,be){if(Y===void 0)be="utf8",Z=this.length,Y=0;else if(Z===void 0&&typeof Y=="string")be=Y,Z=this.length,Y=0;else if(isFinite(Y))Y=Y|0,isFinite(Z)?(Z=Z|0,be===void 0&&(be="utf8")):(be=Z,Z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ge=this.length-Y;if((Z===void 0||Z>ge)&&(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;be<Y;){var ge=le[be],Re=null,Ze=ge>239?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;Z<Q;)Y+=String.fromCharCode.apply(String,le.slice(Z,Z+=L));return Y}function K(le,Q,Y){var Z="";Y=Math.min(le.length,Y);for(var be=Q;be<Y;++be)Z+=String.fromCharCode(le[be]&127);return Z}function W(le,Q,Y){var Z="";Y=Math.min(le.length,Y);for(var be=Q;be<Y;++be)Z+=String.fromCharCode(le[be]);return Z}function G(le,Q,Y){var Z=le.length;(!Q||Q<0)&&(Q=0),(!Y||Y<0||Y>Z)&&(Y=Z);for(var be="",ge=Q;ge<Y;++ge)be+=he(le[ge]);return be}function F(le,Q,Y){for(var Z=le.slice(Q,Y),be="",ge=0;ge<Z.length;ge+=2)be+=String.fromCharCode(Z[ge]+Z[ge+1]*256);return be}u.prototype.slice=function(Q,Y){var Z=this.length;Q=~~Q,Y=Y===void 0?Z:~~Y,Q<0?(Q+=Z,Q<0&&(Q=0)):Q>Z&&(Q=Z),Y<0?(Y+=Z,Y<0&&(Y=0)):Y>Z&&(Y=Z),Y<Q&&(Y=Q);var be;if(u.TYPED_ARRAY_SUPPORT)be=this.subarray(Q,Y),be.__proto__=u.prototype;else{var ge=Y-Q;be=new u(ge,void 0);for(var Re=0;Re<ge;++Re)be[Re]=this[Re+Q]}return be};function B(le,Q,Y){if(le%1!==0||le<0)throw new RangeError("offset is not uint");if(le+Q>Y)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;++Re<Y&&(ge*=256);)be+=this[Q+Re]*ge;return be},u.prototype.readUIntBE=function(Q,Y,Z){Q=Q|0,Y=Y|0,Z||B(Q,Y,this.length);for(var be=this[Q+--Y],ge=1;Y>0&&(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<Y&&(ge*=256);)be+=this[Q+Re]*ge;return ge*=128,be>=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||Q<ge)throw new RangeError('"value" argument is out of bounds');if(Y+Z>le.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<Z&&(Re*=256);)this[Y+Ze]=Q/Re&255;return Y+Z},u.prototype.writeUIntBE=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=Z-1,Ze=1;for(this[Y+Re]=Q&255;--Re>=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<ge;++be)le[Y+be]=(Q&255<<8*(Z?be:1-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<ge;++be)le[Y+be]=Q>>>(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<Z&&(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.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<Z&&(be=Z),be===Z)return 0;if(Q.length===0||this.length===0)return 0;if(Y<0)throw new RangeError("targetStart out of bounds");if(Z<0||Z>=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<be-Z&&(be=Q.length-Y+Z);var ge=be-Z,Re;if(this===Q&&Z<Y&&Y<be)for(Re=ge-1;Re>=0;--Re)Q[Re+Y]=this[Re+Z];else if(ge<1e3||!u.TYPED_ARRAY_SUPPORT)for(Re=0;Re<ge;++Re)Q[Re+Y]=this[Re+Z];else Uint8Array.prototype.set.call(Q,this.subarray(Z,Z+ge),Y);return ge},u.prototype.fill=function(Q,Y,Z,be){if(typeof Q=="string"){if(typeof Y=="string"?(be=Y,Y=0,Z=this.length):typeof Z=="string"&&(be=Z,Z=this.length),Q.length===1){var ge=Q.charCodeAt(0);ge<256&&(Q=ge)}if(be!==void 0&&typeof be!="string")throw new TypeError("encoding must be a string");if(typeof be=="string"&&!u.isEncoding(be))throw new TypeError("Unknown encoding: "+be)}else typeof Q=="number"&&(Q=Q&255);if(Y<0||this.length<Y||this.length<Z)throw new RangeError("Out of range index");if(Z<=Y)return this;Y=Y>>>0,Z=Z===void 0?this.length:Z>>>0,Q||(Q=0);var Re;if(typeof Q=="number")for(Re=Y;Re<Z;++Re)this[Re]=Q;else{var Ze=u.isBuffer(Q)?Q:ce(new u(Q,be).toString()),qe=Ze.length;for(Re=0;Re<Z-Y;++Re)this[Re+Y]=Ze[Re%qe]}return this};var pe=/[^+\/0-9A-Za-z-_]/g;function Me(le){if(le=_e(le).replace(pe,""),le.length<2)return"";for(;le.length%4!==0;)le=le+"=";return le}function _e(le){return le.trim?le.trim():le.replace(/^\s+|\s+$/g,"")}function he(le){return le<16?"0"+le.toString(16):le.toString(16)}function ce(le,Q){Q=Q||Infinity;for(var Y,Z=le.length,be=null,ge=[],Re=0;Re<Z;++Re){if(Y=le.charCodeAt(Re),Y>55295&&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<le.length;++Y)Q.push(le.charCodeAt(Y)&255);return Q}function Se(le,Q){for(var Y,Z,be,ge=[],Re=0;Re<le.length&&!((Q-=2)<0);++Re)Y=le.charCodeAt(Re),Z=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<Z&&!(be+Y>=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 <dead_horse@qq.com>
|
|
|
* 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;l<f.length;l++){if(C=f[l],D[C]!==void 0)continue;D[C]=this.src[C]}return D}for(var l=0;l<f.length;l++){var C=f[l];if(!_(D,C))continue;var v=this.src.__lookupGetter__(C),o=this.src.__lookupSetter__(C);v&&D.__defineGetter__(C,v),o&&D.__defineSetter__(C,o),!v&&!o&&(D[C]=this.src[C])}return D},u.prototype.toCover=function(D){for(var f=this.keys||Object.keys(this.src),l=0;l<f.length;l++){var C=f[l];delete D[C];var v=this.src.__lookupGetter__(C),o=this.src.__lookupSetter__(C);v&&D.__defineGetter__(C,v),o&&D.__defineSetter__(C,o),!v&&!o&&(D[C]=this.src[C])}},u.prototype.override=u.prototype.toCover,u.prototype.and=function(D){var f={};return this.to(f),this.src=D,this.to(f),this.src=f,this};function _(D,f){return D[f]===void 0&&D.__lookupGetter__(f)===void 0&&D.__lookupSetter__(f)===void 0}},{}],77:[function(I,J,P){I("../../modules/es6.string.iterator"),I("../../modules/es6.array.from"),J.exports=I("../../modules/_core").Array.from},{"../../modules/_core":99,"../../modules/es6.array.from":168,"../../modules/es6.string.iterator":180}],78:[function(I,J,P){var M=I("../../modules/_core"),u=M.JSON||(M.JSON={stringify:JSON.stringify});J.exports=function(D){return u.stringify.apply(u,arguments)}},{"../../modules/_core":99}],79:[function(I,J,P){I("../../modules/es6.object.assign"),J.exports=I("../../modules/_core").Object.assign},{"../../modules/_core":99,"../../modules/es6.object.assign":171}],80:[function(I,J,P){I("../../modules/es6.object.create");var M=I("../../modules/_core").Object;J.exports=function(_,D){return M.create(_,D)}},{"../../modules/_core":99,"../../modules/es6.object.create":172}],81:[function(I,J,P){I("../../modules/es6.object.define-property");var M=I("../../modules/_core").Object;J.exports=function(_,D,f){return M.defineProperty(_,D,f)}},{"../../modules/_core":99,"../../modules/es6.object.define-property":173}],82:[function(I,J,P){I("../../modules/es7.object.entries"),J.exports=I("../../modules/_core").Object.entries},{"../../modules/_core":99,"../../modules/es7.object.entries":182}],83:[function(I,J,P){I("../../modules/es6.object.get-own-property-names");var M=I("../../modules/_core").Object;J.exports=function(_){return M.getOwnPropertyNames(_)}},{"../../modules/_core":99,"../../modules/es6.object.get-own-property-names":174}],84:[function(I,J,P){I("../../modules/es6.object.get-prototype-of"),J.exports=I("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":99,"../../modules/es6.object.get-prototype-of":175}],85:[function(I,J,P){I("../../modules/es6.object.keys"),J.exports=I("../../modules/_core").Object.keys},{"../../modules/_core":99,"../../modules/es6.object.keys":176}],86:[function(I,J,P){I("../modules/es6.object.to-string"),I("../modules/es6.string.iterator"),I("../modules/web.dom.iterable"),I("../modules/es6.promise"),I("../modules/es7.promise.finally"),I("../modules/es7.promise.try"),J.exports=I("../modules/_core").Promise},{"../modules/_core":99,"../modules/es6.object.to-string":177,"../modules/es6.promise":178,"../modules/es6.string.iterator":180,"../modules/es7.promise.finally":183,"../modules/es7.promise.try":184,"../modules/web.dom.iterable":187}],87:[function(I,J,P){I("../modules/web.immediate"),J.exports=I("../modules/_core").setImmediate},{"../modules/_core":99,"../modules/web.immediate":188}],88:[function(I,J,P){I("../../modules/es6.string.from-code-point"),J.exports=I("../../modules/_core").String.fromCodePoint},{"../../modules/_core":99,"../../modules/es6.string.from-code-point":179}],89:[function(I,J,P){I("../../modules/es6.function.has-instance"),J.exports=I("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":165,"../../modules/es6.function.has-instance":170}],90:[function(I,J,P){I("../../modules/es6.symbol"),I("../../modules/es6.object.to-string"),I("../../modules/es7.symbol.async-iterator"),I("../../modules/es7.symbol.observable"),J.exports=I("../../modules/_core").Symbol},{"../../modules/_core":99,"../../modules/es6.object.to-string":177,"../../modules/es6.symbol":181,"../../modules/es7.symbol.async-iterator":185,"../../modules/es7.symbol.observable":186}],91:[function(I,J,P){I("../../modules/es6.string.iterator"),I("../../modules/web.dom.iterable"),J.exports=I("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":165,"../../modules/es6.string.iterator":180,"../../modules/web.dom.iterable":187}],92:[function(I,J,P){J.exports=function(M){if(typeof M!="function")throw TypeError(M+" is not a function!");return M}},{}],93:[function(I,J,P){J.exports=function(){}},{}],94:[function(I,J,P){J.exports=function(M,u,_,D){if(!(M instanceof u)||D!==void 0&&D in M)throw TypeError(_+": incorrect invocation!");return M}},{}],95:[function(I,J,P){var M=I("./_is-object");J.exports=function(u){if(!M(u))throw TypeError(u+" is not an object!");return u}},{"./_is-object":119}],96:[function(I,J,P){var M=I("./_to-iobject"),u=I("./_to-length"),_=I("./_to-absolute-index");J.exports=function(D){return function(f,l,C){var v=M(f),o=u(v.length),a=_(C,o),r;if(D&&l!=l){for(;o>a;)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;l<f.length;l++){var C=f[l],v=M[C],o=v&&v.prototype;o&&!o[D]&&u(o,D,C),_[C]=_.Array}},{"./_global":110,"./_hide":112,"./_iterators":125,"./_wks":166,"./es6.array.iterator":169}],188:[function(I,J,P){var M=I("./_export"),u=I("./_task");M(M.G+M.B,{setImmediate:u.set,clearImmediate:u.clear})},{"./_export":107,"./_task":155}],189:[function(I,J,P){(function(M){"use strict";var u=I("babel-runtime/helpers/typeof"),_=D(u);function D(d){return d&&d.__esModule?d:{default:d}}function f(d){return Array.isArray?Array.isArray(d):s(d)==="[object Array]"}P.isArray=f;function l(d){return typeof d=="boolean"}P.isBoolean=l;function C(d){return d===null}P.isNull=C;function v(d){return d==null}P.isNullOrUndefined=v;function o(d){return typeof d=="number"}P.isNumber=o;function a(d){return typeof d=="string"}P.isString=a;function r(d){return(typeof d=="undefined"?"undefined":(0,_.default)(d))==="symbol"}P.isSymbol=r;function h(d){return d===void 0}P.isUndefined=h;function m(d){return s(d)==="[object RegExp]"}P.isRegExp=m;function p(d){return(typeof d=="undefined"?"undefined":(0,_.default)(d))==="object"&&d!==null}P.isObject=p;function w(d){return s(d)==="[object Date]"}P.isDate=w;function g(d){return s(d)==="[object Error]"||d instanceof Error}P.isError=g;function c(d){return typeof d=="function"}P.isFunction=c;function n(d){return d===null||typeof d=="boolean"||typeof d=="number"||typeof d=="string"||(typeof d=="undefined"?"undefined":(0,_.default)(d))==="symbol"||typeof d=="undefined"}P.isPrimitive=n,P.isBuffer=M.isBuffer;function s(d){return Object.prototype.toString.call(d)}}).call(this,{isBuffer:I("../../is-buffer/index.js")})},{"../../is-buffer/index.js":197,"babel-runtime/helpers/typeof":67}],190:[function(I,J,P){"use strict";var M=I("babel-runtime/helpers/typeof"),u=_(M);function _(D){return D&&D.__esModule?D:{default:D}}(function(D){"use strict";var f=function(){var a=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,r=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,h=/[^-+\dA-Z]/g;return function(m,p,w,g){if(arguments.length===1&&o(m)==="string"&&!/\d/.test(m)&&(p=m,m=void 0),m=m||new Date,m instanceof Date||(m=new Date(m)),isNaN(m))throw TypeError("Invalid date");p=String(f.masks[p]||p||f.masks.default);var c=p.slice(0,4);(c==="UTC:"||c==="GMT:")&&(p=p.slice(4),w=!0,c==="GMT:"&&(g=!0));var n=w?"getUTC":"get",s=m[n+"Date"](),d=m[n+"Day"](),S=m[n+"Month"](),y=m[n+"FullYear"](),i=m[n+"Hours"](),k=m[n+"Minutes"](),O=m[n+"Seconds"](),b=m[n+"Milliseconds"](),E=w?0:m.getTimezoneOffset(),x=C(m),T=v(m),N={d:s,dd:l(s),ddd:f.i18n.dayNames[d],dddd:f.i18n.dayNames[d+7],m:S+1,mm:l(S+1),mmm:f.i18n.monthNames[S],mmmm:f.i18n.monthNames[S+12],yy:String(y).slice(2),yyyy:y,h:i%12||12,hh:l(i%12||12),H:i,HH:l(i),M:k,MM:l(k),s:O,ss:l(O),l:l(b,3),L:l(Math.round(b/10)),t:i<12?"a":"p",tt:i<12?"am":"pm",T:i<12?"A":"P",TT:i<12?"AM":"PM",Z:g?"GMT":w?"UTC":(String(m).match(r)||[""]).pop().replace(h,""),o:(E>0?"-":"+")+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<r;)a="0"+a;return a}function C(a){var r=new Date(a.getFullYear(),a.getMonth(),a.getDate());r.setDate(r.getDate()-(r.getDay()+6)%7+3);var h=new Date(r.getFullYear(),0,4);h.setDate(h.getDate()-(h.getDay()+6)%7+3);var m=r.getTimezoneOffset()-h.getTimezoneOffset();r.setHours(r.getHours()-m);var p=(r-h)/(864e5*7);return 1+Math.floor(p)}function v(a){var r=a.getDay();return r===0&&(r=7),r}function o(a){return a===null?"null":a===void 0?"undefined":(typeof a=="undefined"?"undefined":(0,u.default)(a))!=="object"?typeof a=="undefined"?"undefined":(0,u.default)(a):Array.isArray(a)?"array":{}.toString.call(a).slice(8,-1).toLowerCase()}typeof define=="function"&&define.amd?define(function(){return f}):(typeof P=="undefined"?"undefined":(0,u.default)(P))==="object"?J.exports=f:D.dateFormat=f})(void 0)},{"babel-runtime/helpers/typeof":67}],191:[function(I,J,P){/*!
|
|
|
* escape-html
|
|
|
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|
|
* Copyright(c) 2015 Andreas Lubbe
|
|
|
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|
|
* MIT Licensed
|
|
|
*/"use strict";var M=/["'&<>]/;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;v<D.length;v++){switch(D.charCodeAt(v)){case 34:l=""";break;case 38:l="&";break;case 39:l="'";break;case 60:l="<";break;case 62:l=">";break;default:continue}o!==v&&(C+=D.substring(o,v)),o=v+1,C+=l}return o!==v?C+D.substring(o,v):C}},{}],192:[function(I,J,P){function M(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}J.exports=M,M.EventEmitter=M,M.prototype._events=void 0,M.prototype._maxListeners=void 0,M.defaultMaxListeners=10,M.prototype.setMaxListeners=function(l){if(!_(l)||l<0||isNaN(l))throw TypeError("n must be a positive number");return this._maxListeners=l,this},M.prototype.emit=function(l){var C,v,o,a,r,h;if(this._events||(this._events={}),l==="error"&&(!this._events.error||D(this._events.error)&&!this._events.error.length)){if(C=arguments[1],C instanceof Error)throw C;var m=new Error('Uncaught, unspecified "error" event. ('+C+")");throw m.context=C,m}if(v=this._events[l],f(v))return!1;if(u(v))switch(arguments.length){case 1:v.call(this);break;case 2:v.call(this,arguments[1]);break;case 3:v.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),v.apply(this,a)}else if(D(v))for(a=Array.prototype.slice.call(arguments,1),h=v.slice(),o=h.length,r=0;r<o;r++)h[r].apply(this,a);return!0},M.prototype.addListener=function(l,C){var v;if(!u(C))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",l,u(C.listener)?C.listener:C),this._events[l]?D(this._events[l])?this._events[l].push(C):this._events[l]=[this._events[l],C]:this._events[l]=C,D(this._events[l])&&!this._events[l].warned&&(f(this._maxListeners)?v=M.defaultMaxListeners:v=this._maxListeners,v&&v>0&&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 <dead_horse@qq.com>
|
|
|
* 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<<v)-1,a=o>>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<<a)-1,h=r>>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<<f|v,a+=f;a>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 <https://feross.org>
|
|
|
* @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<M;P++)J[I.charAt(P)]=P;return J}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(I){if(I.length<2){var J=I.charCodeAt(0);return J<128?I:J<2048?fromCharCode(192|J>>>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;u<arguments.length;u++)this.define(arguments[u]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}M.prototype.define=function(u,_){for(var D in u){var f=u[D].map(function(v){return v.toLowerCase()});D=D.toLowerCase();for(var l=0;l<f.length;l++){var C=f[l];if(C[0]=="*")continue;if(!_&&C in this._types)throw new Error('Attempt to change mapping for "'+C+'" extension from "'+this._types[C]+'" to "'+D+'". Pass `force=true` to allow this, otherwise remove "'+C+'" from the list of extensions for "'+D+'".');this._types[C]=D}if(_||!this._extensions[D]){var C=f[0];this._extensions[D]=C[0]!="*"?C:C.substr(1)}}},M.prototype.getType=function(u){u=String(u);var _=u.replace(/^.*[/\\]/,"").toLowerCase(),D=_.replace(/^.*\./,"").toLowerCase(),f=_.length<u.length,l=D.length<_.length-1;return(l||!f)&&this._types[D]||null},M.prototype.getExtension=function(u){return u=/^\s*([^;\s]*)/.test(u)&&RegExp.$1,u&&this._extensions[u.toLowerCase()]||null},J.exports=M},{}],202:[function(I,J,P){"use strict";var M=I("./Mime");J.exports=new M(I("./types/standard"))},{"./Mime":201,"./types/standard":203}],203:[function(I,J,P){J.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma","es"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/mrb-consumer+xml":["*xdf"],"application/mrb-publish+xml":["*xdf"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["*xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/ttml+xml":["ttml"],"application/urc-ressheet+xml":["rsheet"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-error+xml":["xer"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},{}],204:[function(I,J,P){var M=1e3,u=M*60,_=u*60,D=_*24,f=D*7,l=D*365.25;J.exports=function(r,h){h=h||{};var m=typeof r;if(m==="string"&&r.length>0)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<w.length&&!(w[g]!=="");g++);for(var c=w.length-1;c>=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<r;m++)if(o[m]!==a[m]){h=m;break}for(var p=[],m=h;m<o.length;m++)p.push("..");return p=p.concat(a.slice(h)),p.join("/")},P.sep="/",P.delimiter=":",P.dirname=function(l){if(typeof l!="string"&&(l=l+""),l.length===0)return".";for(var C=l.charCodeAt(0),v=C===47,o=-1,a=!0,r=l.length-1;r>=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<l.length;o++)C(l[o],o,l)&&v.push(l[o]);return v}var f="ab".substr(-1)==="b"?function(l,C,v){return l.substr(C,v)}:function(l,C,v){return C<0&&(C=l.length+C),l.substr(C,v)}}).call(this,I("_process"))},{_process:208}],206:[function(I,J,P){(function(M){/*!
|
|
|
* Platform.js <https://mths.be/platform>
|
|
|
* Copyright 2014-2018 Benjamin Tan <https://bnjmnt4n.now.sh/>
|
|
|
* Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
|
|
|
* Available under MIT license <https://mths.be/mit>
|
|
|
*/(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(;++x<T;)E(b[x],x,b);else n(b,E)}function c(b){return b=i(b),/^(?:webOS|i(?:OS|P))/.test(b)?b:p(b)}function n(b,E){for(var x in b)h.call(b,x)&&E(b[x],x,b)}function s(b){return b==null?p(b):m.call(b).slice(8,-1)}function d(b,E){var x=b!=null?typeof b[E]:"number";return!/^(?:boolean|number|string|undefined)$/.test(x)&&(x=="object"?!!b[E]:!0)}function S(b){return String(b).replace(/([ -])(?!$)/g,"$1?")}function y(b,E){var x=null;return g(b,function(T,N){x=E(x,T,N,b)}),x}function i(b){return String(b).replace(/^ +| +$/g,"")}function k(b){var E=_,x=b&&typeof b=="object"&&s(b)!="String";x&&(E=b,b=null);var T=E.navigator||{},N=T.userAgent||"";b||(b=N);var j=x||a==D,L=x?!!T.likeChrome:/\bChrome\b/.test(b)&&!/internal|\n/i.test(m.toString()),V="Object",K=x?V:"ScriptBridgingProxyObject",W=x?V:"Environment",G=x&&E.java?"JavaPackage":s(E.java),F=x?V:"RuntimeObject",B=/\bJava/.test(G)&&E.java,H=B&&s(E.environment)==W,q=B?"a":"\u03B1",re=B?"b":"\u03B2",ee=E.document||{},Ce=E.operamini||E.opera,Ee=o.test(Ee=x&&Ce?Ce["[[Class]]"]:s(Ce))?Ee:Ce=null,pe,Me=b,_e=[],he=null,ce=b==N,oe=ce&&Ce&&typeof Ce.version=="function"&&Ce.version(),Se,te=Y([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),ue=be(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"Edge"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Waterfox","WebPositive","Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chrome",{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),Oe=Re([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),le=Z({Apple:{iPad:1,iPhone:1,iPod:1},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1}}),Q=ge(["Windows Phone","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function Y(nt){return y(nt,function(ut,ot){return ut||RegExp("\\b"+(ot.pattern||S(ot))+"\\b","i").exec(b)&&(ot.label||ot)})}function Z(nt){return y(nt,function(ut,ot,je){return ut||(ot[Oe]||ot[/^[a-z]+(?: +[a-z]+\b)*/i.exec(Oe)]||RegExp("\\b"+S(je)+"(?:\\b|\\w*\\d)","i").exec(b))&&je})}function be(nt){return y(nt,function(ut,ot){return ut||RegExp("\\b"+(ot.pattern||S(ot))+"\\b","i").exec(b)&&(ot.label||ot)})}function ge(nt){return y(nt,function(ut,ot){var je=ot.pattern||S(ot);return!ut&&(ut=RegExp("\\b"+je+"(?:/[\\d.]+|[ \\w.]*)","i").exec(b))&&(ut=w(ut,je,ot.label||ot)),ut})}function Re(nt){return y(nt,function(ut,ot){var je=ot.pattern||S(ot);return!ut&&(ut=RegExp("\\b"+je+" *\\d+[.\\w_]*","i").exec(b)||RegExp("\\b"+je+" *\\w+-[\\w]*","i").exec(b)||RegExp("\\b"+je+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(b))&&((ut=String(ot.label&&!RegExp(je,"i").test(ot.label)?ot.label:ut).split("/"))[1]&&!/[\d.]+/.test(ut[0])&&(ut[0]+=" "+ut[1]),ot=ot.label||ot,ut=c(ut[0].replace(RegExp(je,"i"),ot).replace(RegExp("; *(?:"+ot+"[_-])?","i")," ").replace(RegExp("("+ot+")[-_.]?(\\w)","i"),"$1 $2"))),ut})}function Ze(nt){return y(nt,function(ut,ot){return ut||(RegExp(ot+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(b)||0)[1]||null})}function qe(){return this.description||""}if(te&&(te=[te]),le&&!Oe&&(Oe=Re([le])),(pe=/\bGoogle TV\b/.exec(Oe))&&(Oe=pe[0]),/\bSimulator\b/i.test(b)&&(Oe=(Oe?Oe+" ":"")+"Simulator"),ue=="Opera Mini"&&/\bOPiOS\b/.test(b)&&_e.push("running in Turbo/Uncompressed mode"),ue=="IE"&&/\blike iPhone OS\b/.test(b)?(pe=k(b.replace(/like iPhone OS/,"")),le=pe.manufacturer,Oe=pe.product):/^iP/.test(Oe)?(ue||(ue="Safari"),Q="iOS"+((pe=/ OS ([\d_]+)/i.exec(b))?" "+pe[1].replace(/_/g,"."):"")):ue=="Konqueror"&&!/buntu/i.test(Q)?Q="Kubuntu":le&&le!="Google"&&(/Chrome/.test(ue)&&!/\bMobile Safari\b/i.test(b)||/\bVita\b/.test(Oe))||/\bAndroid\b/.test(Q)&&/^Chrome/.test(ue)&&/\bVersion\//i.test(b)?(ue="Android Browser",Q=/\bAndroid\b/.test(Q)?Q:"Android"):ue=="Silk"?(/\bMobi/i.test(b)||(Q="Android",_e.unshift("desktop mode")),/Accelerated *= *true/i.test(b)&&_e.unshift("accelerated")):ue=="PaleMoon"&&(pe=/\bFirefox\/([\d.]+)\b/.exec(b))?_e.push("identifying as Firefox "+pe[1]):ue=="Firefox"&&(pe=/\b(Mobile|Tablet|TV)\b/i.exec(b))?(Q||(Q="Firefox OS"),Oe||(Oe=pe[1])):!ue||(pe=!/\bMinefield\b/i.test(b)&&/\b(?:Firefox|Safari)\b/.exec(ue))?(ue&&!Oe&&/[\/,]|^[^(]+?\)/.test(b.slice(b.indexOf(pe+"/")+8))&&(ue=null),(pe=Oe||le||Q)&&(Oe||le||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(Q))&&(ue=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(Q)?Q:pe)+" Browser")):ue=="Electron"&&(pe=(/\bChrome\/([\d.]+)\b/.exec(b)||0)[1])&&_e.push("Chromium "+pe),oe||(oe=Ze(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",S(ue),"(?:Firefox|Minefield|NetFront)"])),(pe=te=="iCab"&&parseFloat(oe)>3&&"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;o<v.length;)v[o++]=arguments[o];return M.nextTick(function(){_.apply(null,v)})}}}).call(this,I("_process"))},{_process:208}],208:[function(I,J,P){var M=J.exports={},u,_;function D(){throw new Error("setTimeout has not been defined")}function f(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?u=setTimeout:u=D}catch(g){u=D}try{typeof clearTimeout=="function"?_=clearTimeout:_=f}catch(g){_=f}})();function l(g){if(u===setTimeout)return setTimeout(g,0);if((u===D||!u)&&setTimeout)return u=setTimeout,setTimeout(g,0);try{return u(g,0)}catch(c){try{return u.call(null,g,0)}catch(n){return u.call(this,g,0)}}}function C(g){if(_===clearTimeout)return clearTimeout(g);if((_===f||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(g);try{return _(g)}catch(c){try{return _.call(null,g)}catch(n){return _.call(this,g)}}}var v=[],o=!1,a,r=-1;function h(){if(!o||!a)return;o=!1,a.length?v=a.concat(v):r=-1,v.length&&m()}function m(){if(o)return;var g=l(h);o=!0;for(var c=v.length;c;){for(a=v,v=[];++r<c;)a&&a[r].run();r=-1,c=v.length}a=null,o=!1,C(g)}M.nextTick=function(g){var c=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)c[n-1]=arguments[n];v.push(new p(g,c)),v.length===1&&!o&&l(m)};function p(g,c){this.fun=g,this.array=c}p.prototype.run=function(){this.fun.apply(null,this.array)},M.title="browser",M.browser=!0,M.env={},M.argv=[],M.version="",M.versions={};function w(){}M.on=w,M.addListener=w,M.once=w,M.off=w,M.removeListener=w,M.removeAllListeners=w,M.emit=w,M.prependListener=w,M.prependOnceListener=w,M.listeners=function(g){return[]},M.binding=function(g){throw new Error("process.binding is not supported")},M.cwd=function(){return"/"},M.chdir=function(g){throw new Error("process.chdir is not supported")},M.umask=function(){return 0}},{}],209:[function(I,J,P){(function(M){/*! https://mths.be/punycode v1.4.1 by @mathias */(function(u){var _=typeof P=="object"&&P&&!P.nodeType&&P,D=typeof J=="object"&&J&&!J.nodeType&&J,f=typeof M=="object"&&M;(f.global===f||f.window===f||f.self===f)&&(u=f);var l,C=2147483647,v=36,o=1,a=26,r=38,h=700,m=72,p=128,w="-",g=/^xn--/,c=/[^\x20-\x7E]/,n=/[\x2E\u3002\uFF0E\uFF61]/g,s={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 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<H;)q=G.charCodeAt(B++),q>=55296&&q<=56319&&B<H?(re=G.charCodeAt(B++),(re&64512)==56320?F.push(((q&1023)<<10)+(re&1023)+65536):(F.push(q),B--)):F.push(q);return F}function x(G){return O(G,function(F){var B="";return F>65535&&(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<Ce;++Ee)G.charCodeAt(Ee)>=128&&k("not-basic"),F.push(G.charCodeAt(Ee));for(pe=Ce>0?Ce+1:0;pe<B;){for(Me=q,_e=1,he=v;!(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,ce<oe);he+=v)Se=v-oe,_e>S(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<ce;++ee)_e=G[ee],_e<128&&he.push(y(_e));for(H=q=he.length,q&&he.push(w);H<ce;){for(Ce=C,ee=0;ee<ce;++ee)_e=G[ee],_e>=F&&_e<Ce&&(Ce=_e);for(oe=H+1,Ce-F>S((C-B)/oe)&&k("overflow"),B+=(Ce-F)*oe,F=Ce,ee=0;ee<ce;++ee)if(_e=G[ee],_e<F&&++B>C&&k("overflow"),_e==F){for(Ee=B,pe=v;!(Me=pe<=re?o:pe>=re+a?a:pe-re,Ee<Me);pe+=v)te=Ee-Me,Se=v-Me,he.push(y(N(Me+te%Se,0))),Ee=S(te/Se);he.push(y(N(Ee,0))),re=j(B,oe,H==q),B=0,++H}++B,++F}return he.join("")}function K(G){return b(G,function(F){return g.test(F)?L(F.slice(4).toLowerCase()):F})}function W(G){return b(G,function(F){return c.test(F)?"xn--"+V(F):F})}if(l={version:"1.4.1",ucs2:{decode:E,encode:x},decode:L,encode:V,toASCII:W,toUnicode:K},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return l});else if(_&&D)if(J.exports==_)D.exports=l;else for(i in l)l.hasOwnProperty(i)&&(_[i]=l[i]);else u.punycode=l})(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],210:[function(I,J,P){"use strict";function M(_,D){return Object.prototype.hasOwnProperty.call(_,D)}J.exports=function(_,D,f,l){D=D||"&",f=f||"=";var C={};if(typeof _!="string"||_.length===0)return C;var v=/\+/g;_=_.split(D);var o=1e3;l&&typeof l.maxKeys=="number"&&(o=l.maxKeys);var a=_.length;o>0&&a>o&&(a=o);for(var r=0;r<a;++r){var h=_[r].replace(v,"%20"),m=h.indexOf(f),p,w,g,c;m>=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;v<f.length;v++)C.push(l(f[v],v));return C}var D=Object.keys||function(f){var l=[];for(var C in f)Object.prototype.hasOwnProperty.call(f,C)&&l.push(C);return l}},{}],212:[function(I,J,P){"use strict";P.decode=P.parse=I("./decode"),P.encode=P.stringify=I("./encode")},{"./decode":210,"./encode":211}],213:[function(I,J,P){J.exports=I("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":214}],214:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/create"),u=f(M),_=I("babel-runtime/core-js/object/keys"),D=f(_);function f(c){return c&&c.__esModule?c:{default:c}}var l=I("process-nextick-args"),C=D.default||function(c){var n=[];for(var s in c)n.push(s);return n};J.exports=p;var v=(0,u.default)(I("core-util-is"));v.inherits=I("inherits");var o=I("./_stream_readable"),a=I("./_stream_writable");v.inherits(p,o);for(var r=C(a.prototype),h=0;h<r.length;h++){var m=r[h];p.prototype[m]||(p.prototype[m]=a.prototype[m])}function p(c){if(!(this instanceof p))return new p(c);o.call(this,c),a.call(this,c),c&&c.readable===!1&&(this.readable=!1),c&&c.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,c&&c.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",w)}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function w(){if(this.allowHalfOpen||this._writableState.ended)return;l.nextTick(g,this)}function g(c){c.end()}Object.defineProperty(p.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(n){if(this._readableState===void 0||this._writableState===void 0)return;this._readableState.destroyed=n,this._writableState.destroyed=n}}),p.prototype._destroy=function(c,n){this.push(null),this.end(),l.nextTick(n,c)}},{"./_stream_readable":216,"./_stream_writable":218,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/keys":60,"core-util-is":189,inherits:196,"process-nextick-args":207}],215:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/create"),u=_(M);function _(C){return C&&C.__esModule?C:{default:C}}J.exports=l;var D=I("./_stream_transform"),f=(0,u.default)(I("core-util-is"));f.inherits=I("inherits"),f.inherits(l,D);function l(C){if(!(this instanceof l))return new l(C);D.call(this,C)}l.prototype._transform=function(C,v,o){o(null,C)}},{"./_stream_transform":217,"babel-runtime/core-js/object/create":55,"core-util-is":189,inherits:196}],216:[function(I,J,P){(function(M,u){"use strict";var _=I("babel-runtime/core-js/object/get-prototype-of"),D=C(_),f=I("babel-runtime/core-js/object/create"),l=C(f);function C(te){return te&&te.__esModule?te:{default:te}}var v=I("process-nextick-args");J.exports=E;var o=I("isarray"),a;E.ReadableState=b;var r=I("events").EventEmitter,h=function(ue,Oe){return ue.listeners(Oe).length},m=I("./internal/streams/stream"),p=I("safe-buffer").Buffer,w=u.Uint8Array||function(){};function g(te){return p.from(te)}function c(te){return p.isBuffer(te)||te instanceof w}var n=(0,l.default)(I("core-util-is"));n.inherits=I("inherits");var s=I("util"),d=void 0;s&&s.debuglog?d=s.debuglog("stream"):d=function(){};var S=I("./internal/streams/BufferList"),y=I("./internal/streams/destroy"),i;n.inherits(E,m);var k=["error","close","destroy","pause","resume"];function O(te,ue,Oe){if(typeof te.prependListener=="function")return te.prependListener(ue,Oe);!te._events||!te._events[ue]?te.on(ue,Oe):o(te._events[ue])?te._events[ue].unshift(Oe):te._events[ue]=[Oe,te._events[ue]]}function b(te,ue){a=a||I("./_stream_duplex"),te=te||{};var Oe=ue instanceof a;this.objectMode=!!te.objectMode,Oe&&(this.objectMode=this.objectMode||!!te.readableObjectMode);var le=te.highWaterMark,Q=te.readableHighWaterMark,Y=this.objectMode?16:16*1024;le||le===0?this.highWaterMark=le:Oe&&(Q||Q===0)?this.highWaterMark=Q:this.highWaterMark=Y,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new S,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=te.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,te.encoding&&(i||(i=I("string_decoder/").StringDecoder),this.decoder=new i(te.encoding),this.encoding=te.encoding)}function E(te){if(a=a||I("./_stream_duplex"),!(this instanceof E))return new E(te);this._readableState=new b(te,this),this.readable=!0,te&&(typeof te.read=="function"&&(this._read=te.read),typeof te.destroy=="function"&&(this._destroy=te.destroy)),m.call(this)}Object.defineProperty(E.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ue){if(!this._readableState)return;this._readableState.destroyed=ue}}),E.prototype.destroy=y.destroy,E.prototype._undestroy=y.undestroy,E.prototype._destroy=function(te,ue){this.push(null),ue(te)},E.prototype.push=function(te,ue){var Oe=this._readableState,le;return Oe.objectMode?le=!0:typeof te=="string"&&(ue=ue||Oe.defaultEncoding,ue!==Oe.encoding&&(te=p.from(te,ue),ue=""),le=!0),x(this,te,ue,!1,le)},E.prototype.unshift=function(te){return x(this,te,null,!0,!1)};function x(te,ue,Oe,le,Q){var Y=te._readableState;if(ue===null)Y.reading=!1,W(te,Y);else{var Z;Q||(Z=N(Y,ue)),Z?te.emit("error",Z):Y.objectMode||ue&&ue.length>0?(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<te.highWaterMark||te.length===0)}E.prototype.isPaused=function(){return this._readableState.flowing===!1},E.prototype.setEncoding=function(te){return i||(i=I("string_decoder/").StringDecoder),this._readableState.decoder=new i(te),this._readableState.encoding=te,this};var L=8388608;function V(te){return te>=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-te<ue.highWaterMark)&&(le=!0,d("length less than watermark",le)),ue.ended||ue.reading?(le=!1,d("reading or ended",le)):le&&(d("do read"),ue.reading=!0,ue.sync=!0,ue.length===0&&(ue.needReadable=!0),this._read(ue.highWaterMark),ue.sync=!1,ue.reading||(te=K(Oe,ue)));var Q;return te>0?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.length<ue.highWaterMark&&!(d("maybeReadMore read 0"),te.read(0),Oe===ue.length);)Oe=ue.length;ue.readingMore=!1}E.prototype._read=function(te){this.emit("error",new Error("_read() is not implemented"))},E.prototype.pipe=function(te,ue){var Oe=this,le=this._readableState;switch(le.pipesCount){case 0:le.pipes=te;break;case 1:le.pipes=[le.pipes,te];break;default:le.pipes.push(te);break}le.pipesCount+=1,d("pipe count=%d opts=%j",le.pipesCount,ue);var Q=(!ue||ue.end!==!1)&&te!==M.stdout&&te!==M.stderr,Y=Q?be:je;le.endEmitted?v.nextTick(Y):Oe.once("end",Y),te.on("unpipe",Z);function Z(De,rt){d("onunpipe"),De===Oe&&(rt&&rt.hasUnpiped===!1&&(rt.hasUnpiped=!0,Ze()))}function be(){d("onend"),te.end()}var ge=q(Oe);te.on("drain",ge);var Re=!1;function Ze(){d("cleanup"),te.removeListener("close",ut),te.removeListener("finish",ot),te.removeListener("drain",ge),te.removeListener("error",nt),te.removeListener("unpipe",Z),Oe.removeListener("end",be),Oe.removeListener("end",je),Oe.removeListener("data",et),Re=!0,le.awaitDrain&&(!te._writableState||te._writableState.needDrain)&&ge()}var qe=!1;Oe.on("data",et);function et(De){d("ondata"),qe=!1;var rt=te.write(De);rt===!1&&!qe&&((le.pipesCount===1&&le.pipes===te||le.pipesCount>1&&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<Q;Y++)le[Y].emit("unpipe",this,Oe);return this}var Z=Se(ue.pipes,te);return Z===-1?this:(ue.pipes.splice(Z,1),ue.pipesCount-=1,ue.pipesCount===1&&(ue.pipes=ue.pipes[0]),te.emit("unpipe",this,Oe),this)},E.prototype.on=function(te,ue){var Oe=m.prototype.on.call(this,te,ue);if(te==="data")this._readableState.flowing!==!1&&this.resume();else if(te==="readable"){var le=this._readableState;!le.endEmitted&&!le.readableListening&&(le.readableListening=le.needReadable=!0,le.emittedReadable=!1,le.reading?le.length&&G(this):v.nextTick(re,this))}return Oe},E.prototype.addListener=E.prototype.on;function re(te){d("readable nexttick read 0"),te.read(0)}E.prototype.resume=function(){var te=this._readableState;return te.flowing||(d("resume"),te.flowing=!0,ee(this,te)),this};function ee(te,ue){ue.resumeScheduled||(ue.resumeScheduled=!0,v.nextTick(Ce,te,ue))}function Ce(te,ue){ue.reading||(d("resume read 0"),te.read(0)),ue.resumeScheduled=!1,ue.awaitDrain=0,te.emit("resume"),Ee(te),ue.flowing&&!ue.reading&&te.read(0)}E.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Ee(te){var ue=te._readableState;for(d("flow",ue.flowing);ue.flowing&&te.read()!==null;);}E.prototype.wrap=function(te){var ue=this,Oe=this._readableState,le=!1;te.on("end",function(){if(d("wrapped end"),Oe.decoder&&!Oe.ended){var Z=Oe.decoder.end();Z&&Z.length&&ue.push(Z)}ue.push(null)}),te.on("data",function(Z){if(d("wrapped data"),Oe.decoder&&(Z=Oe.decoder.write(Z)),Oe.objectMode&&Z==null)return;if(!Oe.objectMode&&(!Z||!Z.length))return;var be=ue.push(Z);be||(le=!0,te.pause())});for(var Q in te)this[Q]===void 0&&typeof te[Q]=="function"&&(this[Q]=function(Z){return function(){return te[Z].apply(te,arguments)}}(Q));for(var Y=0;Y<k.length;Y++)te.on(k[Y],this.emit.bind(this,k[Y]));return this._read=function(Z){d("wrapped _read",Z),le&&(le=!1,te.resume())},this},Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),E._fromList=pe;function pe(te,ue){if(ue.length===0)return null;var Oe;return ue.objectMode?Oe=ue.buffer.shift():!te||te>=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 te<ue.head.data.length?(le=ue.head.data.slice(0,te),ue.head.data=ue.head.data.slice(te)):te===ue.head.data.length?le=ue.shift():le=Oe?_e(te,ue):he(te,ue),le}function _e(te,ue){var Oe=ue.head,le=1,Q=Oe.data;for(te-=Q.length;Oe=Oe.next;){var Y=Oe.data,Z=te>Y.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<le;Oe++)if(te[Oe]===ue)return Oe;return-1}}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":214,"./internal/streams/BufferList":219,"./internal/streams/destroy":220,"./internal/streams/stream":221,_process:208,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/get-prototype-of":59,"core-util-is":189,events:192,inherits:196,isarray:198,"process-nextick-args":207,"safe-buffer":228,"string_decoder/":235,util:71}],217:[function(I,J,P){"use strict";var M=I("babel-runtime/core-js/object/create"),u=_(M);function _(a){return a&&a.__esModule?a:{default:a}}J.exports=C;var D=I("./_stream_duplex"),f=(0,u.default)(I("core-util-is"));f.inherits=I("inherits"),f.inherits(C,D);function l(a,r){var h=this._transformState;h.transforming=!1;var m=h.writecb;if(!m)return this.emit("error",new Error("write callback called multiple times"));h.writechunk=null,h.writecb=null,r!=null&&this.push(r),m(a);var p=this._readableState;p.reading=!1,(p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}function C(a){if(!(this instanceof C))return new C(a);D.call(this,a),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,a&&(typeof a.transform=="function"&&(this._transform=a.transform),typeof a.flush=="function"&&(this._flush=a.flush)),this.on("prefinish",v)}function v(){var a=this;typeof this._flush=="function"?this._flush(function(r,h){o(a,r,h)}):o(this,null,null)}C.prototype.push=function(a,r){return this._transformState.needTransform=!1,D.prototype.push.call(this,a,r)},C.prototype._transform=function(a,r,h){throw new Error("_transform() is not implemented")},C.prototype._write=function(a,r,h){var m=this._transformState;if(m.writecb=h,m.writechunk=a,m.writeencoding=r,!m.transforming){var p=this._readableState;(m.needTransform||p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}},C.prototype._read=function(a){var r=this._transformState;r.writechunk!==null&&r.writecb&&!r.transforming?(r.transforming=!0,this._transform(r.writechunk,r.writeencoding,r.afterTransform)):r.needTransform=!0},C.prototype._destroy=function(a,r){var h=this;D.prototype._destroy.call(this,a,function(m){r(m),h.emit("close")})};function o(a,r,h){if(r)return a.emit("error",r);if(h!=null&&a.push(h),a._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(a._transformState.transforming)throw new Error("Calling transform done when still transforming");return a.push(null)}},{"./_stream_duplex":214,"babel-runtime/core-js/object/create":55,"core-util-is":189,inherits:196}],218:[function(I,J,P){(function(M,u){"use strict";var _=I("babel-runtime/core-js/object/define-property"),D=m(_),f=I("babel-runtime/core-js/symbol/has-instance"),l=m(f),C=I("babel-runtime/core-js/symbol"),v=m(C),o=I("babel-runtime/core-js/object/create"),a=m(o),r=I("babel-runtime/core-js/set-immediate"),h=m(r);function m(he){return he&&he.__esModule?he:{default:he}}var p=I("process-nextick-args");J.exports=N;function w(he,ce,oe){this.chunk=he,this.encoding=ce,this.callback=oe,this.next=null}function g(he){var ce=this;this.next=null,this.entry=null,this.finish=function(){_e(ce,he)}}var c=!M.browser&&["v0.10","v0.9."].indexOf(M.version.slice(0,5))>-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.length<ce.highWaterMark;if(Q||(ce.needDrain=!0),ce.writing||ce.corked){var Y=ce.lastBufferedRequest;ce.lastBufferedRequest={chunk:Se,encoding:te,isBuf:oe,callback:ue,next:null},Y?Y.next=ce.lastBufferedRequest:ce.bufferedRequest=ce.lastBufferedRequest,ce.bufferedRequestCount+=1}else W(he,ce,!1,le,Se,te,ue);return Q}function W(he,ce,oe,Se,te,ue,Oe){ce.writelen=Se,ce.writecb=Oe,ce.writing=!0,ce.sync=!0,oe?he._writev(te,ce.onwrite):he._write(te,ue,ce.onwrite),ce.sync=!1}function G(he,ce,oe,Se,te){--ce.pendingcb,oe?(p.nextTick(te,Se),p.nextTick(pe,he,ce),he._writableState.errorEmitted=!0,he.emit("error",Se)):(te(Se),he._writableState.errorEmitted=!0,he.emit("error",Se),pe(he,ce))}function F(he){he.writing=!1,he.writecb=null,he.length-=he.writelen,he.writelen=0}function B(he,ce){var oe=he._writableState,Se=oe.sync,te=oe.writecb;if(F(oe),ce)G(he,oe,Se,ce,te);else{var ue=ee(oe);!ue&&!oe.corked&&!oe.bufferProcessing&&oe.bufferedRequest&&re(he,oe),Se?c(H,he,oe,ue,te):H(he,oe,ue,te)}}function H(he,ce,oe,Se){oe||q(he,ce),ce.pendingcb--,Se(),pe(he,ce)}function q(he,ce){ce.length===0&&ce.needDrain&&(ce.needDrain=!1,he.emit("drain"))}function re(he,ce){ce.bufferProcessing=!0;var oe=ce.bufferedRequest;if(he._writev&&oe&&oe.next){var Se=ce.bufferedRequestCount,te=new Array(Se),ue=ce.corkedRequestsFree;ue.entry=oe;for(var Oe=0,le=!0;oe;)te[Oe]=oe,oe.isBuf||(le=!1),oe=oe.next,Oe+=1;te.allBuffers=le,W(he,ce,!0,ce.length,te,"",ue.finish),ce.pendingcb++,ce.lastBufferedRequest=null,ue.next?(ce.corkedRequestsFree=ue.next,ue.next=null):ce.corkedRequestsFree=new g(ce),ce.bufferedRequestCount=0}else{for(;oe;){var Q=oe.chunk,Y=oe.encoding,Z=oe.callback,be=ce.objectMode?1:Q.length;if(W(he,ce,!1,be,Q,Y,Z),oe=oe.next,ce.bufferedRequestCount--,ce.writing)break}oe===null&&(ce.lastBufferedRequest=null)}ce.bufferedRequest=oe,ce.bufferProcessing=!1}N.prototype._write=function(he,ce,oe){oe(new Error("_write() is not implemented"))},N.prototype._writev=null,N.prototype.end=function(he,ce,oe){var Se=this._writableState;typeof he=="function"?(oe=he,he=null,ce=null):typeof ce=="function"&&(oe=ce,ce=null),he!=null&&this.write(he,ce),Se.corked&&(Se.corked=1,this.uncork()),!Se.ending&&!Se.finished&&Me(this,Se,oe)};function ee(he){return he.ending&&he.length===0&&he.bufferedRequest===null&&!he.finished&&!he.writing}function Ce(he,ce){he._final(function(oe){ce.pendingcb--,oe&&he.emit("error",oe),ce.prefinished=!0,he.emit("prefinish"),pe(he,ce)})}function Ee(he,ce){!ce.prefinished&&!ce.finalCalled&&(typeof he._final=="function"?(ce.pendingcb++,ce.finalCalled=!0,p.nextTick(Ce,he,ce)):(ce.prefinished=!0,he.emit("prefinish")))}function pe(he,ce){var oe=ee(ce);return oe&&(Ee(he,ce),ce.pendingcb===0&&(ce.finished=!0,he.emit("finish"))),oe}function Me(he,ce,oe){ce.ending=!0,pe(he,ce),oe&&(ce.finished?p.nextTick(oe):he.once("finish",oe)),ce.ended=!0,he.writable=!1}function _e(he,ce,oe){var Se=he.entry;for(he.entry=null;Se;){var te=Se.callback;ce.pendingcb--,te(oe),Se=Se.next}ce.corkedRequestsFree?ce.corkedRequestsFree.next=he:ce.corkedRequestsFree=he}Object.defineProperty(N.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(ce){if(!this._writableState)return;this._writableState.destroyed=ce}}),N.prototype.destroy=b.destroy,N.prototype._undestroy=b.undestroy,N.prototype._destroy=function(he,ce){this.end(),ce(he)}}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":214,"./internal/streams/destroy":220,"./internal/streams/stream":221,_process:208,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/define-property":56,"babel-runtime/core-js/set-immediate":62,"babel-runtime/core-js/symbol":64,"babel-runtime/core-js/symbol/has-instance":65,"core-util-is":189,inherits:196,"process-nextick-args":207,"safe-buffer":228,"util-deprecate":240}],219:[function(I,J,P){"use strict";function M(f,l){if(!(f instanceof l))throw new TypeError("Cannot call a class as a function")}var u=I("safe-buffer").Buffer,_=I("util");function D(f,l,C){f.copy(l,C)}J.exports=function(){function f(){M(this,f),this.head=null,this.tail=null,this.length=0}return f.prototype.push=function(C){var v={data:C,next:null};this.length>0?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<K.length;)if(_.call(K,G))return B.value=K[G],B.done=!1,B;return B.value=D,B.done=!0,B};return F.next=F}}return{next:V}}a.values=L;function V(){return{value:D,done:!0}}j.prototype={constructor:j,reset:function(K){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(N),!K)for(var W in this)W.charAt(0)==="t"&&_.call(this,W)&&!isNaN(+W.slice(1))&&(this[W]=D)},stop:function(){this.done=!0;var K=this.tryEntries[0],W=K.completion;if(W.type==="throw")throw W.arg;return this.rval},dispatchException:function(K){if(this.done)throw K;var W=this;function G(ee,Ce){return H.type="throw",H.arg=K,W.next=ee,Ce&&(W.method="next",W.arg=D),!!Ce}for(var F=this.tryEntries.length-1;F>=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<B.catchLoc)return G(B.catchLoc,!0);if(this.prev<B.finallyLoc)return G(B.finallyLoc)}else if(q){if(this.prev<B.catchLoc)return G(B.catchLoc,!0)}else if(re){if(this.prev<B.finallyLoc)return G(B.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(K,W){for(var G=this.tryEntries.length-1;G>=0;--G){var F=this.tryEntries[G];if(F.tryLoc<=this.prev&&_.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var B=F;break}}B&&(K==="break"||K==="continue")&&B.tryLoc<=W&&W<=B.finallyLoc&&(B=null);var H=B?B.completion:{};return H.type=K,H.arg=W,B?(this.method="next",this.next=B.finallyLoc,c):this.complete(H)},complete:function(K,W){if(K.type==="throw")throw K.arg;return K.type==="break"||K.type==="continue"?this.next=K.arg:K.type==="return"?(this.rval=this.arg=K.arg,this.method="return",this.next="end"):K.type==="normal"&&W&&(this.next=W),c},finish:function(K){for(var W=this.tryEntries.length-1;W>=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;ge<Re;ge++){var Ze=Y[g[ge]].length;if(Ze>Z)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<be;Z++)Y[g[Z]]=""}function d(Y){Ce(Y),Y.cdata!==""&&(ee(Y,"oncdata",Y.cdata),Y.cdata=""),Y.script!==""&&(ee(Y,"onscript",Y.script),Y.script="")}c.prototype={end:function(){Me(this)},write:Q,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){d(this)}};var S;try{S=I("stream").Stream}catch(Y){S=function(){}}var y=w.EVENTS.filter(function(Y){return Y!=="error"&&Y!=="end"});function i(Y,Z){return new k(Y,Z)}function k(Y,Z){if(!(this instanceof k))return new k(Y,Z);S.apply(this),this._parser=new c(Y,Z),this.writable=!0,this.readable=!0;var be=this;this._parser.onend=function(){be.emit("end")},this._parser.onerror=function(ge){be.emit("error",ge),be._parser.error=null},this._decoder=null,y.forEach(function(ge){(0,o.default)(be,"on"+ge,{get:function(){return be._parser["on"+ge]},set:function(Ze){if(!Ze)return be.removeAllListeners(ge),be._parser["on"+ge]=Ze,Ze;be.on(ge,Ze)},enumerable:!0,configurable:!1})})}k.prototype=(0,m.default)(S.prototype,{constructor:{value:k}}),k.prototype.write=function(Y){if(typeof M=="function"&&typeof M.isBuffer=="function"&&M.isBuffer(Y)){if(!this._decoder){var Z=I("string_decoder").StringDecoder;this._decoder=new Z("utf8")}Y=this._decoder.write(Y)}return this._parser.write(Y.toString()),this.emit("data",Y),!0},k.prototype.end=function(Y){return Y&&Y.length&&this.write(Y),this._parser.end(),!0},k.prototype.on=function(Y,Z){var be=this;return!be._parser["on"+Y]&&y.indexOf(Y)!==-1&&(be._parser["on"+Y]=function(){var ge=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ge.splice(0,0,Y),be.emit.apply(be,ge)}),S.prototype.on.call(be,Y,Z)};var O="[CDATA[",b="DOCTYPE",E="http://www.w3.org/XML/1998/namespace",x="http://www.w3.org/2000/xmlns/",T={xml:E,xmlns:x},N=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,j=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,L=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,V=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function K(Y){return Y===" "||Y===`
|
|
|
`||Y==="\r"||Y===" "}function W(Y){return Y==='"'||Y==="'"}function G(Y){return Y===">"||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<qe;Ze++){var et=Y.attribList[Ze],nt=et[0],ut=et[1],ot=ce(nt,!0),je=ot.prefix,De=ot.local,rt=je===""?"":be.ns[je]||"",lt={name:nt,value:ut,prefix:je,local:De,uri:rt};je&&je!=="xmlns"&&!rt&&(_e(Y,"Unbound namespace prefix: "+(0,f.default)(je)),lt.uri=je),Y.tag.attributes[nt]=lt,ee(Y,"onattribute",lt)}Y.attribList.length=0}Y.tag.isSelfClosing=!!Z,Y.sawRoot=!0,Y.tags.push(Y.tag),ee(Y,"onopentag",Y.tag),Z||(!Y.noscript&&Y.tagName.toLowerCase()==="script"?Y.state=H.SCRIPT:Y.state=H.TEXT,Y.tag=null,Y.tagName=""),Y.attribName=Y.attribValue="",Y.attribList.length=0}function te(Y){if(!Y.tagName){_e(Y,"Weird empty close tag."),Y.textNode+="</>",Y.state=H.TEXT;return}if(Y.script){if(Y.tagName!=="script"){Y.script+="</"+Y.tagName+">",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.tagName+">",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<Y.length&&(be=Y.charAt(Z)),be}function Q(Y){var Z=this;if(this.error)throw this.error;if(Z.closed)return pe(Z,"Cannot write after close. Assign an onready handler.");if(Y===null)return Me(Z);(typeof Y=="undefined"?"undefined":(0,C.default)(Y))==="object"&&(Y=Y.toString());for(var be=0,ge="";!(ge=le(Y,be++),Z.c=ge,!ge);){Z.trackPosition&&(Z.position++,ge===`
|
|
|
`?(Z.line++,Z.column=0):Z.column++);switch(Z.state){case H.BEGIN:if(Z.state=H.BEGIN_WHITESPACE,ge==="\uFEFF")continue;Oe(Z,ge);continue;case H.BEGIN_WHITESPACE:Oe(Z,ge);continue;case H.TEXT:if(Z.sawRoot&&!Z.closedRoot){for(var Re=be-1;ge&&ge!=="<"&&ge!=="&";)ge=le(Y,be++),ge&&Z.trackPosition&&(Z.position++,ge===`
|
|
|
`?(Z.line++,Z.column=0):Z.column++);Z.textNode+=Y.substring(Re,be-1)}ge==="<"&&!(Z.sawRoot&&Z.closedRoot&&!Z.strict)?(Z.state=H.OPEN_WAKA,Z.startTagPosition=Z.position):(!K(ge)&&(!Z.sawRoot||Z.closedRoot)&&_e(Z,"Text data outside of root node."),ge==="&"?Z.state=H.TEXT_ENTITY:Z.textNode+=ge);continue;case H.SCRIPT:ge==="<"?Z.state=H.SCRIPT_ENDING:Z.script+=ge;continue;case H.SCRIPT_ENDING:ge==="/"?Z.state=H.CLOSE_TAG:(Z.script+="<"+ge,Z.state=H.SCRIPT);continue;case H.OPEN_WAKA:if(ge==="!")Z.state=H.SGML_DECL,Z.sgmlDecl="";else if(!K(ge))if(F(N,ge))Z.state=H.OPEN_TAG,Z.tagName=ge;else if(ge==="/")Z.state=H.CLOSE_TAG,Z.tagName="";else if(ge==="?")Z.state=H.PROC_INST,Z.procInstName=Z.procInstBody="";else{if(_e(Z,"Unencoded <"),Z.startTagPosition+1<Z.position){var Ze=Z.position-Z.startTagPosition;ge=new Array(Ze).join(" ")+ge}Z.textNode+="<"+ge,Z.state=H.TEXT}continue;case H.SGML_DECL:(Z.sgmlDecl+ge).toUpperCase()===O?(ee(Z,"onopencdata"),Z.state=H.CDATA,Z.sgmlDecl="",Z.cdata=""):Z.sgmlDecl+ge==="--"?(Z.state=H.COMMENT,Z.comment="",Z.sgmlDecl=""):(Z.sgmlDecl+ge).toUpperCase()===b?(Z.state=H.DOCTYPE,(Z.doctype||Z.sawRoot)&&_e(Z,"Inappropriately located doctype declaration"),Z.doctype="",Z.sgmlDecl=""):ge===">"?(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+="</"+Z.tagName,Z.tagName="",Z.state=H.SCRIPT):(K(ge)||_e(Z,"Invalid tagname in closing tag"),Z.state=H.CLOSE_TAG_SAW_WHITE);else{if(K(ge))continue;B(N,ge)?Z.script?(Z.script+="</"+ge,Z.state=H.SCRIPT):_e(Z,"Invalid tagname in closing tag."):Z.tagName=ge}continue;case H.CLOSE_TAG_SAW_WHITE:if(K(ge))continue;ge===">"?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="";++nt<ut;){var je=Number(arguments[nt]);if(!isFinite(je)||je<0||je>1114111||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;c<w.length;c++)g[c]=w.charCodeAt(c)&255;h.push(g)}else h.push(w,h._charset);h._pos=p.length}break;case"arraybuffer":if(m.readyState!==a.DONE||!m.response)break;p=m.response,h.push(new _(new Uint8Array(p)));break;case"moz-chunked-arraybuffer":if(p=m.response,m.readyState!==a.LOADING||!p)break;h.push(new _(new Uint8Array(p)));break;case"ms-stream":if(p=m.response,m.readyState!==a.LOADING)break;var n=new u.MSStreamReader;n.onprogress=function(){n.result.byteLength>h._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<n.length?s?s+this.text(n,d):this.text(n,d):s||""},f.prototype.end=r,f.prototype.text=a,f.prototype.fillLast=function(n){if(this.lastNeed<=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length};function l(n){return n<=127?0:n>>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<d)return 0;var y=l(s[S]);return y>=0?(y>0&&(n.lastNeed=y-1),y):--S<d||y===-2?0:(y=l(s[S]),y>=0?(y>0&&(n.lastNeed=y-2),y):--S<d||y===-2?0:(y=l(s[S]),y>=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<D;f++)_[f]=u[f];return _.buffer}else throw new Error("Argument must be a Buffer")}},{buffer:73}],238:[function(I,J,P){"use strict";var M=I("punycode"),u=I("./util");P.parse=s,P.resolve=S,P.resolveObject=y,P.format=d,P.Url=_;function _(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var D=/^([a-z0-9.+-]+:)/i,f=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,C=["<",">",'"',"`"," ","\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&&b<i.indexOf("#")?"?":"#",x=i.split(E),T=/\\/g;x[0]=x[0].replace(T,"/"),i=x.join(E);var N=i;if(N=N.trim(),!O&&i.split("#").length===1){var j=l.exec(N);if(j)return this.path=N,this.href=N,this.pathname=j[1],j[2]?(this.search=j[2],k?this.query=n.parse(this.search.substr(1)):this.query=this.search.substr(1)):k&&(this.search="",this.query={}),this}var L=D.exec(N);if(L){L=L[0];var V=L.toLowerCase();this.protocol=V,N=N.substr(L.length)}if(O||L||N.match(/^\/\/[^@\/]+@[^@\/]+/)){var K=N.substr(0,2)==="//";K&&!(L&&g[L])&&(N=N.substr(2),this.slashes=!0)}if(!g[L]&&(K||L&&!c[L])){for(var W=-1,G=0;G<r.length;G++){var F=N.indexOf(r[G]);F!==-1&&(W===-1||F<W)&&(W=F)}var B,H;W===-1?H=N.lastIndexOf("@"):H=N.lastIndexOf("@",W),H!==-1&&(B=N.slice(0,H),N=N.slice(H+1),this.auth=decodeURIComponent(B)),W=-1;for(var G=0;G<a.length;G++){var F=N.indexOf(a[G]);F!==-1&&(W===-1||F<W)&&(W=F)}W===-1&&(W=N.length),this.host=N.slice(0,W),N=N.slice(W),this.parseHost(),this.hostname=this.hostname||"";var q=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!q)for(var re=this.hostname.split(/\./),G=0,ee=re.length;G<ee;G++){var Ce=re[G];if(!Ce)continue;if(!Ce.match(m)){for(var Ee="",pe=0,Me=Ce.length;pe<Me;pe++)Ce.charCodeAt(pe)>127?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;G<ee;G++){var te=o[G];if(N.indexOf(te)===-1)continue;var ue=encodeURIComponent(te);ue===te&&(ue=escape(te)),N=N.split(te).join(ue)}var Oe=N.indexOf("#");Oe!==-1&&(this.hash=N.substr(Oe),N=N.slice(0,Oe));var le=N.indexOf("?");if(le!==-1?(this.search=N.substr(le),this.query=N.substr(le+1),k&&(this.query=n.parse(this.query)),N=N.slice(0,le)):k&&(this.search="",this.query={}),N&&(this.pathname=N),c[V]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var oe=this.pathname||"",Q=this.search||"";this.path=oe+Q}return this.href=this.format(),this};function d(i){return u.isString(i)&&(i=s(i)),i instanceof _?i.format():_.prototype.format.call(i)}_.prototype.format=function(){var i=this.auth||"";i&&(i=encodeURIComponent(i),i=i.replace(/%3A/i,":"),i+="@");var k=this.protocol||"",O=this.pathname||"",b=this.hash||"",E=!1,x="";this.host?E=i+this.host:this.hostname&&(E=i+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(E+=":"+this.port)),this.query&&u.isObject(this.query)&&Object.keys(this.query).length&&(x=n.stringify(this.query));var T=this.search||x&&"?"+x||"";return k&&k.substr(-1)!==":"&&(k+=":"),this.slashes||(!k||c[k])&&E!==!1?(E="//"+(E||""),O&&O.charAt(0)!=="/"&&(O="/"+O)):E||(E=""),b&&b.charAt(0)!=="#"&&(b="#"+b),T&&T.charAt(0)!=="?"&&(T="?"+T),O=O.replace(/[?#]/g,function(N){return encodeURIComponent(N)}),T=T.replace("#","%23"),k+E+O+T+b};function S(i,k){return s(i,!1,!0).resolve(k)}_.prototype.resolve=function(i){return this.resolveObject(s(i,!1,!0)).format()};function y(i,k){return i?s(i,!1,!0).resolveObject(k):k}_.prototype.resolveObject=function(i){if(u.isString(i)){var k=new _;k.parse(i,!1,!0),i=k}for(var O=new _,b=Object.keys(this),E=0;E<b.length;E++){var x=b[E];O[x]=this[x]}if(O.hash=i.hash,i.href==="")return O.href=O.format(),O;if(i.slashes&&!i.protocol){for(var T=Object.keys(i),N=0;N<T.length;N++){var j=T[N];j!=="protocol"&&(O[j]=i[j])}return c[O.protocol]&&O.hostname&&!O.pathname&&(O.path=O.pathname="/"),O.href=O.format(),O}if(i.protocol&&i.protocol!==O.protocol){if(!c[i.protocol]){for(var L=Object.keys(i),V=0;V<L.length;V++){var K=L[V];O[K]=i[K]}return O.href=O.format(),O}if(O.protocol=i.protocol,!i.host&&!g[i.protocol]){for(var ee=(i.pathname||"").split("/");ee.length&&!(i.host=ee.shift()););i.host||(i.host=""),i.hostname||(i.hostname=""),ee[0]!==""&&ee.unshift(""),ee.length<2&&ee.unshift(""),O.pathname=ee.join("/")}else O.pathname=i.pathname;if(O.search=i.search,O.query=i.query,O.host=i.host||"",O.auth=i.auth,O.hostname=i.hostname||i.host,O.port=i.port,O.pathname||O.search){var W=O.pathname||"",G=O.search||"";O.path=W+G}return O.slashes=O.slashes||i.slashes,O.href=O.format(),O}var F=O.pathname&&O.pathname.charAt(0)==="/",B=i.host||i.pathname&&i.pathname.charAt(0)==="/",H=B||F||O.host&&i.pathname,q=H,re=O.pathname&&O.pathname.split("/")||[],ee=i.pathname&&i.pathname.split("/")||[],Ce=O.protocol&&!c[O.protocol];if(Ce&&(O.hostname="",O.port=null,O.host&&(re[0]===""?re[0]=O.host:re.unshift(O.host)),O.host="",i.protocol&&(i.hostname=null,i.port=null,i.host&&(ee[0]===""?ee[0]=i.host:ee.unshift(i.host)),i.host=null),H=H&&(ee[0]===""||re[0]==="")),B)O.host=i.host||i.host===""?i.host:O.host,O.hostname=i.hostname||i.hostname===""?i.hostname:O.hostname,O.search=i.search,O.query=i.query,re=ee;else if(ee.length)re||(re=[]),re.pop(),re=re.concat(ee),O.search=i.search,O.query=i.query;else if(!u.isNullOrUndefined(i.search)){if(Ce){O.hostname=O.host=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 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<arguments.length;F++)G.push(l(arguments[F]));return G.join(" ")}for(var F=1,B=arguments,H=B.length,q=String(W).replace(_,function(ee){if(ee==="%%")return"%";if(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<H;re=B[++F])n(re)||!O(re)?q+=" "+re:q+=" "+l(re);return q},P.deprecate=function(W,G){if(i(u.process))return function(){return P.deprecate(W,G).apply(this,arguments)};if(M.noDeprecation===!0)return W;var F=!1;function B(){if(!F){if(M.throwDeprecation)throw new Error(G);M.traceDeprecation?console.trace(G):console.error(G),F=!0}return W.apply(this,arguments)}return B};var D={},f;P.debuglog=function(W){if(i(f)&&(f=M.env.NODE_DEBUG||""),W=W.toUpperCase(),!D[W])if(new RegExp("\\b"+W+"\\b","i").test(f)){var G=M.pid;D[W]=function(){var F=P.format.apply(P,arguments);console.error("%s %d: %s",W,G,F)}}else D[W]=function(){};return D[W]};function l(W,G){var F={seen:[],stylize:v};return arguments.length>=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<ee;++re)K(G,String(re))?q.push(p(W,G,F,B,String(re),!0)):q.push("");return H.forEach(function(Ce){Ce.match(/^\d+$/)||q.push(p(W,G,F,B,Ce,!0))}),q}function p(W,G,F,B,H,q){var re,ee,Ce;if(Ce=Object.getOwnPropertyDescriptor(G,H)||{value:G[H]},Ce.get?Ce.set?ee=W.stylize("[Getter/Setter]","special"):ee=W.stylize("[Getter]","special"):Ce.set&&(ee=W.stylize("[Setter]","special")),K(B,H)||(re="["+H+"]"),ee||(W.seen.indexOf(Ce.value)<0?(n(F)?ee=a(W,Ce.value,null):ee=a(W,Ce.value,F-1),ee.indexOf(`
|
|
|
`)>-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"<![CDATA["+v(m)+"]]>"},v=function(m){return m.replace("]]>","]]]]><![CDATA[>")},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;O<b;O++)E=y[O],i=E(i,k);return i},P.Parser=function(S){s(y,S);function y(i){this.parseStringPromise=n(this.parseStringPromise,this),this.parseString=n(this.parseString,this),this.reset=n(this.reset,this),this.assignOrPush=n(this.assignOrPush,this),this.processAsync=n(this.processAsync,this);var k,O,b;if(!(this instanceof P.Parser))return new P.Parser(i);this.options={},O=r["0.2"];for(k in O){if(!d.call(O,k))continue;b=O[k],this.options[k]=b}for(k in i){if(!d.call(i,k))continue;b=i[k],this.options[k]=b}this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(w.normalize)),this.reset()}return y.prototype.processAsync=function(){var i,k;try{return this.remaining.length<=this.options.chunkSize?(i=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(i),this.saxParser.close()):(i=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(i),c(this.processAsync))}catch(O){if(k=O,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(k)}},y.prototype.assignOrPush=function(i,k,O){return k in i?(i[k]instanceof Array||(i[k]=[i[k]]),i[k].push(O)):this.options.explicitArray?i[k]=[O]:i[k]=O},y.prototype.reset=function(){var i,k,O,b;return this.removeAllListeners(),this.saxParser=g.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(E){return function(x){if(E.saxParser.resume(),!E.saxParser.errThrown)return E.saxParser.errThrown=!0,E.emit("error",x)}}(this),this.saxParser.onend=function(E){return function(){if(!E.saxParser.ended)return E.saxParser.ended=!0,E.emit("end",E.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,b=[],i=this.options.attrkey,k=this.options.charkey,this.saxParser.onopentag=function(E){return function(x){var T,N,j,L,V;if(j={},j[k]="",!E.options.ignoreAttrs){V=x.attributes;for(T in V){if(!d.call(V,T))continue;!(i in j)&&!E.options.mergeAttrs&&(j[i]={}),N=E.options.attrValueProcessors?p(E.options.attrValueProcessors,x.attributes[T],T):x.attributes[T],L=E.options.attrNameProcessors?p(E.options.attrNameProcessors,T):T,E.options.mergeAttrs?E.assignOrPush(j,L,N):j[i][L]=N}}return j["#name"]=E.options.tagNameProcessors?p(E.options.tagNameProcessors,x.name):x.name,E.options.xmlns&&(j[E.options.xmlnskey]={uri:x.uri,local:x.local}),b.push(j)}}(this),this.saxParser.onclosetag=function(E){return function(){var x,T,N,j,L,V,K,W,G,F;if(V=b.pop(),L=V["#name"],(!E.options.explicitChildren||!E.options.preserveChildrenOrder)&&delete V["#name"],V.cdata===!0&&(x=V.cdata,delete V.cdata),G=b[b.length-1],V[k].match(/^\s*$/)&&!x?(T=V[k],delete V[k]):(E.options.trim&&(V[k]=V[k].trim()),E.options.normalize&&(V[k]=V[k].replace(/\s{2,}/g," ").trim()),V[k]=E.options.valueProcessors?p(E.options.valueProcessors,V[k],L):V[k],(0,l.default)(V).length===1&&k in V&&!E.EXPLICIT_CHARKEY&&(V=V[k])),m(V)&&(V=E.options.emptyTag!==""?E.options.emptyTag:T),E.options.validator!=null&&(F="/"+function(){var B,H,q;for(q=[],B=0,H=b.length;B<H;B++)j=b[B],q.push(j["#name"]);return q}().concat(L).join("/"),function(){var B;try{return V=E.options.validator(F,G&&G[L],V)}catch(H){return B=H,E.emit("error",B)}}()),E.options.explicitChildren&&!E.options.mergeAttrs&&(typeof V=="undefined"?"undefined":(0,v.default)(V))==="object"){if(!E.options.preserveChildrenOrder)j={},E.options.attrkey in V&&(j[E.options.attrkey]=V[E.options.attrkey],delete V[E.options.attrkey]),!E.options.charsAsChildren&&E.options.charkey in V&&(j[E.options.charkey]=V[E.options.charkey],delete V[E.options.charkey]),(0,D.default)(V).length>0&&(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<d;n++)if(S=y[n],S!=null)for(s in S){if(!g.call(S,s))continue;i[s]=S[s]}return i},h=function(n){return!!n&&Object.prototype.toString.call(n)==="[object Function]"},m=function(n){var s;return!!n&&((s=typeof n=="undefined"?"undefined":(0,D.default)(n))==="function"||s==="object")},a=function(n){return h(Array.isArray)?Array.isArray(n):Object.prototype.toString.call(n)==="[object Array]"},r=function(n){var s;if(a(n))return!n.length;for(s in n){if(!g.call(n,s))continue;return!1}return!0},p=function(n){var s,d;return m(n)&&(d=(0,u.default)(n))&&(s=d.constructor)&&typeof s=="function"&&s instanceof s&&Function.prototype.toString.call(s)===Function.prototype.toString.call(Object)},o=function(n){return h(n.valueOf)?n.valueOf():n},J.exports.assign=v,J.exports.isFunction=h,J.exports.isObject=m,J.exports.isArray=a,J.exports.isEmpty=r,J.exports.isPlainObject=p,J.exports.getValue=o}).call(void 0)},{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/get-prototype-of":59,"babel-runtime/helpers/typeof":67}],253:[function(I,J,P){"use strict";(function(){J.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(void 0)},{}],254:[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;D=I("./NodeType"),l=I("./XMLNode"),J.exports=f=function(){function C(v,o,a){if(this.parent=v,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),o==null)throw new Error("Missing attribute name. "+this.debugInfo(o));this.name=this.stringify.name(o),this.value=this.stringify.attValue(a),this.type=D.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(C.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(C.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(C.prototype,"textContent",{get:function(){return this.value},set:function(o){return this.value=o||""}}),Object.defineProperty(C.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(C.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(C.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(C.prototype,"specified",{get:function(){return!0}}),C.prototype.clone=function(){return(0,u.default)(this)},C.prototype.toString=function(v){return this.options.writer.attribute(this,this.options.writer.filterOptions(v))},C.prototype.debugInfo=function(v){return v=v||this.name,v==null?"parent: <"+this.parent.name+">":"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<s;n++)if(c=d[n],c.type===M.Element){this.name=c.name;break}}this.documentObject=p,o(w)&&(S=w,w=S.pubID,g=S.sysID),g==null&&(y=[w,g],g=y[0],w=y[1]),w!=null&&(this.pubID=this.stringify.dtdPubID(w)),g!=null&&(this.sysID=this.stringify.dtdSysID(g))}return Object.defineProperty(m.prototype,"entities",{get:function(){var w,g,c,n,s;for(n={},s=this.children,g=0,c=s.length;g<c;g++)w=s[g],w.type===M.EntityDeclaration&&!w.pe&&(n[w.name]=w);return new C(n)}}),Object.defineProperty(m.prototype,"notations",{get:function(){var w,g,c,n,s;for(n={},s=this.children,g=0,c=s.length;g<c;g++)w=s[g],w.type===M.NotationDeclaration&&(n[w.name]=w);return new C(n)}}),Object.defineProperty(m.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(m.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(m.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),m.prototype.element=function(p,w){var g;return g=new _(this,p,w),this.children.push(g),this},m.prototype.attList=function(p,w,g,c,n){var s;return s=new u(this,p,w,g,c,n),this.children.push(s),this},m.prototype.entity=function(p,w){var g;return g=new D(this,!1,p,w),this.children.push(g),this},m.prototype.pEntity=function(p,w){var g;return g=new D(this,!0,p,w),this.children.push(g),this},m.prototype.notation=function(p,w){var g;return g=new f(this,p,w),this.children.push(g),this},m.prototype.toString=function(p){return this.options.writer.docType(this,this.options.writer.filterOptions(p))},m.prototype.ele=function(p,w){return this.element(p,w)},m.prototype.att=function(p,w,g,c,n){return this.attList(p,w,g,c,n)},m.prototype.ent=function(p,w){return this.entity(p,w)},m.prototype.pent=function(p,w){return this.pEntity(p,w)},m.prototype.not=function(p,w){return this.notation(p,w)},m.prototype.up=function(){return this.root()||this.documentObject},m.prototype.isEqualNode=function(p){return m.__super__.isEqualNode.apply(this,arguments).isEqualNode(p)?p.name!==this.name||p.publicId!==this.publicId?!1:!(p.systemId!==this.systemId):!1},m}(v)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLNamedNodeMap":272,"./XMLNode":273}],268:[function(I,J,P){"use strict";(function(){var M,u,_,D,f,l,C,v,o=function(h,m){for(var p in m)a.call(m,p)&&(h[p]=m[p]);function w(){this.constructor=h}return w.prototype=m.prototype,h.prototype=new w,h.__super__=m.prototype,h},a={}.hasOwnProperty;v=I("./Utility").isPlainObject,_=I("./XMLDOMImplementation"),u=I("./XMLDOMConfiguration"),f=I("./XMLNode"),M=I("./NodeType"),C=I("./XMLStringifier"),l=I("./XMLStringWriter"),J.exports=D=function(r){o(h,r);function h(m){h.__super__.constructor.call(this,null),this.name="#document",this.type=M.Document,this.documentURI=null,this.domConfig=new u,m||(m={}),m.writer||(m.writer=new l),this.options=m,this.stringify=new C(m)}return Object.defineProperty(h.prototype,"implementation",{value:new _}),Object.defineProperty(h.prototype,"doctype",{get:function(){var p,w,g,c;for(c=this.children,w=0,g=c.length;w<g;w++)if(p=c[w],p.type===M.DocType)return p;return null}}),Object.defineProperty(h.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(h.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(h.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(h.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===M.Declaration?this.children[0].encoding:null}}),Object.defineProperty(h.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===M.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(h.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===M.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(h.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(h.prototype,"origin",{get:function(){return null}}),Object.defineProperty(h.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(h.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(h.prototype,"contentType",{get:function(){return null}}),h.prototype.end=function(m){var p;return p={},m?v(m)&&(p=m,m=this.options.writer):m=this.options.writer,m.document(this,m.filterOptions(p))},h.prototype.toString=function(m){return this.options.writer.document(this,this.options.writer.filterOptions(m))},h.prototype.createElement=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createTextNode=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createComment=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createCDATASection=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createProcessingInstruction=function(m,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createAttribute=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createEntityReference=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.getElementsByTagName=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.importNode=function(m,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createElementNS=function(m,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createAttributeNS=function(m,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.getElementsByTagNameNS=function(m,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.getElementById=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.adoptNode=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.renameNode=function(m,p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.getElementsByClassName=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createEvent=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createNodeIterator=function(m,p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createTreeWalker=function(m,p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},h}(f)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLDOMConfiguration":258,"./XMLDOMImplementation":260,"./XMLNode":273,"./XMLStringWriter":278,"./XMLStringifier":279}],269:[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,S,y,i,k,O={}.hasOwnProperty;k=I("./Utility"),y=k.isObject,S=k.isFunction,i=k.isPlainObject,d=k.getValue,M=I("./NodeType"),h=I("./XMLDocument"),p=I("./XMLElement"),D=I("./XMLCData"),f=I("./XMLComment"),g=I("./XMLRaw"),s=I("./XMLText"),w=I("./XMLProcessingInstruction"),a=I("./XMLDeclaration"),r=I("./XMLDocType"),l=I("./XMLDTDAttList"),v=I("./XMLDTDEntity"),C=I("./XMLDTDElement"),o=I("./XMLDTDNotation"),_=I("./XMLAttribute"),n=I("./XMLStringifier"),c=I("./XMLStringWriter"),u=I("./WriterState"),J.exports=m=function(){function b(E,x,T){var N;this.name="?xml",this.type=M.Document,E||(E={}),N={},E.writer?i(E.writer)&&(N=E.writer,E.writer=new c):E.writer=new c,this.options=E,this.writer=E.writer,this.writerOptions=this.writer.filterOptions(N),this.stringify=new n(E),this.onDataCallback=x||function(){},this.onEndCallback=T||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return b.prototype.createChildNode=function(E){var x,T,N,j,L,V,K,W;switch(E.type){case M.CData:this.cdata(E.value);break;case M.Comment:this.comment(E.value);break;case M.Element:N={},K=E.attribs;for(T in K){if(!O.call(K,T))continue;x=K[T],N[T]=x.value}this.node(E.name,N);break;case M.Dummy:this.dummy();break;case M.Raw:this.raw(E.value);break;case M.Text:this.text(E.value);break;case M.ProcessingInstruction:this.instruction(E.target,E.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+E.constructor.name)}for(W=E.children,L=0,V=W.length;L<V;L++)j=W[L],this.createChildNode(j),j.type===M.Element&&this.up();return this},b.prototype.dummy=function(){return this},b.prototype.node=function(E,x,T){var N;if(E==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(E));return this.openCurrent(),E=d(E),x==null&&(x={}),x=d(x),y(x)||(N=[x,T],T=N[0],x=N[1]),this.currentNode=new p(this,E,x),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,T!=null&&this.text(T),this},b.prototype.element=function(E,x,T){var N,j,L,V,K,W;if(this.currentNode&&this.currentNode.type===M.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(E)||y(E)||S(E))for(V=this.options.noValidation,this.options.noValidation=!0,W=new h(this.options).element("TEMP_ROOT"),W.element(E),this.options.noValidation=V,K=W.children,j=0,L=K.length;j<L;j++)N=K[j],this.createChildNode(N),N.type===M.Element&&this.up();else this.node(E,x,T);return this},b.prototype.attribute=function(E,x){var T,N;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(E));if(E!=null&&(E=d(E)),y(E))for(T in E){if(!O.call(E,T))continue;N=E[T],this.attribute(T,N)}else S(x)&&(x=x.apply()),this.options.keepNullAttributes&&x==null?this.currentNode.attribs[E]=new _(this,E,""):x!=null&&(this.currentNode.attribs[E]=new _(this,E,x));return this},b.prototype.text=function(E){var x;return this.openCurrent(),x=new s(this,E),this.onData(this.writer.text(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.cdata=function(E){var x;return this.openCurrent(),x=new D(this,E),this.onData(this.writer.cdata(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.comment=function(E){var x;return this.openCurrent(),x=new f(this,E),this.onData(this.writer.comment(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.raw=function(E){var x;return this.openCurrent(),x=new g(this,E),this.onData(this.writer.raw(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.instruction=function(E,x){var T,N,j,L,V;if(this.openCurrent(),E!=null&&(E=d(E)),x!=null&&(x=d(x)),Array.isArray(E))for(T=0,L=E.length;T<L;T++)N=E[T],this.instruction(N);else if(y(E))for(N in E){if(!O.call(E,N))continue;j=E[N],this.instruction(N,j)}else S(x)&&(x=x.apply()),V=new w(this,E,x),this.onData(this.writer.processingInstruction(V,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},b.prototype.declaration=function(E,x,T){var N;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return N=new a(this,E,x,T),this.onData(this.writer.declaration(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.doctype=function(E,x,T){if(this.openCurrent(),E==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new r(this,x,T),this.currentNode.rootNodeName=E,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},b.prototype.dtdElement=function(E,x){var T;return this.openCurrent(),T=new C(this,E,x),this.onData(this.writer.dtdElement(T,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.attList=function(E,x,T,N,j){var L;return this.openCurrent(),L=new l(this,E,x,T,N,j),this.onData(this.writer.dtdAttList(L,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.entity=function(E,x){var T;return this.openCurrent(),T=new v(this,!1,E,x),this.onData(this.writer.dtdEntity(T,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.pEntity=function(E,x){var T;return this.openCurrent(),T=new v(this,!0,E,x),this.onData(this.writer.dtdEntity(T,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.notation=function(E,x){var T;return this.openCurrent(),T=new o(this,E,x),this.onData(this.writer.dtdNotation(T,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},b.prototype.end=function(){for(;this.currentLevel>=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)+"<!DOCTYPE "+E.rootNodeName,E.pubID&&E.sysID?T+=' PUBLIC "'+E.pubID+'" "'+E.sysID+'"':E.sysID&&(T+=' SYSTEM "'+E.sysID+'"'),E.children?(T+=" [",this.writerOptions.state=u.InsideTag):(this.writerOptions.state=u.CloseTag,T+=">"),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)+"</"+E.name+">"+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<y;S++)if(d=i[S],d.type===D.DocType){d.name=this.name;break}}}return Object.defineProperty(g.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(g.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(g.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(g.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(g.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(g.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(g.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(g.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new C(this.attribs)),this.attributeMap}}),g.prototype.clone=function(){var c,n,s,d;s=(0,u.default)(this),s.isRoot&&(s.documentObject=null),s.attribs={},d=this.attribs;for(n in d){if(!p.call(d,n))continue;c=d[n],s.attribs[n]=c.clone()}return s.children=[],this.children.forEach(function(S){var y;return y=S.clone(),y.parent=s,s.children.push(y)}),s},g.prototype.attribute=function(c,n){var s,d;if(c!=null&&(c=o(c)),r(c))for(s in c){if(!p.call(c,s))continue;d=c[s],this.attribute(s,d)}else a(n)&&(n=n.apply()),this.options.keepNullAttributes&&n==null?this.attribs[c]=new f(this,c,""):n!=null&&(this.attribs[c]=new f(this,c,n));return this},g.prototype.removeAttribute=function(c){var n,s,d;if(c==null)throw new Error("Missing attribute name. "+this.debugInfo());if(c=o(c),Array.isArray(c))for(s=0,d=c.length;s<d;s++)n=c[s],delete this.attribs[n];else delete this.attribs[c];return this},g.prototype.toString=function(c){return this.options.writer.element(this,this.options.writer.filterOptions(c))},g.prototype.att=function(c,n){return this.attribute(c,n)},g.prototype.a=function(c,n){return this.attribute(c,n)},g.prototype.getAttribute=function(c){return this.attribs.hasOwnProperty(c)?this.attribs[c].value:null},g.prototype.setAttribute=function(c,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNode=function(c){return this.attribs.hasOwnProperty(c)?this.attribs[c]:null},g.prototype.setAttributeNode=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNode=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNS=function(c,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNS=function(c,n,s){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNS=function(c,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNodeNS=function(c,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNodeNS=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(c,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.hasAttribute=function(c){return this.attribs.hasOwnProperty(c)},g.prototype.hasAttributeNS=function(c,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttribute=function(c,n){return this.attribs.hasOwnProperty(c)?this.attribs[c].isId:n},g.prototype.setIdAttributeNS=function(c,n,s){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttributeNode=function(c,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(c,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByClassName=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isEqualNode=function(c){var n,s,d;if(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(c))return!1;if(c.namespaceURI!==this.namespaceURI)return!1;if(c.prefix!==this.prefix)return!1;if(c.localName!==this.localName)return!1;if(c.attribs.length!==this.attribs.length)return!1;for(n=s=0,d=this.attribs.length-1;0<=d?s<=d: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<O;k++)i=b[k],i.textContent&&(E+=i.textContent);return E}else return null},set:function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),S.prototype.setParent=function(y){var i,k,O,b,E;for(this.parent=y,y&&(this.options=y.options,this.stringify=y.stringify),b=this.children,E=[],k=0,O=b.length;k<O;k++)i=b[k],E.push(i.setParent(this));return E},S.prototype.element=function(y,i,k){var O,b,E,x,T,N,j,L,V,K,W;if(N=null,i===null&&k==null&&(V=[{},null],i=V[0],k=V[1]),i==null&&(i={}),i=w(i),n(i)||(K=[i,k],k=K[0],i=K[1]),y!=null&&(y=w(y)),Array.isArray(y))for(E=0,j=y.length;E<j;E++)b=y[E],N=this.element(b);else if(c(y))N=this.element(y.apply());else if(n(y))for(T in y){if(!d.call(y,T))continue;if(W=y[T],c(W)&&(W=W.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&T.indexOf(this.stringify.convertAttKey)===0)N=this.attribute(T.substr(this.stringify.convertAttKey.length),W);else if(!this.options.separateArrayItems&&Array.isArray(W)&&g(W))N=this.dummy();else if(n(W)&&g(W))N=this.element(T);else if(!this.options.keepNullNodes&&W==null)N=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(W))for(x=0,L=W.length;x<L;x++)b=W[x],O={},O[T]=b,N=this.element(O);else n(W)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&T.indexOf(this.stringify.convertTextKey)===0?N=this.element(W):(N=this.element(T),N.element(W)):N=this.element(T,W)}else!this.options.keepNullNodes&&k===null?N=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&y.indexOf(this.stringify.convertTextKey)===0?N=this.text(k):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&y.indexOf(this.stringify.convertCDataKey)===0?N=this.cdata(k):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&y.indexOf(this.stringify.convertCommentKey)===0?N=this.comment(k):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&y.indexOf(this.stringify.convertRawKey)===0?N=this.raw(k):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&y.indexOf(this.stringify.convertPIKey)===0?N=this.instruction(y.substr(this.stringify.convertPIKey.length),k):N=this.node(y,i,k);if(N==null)throw new Error("Could not create any elements with: "+y+". "+this.debugInfo());return N},S.prototype.insertBefore=function(y,i,k){var O,b,E,x,T;if(y!=null?y.type:void 0)return E=y,x=i,E.setParent(this),x?(b=children.indexOf(x),T=children.splice(b),children.push(E),Array.prototype.push.apply(children,T)):children.push(E),E;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(y));return b=this.parent.children.indexOf(this),T=this.parent.children.splice(b),O=this.parent.element(y,i,k),Array.prototype.push.apply(this.parent.children,T),O},S.prototype.insertAfter=function(y,i,k){var O,b,E;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(y));return b=this.parent.children.indexOf(this),E=this.parent.children.splice(b+1),O=this.parent.element(y,i,k),Array.prototype.push.apply(this.parent.children,E),O},S.prototype.remove=function(){var y,i;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return y=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[y,y-y+1].concat(i=[])),this.parent},S.prototype.node=function(y,i,k){var O,b;return y!=null&&(y=w(y)),i||(i={}),i=w(i),n(i)||(b=[i,k],k=b[0],i=b[1]),O=new v(this,y,i),k!=null&&O.text(k),this.children.push(O),O},S.prototype.text=function(y){var i;return n(y)&&this.element(y),i=new p(this,y),this.children.push(i),this},S.prototype.cdata=function(y){var i;return i=new _(this,y),this.children.push(i),this},S.prototype.comment=function(y){var i;return i=new D(this,y),this.children.push(i),this},S.prototype.commentBefore=function(y){var i,k,O;return k=this.parent.children.indexOf(this),O=this.parent.children.splice(k),i=this.parent.comment(y),Array.prototype.push.apply(this.parent.children,O),this},S.prototype.commentAfter=function(y){var i,k,O;return k=this.parent.children.indexOf(this),O=this.parent.children.splice(k+1),i=this.parent.comment(y),Array.prototype.push.apply(this.parent.children,O),this},S.prototype.raw=function(y){var i;return i=new m(this,y),this.children.push(i),this},S.prototype.dummy=function(){var y;return y=new C(this),y},S.prototype.instruction=function(y,i){var k,O,b,E,x;if(y!=null&&(y=w(y)),i!=null&&(i=w(i)),Array.isArray(y))for(E=0,x=y.length;E<x;E++)k=y[E],this.instruction(k);else if(n(y))for(k in y){if(!d.call(y,k))continue;O=y[k],this.instruction(k,O)}else c(i)&&(i=i.apply()),b=new h(this,y,i),this.children.push(b);return this},S.prototype.instructionBefore=function(y,i){var k,O,b;return O=this.parent.children.indexOf(this),b=this.parent.children.splice(O),k=this.parent.instruction(y,i),Array.prototype.push.apply(this.parent.children,b),this},S.prototype.instructionAfter=function(y,i){var k,O,b;return O=this.parent.children.indexOf(this),b=this.parent.children.splice(O+1),k=this.parent.instruction(y,i),Array.prototype.push.apply(this.parent.children,b),this},S.prototype.declaration=function(y,i,k){var O,b;return O=this.document(),b=new f(O,y,i,k),O.children.length===0?O.children.unshift(b):O.children[0].type===u.Declaration?O.children[0]=b:O.children.unshift(b),O.root()||O},S.prototype.dtd=function(y,i){var k,O,b,E,x,T,N,j,L,V;for(O=this.document(),b=new l(O,y,i),L=O.children,E=x=0,N=L.length;x<N;E=++x)if(k=L[E],k.type===u.DocType)return O.children[E]=b,b;for(V=O.children,E=T=0,j=V.length;T<j;E=++T)if(k=V[E],k.isRoot)return O.children.splice(E,0,b),b;return O.children.push(b),b},S.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},S.prototype.root=function(){var y;for(y=this;y;){if(y.type===u.Document)return y.rootObject;if(y.isRoot)return y;y=y.parent}},S.prototype.document=function(){var y;for(y=this;y;){if(y.type===u.Document)return y;y=y.parent}},S.prototype.end=function(y){return this.document().end(y)},S.prototype.prev=function(){var y;if(y=this.parent.children.indexOf(this),y<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[y-1]},S.prototype.next=function(){var y;if(y=this.parent.children.indexOf(this),y===-1||y===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[y+1]},S.prototype.importDocument=function(y){var i;return i=y.root().clone(),i.parent=this,i.isRoot=!1,this.children.push(i),this},S.prototype.debugInfo=function(y){var i,k;return y=y||this.name,y==null&&!((i=this.parent)!=null?i.name:void 0)?"":y==null?"parent: <"+this.parent.name+">":((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;O<b;O++){if(i=E[O],y===i)return!0;if(k=i.isDescendant(y),k)return!0}return!1},S.prototype.isAncestor=function(y){return y.isDescendant(this)},S.prototype.isPreceding=function(y){var i,k;return i=this.treePosition(y),k=this.treePosition(this),i===-1||k===-1?!1:i<k},S.prototype.isFollowing=function(y){var i,k;return i=this.treePosition(y),k=this.treePosition(this),i===-1||k===-1?!1:i>k},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;O<b;O++){if(k=E[O],x=i(k))return x;if(x=this.foreachTreeNode(k,i),x)return x}},S}()}).call(void 0)},{"./DocumentPosition":250,"./NodeType":251,"./Utility":252,"./XMLCData":255,"./XMLComment":257,"./XMLDeclaration":266,"./XMLDocType":267,"./XMLDummy":270,"./XMLElement":271,"./XMLNamedNodeMap":272,"./XMLNodeList":274,"./XMLProcessingInstruction":275,"./XMLRaw":276,"./XMLText":280}],274:[function(I,J,P){"use strict";(function(){var M;J.exports=M=function(){function u(_){this.nodes=_}return Object.defineProperty(u.prototype,"length",{get:function(){return this.nodes.length||0}}),u.prototype.clone=function(){return this.nodes=null},u.prototype.item=function(_){return this.nodes[_]||null},u}()}).call(void 0)},{}],275:[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,m){if(a.__super__.constructor.call(this,r),h==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=D.ProcessingInstruction,this.target=this.stringify.insTarget(h),this.name=this.target,m&&(this.value=this.stringify.insValue(m))}return a.prototype.clone=function(){return(0,u.default)(this)},a.prototype.toString=function(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))},a.prototype.isEqualNode=function(r){return a.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)?!(r.target!==this.target):!1},a}(f)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],276:[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("./XMLNode"),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 raw text. "+this.debugInfo());this.type=D.Raw,this.value=this.stringify.raw(h)}return a.prototype.clone=function(){return(0,u.default)(this)},a.prototype.toString=function(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))},a}(f)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],277:[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;M=I("./NodeType"),D=I("./XMLWriterBase"),u=I("./WriterState"),J.exports=_=function(C){f(v,C);function v(o,a){this.stream=o,v.__super__.constructor.call(this,a)}return v.prototype.endline=function(o,a,r){return o.isLastRootNode&&a.state===u.CloseTag?"":v.__super__.endline.call(this,o,a,r)},v.prototype.document=function(o,a){var r,h,m,p,w,g,c,n,s;for(c=o.children,h=m=0,w=c.length;m<w;h=++m)r=c[h],r.isLastRootNode=h===o.children.length-1;for(a=this.filterOptions(a),n=o.children,s=[],p=0,g=n.length;p<g;p++)r=n[p],s.push(this.writeChildNode(r,a,0));return s},v.prototype.attribute=function(o,a,r){return this.stream.write(v.__super__.attribute.call(this,o,a,r))},v.prototype.cdata=function(o,a,r){return this.stream.write(v.__super__.cdata.call(this,o,a,r))},v.prototype.comment=function(o,a,r){return this.stream.write(v.__super__.comment.call(this,o,a,r))},v.prototype.declaration=function(o,a,r){return this.stream.write(v.__super__.declaration.call(this,o,a,r))},v.prototype.docType=function(o,a,r){var h,m,p,w;if(r||(r=0),this.openNode(o,a,r),a.state=u.OpenTag,this.stream.write(this.indent(o,a,r)),this.stream.write("<!DOCTYPE "+o.root().name),o.pubID&&o.sysID?this.stream.write(' PUBLIC "'+o.pubID+'" "'+o.sysID+'"'):o.sysID&&this.stream.write(' SYSTEM "'+o.sysID+'"'),o.children.length>0){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<p;m++)h=w[m],this.writeChildNode(h,a,r+1);a.state=u.CloseTag,this.stream.write("]")}return a.state=u.CloseTag,this.stream.write(a.spaceBeforeSlash+">"),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("</"+o.name+">")):(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("</"+o.name+">");else{for(this.stream.write(">"+this.endline(o,a,r)),a.state=u.InsideTag,S=o.children,g=0,c=S.length;g<c;g++)m=S[g],this.writeChildNode(m,a,r+1);a.state=u.CloseTag,this.stream.write(this.indent(o,a,r)+"</"+o.name+">")}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<r;a++)o=m[a],h+=this.writeChildNode(o,v,0);return v.pretty&&h.slice(-v.newline.length)===v.newline&&(h=h.slice(0,-v.newline.length)),h},l}(u)}).call(void 0)},{"./XMLWriterBase":281}],279:[function(I,J,P){"use strict";(function(){var M,u=function(f,l){return function(){return f.apply(l,arguments)}},_={}.hasOwnProperty;J.exports=M=function(){function D(f){this.assertLegalName=u(this.assertLegalName,this),this.assertLegalChar=u(this.assertLegalChar,this);var l,C,v;f||(f={}),this.options=f,this.options.version||(this.options.version="1.0"),C=f.stringify||{};for(l in C){if(!_.call(C,l))continue;v=C[l],this[l]=v}}return D.prototype.name=function(f){return this.options.noValidation?f:this.assertLegalName(""+f||"")},D.prototype.text=function(f){return this.options.noValidation?f:this.assertLegalChar(this.textEscape(""+f||""))},D.prototype.cdata=function(f){return this.options.noValidation?f:(f=""+f||"",f=f.replace("]]>","]]]]><![CDATA[>"),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(/>/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(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},D}()}).call(void 0)},{}],280:[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 element text. "+this.debugInfo());this.name="#text",this.type=D.Text,this.value=this.stringify.text(h)}return Object.defineProperty(a.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(a.prototype,"wholeText",{get:function(){var h,m,p;for(p="",m=this.previousSibling;m;)p=m.data+p,m=m.previousSibling;for(p+=this.data,h=this.nextSibling;h;)p=p+h.data,h=h.nextSibling;return p}}),a.prototype.clone=function(){return(0,u.default)(this)},a.prototype.toString=function(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))},a.prototype.splitText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.replaceWholeText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},a}(f)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],281:[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={}.hasOwnProperty;c=I("./Utility").assign,M=I("./NodeType"),o=I("./XMLDeclaration"),a=I("./XMLDocType"),_=I("./XMLCData"),D=I("./XMLComment"),h=I("./XMLElement"),p=I("./XMLRaw"),w=I("./XMLText"),m=I("./XMLProcessingInstruction"),r=I("./XMLDummy"),f=I("./XMLDTDAttList"),l=I("./XMLDTDElement"),C=I("./XMLDTDEntity"),v=I("./XMLDTDNotation"),u=I("./WriterState"),J.exports=g=function(){function s(d){var S,y,i;d||(d={}),this.options=d,y=d.writer||{};for(S in y){if(!n.call(y,S))continue;i=y[S],this["_"+S]=this[S],this[S]=i}}return s.prototype.filterOptions=function(d){var S,y,i,k,O,b,E,x;return d||(d={}),d=c({},this.options,d),S={writer:this},S.pretty=d.pretty||!1,S.allowEmpty=d.allowEmpty||!1,S.indent=(y=d.indent)!=null?y:" ",S.newline=(i=d.newline)!=null?i:`
|
|
|
`,S.offset=(k=d.offset)!=null?k:0,S.dontPrettyTextNodes=(O=(b=d.dontPrettyTextNodes)!=null?b:d.dontprettytextnodes)!=null?O:0,S.spaceBeforeSlash=(E=(x=d.spaceBeforeSlash)!=null?x:d.spacebeforeslash)!=null?E:"",S.spaceBeforeSlash===!0&&(S.spaceBeforeSlash=" "),S.suppressPrettyCount=0,S.user={},S.state=u.None,S},s.prototype.indent=function(d,S,y){var i;return!S.pretty||S.suppressPrettyCount?"":S.pretty&&(i=(y||0)+S.offset+1,i>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)+"<![CDATA[",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.comment=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.declaration=function(d,S,y){var i;return this.openNode(d,S,y),S.state=u.OpenTag,i=this.indent(d,S,y)+"<?xml",S.state=u.InsideTag,i+=' version="'+d.version+'"',d.encoding!=null&&(i+=' encoding="'+d.encoding+'"'),d.standalone!=null&&(i+=' standalone="'+d.standalone+'"'),S.state=u.CloseTag,i+=S.spaceBeforeSlash+"?>",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+="<!DOCTYPE "+d.root().name,d.pubID&&d.sysID?b+=' PUBLIC "'+d.pubID+'" "'+d.sysID+'"':d.sysID&&(b+=' SYSTEM "'+d.sysID+'"'),d.children.length>0){for(b+=" [",b+=this.endline(d,S,y),S.state=u.InsideTag,E=d.children,k=0,O=E.length;k<O;k++)i=E[k],b+=this.writeChildNode(i,S,y+1);S.state=u.CloseTag,b+="]"}return S.state=u.CloseTag,b+=S.spaceBeforeSlash+">",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+="</"+d.name+">"+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+="</"+d.name+">"+this.endline(d,S,y);else{if(S.dontPrettyTextNodes){for(W=d.children,E=0,T=W.length;E<T;E++)if(k=W[E],(k.type===M.Text||k.type===M.Raw)&&k.value!=null){S.suppressPrettyCount++,L=!0;break}}for(V+=">"+this.endline(d,S,y),S.state=u.InsideTag,G=d.children,x=0,N=G.length;x<N;x++)k=G[x],V+=this.writeChildNode(k,S,y+1);S.state=u.CloseTag,V+=this.indent(d,S,y)+"</"+d.name+">",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)+"<?",S.state=u.InsideTag,i+=d.target,d.value&&(i+=" "+d.value),S.state=u.CloseTag,i+=S.spaceBeforeSlash+"?>",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)+"<!ATTLIST",S.state=u.InsideTag,i+=" "+d.elementName+" "+d.attributeName+" "+d.attributeType,d.defaultValueType!=="#DEFAULT"&&(i+=" "+d.defaultValueType),d.defaultValue&&(i+=' "'+d.defaultValue+'"'),S.state=u.CloseTag,i+=S.spaceBeforeSlash+">"+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)+"<!ELEMENT",S.state=u.InsideTag,i+=" "+d.name+" "+d.value,S.state=u.CloseTag,i+=S.spaceBeforeSlash+">"+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)+"<!ENTITY",S.state=u.InsideTag,d.pe&&(i+=" %"),i+=" "+d.name,d.value?i+=' "'+d.value+'"':(d.pubID&&d.sysID?i+=' PUBLIC "'+d.pubID+'" "'+d.sysID+'"':d.sysID&&(i+=' SYSTEM "'+d.sysID+'"'),d.nData&&(i+=" NDATA "+d.nData)),S.state=u.CloseTag,i+=S.spaceBeforeSlash+">"+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)+"<!NOTATION",S.state=u.InsideTag,i+=" "+d.name,d.pubID&&d.sysID?i+=' PUBLIC "'+d.pubID+'" "'+d.sysID+'"':d.pubID?i+=' PUBLIC "'+d.pubID+'"':d.sysID&&(i+=' SYSTEM "'+d.sysID+'"'),S.state=u.CloseTag,i+=S.spaceBeforeSlash+">"+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;D<arguments.length;D++){var f=arguments[D];for(var l in f)M.call(f,l)&&(_[l]=f[l])}return _}},{}],284:[function(I,J,P){"use strict";var M=I("buffer").Buffer,u=I("./sha"),_=I("./md5"),D={sha1:u,md5:_},f=64,l=M.alloc(f);l.fill(0);function C(a,r,h){M.isBuffer(r)||(r=M.from(r)),M.isBuffer(h)||(h=M.from(h)),r.length>f?r=a(r):r.length<f&&(r=M.concat([r,l],f));for(var m=M.alloc(f),p=M.alloc(f),w=0;w<f;w++)m[w]=r[w]^54,p[w]=r[w]^92;var g=a(M.concat([m,h]));return a(M.concat([p,g]))}function v(a,r){a=a||"sha1";var h=D[a],m=[],p=0;return h||o("algorithm:",a,"is not yet supported"),{update:function(g){return M.isBuffer(g)||(g=M.from(g)),m.push(g),p+=g.length,this},digest:function(g){var c=M.concat(m),n=r?C(h,r,c):h(c);return m=null,g?n.toString(g):n}}}function o(){var a=[].slice.call(arguments).join(" ");throw new Error([a,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
|
|
|
`))}P.createHash=function(a){return v(a)},P.createHmac=function(a,r){return v(a,r)},P.createCredentials=function(){o("sorry,createCredentials is not implemented yet")},P.createCipher=function(){o("sorry,createCipher is not implemented yet")},P.createCipheriv=function(){o("sorry,createCipheriv is not implemented yet")},P.createDecipher=function(){o("sorry,createDecipher is not implemented yet")},P.createDecipheriv=function(){o("sorry,createDecipheriv is not implemented yet")},P.createSign=function(){o("sorry,createSign is not implemented yet")},P.createVerify=function(){o("sorry,createVerify is not implemented yet")},P.createDiffieHellman=function(){o("sorry,createDiffieHellman is not implemented yet")},P.pbkdf2=function(){o("sorry,pbkdf2 is not implemented yet")}},{"./md5":286,"./sha":287,buffer:73}],285:[function(I,J,P){"use strict";var M=I("buffer").Buffer,u=4,_=M.alloc(u);_.fill(0);var D=8;function f(v,o){if(v.length%u!==0){var a=v.length+(u-v.length%u);v=M.concat([v,_],a)}for(var r=[],h=o?v.readInt32BE:v.readInt32LE,m=0;m<v.length;m+=u)r.push(h.call(v,m));return r}function l(v,o,a){for(var r=M.alloc(o),h=a?r.writeInt32BE:r.writeInt32LE,m=0;m<v.length;m++)h.call(r,v[m],m*4,!0);return r}function C(v,o,a,r){M.isBuffer(v)||(v=M.from(v));var h=o(f(v,r),v.length*D);return l(h,a,r)}J.exports={hash:C}},{buffer:73}],286:[function(I,J,P){"use strict";var M=I("./helpers");function u(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function _(r,h){r[h>>5]|=128<<h%32,r[(h+64>>>9<<4)+14]=h;for(var m=1732584193,p=-271733879,w=-1732584194,g=271733878,c=0;c<r.length;c+=16){var n=m,s=p,d=w,S=g;m=f(m,p,w,g,r[c+0],7,-680876936),g=f(g,m,p,w,r[c+1],12,-389564586),w=f(w,g,m,p,r[c+2],17,606105819),p=f(p,w,g,m,r[c+3],22,-1044525330),m=f(m,p,w,g,r[c+4],7,-176418897),g=f(g,m,p,w,r[c+5],12,1200080426),w=f(w,g,m,p,r[c+6],17,-1473231341),p=f(p,w,g,m,r[c+7],22,-45705983),m=f(m,p,w,g,r[c+8],7,1770035416),g=f(g,m,p,w,r[c+9],12,-1958414417),w=f(w,g,m,p,r[c+10],17,-42063),p=f(p,w,g,m,r[c+11],22,-1990404162),m=f(m,p,w,g,r[c+12],7,1804603682),g=f(g,m,p,w,r[c+13],12,-40341101),w=f(w,g,m,p,r[c+14],17,-1502002290),p=f(p,w,g,m,r[c+15],22,1236535329),m=l(m,p,w,g,r[c+1],5,-165796510),g=l(g,m,p,w,r[c+6],9,-1069501632),w=l(w,g,m,p,r[c+11],14,643717713),p=l(p,w,g,m,r[c+0],20,-373897302),m=l(m,p,w,g,r[c+5],5,-701558691),g=l(g,m,p,w,r[c+10],9,38016083),w=l(w,g,m,p,r[c+15],14,-660478335),p=l(p,w,g,m,r[c+4],20,-405537848),m=l(m,p,w,g,r[c+9],5,568446438),g=l(g,m,p,w,r[c+14],9,-1019803690),w=l(w,g,m,p,r[c+3],14,-187363961),p=l(p,w,g,m,r[c+8],20,1163531501),m=l(m,p,w,g,r[c+13],5,-1444681467),g=l(g,m,p,w,r[c+2],9,-51403784),w=l(w,g,m,p,r[c+7],14,1735328473),p=l(p,w,g,m,r[c+12],20,-1926607734),m=C(m,p,w,g,r[c+5],4,-378558),g=C(g,m,p,w,r[c+8],11,-2022574463),w=C(w,g,m,p,r[c+11],16,1839030562),p=C(p,w,g,m,r[c+14],23,-35309556),m=C(m,p,w,g,r[c+1],4,-1530992060),g=C(g,m,p,w,r[c+4],11,1272893353),w=C(w,g,m,p,r[c+7],16,-155497632),p=C(p,w,g,m,r[c+10],23,-1094730640),m=C(m,p,w,g,r[c+13],4,681279174),g=C(g,m,p,w,r[c+0],11,-358537222),w=C(w,g,m,p,r[c+3],16,-722521979),p=C(p,w,g,m,r[c+6],23,76029189),m=C(m,p,w,g,r[c+9],4,-640364487),g=C(g,m,p,w,r[c+12],11,-421815835),w=C(w,g,m,p,r[c+15],16,530742520),p=C(p,w,g,m,r[c+2],23,-995338651),m=v(m,p,w,g,r[c+0],6,-198630844),g=v(g,m,p,w,r[c+7],10,1126891415),w=v(w,g,m,p,r[c+14],15,-1416354905),p=v(p,w,g,m,r[c+5],21,-57434055),m=v(m,p,w,g,r[c+12],6,1700485571),g=v(g,m,p,w,r[c+3],10,-1894986606),w=v(w,g,m,p,r[c+10],15,-1051523),p=v(p,w,g,m,r[c+1],21,-2054922799),m=v(m,p,w,g,r[c+8],6,1873313359),g=v(g,m,p,w,r[c+15],10,-30611744),w=v(w,g,m,p,r[c+6],15,-1560198380),p=v(p,w,g,m,r[c+13],21,1309151649),m=v(m,p,w,g,r[c+4],6,-145523070),g=v(g,m,p,w,r[c+11],10,-1120210379),w=v(w,g,m,p,r[c+2],15,718787259),p=v(p,w,g,m,r[c+9],21,-343485551),m=o(m,n),p=o(p,s),w=o(w,d),g=o(g,S)}return Array(m,p,w,g)}function D(r,h,m,p,w,g){return o(a(o(o(h,r),o(p,g)),w),m)}function f(r,h,m,p,w,g,c){return D(h&m|~h&p,r,h,w,g,c)}function l(r,h,m,p,w,g,c){return D(h&p|m&~p,r,h,w,g,c)}function C(r,h,m,p,w,g,c){return D(h^m^p,r,h,w,g,c)}function v(r,h,m,p,w,g,c){return D(m^(h|~p),r,h,w,g,c)}function o(r,h){var m=(r&65535)+(h&65535),p=(r>>16)+(h>>16)+(m>>16);return p<<16|m&65535}function a(r,h){return r<<h|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<C.length;w+=16){for(var g=a,c=r,n=h,s=m,d=p,S=0;S<80;S++){S<16?o[S]=C[w+S]:o[S]=l(o[S-3]^o[S-8]^o[S-14]^o[S-16],1);var y=f(f(l(a,5),_(S,r,h,m)),f(f(p,o[S]),D(S)));p=m,m=h,h=l(r,30),r=a,a=y}a=f(a,g),r=f(r,c),h=f(h,n),m=f(m,s),p=f(p,d)}return Array(a,r,h,m,p)}function _(C,v,o,a){return C<20?v&o|~v&a:C<40?v^o^a:C<60?v&o|v&a|o&a:v^o^a}function D(C){return C<20?1518500249:C<40?1859775393:C<60?-1894007588:-899497514}function f(C,v){var o=(C&65535)+(v&65535),a=(C>>16)+(v>>16)+(o>>16);return a<<16|o&65535}function l(C,v){return C<<v|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<G.length;F++){var B=G[F];i.hasOwnProperty(B)&&(W[B]=i[B])}W.rejectUnauthorized===!1&&!W.hasOwnProperty("secureOptions")&&(W.secureOptions=I("constants").SSL_OP_NO_TLSv1_2);var H=i.auth||T.auth;H&&(W.auth=H);var q=i.content||i.data,re=N==="GET"||N==="HEAD"||i.dataAsQueryString;if(!i.content&&(q&&!(typeof q=="string"||u.isBuffer(q))))if(re)q=i.nestedQuerystring?qs.stringify(q):querystring.stringify(q);else{var ee=W.headers["Content-Type"]||W.headers["content-type"];ee||(i.contentType==="json"?ee="application/json":ee="application/x-www-form-urlencoded",W.headers["Content-Type"]=ee),parseContentType(ee).type==="application/json"?q=(0,D.default)(q):q=i.nestedQuerystring?qs.stringify(q):querystring.stringify(q)}re&&q&&(W.path+=(T.query?"&":"?")+q,q=null);var Ce=0;if(q){var Ee=q.length;u.isBuffer(q)||(Ee=u.byteLength(q)),Ce=W.headers["Content-Length"]=Ee}i.dataType==="json"&&(W.headers.Accept="application/json"),typeof i.beforeRequest=="function"&&i.beforeRequest(W);var pe=null,Me=null,_e=null,he=!1,ce=!1,oe=0,Se=-1,te=!1,ue="",Oe="",le=null;i.timing&&(le={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0});function Q(){pe&&(clearTimeout(pe),pe=null)}function Y(){Me&&(clearTimeout(Me),Me=null)}function Z(De,rt,lt){if(Y(),!k){console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),b,M.pid,W.method,y),De&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
|
|
|
stack: %s`,Date(),b,M.pid,De.name,De.message,De.stack);return}var Je=k;k=null;var tt={};if(lt&&(Se=lt.statusCode,tt=lt.headers),Se===401&&tt["www-authenticate"]&&(!i.headers||!i.headers.Authorization)&&i.digestAuth){var Ue=tt["www-authenticate"];if(Ue.indexOf("Digest ")>=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}function p(g,c){var n=(this._rBlock>>>g^this._lBlock)&c;this._lBlock^=n,this._rBlock^=n<<g}u.DES=f._createHelper(h);var w=l.TripleDES=f.extend({_doReset:function(){var g=this._key,c=g.words;if(c.length!==2&&c.length!==4&&c.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >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<a;h+=2){var m=o[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<o;r++)a[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<a;h+=2){var m=C(o[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<o;r++)a[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<o;m++)l[C+m]^=h[m]}});return u.Decryptor=f,u}(),M.mode.CTRGladman})},"rAM+":function(I,J,P){"use strict";P.d(J,"a",function(){return u});var M=P("Qw5x");function u(_,D){var f;if(typeof Symbol=="undefined"||_[Symbol.iterator]==null){if(Array.isArray(_)||(f=Object(M.a)(_))||D&&_&&typeof _.length=="number"){f&&(_=f);var l=0,C=function(){};return{s:C,n:function(){return l>=_.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<arguments.length;b++){E=arguments[b];for(x in E)Object.prototype.hasOwnProperty.call(E,x)&&(O[x]=E[x])}return O}function S(O,b){const E=O.replace(/\|/g,(N,j,L)=>{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.length<b;)x.push("");for(;T<x.length;T++)x[T]=x[T].trim().replace(/\\\|/g,"|");return x}function y(O,b,E){const x=O.length;if(x===0)return"";let T=0;for(;T<x;){const N=O.charAt(x-T-1);if(N===b&&!E)T++;else if(N!==b&&E)T++;else break}return O.substr(0,x-T)}function i(O,b){if(O.indexOf(b[1])===-1)return-1;const E=O.length;let x=0,T=0;for(;T<E;T++)if(O[T]==="\\")T++;else if(O[T]===b[0])x++;else if(O[T]===b[1]&&(x--,x<0))return T;return-1}function k(O){O&&O.sanitize&&!O.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}I.exports={escape:l,unescape:v,edit:a,cleanUrl:m,resolveUrl:n,noopTest:s,merge:d,splitCells:S,rtrim:y,findClosingBracket:i,checkSanitizeDeprecation:k}},rWjI:function(I,J,P){"use strict";P.r(J),P.d(J,"Types",function(){return lr});var M=P("P2fV"),u=P("NJEC"),_=P("CiB2"),D=P("DYRE"),f=P("zeV3"),l=P("sRBo"),C=P("kaz8"),v=P("7Kak"),o=P("9yH6"),a=P("giR+"),r=P("fyUT"),h=P("OaEy"),m=P("2fM7"),p=P("oBTY"),w=P("rAM+"),g=P("T2oS"),c=P("W9HT"),n=P("g9YV"),s=P("wCAj"),d=P("+L6B"),S=P("2/Rp"),y=P("14J3"),i=P("BMrR"),k=P("jCWc"),O=P("kPKH"),b=P("miYZ"),E=P("tsqr"),x=P("9og8"),T=P("y8nQ"),N=P("Vl3Y"),j=P("tJVT"),L=P("k1fw"),V=P("fu2T"),K=P("gK9i"),W=P("2qtc"),G=P("kLXV"),F=P("5NDa"),B=P("5rEg"),H=P("WmNS"),q=P.n(H),re=P("q1tI"),ee=P.n(re),Ce=P("eRFJ"),Ee=P.n(Ce),pe=P("jrin"),Me,_e=m.a.Option,he;(function(Tt){Tt[Tt.language=0]="language",Tt[Tt.difficulty=1]="difficulty",Tt[Tt.category=2]="category",Tt[Tt.openOrNot=3]="openOrNot"})(he||(he={}));var ce=(Me={},Object(pe.a)(Me,he.language,[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"},{title:"JavaScript",key:"JavaScript"},{title:"Ruby",key:"Ruby"}]),Object(pe.a)(Me,he.difficulty,[{title:"\u7B80\u5355",key:1},{title:"\u9002\u4E2D",key:2},{title:"\u56F0\u96BE",key:3}]),Object(pe.a)(Me,he.category,[{title:"\u7A0B\u5E8F\u8BBE\u8BA1",key:1},{title:"\u7B97\u6CD5",key:2}]),Object(pe.a)(Me,he.openOrNot,[{title:"\u516C\u5F00",key:1},{title:"\u79C1\u6709",key:0}]),Me);function oe(Tt){return ce[Tt].map(function(Rt){return ee.a.createElement(_e,{key:Rt.title,value:Rt.key}," ",Rt.title," ")})}function Se(Tt,Rt){Tt.map(function(Et){var Ar=Et.id,Br=Et.name,Xt=Et.sub_disciplines,Nt={value:Ar,label:Br};Rt.push(Nt),Xt&&Xt.length>0&&(Nt.children=[],Se(Xt,Nt.children))})}function te(Tt,Rt){for(var Et=[],Ar=0;Ar<Tt.length;Ar++){var Br,Xt=Tt[Ar];if(((Br=Xt.sub_disciplines)===null||Br===void 0?void 0:Br.length)>0){Et[0]=Xt.id;for(var Nt=0;Nt<Xt.sub_disciplines.length;Nt++){var jr=Xt.sub_disciplines[Nt];if(jr.id===Rt)return Et[1]=jr.id,[Et,jr.tag_disciplines||jr.sub_disciplines||[]]}}}return[Et,[]]}var ue=P("Ty5D"),Oe=P("9kvl"),le=P("J66h"),Q=P("GIiI"),Y=P("2BaD"),Z=P("Ot1p"),be=P("ErOA");function ge(Tt){return Object(be.f)("practices.json",Tt)}function Re(){return Object(be.c)("problems/new.json")}function Ze(Tt){return Object(be.c)("practices/".concat(Tt,"/edit.json"))}function qe(Tt,Rt){return Object(be.g)("practices/".concat(Tt),Rt)}function et(Tt,Rt){return Object(be.f)("exercises/".concat(Tt,"/exercise_questions.json"),Rt)}function nt(Tt,Rt){return Object(be.g)("exercise_questions/".concat(Tt,".json"),Rt)}var ut=P("cDPC"),ot=P("bbsP"),je=P("/wGt"),De=P("0Owb"),rt=P("ZW9T"),lt=P("ZD9Y"),Je=P("M8RZ"),tt=P("bCnd"),Ue=P("1T2W"),ke=P.n(Ue),Ie={theme:Object(tt.a)("cmCodeMode","vs-dark"),fontSize:Object(tt.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(tt.a)("cmTabToSpace",!0)},ye;(function(Tt){Tt[Tt.set_font_size=0]="set_font_size",Tt[Tt.set_theme=1]="set_theme",Tt[Tt.on_tab_to_space=2]="on_tab_to_space",Tt[Tt.set_show_editor_setting=3]="set_show_editor_setting"})(ye||(ye={}));function Te(Tt,Rt){switch(Rt.type){case ye.set_show_editor_setting:return Object(L.a)(Object(L.a)({},Tt),{},{showEditorSetting:Rt.payload});case ye.set_theme:return Object(L.a)(Object(L.a)({},Tt),{},{theme:Rt.payload});case ye.set_font_size:return Object(L.a)(Object(L.a)({},Tt),{},{fontSize:Rt.payload});case ye.on_tab_to_space:return Object(L.a)(Object(L.a)({},Tt),{},{tabToSpace:Rt.payload});default:throw new Error}}var Ae=function(Tt){var Rt=Tt.value,Et=Tt.onChange,Ar=Tt.language,Br=Tt.onLanguage,Xt=Tt.languageItems,Nt=Tt.ActionBarRender,jr=Nt===void 0?function(de){return ee.a.createElement(Pe,{languageItems:Xt,onLanguage:Br,language:Ar,onShowCodeSetting:de})}:Nt,bn=Object(re.useReducer)(Te,Ie),zr=Object(j.a)(bn,2),mt=zr[0],Ut=zr[1],an=mt.theme,xn=mt.fontSize,On=mt.showEditorSetting,An=mt.tabToSpace;console.log(Rt,Ar,"value");var se={onFontSizeChange:function(ie){Ut({type:ye.set_font_size,payload:ie}),Object(tt.b)("cmFontSize",ie)},tabToSpace:An,cmFontSize:xn,className:"oj",cmCodeMode:an,onTabToSpace:function(ie){Ut({type:ye.on_tab_to_space,payload:ie}),Object(tt.b)("cmTabToSpace",ie)},onCodeModeChange:function(ie){Ut({type:ye.set_theme,payload:ie}),Object(tt.b)("cmCodeMode",ie)}};function z(){Ut({type:ye.set_show_editor_setting,payload:!1})}function X(){Ut({type:ye.set_show_editor_setting,payload:!0})}var ne={value:Rt,language:Ar,onChange:Et,theme:an,height:"calc(100% - 56px)",options:{fontSize:xn,insertSpaces:An}};return ee.a.createElement(re.Fragment,null,ee.a.createElement("div",{className:ke.a["code-panel-container"]},jr(X),ee.a.createElement(rt.b,Object(De.a)({key:Ar},ne))),ee.a.createElement(Je.a,null,ee.a.createElement(je.a,{className:"oj",title:null,placement:"right",closable:!1,visible:On,onClose:z},ee.a.createElement(lt.a,se))))};function Pe(Tt){var Rt=Tt.languageItems,Et=Tt.language,Ar=Tt.onShowCodeSetting,Br=Tt.onLanguage;return ee.a.createElement("div",{className:ke.a["action-oj-bar"]},Rt==null?void 0:Rt.map(function(Xt){return ee.a.createElement("div",{className:Et===(Xt==null?void 0:Xt.language)?ke.a.active:"",onClick:function(){return Br(Xt==null?void 0:Xt.language)},key:Xt==null?void 0:Xt.language},Xt==null?void 0:Xt.language)}),ee.a.createElement("a",{onClick:Ar},ee.a.createElement("i",{className:"iconfont icon-shezhi"})))}var $e=P("Znn+"),Ke=P("ZTPi"),ct=P("L9qf"),gt=P.n(ct),wt=function(Rt){var Et=Rt.visible,Ar=Rt.onOK,Br=Rt.onCancel,Xt=Object(re.useState)(!1),Nt=Object(j.a)(Xt,2),jr=Nt[0],bn=Nt[1],zr=Object(re.useState)(!1),mt=Object(j.a)(zr,2),Ut=mt[0],an=mt[1],xn=Object(re.useState)("1"),On=Object(j.a)(xn,2),An=On[0],se=On[1],z=Object(re.useState)(""),X=Object(j.a)(z,2),ne=X[0],de=X[1],ie=Object(re.useState)([]),ze=Object(j.a)(ie,2),ht=ze[0],St=ze[1],Pt=function(){var Zr=Object(x.a)(q.a.mark(function Qt(){var Kr;return q.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(ne){Yt.next=3;break}return E.b.warn("\u9898\u76EE".concat(on,"\u4E0D\u80FD\u4E3A\u7A7A")),Yt.abrupt("return");case 3:return an(!0),Yt.next=6,Object(be.a)("/api/tag_disciplines.json",{method:"post",body:{target:Et,name:ne}});case 6:if(Kr=Yt.sent,!((Kr==null?void 0:Kr.status)===0)){Yt.next=10;break}return Ar(),Yt.abrupt("return");case 10:an(!1);case 11:case"end":return Yt.stop()}},Qt)}));return function(){return Zr.apply(this,arguments)}}(),pt=function(){var Zr=Object(x.a)(q.a.mark(function Qt(){var Kr,or,Yt=arguments;return q.a.wrap(function(dr){for(;;)switch(dr.prev=dr.next){case 0:return Kr=Yt.length>0&&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;h<a.length;h+=1){if(!r)return null;var m=a[h];r=r[m]}return r}function f(v){var o=[],a={};return v.forEach(function(r){for(var h=r||{},m=h.key,p=h.dataIndex,w=m||_(p).join("-")||u;a[w];)w="".concat(w,"_next");a[w]=!0,o.push(w)}),o}function l(){var v={};function o(m,p){p&&Object.keys(p).forEach(function(w){var g=p[w];g&&Object(M.a)(g)==="object"?(m[w]=m[w]||{},o(m[w],g)):m[w]=g})}for(var a=arguments.length,r=new Array(a),h=0;h<a;h++)r[h]=arguments[h];return r.forEach(function(m){o(v,m)}),v}function C(v){return v!=null}},sboe:function(I,J,P){"use strict";P.d(J,"a",function(){return _});var M=P("q1tI"),u=P.n(M),_=M.createContext(null)},t23M:function(I,J,P){"use strict";var M=P("VTBJ"),u=P("1OyB"),_=P("vuIU"),D=P("Ji7U"),f=P("LK+K"),l=P("q1tI"),C=P.n(l),v=P("m+aA"),o=P("Zm9Q"),a=P("Kwbf"),r=P("c+Xe"),h=P("bdgK"),m="rc-observer-key",p=function(w){Object(D.a)(c,w);var g=Object(f.a)(c);function c(){var n;return Object(u.a)(this,c),n=g.apply(this,arguments),n.resizeObserver=null,n.childNode=null,n.currentElement=null,n.state={width:0,height:0,offsetHeight:0,offsetWidth:0},n.onResize=function(s){var d=n.props.onResize,S=s[0].target,y=S.getBoundingClientRect(),i=y.width,k=y.height,O=S.offsetWidth,b=S.offsetHeight,E=Math.floor(i),x=Math.floor(k);if(n.state.width!==E||n.state.height!==x||n.state.offsetWidth!==O||n.state.offsetHeight!==b){var T={width:E,height:x,offsetWidth:O,offsetHeight:b};n.setState(T),d&&Promise.resolve().then(function(){d(Object(M.a)(Object(M.a)({},T),{},{offsetWidth:O,offsetHeight:b}))})}},n.setChildNode=function(s){n.childNode=s},n}return Object(_.a)(c,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var s=this.props.disabled;if(s){this.destroyObserver();return}var d=Object(v.a)(this.childNode||this),S=d!==this.currentElement;S&&(this.destroyObserver(),this.currentElement=d),!this.resizeObserver&&d&&(this.resizeObserver=new h.default(this.onResize),this.resizeObserver.observe(d))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var s=this.props.children,d=Object(o.a)(s);if(d.length>1)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);w<g;w++)c[w]=p[w].fn;return c},a.prototype.listenerCount=function(h){var m=f?f+h:h,p=this._events[m];return p?p.fn?1:p.length:0},a.prototype.emit=function(h,m,p,w,g,c){var n=f?f+h:h;if(!this._events[n])return!1;var s=this._events[n],d=arguments.length,S,y;if(s.fn){s.once&&this.removeListener(h,s.fn,void 0,!0);switch(d){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,m),!0;case 3:return s.fn.call(s.context,m,p),!0;case 4:return s.fn.call(s.context,m,p,w),!0;case 5:return s.fn.call(s.context,m,p,w,g),!0;case 6:return s.fn.call(s.context,m,p,w,g,c),!0}for(y=1,S=new Array(d-1);y<d;y++)S[y-1]=arguments[y];s.fn.apply(s.context,S)}else{var i=s.length,k;for(y=0;y<i;y++){s[y].once&&this.removeListener(h,s[y].fn,void 0,!0);switch(d){case 1:s[y].fn.call(s[y].context);break;case 2:s[y].fn.call(s[y].context,m);break;case 3:s[y].fn.call(s[y].context,m,p);break;case 4:s[y].fn.call(s[y].context,m,p,w);break;default:if(!S)for(k=1,S=new Array(d-1);k<d;k++)S[k-1]=arguments[k];s[y].fn.apply(s[y].context,S)}}}return!0},a.prototype.on=function(h,m,p){return v(this,h,m,p,!1)},a.prototype.once=function(h,m,p){return v(this,h,m,p,!0)},a.prototype.removeListener=function(h,m,p,w){var g=f?f+h:h;if(!this._events[g])return this;if(!m)return o(this,g),this;var c=this._events[g];if(c.fn)c.fn===m&&(!w||c.once)&&(!p||c.context===p)&&o(this,g);else{for(var n=0,s=[],d=c.length;n<d;n++)(c[n].fn!==m||w&&!c[n].once||p&&c[n].context!==p)&&s.push(c[n]);s.length?this._events[g]=s.length===1?s[0]:s:o(this,g)}return this},a.prototype.removeAllListeners=function(h){var m;return h?(m=f?f+h:h,this._events[m]&&o(this,m)):(this._events=new l,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=f,a.EventEmitter=a,M.exports=a},"./node_modules/url-toolkit/src/url-toolkit.js":function(M,u,_){(function(D){var f=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,l=/^([^\/?#]*)([^]*)$/,C=/(?:\/|^)\.(?=\/)/g,v=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(a,r,h){if(h=h||{},a=a.trim(),r=r.trim(),!r){if(!h.alwaysNormalize)return a;var m=o.parseURL(a);if(!m)throw new Error("Error trying to parse base URL.");return m.path=o.normalizePath(m.path),o.buildURLFromParts(m)}var p=o.parseURL(r);if(!p)throw new Error("Error trying to parse relative URL.");if(p.scheme)return h.alwaysNormalize?(p.path=o.normalizePath(p.path),o.buildURLFromParts(p)):r;var w=o.parseURL(a);if(!w)throw new Error("Error trying to parse base URL.");if(!w.netLoc&&w.path&&w.path[0]!=="/"){var g=l.exec(w.path);w.netLoc=g[1],w.path=g[2]}w.netLoc&&!w.path&&(w.path="/");var c={scheme:w.scheme,netLoc:p.netLoc,path:null,params:p.params,query:p.query,fragment:p.fragment};if(!p.netLoc&&(c.netLoc=w.netLoc,p.path[0]!=="/"))if(!p.path)c.path=w.path,p.params||(c.params=w.params,p.query||(c.query=w.query));else{var n=w.path,s=n.substring(0,n.lastIndexOf("/")+1)+p.path;c.path=o.normalizePath(s)}return c.path===null&&(c.path=h.alwaysNormalize?o.normalizePath(p.path):p.path),o.buildURLFromParts(c)},parseURL:function(a){var r=f.exec(a);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(a){for(a=a.split("").reverse().join("").replace(C,"");a.length!==(a=a.replace(v,"")).length;);return a.split("").reverse().join("")},buildURLFromParts:function(a){return a.scheme+a.netLoc+a.path+a.params+a.query+a.fragment}};M.exports=o})(this)},"./node_modules/webworkify-webpack/index.js":function(M,u,_){function D(h){var m={};function p(g){if(m[g])return m[g].exports;var c=m[g]={i:g,l:!1,exports:{}};return h[g].call(c.exports,c,c.exports,p),c.l=!0,c.exports}p.m=h,p.c=m,p.i=function(g){return g},p.d=function(g,c,n){p.o(g,c)||Object.defineProperty(g,c,{configurable:!1,enumerable:!0,get:n})},p.r=function(g){Object.defineProperty(g,"__esModule",{value:!0})},p.n=function(g){var c=g&&g.__esModule?function(){return g.default}:function(){return g};return p.d(c,"a",c),c},p.o=function(g,c){return Object.prototype.hasOwnProperty.call(g,c)},p.p="/",p.oe=function(g){throw console.error(g),g};var w=p(p.s=ENTRY_MODULE);return w.default||w}var f="[\\.|\\-|\\+|\\w|/|@]+",l="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+f+").*?\\)";function C(h){return(h+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function v(h){return!isNaN(1*h)}function o(h,m,p){var w={};w[p]=[];var g=m.toString(),c=g.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return w;for(var n=c[1],s=new RegExp("(\\\\n|\\W)"+C(n)+l,"g"),d;d=s.exec(g);){if(d[3]==="dll-reference")continue;w[p].push(d[3])}for(s=new RegExp("\\("+C(n)+'\\("(dll-reference\\s('+f+'))"\\)\\)'+l,"g");d=s.exec(g);)h[d[2]]||(w[p].push(d[1]),h[d[2]]=_(d[1]).m),w[d[2]]=w[d[2]]||[],w[d[2]].push(d[4]);for(var S=Object.keys(w),y=0;y<S.length;y++)for(var i=0;i<w[S[y]].length;i++)v(w[S[y]][i])&&(w[S[y]][i]=1*w[S[y]][i]);return w}function a(h){var m=Object.keys(h);return m.reduce(function(p,w){return p||h[w].length>0},!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<c.length;n++){var s=c[n],d=p[s],S=d.pop();if(g[s]=g[s]||{},g[s][S]||!h[s][S])continue;g[s][S]=!0,w[s]=w[s]||[],w[s].push(S);for(var y=o(h,h[s][S],s),i=Object.keys(y),k=0;k<i.length;k++)p[i[k]]=p[i[k]]||[],p[i[k]]=p[i[k]].concat(y[i[k]])}return w}M.exports=function(h,m){m=m||{};var p={main:_.m},w=m.all?{main:Object.keys(p.main)}:r(p,h),g="";Object.keys(w).filter(function(S){return S!=="main"}).forEach(function(S){for(var y=0;w[S][y];)y++;w[S].push(y),p[S][y]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",g=g+"var "+S+" = ("+D.toString().replace("ENTRY_MODULE",JSON.stringify(y))+")({"+w[S].map(function(i){return""+JSON.stringify(i)+": "+p[S][i].toString()}).join(",")+`});
|
|
|
`}),g=g+"new (("+D.toString().replace("ENTRY_MODULE",JSON.stringify(h))+")({"+w.main.map(function(S){return""+JSON.stringify(S)+": "+p.main[S].toString()}).join(",")+"}))(self);";var c=new window.Blob([g],{type:"text/javascript"});if(m.bare)return c;var n=window.URL||window.webkitURL||window.mozURL||window.msURL,s=n.createObjectURL(c),d=new window.Worker(s);return d.objectURL=s,d}},"./src/config.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"hlsDefaultConfig",function(){return k}),_.d(u,"mergeConfig",function(){return b}),_.d(u,"enableStreamingMode",function(){return E});var D=_("./src/controller/abr-controller.ts"),f=_("./src/controller/audio-stream-controller.ts"),l=_("./src/controller/audio-track-controller.ts"),C=_("./src/controller/subtitle-stream-controller.ts"),v=_("./src/controller/subtitle-track-controller.ts"),o=_("./src/controller/buffer-controller.ts"),a=_("./src/controller/timeline-controller.ts"),r=_("./src/controller/cap-level-controller.ts"),h=_("./src/controller/fps-controller.ts"),m=_("./src/controller/eme-controller.ts"),p=_("./src/controller/cmcd-controller.ts"),w=_("./src/utils/xhr-loader.ts"),g=_("./src/utils/fetch-loader.ts"),c=_("./src/utils/cues.ts"),n=_("./src/utils/mediakeys-helper.ts"),s=_("./src/utils/logger.ts");function d(){return d=Object.assign||function(x){for(var T=1;T<arguments.length;T++){var N=arguments[T];for(var j in N)Object.prototype.hasOwnProperty.call(N,j)&&(x[j]=N[j])}return x},d.apply(this,arguments)}function S(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 y(x){for(var T=1;T<arguments.length;T++){var N=arguments[T]!=null?arguments[T]:{};T%2?S(Object(N),!0).forEach(function(j){i(x,j,N[j])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(N)):S(Object(N)).forEach(function(j){Object.defineProperty(x,j,Object.getOwnPropertyDescriptor(N,j))})}return x}function i(x,T,N){return T in x?Object.defineProperty(x,T,{value:N,enumerable:!0,configurable:!0,writable:!0}):x[T]=N,x}var k=y(y({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:w.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:D.default,bufferController:o.default,capLevelController:r.default,fpsController:h.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:n.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:C.SubtitleStreamController,subtitleTrackController:v.default,timelineController:a.TimelineController,audioStreamController:f.default,audioTrackController:l.default,emeController:m.default,cmcdController:p.default});function O(){return{cueHandler:c.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function b(x,T){if((T.liveSyncDurationCount||T.liveMaxLatencyDurationCount)&&(T.liveSyncDuration||T.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(T.liveMaxLatencyDurationCount!==void 0&&(T.liveSyncDurationCount===void 0||T.liveMaxLatencyDurationCount<=T.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(T.liveMaxLatencyDuration!==void 0&&(T.liveSyncDuration===void 0||T.liveMaxLatencyDuration<=T.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},x,T)}function E(x){var T=x.loader;if(T!==g.default&&T!==w.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),x.progressive=!1;else{var N=Object(g.fetchSupported)();N&&(x.loader=g.default,x.progressive=!0,x.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/polyfills/number.ts"),f=_("./src/utils/ewma-bandwidth-estimator.ts"),l=_("./src/events.ts"),C=_("./src/utils/buffer-helper.ts"),v=_("./src/errors.ts"),o=_("./src/types/loader.ts"),a=_("./src/utils/logger.ts");function r(p,w){for(var g=0;g<w.length;g++){var c=w[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(p,c.key,c)}}function h(p,w,g){return w&&r(p.prototype,w),g&&r(p,g),p}var m=function(){function p(g){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=g;var c=g.config;this.bwEstimator=new f.default(c.abrEwmaSlowVoD,c.abrEwmaFastVoD,c.abrEwmaDefaultEstimate),this.registerListeners()}var w=p.prototype;return w.registerListeners=function(){var c=this.hls;c.on(l.Events.FRAG_LOADING,this.onFragLoading,this),c.on(l.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(l.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(l.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(l.Events.ERROR,this.onError,this)},w.unregisterListeners=function(){var c=this.hls;c.off(l.Events.FRAG_LOADING,this.onFragLoading,this),c.off(l.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(l.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(l.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(l.Events.ERROR,this.onError,this)},w.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},w.onFragLoading=function(c,n){var s=n.frag;if(s.type===o.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=s,this.partCurrent=(d=n.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},w.onLevelLoaded=function(c,n){var s=this.hls.config;n.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},w._abandonRulesCheck=function(){var c=this.fragCurrent,n=this.partCurrent,s=this.hls,d=s.autoLevelEnabled,S=s.config,y=s.media;if(!c||!y)return;var i=n?n.stats:c.stats,k=n?n.duration:c.duration;if(i.aborted){a.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||y.paused||!y.playbackRate||!y.readyState)return;var O=performance.now()-i.loading.start,b=Math.abs(y.playbackRate);if(O<=500*k/b)return;var E=s.levels,x=s.minAutoLevel,T=E[c.level],N=i.total||Math.max(i.loaded,Math.round(k*T.maxBitrate/8)),j=Math.max(1,i.bwEstimate?i.bwEstimate/8:i.loaded*1e3/O),L=(N-i.loaded)/j,V=y.currentTime,K=(C.BufferHelper.bufferInfo(y,V,S.maxBufferHole).end-V)/b;if(K>=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<K)break}if(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||B<d))return L}return-1},h(p,[{key:"nextAutoLevel",get:function(){var c=this._nextAutoLevel,n=this.bwEstimator;if(c!==-1&&(!n||!n.canEstimate()))return c;var s=this.getNextABRAutoLevel();return c!==-1&&(s=Math.min(c,s)),s},set:function(c){this._nextAutoLevel=c}}]),p}();u.default=m},"./src/controller/audio-stream-controller.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/polyfills/number.ts"),f=_("./src/controller/base-stream-controller.ts"),l=_("./src/events.ts"),C=_("./src/utils/buffer-helper.ts"),v=_("./src/controller/fragment-tracker.ts"),o=_("./src/types/level.ts"),a=_("./src/types/loader.ts"),r=_("./src/loader/fragment.ts"),h=_("./src/demux/chunk-cache.ts"),m=_("./src/demux/transmuxer-interface.ts"),p=_("./src/types/transmuxer.ts"),w=_("./src/controller/fragment-finders.ts"),g=_("./src/utils/discontinuities.ts"),c=_("./src/errors.ts"),n=_("./src/utils/logger.ts");function s(){return s=Object.assign||function(k){for(var O=1;O<arguments.length;O++){var b=arguments[O];for(var E in b)Object.prototype.hasOwnProperty.call(b,E)&&(k[E]=b[E])}return k},s.apply(this,arguments)}function d(k,O){k.prototype=Object.create(O.prototype),k.prototype.constructor=k,S(k,O)}function S(k,O){return S=Object.setPrototypeOf||function(E,x){return E.__proto__=x,E},S(k,O)}var y=100,i=function(k){d(O,k);function O(E,x){var T;return T=k.call(this,E,x,"[audio-stream-controller]")||this,T.videoBuffer=null,T.videoTrackCC=-1,T.waitingVideoCC=-1,T.audioSwitch=!1,T.trackId=-1,T.waitingData=null,T.mainDetails=null,T.bufferFlushed=!1,T._registerListeners(),T}var b=O.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var x=this.hls;x.on(l.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(l.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(l.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(l.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(l.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.on(l.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(l.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.on(l.Events.ERROR,this.onError,this),x.on(l.Events.BUFFER_RESET,this.onBufferReset,this),x.on(l.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(l.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(l.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.on(l.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var x=this.hls;x.off(l.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(l.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(l.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(l.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(l.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.off(l.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(l.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.off(l.Events.ERROR,this.onError,this),x.off(l.Events.BUFFER_RESET,this.onBufferReset,this),x.off(l.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(l.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(l.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.off(l.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onInitPtsFound=function(x,T){var N=T.frag,j=T.id,L=T.initPTS;if(j==="main"){var V=N.cc;this.initPTS[N.cc]=L,this.log("InitPTS for cc: "+V+" found from main: "+L),this.videoTrackCC=V,this.state===f.State.WAITING_INIT_PTS&&this.tick()}},b.startLoad=function(x){if(!this.levels){this.startPosition=x,this.state=f.State.STOPPED;return}var T=this.lastCurrentTime;this.stopLoad(),this.setInterval(y),this.fragLoadError=0,T>0&&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&&Ee<ee&&((F.end>ee||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<p.length;w++){var g=p[w];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}function o(m,p,w){return p&&v(m.prototype,p),w&&v(m,w),m}function a(m,p){m.prototype=Object.create(p.prototype),m.prototype.constructor=m,r(m,p)}function r(m,p){return r=Object.setPrototypeOf||function(g,c){return g.__proto__=c,g},r(m,p)}var h=function(m){a(p,m);function p(g){var c;return c=m.call(this,g,"[audio-track-controller]")||this,c.tracks=[],c.groupId=null,c.tracksInGroup=[],c.trackId=-1,c.trackName="",c.selectDefaultTrack=!0,c.registerListeners(),c}var w=p.prototype;return w.registerListeners=function(){var c=this.hls;c.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(D.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.on(D.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.on(D.Events.ERROR,this.onError,this)},w.unregisterListeners=function(){var c=this.hls;c.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(D.Events.LEVEL_LOADING,this.onLevelLoading,this),c.off(D.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.off(D.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.off(D.Events.ERROR,this.onError,this)},w.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},w.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},w.onManifestParsed=function(c,n){this.tracks=n.audioTracks||[]},w.onAudioTrackLoaded=function(c,n){var s=n.id,d=n.details,S=this.tracksInGroup[s];if(!S){this.warn("Invalid audio track id "+s);return}var y=S.details;S.details=n.details,this.log("audioTrack "+s+" loaded ["+d.startSN+"-"+d.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,n,y))},w.onLevelLoading=function(c,n){this.switchLevel(n.level)},w.onLevelSwitching=function(c,n){this.switchLevel(n.level)},w.switchLevel=function(c){var n=this.hls.levels[c];if(!(n!=null&&n.audioGroupIds))return;var s=n.audioGroupIds[n.urlId];if(this.groupId!==s){this.groupId=s;var d=this.tracks.filter(function(y){return!s||y.groupId===s});this.selectDefaultTrack&&!d.some(function(y){return y.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var S={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(D.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}},w.onError=function(c,n){if(m.prototype.onError.call(this,c,n),n.fatal||!n.context)return;n.context.type===C.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},w.setAudioTrack=function(c){var n=this.tracksInGroup;if(c<0||c>=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;s<n.length;s++){var d=n[s];if((!this.selectDefaultTrack||d.default)&&(!c||c===d.name))return d.id}return-1},w.loadPlaylist=function(c){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var s=n.id,d=n.groupId,S=n.url;if(c)try{S=c.addDirectives(S)}catch(y){this.warn("Could not construct new URL with HLS Delivery Directives: "+y)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(D.Events.AUDIO_TRACK_LOADING,{url:S,id:s,groupId:d,deliveryDirectives:c||null})}},o(p,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(c){this.selectDefaultTrack=!1,this.setAudioTrack(c)}}]),p}(l.default);u.default=h},"./src/controller/base-playlist-controller.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return o});var D=_("./src/polyfills/number.ts"),f=_("./src/types/level.ts"),l=_("./src/controller/level-helper.ts"),C=_("./src/utils/logger.ts"),v=_("./src/errors.ts"),o=function(){function a(h,m){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=C.logger.log.bind(C.logger,m+":"),this.warn=C.logger.warn.bind(C.logger,m+":"),this.hls=h}var r=a.prototype;return r.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},r.onError=function(m,p){p.fatal&&p.type===v.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},r.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},r.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},r.stopLoad=function(){this.canLoad=!1,this.clearTimer()},r.switchParams=function(m,p){var w=p==null?void 0:p.renditionReports;if(w)for(var g=0;g<w.length;g++){var c=w[g],n=""+c.URI;if(n===m.substr(-n.length)){var s=parseInt(c["LAST-MSN"]),d=parseInt(c["LAST-PART"]);if(p&&this.hls.config.lowLatencyMode){var S=Math.min(p.age-p.partTarget,p.targetduration);d!==void 0&&S>p.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<w.levelLoadingMaxRetry;if(g){var c;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-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;T<x.length;T++){var N=x[T];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(E,N.key,N)}}function S(E,x,T){return x&&d(E.prototype,x),T&&d(E,T),E}function y(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function i(E,x){E.prototype=Object.create(x.prototype),E.prototype.constructor=E,k(E,x)}function k(E,x){return k=Object.setPrototypeOf||function(N,j){return N.__proto__=j,N},k(E,x)}var O={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},b=function(E){i(x,E);function x(N,j,L){var V;return V=E.call(this)||this,V.hls=void 0,V.fragPrevious=null,V.fragCurrent=null,V.fragmentTracker=void 0,V.transmuxer=null,V._state=O.STOPPED,V.media=void 0,V.mediaBuffer=void 0,V.config=void 0,V.bitrateTest=!1,V.lastCurrentTime=0,V.nextLoadPosition=0,V.startPosition=0,V.loadedmetadata=!1,V.fragLoadError=0,V.retryDate=0,V.levels=null,V.fragmentLoader=void 0,V.levelLastLoaded=null,V.startFragRequested=!1,V.decrypter=void 0,V.initPTS=[],V.onvseeking=null,V.onvended=null,V.logPrefix="",V.log=void 0,V.warn=void 0,V.logPrefix=L,V.log=v.logger.log.bind(v.logger,L+":"),V.warn=v.logger.warn.bind(v.logger,L+":"),V.hls=N,V.fragmentLoader=new g.default(N.config),V.fragmentTracker=j,V.config=N.config,V.decrypter=new c.default(N,N.config),N.on(o.Events.KEY_LOADED,V.onKeyLoaded,y(V)),V}var T=x.prototype;return T.doTick=function(){this.onTickEnd()},T.onTickEnd=function(){},T.startLoad=function(j){},T.stopLoad=function(){this.fragmentLoader.abort();var j=this.fragCurrent;j&&this.fragmentTracker.removeFragment(j),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},T._streamEnded=function(j,L){var V=this.fragCurrent,K=this.fragmentTracker;if(!L.live&&V&&V.sn===L.endSN&&!j.nextStart){var W=K.getState(V);return W===l.FragmentState.PARTIAL||W===l.FragmentState.OK}return!1},T.onMediaAttached=function(j,L){var V=this.media=this.mediaBuffer=L.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),V.addEventListener("seeking",this.onvseeking),V.addEventListener("ended",this.onvended);var K=this.config;this.levels&&K.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(K.startPosition)},T.onMediaDetaching=function(){var j=this.media;j!=null&&j.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),j&&(j.removeEventListener("seeking",this.onvseeking),j.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},T.onMediaSeeking=function(){var j=this.config,L=this.fragCurrent,V=this.media,K=this.mediaBuffer,W=this.state,G=V?V.currentTime:0,F=C.BufferHelper.bufferInfo(K||V,G,j.maxBufferHole);if(this.log("media seeking to "+(Object(D.isFiniteNumber)(G)?G.toFixed(3):G)+", state: "+W),W===O.ENDED)this.resetLoadingState();else if(L&&!F.len){var B=j.maxFragLookUpTolerance,H=L.start-B,q=L.start+L.duration+B,re=G>q;(G<H||re)&&(re&&L.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),L.loader.abort()),this.resetLoadingState())}V&&(this.lastCurrentTime=G),!this.loadedmetadata&&!F.len&&(this.nextLoadPosition=this.startPosition=G),this.tickImmediate()},T.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},T.onKeyLoaded=function(j,L){if(this.state!==O.KEY_LOADING||L.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var V=this.levels[L.frag.level].details;V&&this.loadFragment(L.frag,V,L.frag.start)},T.onHandlerDestroying=function(){this.stopLoad(),E.prototype.onHandlerDestroying.call(this)},T.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(o.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,E.prototype.onHandlerDestroyed.call(this)},T.loadKey=function(j,L){this.log("Loading key for "+j.sn+" of ["+L.startSN+"-"+L.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+j.level),this.state=O.KEY_LOADING,this.fragCurrent=j,this.hls.trigger(o.Events.KEY_LOADING,{frag:j})},T.loadFragment=function(j,L,V){this._loadFragForPlayback(j,L,V)},T._loadFragForPlayback=function(j,L,V){var K=this,W=function(F){if(K.fragContextChanged(j)){K.warn("Fragment "+j.sn+(F.part?" p: "+F.part.index:"")+" of level "+j.level+" was dropped during download."),K.fragmentTracker.removeFragment(j);return}j.stats.chunkCount++,K._handleFragmentLoadProgress(F)};this._doFragLoad(j,L,V,W).then(function(G){if(!G)return;K.fragLoadError=0;var F=K.state;if(K.fragContextChanged(j)){(F===O.FRAG_LOADING||F===O.BACKTRACKING||!K.fragCurrent&&F===O.PARSING)&&(K.fragmentTracker.removeFragment(j),K.state=O.IDLE);return}if("payload"in G&&(K.log("Loaded fragment "+j.sn+" of level "+j.level),K.hls.trigger(o.Events.FRAG_LOADED,G),K.state===O.BACKTRACKING)){K.fragmentTracker.backtrack(j,G),K.resetFragmentLoading(j);return}K._handleFragmentLoadComplete(G)}).catch(function(G){K.warn(G),K.resetFragmentLoading(j)})},T.flushMainBuffer=function(j,L,V){if(V===void 0&&(V=null),!(j-L))return;var K={startOffset:j,endOffset:L,type:V};this.fragLoadError=0,this.hls.trigger(o.Events.BUFFER_FLUSHING,K)},T._loadInitSegment=function(j){var L=this;this._doFragLoad(j).then(function(V){if(!V||L.fragContextChanged(j)||!L.levels)throw new Error("init load aborted");return V}).then(function(V){var K=L.hls,W=V.payload,G=j.decryptdata;if(W&&W.byteLength>0&&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<G.end)return C.BufferHelper.bufferInfo(j,K,Math.max(W.nextStart,V.maxBufferHole))}return W},T.getMaxBufferLength=function(j){var L=this.config,V;return j?V=Math.max(8*L.maxBufferSize/j,L.maxBufferLength):V=L.maxBufferLength,Math.min(V,L.maxMaxBufferLength)},T.reduceMaxBufferLength=function(j){var L=this.config,V=j||L.maxBufferLength;return L.maxMaxBufferLength>=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<q)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+q+")"),null;!L.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(L,W),this.startPosition=H?this.hls.liveSyncPosition||H.start:j)}else j<=B&&(H=W[0]);if(!H){var re=F.lowLatencyMode?L.partEnd:L.fragmentEnd;H=this.getFragmentAtPosition(j,re,L)}return(V=H)!==null&&V!==void 0&&V.initSegment&&!((K=H)!==null&&K!==void 0&&K.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},T.getNextPart=function(j,L,V){for(var K=-1,W=!1,G=!0,F=0,B=j.length;F<B;F++){var H=j[F];if(G=G&&!H.independent,K>-1&&V<H.start)break;var q=H.loaded;!q&&(W||H.independent||G)&&H.fragment===L&&(K=F),W=q}return K},T.loadedEndOfParts=function(j,L){var V=j[j.length-1];return V&&L>V.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(j<L){var ee=j>L-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<F&&this.fragmentTracker.getState(pe)!==l.FragmentState.OK?(this.log("SN "+re.sn+" just loaded, load next one: "+pe.sn),re=pe):re=null))}return re},T.synchronizeToLiveEdge=function(j){var L=this.config,V=this.media;if(!V)return;var K=this.hls.liveSyncPosition,W=V.currentTime,G=j.fragments[0].start,F=j.edge,B=W>=G-L.maxFragLookUpTolerance&&W<=F;if(K!==null&&V.duration>K&&(W<K||!B)){var H=L.liveMaxLatencyDuration!==void 0?L.liveMaxLatencyDuration:L.liveMaxLatencyDurationCount*j.targetduration;(!B&&V.readyState<4||W<F-H)&&(this.loadedmetadata||(this.nextLoadPosition=K),V.readyState&&(this.warn("Playback: "+W.toFixed(3)+" is located too far from the end of live sliding playlist: "+F+", reset currentTime to : "+K.toFixed(3)),V.currentTime=K))}},T.alignPlaylists=function(j,L){var V=this.levels,K=this.levelLastLoaded,W=this.fragPrevious,G=K!==null?V[K]:null,F=j.fragments.length;if(!F)return this.warn("No fragments in live playlist"),0;var B=j.fragments[0].start,H=!L,q=j.alignedSliding&&Object(D.isFiniteNumber)(B);if(H||!q&&!B){Object(m.alignStream)(W,G,j);var re=j.fragments[0].start;return this.log("Live playlist sliding: "+re.toFixed(2)+" start-sn: "+(L?L.startSN:"na")+"->"+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<L&&(V=-1),V===-1||this.lastCurrentTime===-1){var K=j.startTimeOffset;Object(D.isFiniteNumber)(K)?(V=L+K,K<0&&(V+=j.totalduration),V=Math.min(Math.max(L,V),L+j.totalduration),this.log("Start time offset "+K+" found in playlist, adjust startPosition to "+V),this.startPosition=V):j.live?V=this.hls.liveSyncPosition||L:this.startPosition=V=0,this.lastCurrentTime=V}this.nextLoadPosition=V},T.getLoadPosition=function(){var j=this.media,L=0;return this.loadedmetadata&&j?L=j.currentTime:this.nextLoadPosition&&(L=this.nextLoadPosition),L},T.handleFragLoadAborted=function(j,L){this.transmuxer&&j.sn!=="initSegment"&&j.stats.aborted&&(this.warn("Fragment "+j.sn+(L?" part"+L.index:"")+" of level "+j.level+" was aborted"),this.resetFragmentLoading(j))},T.resetFragmentLoading=function(j){(!this.fragCurrent||!this.fragContextChanged(j))&&(this.state=O.IDLE)},T.onFragmentOrKeyLoadError=function(j,L){if(L.fatal)return;var V=L.frag;if(!V||V.type!==j)return;var K=this.fragCurrent;console.assert(K&&V.sn===K.sn&&V.level===K.level&&V.urlId===K.urlId,"Frag load error must match current frag to retry");var W=this.config;if(this.fragLoadError+1<=W.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(V.level))return;var G=Math.min(Math.pow(2,this.fragLoadError)*W.fragLoadingRetryDelay,W.fragLoadingMaxRetryTimeout);this.warn("Fragment "+V.sn+" of "+j+" "+V.level+" failed to load, retrying in "+G+"ms"),this.retryDate=self.performance.now()+G,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else L.levelRetry?(j===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(v.logger.error(L.details+" reaches max retry, redispatch as fatal ..."),L.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},T.afterBufferFlushed=function(j,L,V){if(!j)return;var K=C.BufferHelper.getBuffered(j);this.fragmentTracker.detectEvictedFragments(L,K,V),this.state===O.ENDED&&this.resetLoadingState()},T.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},T.resetLiveStartWhenNotLoaded=function(j){if(!this.loadedmetadata){this.startFragRequested=!1;var L=this.levels?this.levels[j].details:null;if(L!=null&&L.live)return this.startPosition=-1,this.setStartPosition(L,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},T.updateLevelTiming=function(j,L,V,K){var W=this,G=V.details;console.assert(!!G,"level.details must be defined");var F=Object.keys(j.elementaryStreams).reduce(function(B,H){var q=j.elementaryStreams[H];if(q){var re=q.endPTS-q.startPTS;if(re<=0)return W.warn("Could not parse fragment "+j.sn+" "+H+" duration reliably ("+re+") resetting transmuxer to fallback to playlist timing"),W.resetTransmuxer(),B||!1;var ee=K?0:Object(w.updateFragPTSDTS)(G,j,q.startPTS,q.endPTS,q.startDTS,q.endDTS);return W.hls.trigger(o.Events.LEVEL_PTS_UPDATED,{details:G,level:V,drift:ee,type:H,frag:j,start:q.startPTS,end:q.endPTS}),!0}return B},!1);F?(this.state=O.PARSED,this.hls.trigger(o.Events.FRAG_PARSED,{frag:j,part:L})):this.resetLoadingState()},T.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S(x,[{key:"state",get:function(){return this._state},set:function(j){var L=this._state;L!==j&&(this._state=j,this.log(L+"->"+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;a<o.length;a++){var r=o[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(v,r.key,r)}}function l(v,o,a){return o&&f(v.prototype,o),a&&f(v,a),v}var C=function(){function v(a){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=a,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var o=v.prototype;return o.setStreamController=function(r){this.streamController=r},o.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},o.registerListeners=function(){var r=this.hls;r.on(D.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),r.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},o.unregisterListener=function(){var r=this.hls;r.off(D.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),r.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},o.onFpsDropLevelCapping=function(r,h){v.isLevelAllowed(h.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(h.droppedLevel)},o.onMediaAttaching=function(r,h){this.media=h.media instanceof HTMLVideoElement?h.media:null},o.onManifestParsed=function(r,h){var m=this.hls;this.restrictedLevels=[],this.firstLevel=h.firstLevel,m.config.capLevelToPlayerSize&&h.video&&this.startCapping()},o.onBufferCodecs=function(r,h){var m=this.hls;m.config.capLevelToPlayerSize&&h.video&&this.startCapping()},o.onMediaDetaching=function(){this.stopCapping()},o.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&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<r.length;g+=1){var c=r[g];if((c.width>=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<g.length;c++){var n=g[c];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(w,n.key,n)}}function o(w,g,c){return g&&v(w.prototype,g),c&&v(w,c),w}function a(w,g){var c=typeof Symbol!="undefined"&&w[Symbol.iterator]||w["@@iterator"];if(c)return(c=c.call(w)).next.bind(c);if(Array.isArray(w)||(c=r(w))||g&&w&&typeof w.length=="number"){c&&(w=c);var n=0;return function(){return n>=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);c<g;c++)n[c]=w[c];return n}function m(){return m=Object.assign||function(w){for(var g=1;g<arguments.length;g++){var c=arguments[g];for(var n in c)Object.prototype.hasOwnProperty.call(c,n)&&(w[n]=c[n])}return w},m.apply(this,arguments)}var p=function(){function w(c){var n=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){n.initialized&&(n.starved=!0),n.buffering=!0},this.onPlaying=function(){n.initialized||(n.initialized=!0),n.buffering=!1},this.applyPlaylistData=function(S){try{n.apply(S,{ot:f.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(y){C.logger.warn("Could not generate manifest CMCD data.",y)}},this.applyFragmentData=function(S){try{var y=S.frag,i=n.hls.levels[y.level],k=n.getObjectType(y),O={d:y.duration*1e3,ot:k};(k===f.CMCDObjectType.VIDEO||k===f.CMCDObjectType.AUDIO||k==f.CMCDObjectType.MUXED)&&(O.br=i.bitrate/1e3,O.tb=n.getTopBandwidth(k),O.bl=n.getBufferLength(k)),n.apply(S,O)}catch(b){C.logger.warn("Could not generate segment CMCD data.",b)}},this.hls=c;var s=this.config=c.config,d=s.cmcd;d!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||w.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var g=w.prototype;return g.registerListeners=function(){var n=this.hls;n.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(D.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(D.Events.BUFFER_CREATED,this.onBufferCreated,this)},g.unregisterListeners=function(){var n=this.hls;n.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(D.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(D.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},g.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},g.onMediaAttached=function(n,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},g.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},g.onBufferCreated=function(n,s){var d,S;this.audioBuffer=(d=s.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(S=s.tracks.video)===null||S===void 0?void 0:S.buffer},g.createData=function(){var n;return{v:f.CMCDVersion,sf:f.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(n=this.media)===null||n===void 0?void 0:n.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},g.apply=function(n,s){s===void 0&&(s={}),m(s,this.createData());var d=s.ot===f.CMCDObjectType.INIT||s.ot===f.CMCDObjectType.VIDEO||s.ot===f.CMCDObjectType.MUXED;if(this.starved&&d&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var S=w.toHeaders(s);if(!Object.keys(S).length)return;n.headers||(n.headers={}),m(n.headers,S)}else{var y=w.toQuery(s);if(!y)return;n.url=w.appendQueryToUri(n.url,y)}},g.getObjectType=function(n){var s=n.type;return s==="subtitle"?f.CMCDObjectType.TIMED_TEXT:n.sn==="initSegment"?f.CMCDObjectType.INIT:s==="audio"?f.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?f.CMCDObjectType.VIDEO:f.CMCDObjectType.MUXED:void 0},g.getTopBandwidth=function(n){for(var s=0,d=n===f.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,S=a(d),y;!(y=S()).done;){var i=y.value;i.bitrate>s&&(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;k<O.length;k++){var b=O[k],E=i[b]!=null?i[b]:1;y[E][b]=n[b]}for(var x=0;x<y.length;x++){var T=w.serialize(y[x]);T&&(d["CMCD-"+S[x]]=T)}return d},w.toQuery=function(n){return"CMCD="+encodeURIComponent(w.serialize(n))},w.appendQueryToUri=function(n,s){if(!s)return n;var d=n.includes("?")?"&":"?";return""+n+d+s},w}()},"./src/controller/eme-controller.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/events.ts"),f=_("./src/errors.ts"),l=_("./src/utils/logger.ts"),C=_("./src/utils/mediakeys-helper.ts");function v(p,w){for(var g=0;g<w.length;g++){var c=w[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(p,c.key,c)}}function o(p,w,g){return w&&v(p.prototype,w),g&&v(p,g),p}var a=3,r=function(w,g,c){var n={audioCapabilities:[],videoCapabilities:[]};return w.forEach(function(s){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:c.audioRobustness||""})}),g.forEach(function(s){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:c.videoRobustness||""})}),[n]},h=function(w,g,c,n){switch(w){case C.KeySystems.WIDEVINE:return r(g,c,n);default:throw new Error("Unknown key-system: "+w)}},m=function(){function p(g){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=g,this._config=g.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var w=p.prototype;return w.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},w._registerListeners=function(){this.hls.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(D.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this)},w._unregisterListeners=function(){this.hls.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(D.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this)},w.getLicenseServerUrl=function(c){switch(c){case C.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+c+'"')},w._attemptKeySystemAccess=function(c,n,s){var d=this,S=h(c,n,s,this._drmSystemOptions);l.logger.log("Requesting encrypted media key-system access");var y=this.requestMediaKeySystemAccess(c,S);this.mediaKeysPromise=y.then(function(i){return d._onMediaKeySystemAccessObtained(c,i)}),y.catch(function(i){l.logger.error('Failed to obtain key-system "'+c+'" access:',i)})},w._onMediaKeySystemAccessObtained=function(c,n){var s=this;l.logger.log('Access for key-system "'+c+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:n,mediaKeySystemDomain:c};this._mediaKeysList.push(d);var S=Promise.resolve().then(function(){return n.createMediaKeys()}).then(function(y){return d.mediaKeys=y,l.logger.log('Media-keys created for key-system "'+c+'"'),s._onMediaKeysCreated(),y});return S.catch(function(y){l.logger.error("Failed to create media-keys:",y)}),S},w._onMediaKeysCreated=function(){var c=this;this._mediaKeysList.forEach(function(n){n.mediaKeysSession||(n.mediaKeysSession=n.mediaKeys.createSession(),c._onNewMediaKeySession(n.mediaKeysSession))})},w._onNewMediaKeySession=function(c){var n=this;l.logger.log("New key-system session "+c.sessionId),c.addEventListener("message",function(s){n._onKeySessionMessage(c,s.message)},!1)},w._onKeySessionMessage=function(c,n){l.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(s){l.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),c.update(s)})},w.onMediaEncrypted=function(c){var n=this;if(l.logger.log('Media is encrypted using "'+c.initDataType+'" init data type'),!this.mediaKeysPromise){l.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(D.Events.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(S){if(!n._media)return;n._attemptSetMediaKeys(S),n._generateRequestWithPreferredKeySession(c.initDataType,c.initData)};this.mediaKeysPromise.then(s).catch(s)},w._attemptSetMediaKeys=function(c){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var n=this._mediaKeysList[0];if(!n||!n.mediaKeys){l.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(D.Events.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}l.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(n.mediaKeys),this._hasSetMediaKeys=!0}},w._generateRequestWithPreferredKeySession=function(c,n){var s=this,d=this._mediaKeysList[0];if(!d){l.logger.error("Fatal: Media is encrypted but not any 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}if(d.mediaKeysSessionInitialized){l.logger.warn("Key-Session already initialized but requested again");return}var S=d.mediaKeysSession;if(!S){l.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(D.Events.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){l.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(D.Events.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}l.logger.log('Generating key-session request for "'+c+'" init data type'),d.mediaKeysSessionInitialized=!0,S.generateRequest(c,n).then(function(){l.logger.debug("Key-session generation succeeded")}).catch(function(y){l.logger.error("Error generating key-session request:",y),s.hls.trigger(D.Events.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},w._createLicenseXhr=function(c,n,s){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,c,n,s);var S=this._licenseXhrSetup;if(S)try{S.call(this.hls,d,c),S=void 0}catch(y){l.logger.error(y)}try{d.readyState||d.open("POST",c,!0),S&&S.call(this.hls,d,c)}catch(y){throw new Error("issue setting up KeySystem license XHR "+y)}return d},w._onLicenseRequestReadyStageChange=function(c,n,s,d){switch(c.readyState){case 4:if(c.status===200){this._requestLicenseFailureCount=0,l.logger.log("License request succeeded");var S=c.response,y=this._licenseResponseCallback;if(y)try{S=y.call(this.hls,c,n)}catch(k){l.logger.error(k)}d(S)}else{if(l.logger.error("License Request XHR failed ("+n+"). Status: "+c.status+" ("+c.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>a){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;g<r.length;++g){var c=r[g];if(o(h,m,c))return c}return null}function C(r,h,m,p){m===void 0&&(m=0),p===void 0&&(p=0);var w=null;if(r?w=h[r.sn-h[0].sn+1]||null:m===0&&h[0].start===0&&(w=h[0]),w&&v(m,p,w)===0)return w;var g=f.default.search(h,v.bind(null,m,p));return g||w}function v(r,h,m){r===void 0&&(r=0),h===void 0&&(h=0);var p=Math.min(h,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-p<=r?1:m.start-p>r&&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.cc<h?1:m.cc>h?-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<g.length;y++){var i=g.start(y)-this.bufferPadding,k=g.end(y)+this.bufferPadding;if(S>=i&&d<=k){c.time.push({startPTS:Math.max(n,g.start(y)),endPTS:Math.min(s,g.end(y))});break}else if(n<k&&s>i)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<w.length;n++){if(g=w.start(n)-this.bufferPadding,c=w.end(n)+this.bufferPadding,m>=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;y<S.length;y++)g.appendedPTS=Math.max(S.end(y),g.appendedPTS||0)})},r.onFragBuffered=function(m,p){this.detectPartialFragments(p)},r.hasFragment=function(m){var p=o(m);return!!this.fragments[p]},r.removeFragmentsInRange=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){var s=n.body;s.type===w&&s.start<p&&s.end>m&&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<y.length;i++){var k=y.start(i);if(d+c.maxBufferHole>=S&&d<k){var O=Math.max(k+r,s.currentTime+a);return C.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+O),this.moved=!0,this.stalled=null,s.currentTime=O,g&&n.trigger(l.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+O,frag:g}),O}S=y.end(i)}return 0},p._tryNudgeBuffer=function(){var g=this.config,c=this.hls,n=this.media,s=n.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<g.nudgeMaxRetry){var S=s+d*g.nudgeOffset;C.logger.warn("Nudging 'currentTime' from "+s+" to "+S),n.currentTime=S,c.trigger(l.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else C.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+g.nudgeMaxRetry+" nudges"),c.trigger(l.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/events.ts"),f=_("./src/utils/texttrack-utils.ts"),l=_("./src/demux/id3.ts"),C=.25,v=function(){function o(r){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=r,this._registerListeners()}var a=o.prototype;return a.destroy=function(){this._unregisterListeners()},a._registerListeners=function(){var h=this.hls;h.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(D.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},a._unregisterListeners=function(){var h=this.hls;h.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(D.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},a.onMediaAttached=function(h,m){this.media=m.media},a.onMediaDetaching=function(){if(!this.id3Track)return;Object(f.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},a.getID3Track=function(h){if(!this.media)return;for(var m=0;m<h.length;m++){var p=h[m];if(p.kind==="metadata"&&p.label==="id3")return Object(f.sendAddTrackEvent)(p,this.media),p}return this.media.addTextTrack("metadata","id3")},a.onFragParsingMetadata=function(h,m){if(!this.media)return;var p=m.frag,w=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var g=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,c=0;c<w.length;c++){var n=l.getID3Frames(w[c].data);if(n){var s=w[c].pts,d=c<w.length-1?w[c+1].pts:p.end,S=d-s;S<=0&&(d=s+C);for(var y=0;y<n.length;y++){var i=n[y];if(!l.isTimeStampFrame(i)){var k=new g(s,d,"");k.value=i,this.id3Track.addCue(k)}}}}},a.onBufferFlushing=function(h,m){var p=m.startOffset,w=m.endOffset,g=m.type;if(!g||g==="audio"){var c=this.id3Track;c&&Object(f.removeCuesInRange)(c,p,w)}},o}();u.default=v},"./src/controller/latency-controller.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return o});var D=_("./src/errors.ts"),f=_("./src/events.ts"),l=_("./src/utils/logger.ts");function C(a,r){for(var h=0;h<r.length;h++){var m=r[h];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(a,m.key,m)}}function v(a,r,h){return r&&C(a.prototype,r),h&&C(a,h),a}var o=function(){function a(h){var m=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return m.timeupdate()},this.hls=h,this.config=h.config,this.registerListeners()}var r=a.prototype;return r.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},r.registerListeners=function(){this.hls.on(f.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(f.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(f.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(f.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(f.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){this.hls.off(f.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(f.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(f.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(f.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(f.Events.ERROR,this.onError)},r.onMediaAttached=function(m,p){this.media=p.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},r.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},r.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},r.onLevelUpdated=function(m,p){var w=p.details;this.levelDetails=w,w.advanced&&this.timeupdate(),!w.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},r.onError=function(m,p){if(p.details!==D.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,l.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},r.timeupdate=function(){var m=this.media,p=this.levelDetails;if(!m||!p)return;this.currentTime=m.currentTime;var w=this.computeLatency();if(w===null)return;this._latency=w;var g=this.config,c=g.lowLatencyMode,n=g.maxLiveSyncPlaybackRate;if(!c||n===1)return;var s=this.targetLatency;if(s===null)return;var d=w-s,S=Math.min(this.maxLatency,s+p.targetduration),y=d<S;if(p.live&&y&&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;s<arguments.length;s++){var d=arguments[s];for(var S in d)Object.prototype.hasOwnProperty.call(d,S)&&(n[S]=d[S])}return n},r.apply(this,arguments)}function h(n,s){for(var d=0;d<s.length;d++){var S=s[d];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(n,S.key,S)}}function m(n,s,d){return s&&h(n.prototype,s),d&&h(n,d),n}function p(n,s){n.prototype=Object.create(s.prototype),n.prototype.constructor=n,w(n,s)}function w(n,s){return w=Object.setPrototypeOf||function(S,y){return S.__proto__=y,S},w(n,s)}var g=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),c=function(n){p(s,n);function s(S){var y;return y=n.call(this,S,"[level-controller]")||this,y._levels=[],y._firstLevel=-1,y._startLevel=void 0,y.currentLevelIndex=-1,y.manualLevelIndex=-1,y.onParsedComplete=void 0,y._registerListeners(),y}var d=s.prototype;return d._registerListeners=function(){var y=this.hls;y.on(f.Events.MANIFEST_LOADED,this.onManifestLoaded,this),y.on(f.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.on(f.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.on(f.Events.FRAG_LOADED,this.onFragLoaded,this),y.on(f.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var y=this.hls;y.off(f.Events.MANIFEST_LOADED,this.onManifestLoaded,this),y.off(f.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.off(f.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.off(f.Events.FRAG_LOADED,this.onFragLoaded,this),y.off(f.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,n.prototype.destroy.call(this)},d.startLoad=function(){var y=this._levels;y.forEach(function(i){i.loadError=0}),n.prototype.startLoad.call(this)},d.onManifestLoaded=function(y,i){var k=[],O=[],b=[],E,x={},T,N=!1,j=!1,L=!1;if(i.levels.forEach(function(G){var F=G.attrs;N=N||!!(G.width&&G.height),j=j||!!G.videoCodec,L=L||!!G.audioCodec,g&&G.audioCodec&&G.audioCodec.indexOf("mp4a.40.34")!==-1&&(G.audioCodec=void 0);var B=G.bitrate+"-"+G.attrs.RESOLUTION+"-"+G.attrs.CODECS;T=x[B],T?T.url.push(G.url):(T=new D.Level(G),x[B]=T,k.push(T)),F&&(F.AUDIO&&Object(v.addGroupId)(T,"audio",F.AUDIO),F.SUBTITLES&&Object(v.addGroupId)(T,"text",F.SUBTITLES))}),(N||j)&&L&&(k=k.filter(function(G){var F=G.videoCodec,B=G.width,H=G.height;return!!F||!!(B&&H)})),k=k.filter(function(G){var F=G.audioCodec,B=G.videoCodec;return(!F||Object(C.isCodecSupportedInMp4)(F,"audio"))&&(!B||Object(C.isCodecSupportedInMp4)(B,"video"))}),i.audioTracks&&(O=i.audioTracks.filter(function(G){return!G.audioCodec||Object(C.isCodecSupportedInMp4)(G.audioCodec,"audio")}),Object(v.assignTrackIdsByGroup)(O)),i.subtitles&&(b=i.subtitles,Object(v.assignTrackIdsByGroup)(b)),k.length>0){E=k[0].bitrate,k.sort(function(G,F){return G.bitrate-F.bitrate}),this._levels=k;for(var V=0;V<k.length;V++)if(k[V].bitrate===E){this._firstLevel=V,this.log("manifest loaded, "+k.length+" level(s) found, first bitrate: "+E);break}var K=L&&!j,W={levels:k,audioTracks:O,subtitleTracks:b,firstLevel:this._firstLevel,stats:i.stats,audio:L,video:j,altAudio:!K&&O.some(function(G){return!!G.url})};this.hls.trigger(f.Events.MANIFEST_PARSED,W),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(f.Events.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:i.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(y,i){if(n.prototype.onError.call(this,y,i),i.fatal)return;var k=i.context,O=this._levels[this.currentLevelIndex];if(k&&(k.type===a.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&k.groupId===O.audioGroupIds[O.urlId]||k.type===a.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&k.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var b=!1,E=!0,x;switch(i.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:if(i.frag){var T=this._levels[i.frag.level];T?(T.fragmentError++,T.fragmentError>this.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.loadError<T)y.levelRetry=!0,this.redundantFailover(i);else if(this.manualLevelIndex===-1){var N=i===0?this._levels.length-1:i-1;this.currentLevelIndex!==N&&this._levels[N].loadError===0&&(this.warn(b+": switch to "+N),y.levelRetry=!0,this.hls.nextAutoLevel=N)}}},d.redundantFailover=function(y){var i=this._levels[y],k=i.url.length;if(k>1){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;E<k.audioGroupIds.length;E++)if(k.audioGroupIds[E]===b){O=E;break}O!==k.urlId&&(k.urlId=O,this.startLoad())}},d.loadPlaylist=function(y){var i=this.currentLevelIndex,k=this._levels[i];if(this.canLoad&&k&&k.url.length>0){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||L<s.startSN||L>s.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<W.length-1;V++)o(W[V],W[V+1]);return s.fragmentHint&&o(W[W.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,j}function r(s,d){for(var S=null,y=s.fragments,i=y.length-1;i>=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<T.length;N++)T[N].cc+=O}d.skippedSegments&&(d.startCC=d.fragments[0].cc),h(s.partList,d.partList,function(V,K){K.elementaryStreams=V.elementaryStreams,K.stats=V.stats}),b?a(d,b,b.startPTS,b.endPTS,b.startDTS,b.endDTS):p(s,d),T.length&&(d.totalduration=d.edge-T[0].start),d.driftStartTime=s.driftStartTime,d.driftStart=s.driftStart;var j=d.advancedDateTime;if(d.advanced&&j){var L=d.edge;d.driftStart||(d.driftStartTime=j,d.driftStart=L),d.driftEndTime=j,d.driftEnd=L}else d.driftEndTime=s.driftEndTime,d.driftEnd=s.driftEnd,d.advancedDateTime=s.advancedDateTime}function h(s,d,S){if(s&&d)for(var y=0,i=0,k=s.length;i<=k;i++){var O=s[i],b=d[i+y];O&&b&&O.index===b.index&&O.fragment.sn===b.fragment.sn?S(O,b):y--}}function m(s,d,S){for(var y=d.skippedSegments,i=Math.max(s.startSN,d.startSN)-d.startSN,k=(s.fragmentHint?1:0)+(y?d.endSN:Math.min(s.endSN,d.endSN))-d.startSN,O=d.startSN-s.startSN,b=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,E=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,x=i;x<=k;x++){var T=E[O+x],N=b[x];y&&!N&&x<y&&(N=d.fragments[x]=T),T&&N&&S(T,N)}}function p(s,d){var S=d.startSN+d.skippedSegments-s.startSN,y=s.fragments;if(S<0||S>=y.length)return;w(d,y[S].start)}function w(s,d){if(d){for(var S=s.fragments,y=s.skippedSegments;y<S.length;y++)S[y].start+=d;s.fragmentHint&&(s.fragmentHint.start+=d)}}function g(s,d){var S=1e3*s.levelTargetDuration,y=S/2,i=s.age,k=i>0&&i<S*3,O=d.loading.end-d.loading.start,b,E=s.availabilityDelay;if(s.updated===!1)if(k){var x=333*s.misses;b=Math.max(Math.min(y,O*2),x),s.availabilityDelay=(s.availabilityDelay||0)+b}else b=y;else k?(E=Math.min(E||S/2,i),s.availabilityDelay=E,b=E+S-i):b=S-O;return Math.round(b)}function c(s,d,S){if(!s||!s.details)return null;var y=s.details,i=y.fragments[d-y.startSN];return i||(i=y.fragmentHint,i&&i.sn===d?i:d<y.startSN&&S&&S.sn===d?S:null)}function n(s,d,S){if(!s||!s.details)return null;var y=s.details.partList;if(y)for(var i=y.length;i--;){var k=y[i];if(k.index===S&&k.fragment.sn===d)return k}return null}},"./src/controller/stream-controller.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return y});var D=_("./src/polyfills/number.ts"),f=_("./src/controller/base-stream-controller.ts"),l=_("./src/is-supported.ts"),C=_("./src/events.ts"),v=_("./src/utils/buffer-helper.ts"),o=_("./src/controller/fragment-tracker.ts"),a=_("./src/types/loader.ts"),r=_("./src/loader/fragment.ts"),h=_("./src/demux/transmuxer-interface.ts"),m=_("./src/types/transmuxer.ts"),p=_("./src/controller/gap-controller.ts"),w=_("./src/errors.ts"),g=_("./src/utils/logger.ts");function c(i,k){for(var O=0;O<k.length;O++){var b=k[O];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(i,b.key,b)}}function n(i,k,O){return k&&c(i.prototype,k),O&&c(i,O),i}function s(i,k){i.prototype=Object.create(k.prototype),i.prototype.constructor=i,d(i,k)}function d(i,k){return d=Object.setPrototypeOf||function(b,E){return b.__proto__=E,b},d(i,k)}var S=100,y=function(i){s(k,i);function k(b,E){var x;return x=i.call(this,b,E,"[stream-controller]")||this,x.audioCodecSwap=!1,x.gapController=null,x.level=-1,x._forceStartLoad=!1,x.altAudio=!1,x.audioOnly=!1,x.fragPlaying=null,x.onvplaying=null,x.onvseeked=null,x.fragLastKbps=0,x.stalled=!1,x.couldBacktrack=!1,x.audioCodecSwitch=!1,x.videoBuffer=null,x._registerListeners(),x}var O=k.prototype;return O._registerListeners=function(){var E=this.hls;E.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(C.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(C.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.on(C.Events.ERROR,this.onError,this),E.on(C.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(C.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(C.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(C.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(C.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.on(C.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var E=this.hls;E.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(C.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.off(C.Events.ERROR,this.onError,this),E.off(C.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(C.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(C.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(C.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(C.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.off(C.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(E){if(this.levels){var x=this.lastCurrentTime,T=this.hls;if(this.stopLoad(),this.setInterval(S),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var N=T.startLevel;N===-1&&(T.config.testBandwidth?(N=0,this.bitrateTest=!0):N=T.nextAutoLevel),this.level=T.nextLoadLevel=N,this.loadedmetadata=!1}x>0&&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&&x<T){if(E.seeking){g.logger.log("could not seek to "+T+", already seeking at "+x);return}var N=v.BufferHelper.getBuffered(E),j=N.length?N.start(0):0,L=j-T;L>0&&(L<this.config.maxBufferHole||L<this.config.maxFragLookUpTolerance)&&(g.logger.log("adjusting start position by "+L+" to match buffer start"),T+=L,this.startPosition=T),this.log("seek to target start position "+T+" from current time "+x),E.currentTime=T}},O._getAudioCodec=function(E){var x=this.config.defaultAudioCodec||E.audioCodec;return this.audioCodecSwap&&x&&(this.log("Swapping audio codec"),x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),x},O._loadBitrateTestFrag=function(E){var x=this;this._doFragLoad(E).then(function(T){var N=x.hls;if(!T||N.nextLoadLevel||x.fragContextChanged(E))return;x.fragLoadError=0,x.state=f.State.IDLE,x.startFragRequested=!1,x.bitrateTest=!1;var j=E.stats;j.parsing.start=j.parsing.end=j.buffering.start=j.buffering.end=self.performance.now(),N.trigger(C.Events.FRAG_LOADED,T)})},O._handleTransmuxComplete=function(E){var x,T="main",N=this.hls,j=E.remuxResult,L=E.chunkMeta,V=this.getCurrentContext(L);if(!V){this.warn("The loading context changed while buffering fragment "+L.sn+" of level "+L.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(L.level);return}var K=V.frag,W=V.part,G=V.level,F=j.video,B=j.text,H=j.id3,q=j.initSegment,re=this.altAudio?void 0:j.audio;if(this.fragContextChanged(K))return;if(this.state=f.State.PARSING,q){q.tracks&&(this._bufferInitSegment(G,q.tracks,K,L),N.trigger(C.Events.FRAG_PARSING_INIT_SEGMENT,{frag:K,id:T,tracks:q.tracks}));var ee=q.initPTS,Ce=q.timescale;Object(D.isFiniteNumber)(ee)&&(this.initPTS[K.cc]=ee,N.trigger(C.Events.INIT_PTS_FOUND,{frag:K,id:T,initPTS:ee,timescale:Ce}))}if(F&&j.independent!==!1){if(G.details){var Ee=F.startPTS,pe=F.endPTS,Me=F.startDTS,_e=F.endDTS;if(W)W.elementaryStreams[F.type]={startPTS:Ee,endPTS:pe,startDTS:Me,endDTS:_e};else if(F.firstKeyFrame&&F.independent&&(this.couldBacktrack=!0),F.dropped&&F.independent){var he=this.getLoadPosition()+this.config.maxBufferHole;if(he<Ee){this.backtrack(K);return}K.setElementaryStreamInfo(F.type,K.start,pe,K.start,_e,!0)}K.setElementaryStreamInfo(F.type,Ee,pe,Me,_e),this.bufferFragmentData(F,K,W,L)}}else if(j.independent===!1){this.backtrack(K);return}if(re){var ce=re.startPTS,oe=re.endPTS,Se=re.startDTS,te=re.endDTS;W&&(W.elementaryStreams[r.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:oe,startDTS:Se,endDTS:te}),K.setElementaryStreamInfo(r.ElementaryStreamTypes.AUDIO,ce,oe,Se,te),this.bufferFragmentData(re,K,W,L)}if(H!=null&&(x=H.samples)!==null&&x!==void 0&&x.length){var ue={frag:K,id:T,samples:H.samples};N.trigger(C.Events.FRAG_PARSING_METADATA,ue)}if(B){var Oe={frag:K,id:T,samples:B.samples};N.trigger(C.Events.FRAG_PARSING_USERDATA,Oe)}},O._bufferInitSegment=function(E,x,T,N){var j=this;if(this.state!==f.State.PARSING)return;this.audioOnly=!!x.audio&&!x.video,this.altAudio&&!this.audioOnly&&delete x.audio;var L=x.audio,V=x.video,K=x.audiovideo;if(L){var W=E.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(W&&(W.indexOf("mp4a.40.5")!==-1?W="mp4a.40.2":W="mp4a.40.5"),L.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(W="mp4a.40.5")),G.indexOf("android")!==-1&&L.container!=="audio/mpeg"&&(W="mp4a.40.2",this.log("Android: force audio codec to "+W)),E.audioCodec&&E.audioCodec!==W&&this.log('Swapping manifest audio codec "'+E.audioCodec+'" for "'+W+'"'),L.levelCodec=W,L.id="main",this.log("Init audio buffer, container:"+L.container+", codecs[selected/level/parsed]=["+(W||"")+"/"+(E.audioCodec||"")+"/"+L.codec+"]")}V&&(V.levelCodec=E.videoCodec,V.id="main",this.log("Init video buffer, container:"+V.container+", codecs[level/parsed]=["+(E.videoCodec||"")+"/"+V.codec+"]")),K&&this.log("Init audiovideo buffer, container:"+K.container+", codecs[level/parsed]=["+(E.attrs.CODECS||"")+"/"+K.codec+"]"),this.hls.trigger(C.Events.BUFFER_CODECS,x),Object.keys(x).forEach(function(F){var B=x[F],H=B.initSegment;H!=null&&H.byteLength&&j.hls.trigger(C.Events.BUFFER_APPENDING,{type:F,data:H,frag:T,part:null,chunkMeta:N,parent:T.type})}),this.tick()},O.backtrack=function(E){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(E);var x=this.fragmentTracker.backtrack(E);this.fragPrevious=null,this.nextLoadPosition=E.start,x?this.resetFragmentLoading(E):this.state=f.State.BACKTRACKING},O.checkFragmentChanged=function(){var E=this.media,x=null;if(E&&E.readyState>1&&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<S.length;y++){var i=S[y];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(d,i.key,i)}}function w(d,S,y){return S&&p(d.prototype,S),y&&p(d,y),d}function g(d,S){d.prototype=Object.create(S.prototype),d.prototype.constructor=d,c(d,S)}function c(d,S){return c=Object.setPrototypeOf||function(i,k){return i.__proto__=k,i},c(d,S)}var n=500,s=function(d){g(S,d);function S(i,k){var O;return O=d.call(this,i,k,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var y=S.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var k=this.hls;k.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),k.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),k.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),k.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),k.on(D.Events.ERROR,this.onError,this),k.on(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),k.on(D.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),k.on(D.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),k.on(D.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),k.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},y._unregisterListeners=function(){var k=this.hls;k.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),k.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),k.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),k.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),k.off(D.Events.ERROR,this.onError,this),k.off(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),k.off(D.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),k.off(D.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),k.off(D.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),k.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},y.startLoad=function(){this.stopLoad(),this.state=r.State.IDLE,this.setInterval(n),this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},y.onLevelLoaded=function(k,O){this.mainDetails=O.details},y.onSubtitleFragProcessed=function(k,O){var b=O.frag,E=O.success;if(this.fragPrevious=b,this.state=r.State.IDLE,!E)return;var x=this.tracksBuffered[this.currentTrackId];if(!x)return;for(var T,N=b.start,j=0;j<x.length;j++)if(N>=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<V.length;){if(V[K].end<=L){V.shift();continue}else if(V[K].start<L)V[K].start=L;else break;K++}}),this.fragmentTracker.removeFragmentsInRange(b,L,h.PlaylistLevelType.SUBTITLE)}},y.onError=function(k,O){var b,E=O.frag;if(!E||E.type!==h.PlaylistLevelType.SUBTITLE)return;(b=this.fragCurrent)!==null&&b!==void 0&&b.loader&&this.fragCurrent.loader.abort(),this.state=r.State.IDLE},y.onSubtitleTracksUpdated=function(k,O){var b=this,E=O.subtitleTracks;this.tracksBuffered=[],this.levels=E.map(function(x){return new m.Level(x)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(x){b.tracksBuffered[x.id]=[]}),this.mediaBuffer=null},y.onSubtitleTrackSwitch=function(k,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var b=this.levels[this.currentTrackId];b!=null&&b.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,b&&this.setInterval(n)},y.onSubtitleTrackLoaded=function(k,O){var b,E=O.details,x=O.id,T=this.currentTrackId,N=this.levels;if(!N.length)return;var j=N[T];if(x>=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<F){var q=T.maxFragLookUpTolerance;H&&E.hasProgramDateTime&&(B=Object(C.findFragmentByPDT)(W,H.endProgramDateTime,q)),B||(B=Object(C.findFragmentByPTS)(H,W,L,q),!B&&H&&H.start<W[0].start&&(B=W[0]))}else B=W[G-1];(k=B)!==null&&k!==void 0&&k.encrypted?(f.logger.log("Loading key for "+B.sn),this.state=r.State.KEY_LOADING,this.hls.trigger(D.Events.KEY_LOADING,{frag:B})):B&&this.fragmentTracker.getState(B)===a.FragmentState.NOT_LOADED&&this.loadFragment(B,E,L)}},y.loadFragment=function(k,O,b){this.fragCurrent=k,d.prototype.loadFragment.call(this,k,O,b)},w(S,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),S}(r.default)},"./src/controller/subtitle-track-controller.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/events.ts"),f=_("./src/utils/texttrack-utils.ts"),l=_("./src/controller/base-playlist-controller.ts"),C=_("./src/types/loader.ts");function v(p,w){for(var g=0;g<w.length;g++){var c=w[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(p,c.key,c)}}function o(p,w,g){return w&&v(p.prototype,w),g&&v(p,g),p}function a(p,w){p.prototype=Object.create(w.prototype),p.prototype.constructor=p,r(p,w)}function r(p,w){return r=Object.setPrototypeOf||function(c,n){return c.__proto__=n,c},r(p,w)}var h=function(p){a(w,p);function w(c){var n;return n=p.call(this,c,"[subtitle-track-controller]")||this,n.media=null,n.tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.selectDefaultTrack=!0,n.queuedDefaultTrack=-1,n.trackChangeListener=function(){return n.onTextTracksChanged()},n.asyncPollTrackChange=function(){return n.pollTrackChange(0)},n.useTextTrackPolling=!1,n.subtitlePollingInterval=-1,n.subtitleDisplay=!0,n.registerListeners(),n}var g=w.prototype;return g.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,p.prototype.destroy.call(this)},g.registerListeners=function(){var n=this.hls;n.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(D.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(D.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(D.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){var n=this.hls;n.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(D.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(D.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(D.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(D.Events.ERROR,this.onError,this)},g.onMediaAttached=function(n,s){if(this.media=s.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},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;d++){var S=s[d];if((!this.selectDefaultTrack||S.default)&&(!n||n===S.name))return S.id}return-1},g.onError=function(n,s){if(p.prototype.onError.call(this,n,s),s.fatal||!s.context)return;s.context.type===C.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},g.loadPlaylist=function(n){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var d=s.id,S=s.groupId,y=s.url;if(n)try{y=n.addDirectives(y)}catch(i){this.warn("Could not construct new URL with HLS Delivery Directives: "+i)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(D.Events.SUBTITLE_TRACK_LOADING,{url:y,id:d,groupId:S,deliveryDirectives:n||null})}},g.toggleTrackModes=function(n){var s=this,d=this.media,S=this.subtitleDisplay,y=this.trackId;if(!d)return;var i=m(d.textTracks),k=i.filter(function(E){return E.groupId===s.groupId});if(n===-1)[].slice.call(i).forEach(function(E){E.mode="disabled"});else{var O=k[y];O&&(O.mode="disabled")}var b=k[n];b&&(b.mode=S?"showing":"hidden")},g.setSubtitleTrack=function(n,s){var d,S=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=n;return}if(this.trackId!==n&&this.toggleTrackModes(n),this.trackId===n&&(n===-1||(d=S[n])!==null&&d!==void 0&&d.details)||n<-1||n>=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<s.length;d++)if(s[d].mode==="hidden")n=d;else if(s[d].mode==="showing"){n=d;break}this.subtitleTrack!==n&&(this.subtitleTrack=n)},o(w,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(n,s)}}]),w}(l.default);function m(p){for(var w=[],g=0;g<p.length;g++){var c=p[g];c.kind==="subtitles"&&c.label&&w.push(p[g])}return w}u.default=h},"./src/controller/timeline-controller.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"TimelineController",function(){return m});var D=_("./src/polyfills/number.ts"),f=_("./src/events.ts"),l=_("./src/utils/cea-608-parser.ts"),C=_("./src/utils/output-filter.ts"),v=_("./src/utils/webvtt-parser.ts"),o=_("./src/utils/texttrack-utils.ts"),a=_("./src/utils/imsc1-ttml-parser.ts"),r=_("./src/types/loader.ts"),h=_("./src/utils/logger.ts"),m=function(){function c(s){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=g(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var d=new C.default(this,"textTrack1"),S=new C.default(this,"textTrack2"),y=new C.default(this,"textTrack3"),i=new C.default(this,"textTrack4");this.cea608Parser1=new l.default(1,d,S),this.cea608Parser2=new l.default(3,y,i)}s.on(f.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(f.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(f.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(f.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(f.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(f.Events.FRAG_LOADING,this.onFragLoading,this),s.on(f.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(f.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(f.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(f.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(f.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(f.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=c.prototype;return n.destroy=function(){var d=this.hls;d.off(f.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(f.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(f.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(f.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(f.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(f.Events.FRAG_LOADING,this.onFragLoading,this),d.off(f.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(f.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(f.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(f.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(f.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(f.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(d,S,y,i,k){for(var O=!1,b=k.length;b--;){var E=k[b],x=w(E[0],E[1],S,y);if(x>=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<S.textTracks.length;y++){var i=S.textTracks[y];if(i[d])return i}return null},n.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},n.createNativeTrack=function(d){if(this.captionsTracks[d])return;var S=this.captionsProperties,y=this.captionsTracks,i=this.media,k=S[d],O=k.label,b=k.languageCode,E=this.getExistingTrack(d);if(E)y[d]=E,Object(o.clearCurrentCues)(y[d]),Object(o.sendAddTrackEvent)(y[d],i);else{var x=this.createTextTrack("captions",O,b);x&&(x[d]=!0,y[d]=x)}},n.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var S=this.captionsProperties[d];if(!S)return;var y=S.label,i={_id:d,label:y,kind:"captions",default:S.media?!!S.media.default:!1,closedCaptions:S.media};this.nonNativeCaptionsTracks[d]=i,this.hls.trigger(f.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})},n.createTextTrack=function(d,S,y){var i=this.media;return i?i.addTextTrack(d,S,y):void 0},n.onMediaAttaching=function(d,S){this.media=S.media,this._cleanTracks()},n.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(S){Object(o.clearCurrentCues)(d[S]),delete d[S]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=g(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},n._cleanTracks=function(){var d=this.media;if(!d)return;var S=d.textTracks;if(S)for(var y=0;y<S.length;y++)Object(o.clearCurrentCues)(S[y])},n.onSubtitleTracksUpdated=function(d,S){var y=this;this.textTracks=[];var i=S.subtitleTracks||[],k=i.some(function(x){return x.textCodec===a.IMSC1_CODEC});if(this.config.enableWebVTT||k&&this.config.enableIMSC1){var O=this.tracks&&i&&this.tracks.length===i.length;if(this.tracks=i||[],this.config.renderTextTracksNatively){var b=this.media?this.media.textTracks:[];this.tracks.forEach(function(x,T){var N;if(T<b.length){for(var j=null,L=0;L<b.length;L++)if(p(b[L],x)){j=b[L];break}j&&(N=j)}N?Object(o.clearCurrentCues)(N):(N=y.createTextTrack("subtitles",x.name,x.lang),N&&(N.mode="disabled")),N&&(N.groupId=x.groupId,y.textTracks.push(N))})}else if(!O&&this.tracks&&this.tracks.length){var E=this.tracks.map(function(x){return{label:x.name,kind:x.type.toLowerCase(),default:x.default,subtitleTrack:x}});this.hls.trigger(f.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:E})}}},n.onManifestLoaded=function(d,S){var y=this;this.config.enableCEA708Captions&&S.captions&&S.captions.forEach(function(i){var k=/(?:CC|SERVICE)([1-4])/.exec(i.instreamId);if(!k)return;var O="textTrack"+k[1],b=y.captionsProperties[O];if(!b)return;b.label=i.name,i.lang&&(b.languageCode=i.lang),b.media=i})},n.onFragLoading=function(d,S){var y=this.cea608Parser1,i=this.cea608Parser2,k=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(y&&i))return;if(S.frag.type===r.PlaylistLevelType.MAIN){var b,E,x=S.frag.sn,T=(b=S==null||((E=S.part)===null||E===void 0)?void 0:E.index)!=null?b:-1;x===k+1||x===k&&T===O+1||(y.reset(),i.reset()),this.lastSn=x,this.lastPartIndex=T}},n.onFragLoaded=function(d,S){var y=S.frag,i=S.payload,k=this.initPTS,O=this.unparsedVttFrags;if(y.type===r.PlaylistLevelType.SUBTITLE)if(i.byteLength){if(!Object(D.isFiniteNumber)(k[y.cc])){O.push(S),k.length&&this.hls.trigger(f.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:y,error:new Error("Missing initial subtitle PTS")});return}var b=y.decryptdata;if(b==null||b.key==null||b.method!=="AES-128"){var E=this.tracks[y.level],x=this.vttCCs;x[y.cc]||(x[y.cc]={start:y.start,prevCC:this.prevCC,new:!0},this.prevCC=y.cc),E&&E.textCodec===a.IMSC1_CODEC?this._parseIMSC1(y,i):this._parseVTTs(y,i,x)}}else this.hls.trigger(f.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:y,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(d,S){var y=this,i=this.hls;Object(a.parseIMSC1)(S,this.initPTS[d.cc],this.timescale[d.cc],function(k){y._appendCues(k,d.level),i.trigger(f.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(k){h.logger.log("Failed to parse IMSC1: "+k),i.trigger(f.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:k})})},n._parseVTTs=function(d,S,y){var i=this,k=this.hls;Object(v.parseWebVTT)(S,this.initPTS[d.cc],this.timescale[d.cc],y,d.cc,d.start,function(O){i._appendCues(O,d.level),k.trigger(f.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(O){i._fallbackToIMSC1(d,S),h.logger.log("Failed to parse VTT cue: "+O),k.trigger(f.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:O})})},n._fallbackToIMSC1=function(d,S){var y=this,i=this.tracks[d.level];i.textCodec||Object(a.parseIMSC1)(S,this.initPTS[d.cc],this.timescale[d.cc],function(){i.textCodec=a.IMSC1_CODEC,y._parseIMSC1(d,S)},function(){i.textCodec="wvtt"})},n._appendCues=function(d,S){var y=this.hls;if(this.config.renderTextTracksNatively){var i=this.textTracks[S];if(i.mode==="disabled")return;d.forEach(function(b){return Object(o.addCueToTrack)(i,b)})}else{var k=this.tracks[S],O=k.default?"default":"subtitles"+S;y.trigger(f.Events.CUES_PARSED,{type:"subtitles",cues:d,track:O})}},n.onFragDecrypted=function(d,S){var y=S.frag;if(y.type===r.PlaylistLevelType.SUBTITLE){if(!Object(D.isFiniteNumber)(this.initPTS[y.cc])){this.unparsedVttFrags.push(S);return}this.onFragLoaded(f.Events.FRAG_LOADED,S)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(d,S){var y=this.cea608Parser1,i=this.cea608Parser2;if(!this.enabled||!(y&&i))return;for(var k=0;k<S.samples.length;k++){var O=S.samples[k].bytes;if(O){var b=this.extractCea608Data(O);y.addData(S.samples[k].pts,b[0]),i.addData(S.samples[k].pts,b[1])}}},n.onBufferFlushing=function(d,S){var y=S.startOffset,i=S.endOffset,k=S.endOffsetSubtitles,O=S.type,b=this.media;if(!b||b.currentTime<i)return;if(!O||O==="video"){var E=this.captionsTracks;Object.keys(E).forEach(function(T){return Object(o.removeCuesInRange)(E[T],y,i)})}if(this.config.renderTextTracksNatively&&(y===0&&k!==void 0)){var x=this.textTracks;Object.keys(x).forEach(function(T){return Object(o.removeCuesInRange)(x[T],y,k)})}},n.extractCea608Data=function(d){for(var S=d[0]&31,y=2,i=[[],[]],k=0;k<S;k++){var O=d[y++],b=127&d[y++],E=127&d[y++],x=(4&O)!==0,T=3&O;if(b===0&&E===0)continue;x&&((T===0||T===1)&&(i[T].push(b),i[T].push(E)))}return i},c}();function p(c,n){return c&&c.label===n.name&&!(c.textTrack1||c.textTrack2)}function w(c,n,s,d){return Math.min(n,d)-Math.max(c,s)}function g(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return D});var D=function(){function f(C,v){this.subtle=void 0,this.aesIV=void 0,this.subtle=C,this.aesIV=v}var l=f.prototype;return l.decrypt=function(v,o){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},o,v)},f}()},"./src/crypt/aes-decryptor.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"removePadding",function(){return f}),_.d(u,"default",function(){return l});var D=_("./src/utils/typed-array.ts");function f(C){var v=C.byteLength,o=v&&new DataView(C.buffer).getUint8(v-1);return o?Object(D.sliceUint8)(C,0,v-o):C}var l=function(){function C(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var v=C.prototype;return v.uint8ArrayToUint32Array_=function(a){for(var r=new DataView(a),h=new Uint32Array(4),m=0;m<4;m++)h[m]=r.getUint32(m*4);return h},v.initTable=function(){var a=this.sBox,r=this.invSBox,h=this.subMix,m=h[0],p=h[1],w=h[2],g=h[3],c=this.invSubMix,n=c[0],s=c[1],d=c[2],S=c[3],y=new Uint32Array(256),i=0,k=0,O=0;for(O=0;O<256;O++)O<128?y[O]=O<<1:y[O]=O<<1^283;for(O=0;O<256;O++){var b=k^k<<1^k<<2^k<<3^k<<4;b=b>>>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<r.length&&h;)h=r[m]===this.key[m],m++;if(h)return;this.key=r;var p=this.keySize=r.length;if(p!==4&&p!==6&&p!==8)throw new Error("Invalid aes key size="+p);var w=this.ksRows=(p+6+1)*4,g,c,n=this.keySchedule=new Uint32Array(w),s=this.invKeySchedule=new Uint32Array(w),d=this.sBox,S=this.rcon,y=this.invSubMix,i=y[0],k=y[1],O=y[2],b=y[3],E,x;for(g=0;g<w;g++){if(g<p){E=n[g]=r[g];continue}x=E,g%p===0?(x=x<<8|x>>>24,x=d[x>>>24]<<24|d[x>>>16&255]<<16|d[x>>>8&255]<<8|d[x&255],x^=S[g/p|0]<<24):p>6&&g%p===4&&(x=d[x>>>24]<<24|d[x>>>16&255]<<16|d[x>>>8&255]<<8|d[x&255]),n[g]=E=(n[g-p]^x)>>>0}for(c=0;c<w;c++)g=w-c,c&3?x=n[g]:x=n[g-4],c<4||g<=4?s[c]=x:s[c]=i[d[x>>>24]]^k[d[x>>>16&255]]^O[d[x>>>8&255]]^b[d[x&255]],s[c]=s[c]>>>0},v.networkToHostOrderSwap=function(a){return a<<24|(a&65280)<<8|(a&16711680)>>8|a>>>24},v.decrypt=function(a,r,h){for(var m=this.keySize+6,p=this.invKeySchedule,w=this.invSBox,g=this.invSubMix,c=g[0],n=g[1],s=g[2],d=g[3],S=this.uint8ArrayToUint32Array_(h),y=S[0],i=S[1],k=S[2],O=S[3],b=new Int32Array(a),E=new Int32Array(b.length),x,T,N,j,L,V,K,W,G,F,B,H,q,re,ee=this.networkToHostOrderSwap;r<b.length;){for(G=ee(b[r]),F=ee(b[r+1]),B=ee(b[r+2]),H=ee(b[r+3]),L=G^p[0],V=H^p[1],K=B^p[2],W=F^p[3],q=4,re=1;re<m;re++)x=c[L>>>24]^n[V>>16&255]^s[K>>8&255]^d[W&255]^p[q],T=c[V>>>24]^n[K>>16&255]^s[W>>8&255]^d[L&255]^p[q+1],N=c[K>>>24]^n[W>>16&255]^s[L>>8&255]^d[V&255]^p[q+2],j=c[W>>>24]^n[L>>16&255]^s[V>>8&255]^d[K&255]^p[q+3],L=x,V=T,K=N,W=j,q=q+4;x=w[L>>>24]<<24^w[V>>16&255]<<16^w[K>>8&255]<<8^w[W&255]^p[q],T=w[V>>>24]<<24^w[K>>16&255]<<16^w[W>>8&255]<<8^w[L&255]^p[q+1],N=w[K>>>24]<<24^w[W>>16&255]<<16^w[L>>8&255]<<8^w[V&255]^p[q+2],j=w[W>>>24]<<24^w[L>>16&255]<<16^w[V>>8&255]<<8^w[K&255]^p[q+3],E[r]=ee(x^y),E[r+1]=ee(j^i),E[r+2]=ee(N^k),E[r+3]=ee(T^O),y=G,i=F,k=B,O=H,r=r+4}return E.buffer},C}()},"./src/crypt/decrypter.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return r});var D=_("./src/crypt/aes-crypto.ts"),f=_("./src/crypt/fast-aes-key.ts"),l=_("./src/crypt/aes-decryptor.ts"),C=_("./src/utils/logger.ts"),v=_("./src/utils/mp4-tools.ts"),o=_("./src/utils/typed-array.ts"),a=16,r=function(){function h(p,w,g){var c=g===void 0?{}:g,n=c.removePKCS7Padding,s=n===void 0?!0:n;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=p,this.config=w,this.removePKCS7Padding=s,s)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(S){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var m=h.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var w=this.currentResult;if(!w){this.reset();return}var g=new Uint8Array(w);return this.reset(),this.removePKCS7Padding?Object(l.removePadding)(g):g},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(w,g,c,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(w),g,c);var s=this.flush();s&&n(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(w),g,c).then(n)},m.softwareDecrypt=function(w,g,c){var n=this.currentIV,s=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(w=Object(v.appendUint8Array)(d,w),this.remainderData=null);var S=this.getValidChunk(w);if(!S.length)return null;n&&(c=n);var y=this.softwareDecrypter;y||(y=this.softwareDecrypter=new l.default),y.expandKey(g);var i=s;return this.currentResult=y.decrypt(S.buffer,0,c),this.currentIV=Object(o.sliceUint8)(S,-16).buffer,i||null},m.webCryptoDecrypt=function(w,g,c){var n=this,s=this.subtle;return(this.key!==g||!this.fastAesKey)&&(this.key=g,this.fastAesKey=new f.default(s,g)),this.fastAesKey.expandKey().then(function(d){if(!s)return Promise.reject(new Error("web crypto not initialized"));var S=new D.default(s,c);return S.decrypt(w.buffer,d)}).catch(function(d){return n.onWebCryptoError(d,w,g,c)})},m.onWebCryptoError=function(w,g,c,n){return C.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",w),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(g,c,n)},m.getValidChunk=function(w){var g=w,c=w.length-w.length%a;return c!==w.length&&(g=Object(o.sliceUint8)(w,0,c),this.remainderData=Object(o.sliceUint8)(w,c)),g},m.logOnce=function(w){if(!this.logEnabled)return;C.logger.log("[decrypter.ts]: "+w),this.logEnabled=!1},h}()},"./src/crypt/fast-aes-key.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return D});var D=function(){function f(C,v){this.subtle=void 0,this.key=void 0,this.subtle=C,this.key=v}var l=f.prototype;return l.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},f}()},"./src/demux/aacdemuxer.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/demux/base-audio-demuxer.ts"),f=_("./src/demux/adts.ts"),l=_("./src/utils/logger.ts"),C=_("./src/demux/id3.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(p,w){var g;return g=r.call(this)||this,g.observer=void 0,g.config=void 0,g.observer=p,g.config=w,g}var m=h.prototype;return m.resetInitSegment=function(w,g,c){r.prototype.resetInitSegment.call(this,w,g,c),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:w,duration:c,inputTimeScale:9e4,dropped:0}},h.probe=function(w){if(!w)return!1;for(var g=C.getID3Data(w,0)||[],c=g.length,n=w.length;c<n;c++)if(f.probe(w,c))return l.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(w,g){return f.canParse(w,g)},m.appendFrame=function(w,g,c){f.initTrackConfig(w,this.observer,g,c,w.manifestCodec);var n=f.appendFrame(w,g,c,this.initPTS,this.frameIndex);if(n&&n.missing===0)return n},h}(D.default);a.minProbeByteLength=9,u.default=a},"./src/demux/adts.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"getAudioConfig",function(){return C}),_.d(u,"isHeaderPattern",function(){return v}),_.d(u,"getHeaderLength",function(){return o}),_.d(u,"getFullFrameLength",function(){return a}),_.d(u,"canGetFrameLength",function(){return r}),_.d(u,"isHeader",function(){return h}),_.d(u,"canParse",function(){return m}),_.d(u,"probe",function(){return p}),_.d(u,"initTrackConfig",function(){return w}),_.d(u,"getFrameDuration",function(){return g}),_.d(u,"parseFrameHeader",function(){return c}),_.d(u,"appendFrame",function(){return n});var D=_("./src/utils/logger.ts"),f=_("./src/errors.ts"),l=_("./src/events.ts");function C(s,d,S,y){var i,k,O,b,E=navigator.userAgent.toLowerCase(),x=y,T=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((d[S+2]&192)>>>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}function h(s,d){return d+1<s.length&&v(s,d)}function m(s,d){return r(s,d)&&v(s,d)&&a(s,d)<=s.length-d}function p(s,d){if(h(s,d)){var S=o(s,d);if(d+S>=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;c<i;){if(this.canParse(p,c)){var k=this.appendFrame(d,p,c);k?(this.frameIndex++,s=k.sample.pts,c+=k.length,n=c):c=i}else f.canParse(p,c)?(g=f.getID3Data(p,c),S.samples.push({pts:s,dts:s,data:g}),c+=g.length,n=c):c++;if(c===i&&n!==i){var O=Object(v.sliceUint8)(p,n);this.cachedData?this.cachedData=Object(C.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:d,avcTrack:Object(l.dummyTrack)(),id3Track:S,textTrack:Object(l.dummyTrack)()}},h.demuxSampleAes=function(p,w,g){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},h.flush=function(p){var w=this.cachedData;return w&&(this.cachedData=null,this.demux(w,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(l.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(l.dummyTrack)()}},h.destroy=function(){},r}(),a=function(h,m){return Object(D.isFiniteNumber)(h)?h*90:m*9e4};u.default=o},"./src/demux/chunk-cache.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return D});var D=function(){function l(){this.chunks=[],this.dataLength=0}var C=l.prototype;return C.push=function(o){this.chunks.push(o),this.dataLength+=o.length},C.flush=function(){var o=this.chunks,a=this.dataLength,r;if(o.length)o.length===1?r=o[0]:r=f(o,a);else return new Uint8Array(0);return this.reset(),r},C.reset=function(){this.chunks.length=0,this.dataLength=0},l}();function f(l,C){for(var v=new Uint8Array(C),o=0,a=0;a<l.length;a++){var r=l[a];v.set(r,o),o+=r.length}return v}},"./src/demux/dummy-demuxed-track.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"dummyTrack",function(){return D});function D(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/utils/logger.ts"),f=function(){function l(v){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=v,this.bytesAvailable=v.byteLength,this.word=0,this.bitsAvailable=0}var C=l.prototype;return C.loadWord=function(){var o=this.data,a=this.bytesAvailable,r=o.byteLength-a,h=new Uint8Array(4),m=Math.min(4,a);if(m===0)throw new Error("no bytes available");h.set(o.subarray(r,r+m)),this.word=new DataView(h.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},C.skipBits=function(o){var a;this.bitsAvailable>o?(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<<a|this.readBits(a):r},C.skipLZ=function(){var o;for(o=0;o<this.bitsAvailable;++o)if((this.word&2147483648>>>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;m<o;m++)r!==0&&(h=this.readEG(),r=(a+h+256)%256),a=r===0?a:r},C.readSPS=function(){var o=0,a=0,r=0,h=0,m,p,w,g=this.readUByte.bind(this),c=this.readBits.bind(this),n=this.readUEG.bind(this),s=this.readBoolean.bind(this),d=this.skipBits.bind(this),S=this.skipEG.bind(this),y=this.skipUEG.bind(this),i=this.skipScalingList.bind(this);g();var k=g();if(c(5),d(3),g(),y(),k===100||k===110||k===122||k===244||k===44||k===83||k===86||k===118||k===128){var O=n();if(O===3&&d(1),y(),y(),d(1),s())for(p=O!==3?8:12,w=0;w<p;w++)s()&&(w<6?i(16):i(64))}y();var b=n();if(b===0)n();else if(b===1)for(d(1),S(),S(),m=n(),w=0;w<m;w++)S();y(),d(1);var E=n(),x=n(),T=c(1);T===0&&d(1),d(1),s()&&(o=n(),a=n(),r=n(),h=n());var N=[1,1];if(s()&&s()){var j=g();switch(j){case 1:N=[1,1];break;case 2:N=[12,11];break;case 3:N=[10,11];break;case 4:N=[16,11];break;case 5:N=[40,33];break;case 6:N=[24,11];break;case 7:N=[20,11];break;case 8:N=[32,11];break;case 9:N=[80,33];break;case 10:N=[18,11];break;case 11:N=[15,11];break;case 12:N=[64,33];break;case 13:N=[160,99];break;case 14:N=[4,3];break;case 15:N=[3,2];break;case 16:N=[2,1];break;case 255:{N=[g()<<8|g(),g()<<8|g()];break}}}return{width:Math.ceil((E+1)*16-o*2-a*2),height:(2-T)*(x+1)*16-(T?2:4)*(r+h),pixelRatio:N}},C.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},l}();u.default=f},"./src/demux/id3.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"isHeader",function(){return D}),_.d(u,"isFooter",function(){return f}),_.d(u,"getID3Data",function(){return l}),_.d(u,"canParse",function(){return v}),_.d(u,"getTimeStamp",function(){return o}),_.d(u,"isTimeStampFrame",function(){return a}),_.d(u,"getID3Frames",function(){return h}),_.d(u,"decodeFrame",function(){return m}),_.d(u,"utf8ArrayToStr",function(){return n}),_.d(u,"testables",function(){return s});var D=function(i,k){return k+10<=i.length&&(i[k]===73&&i[k+1]===68&&i[k+2]===51&&(i[k+3]<255&&i[k+4]<255&&(i[k+6]<128&&i[k+7]<128&&i[k+8]<128&&i[k+9]<128)))},f=function(i,k){return k+10<=i.length&&(i[k]===51&&i[k+1]===68&&i[k+2]===73&&(i[k+3]<255&&i[k+4]<255&&(i[k+6]<128&&i[k+7]<128&&i[k+8]<128&&i[k+9]<128)))},l=function(i,k){for(var O=k,b=0;D(i,k);){b+=10;var E=C(i,k+6);b+=E,f(i,k+10)&&(b+=10),k+=b}return b>0?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<k.length;O++){var b=k[O];if(a(b))return c(b)}return},a=function(i){return i&&i.key==="PRIV"&&i.info==="com.apple.streaming.transportStreamTimestamp"},r=function(i){var k=String.fromCharCode(i[0],i[1],i[2],i[3]),O=C(i,4),b=10;return{type:k,size:O,data:i.subarray(b,b+O)}},h=function(i){for(var k=0,O=[];D(i,k);){var b=C(i,k+6);k+=10;for(var E=k+b;k+8<E;){var x=r(i.subarray(k)),T=m(x);T&&O.push(T),k+=x.size+10}f(i,k)&&(k+=10)}return O},m=function(i){return i.type==="PRIV"?p(i):i.type[0]==="W"?g(i):w(i)},p=function(i){if(i.size<2)return;var k=n(i.data,!0),O=new Uint8Array(i.data.subarray(k.length+1));return{key:i.type,info:k,data:O.buffer}},w=function(i){if(i.size<2)return;if(i.type==="TXXX"){var k=1,O=n(i.data.subarray(k),!0);k+=O.length+1;var b=n(i.data.subarray(k));return{key:i.type,info:O,data:b}}var E=n(i.data.subarray(1));return{key:i.type,data:E}},g=function(i){if(i.type==="WXXX"){if(i.size<2)return;var k=1,O=n(i.data.subarray(k),!0);k+=O.length+1;var b=n(i.data.subarray(k));return{key:i.type,info:O,data:b}}var E=n(i.data);return{key:i.type,data:E}},c=function(i){if(i.data.byteLength===8){var k=new Uint8Array(i.data),O=k[3]&1,b=(k[4]<<23)+(k[5]<<15)+(k[6]<<7)+k[7];return b/=45,O&&(b+=4772185884e-2),Math.round(b)}return},n=function(i,k){k===void 0&&(k=!1);var O=S();if(O){var b=O.decode(i);if(k){var E=b.indexOf("\0");return E!==-1?b.substring(0,E):b}return b.replace(/\0/g,"")}for(var x=i.length,T,N,j,L="",V=0;V<x;){if(T=i[V++],T===0&&k)return L;if(T===0||T===3)continue;switch(T>>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;c<n;c++)if(C.probe(w,c))return l.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(w,g){return C.canParse(w,g)},m.appendFrame=function(w,g,c){return this.initPTS===null?void 0:C.appendFrame(w,g,c,this.initPTS,this.frameIndex)},h}(D.default);a.minProbeByteLength=4,u.default=a},"./src/demux/mp4demuxer.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/utils/mp4-tools.ts"),f=_("./src/demux/dummy-demuxed-track.ts"),l=function(){function C(o,a){this.remainderData=null,this.config=void 0,this.config=a}var v=C.prototype;return v.resetTimeStamp=function(){},v.resetInitSegment=function(){},v.resetContiguity=function(){},C.probe=function(a){return Object(D.findBox)({data:a,start:0,end:Math.min(a.length,16384)},["moof"]).length>0},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<w.length&&r(w,g)}function m(w,g){var c=4;return r(w,g)&&c<=w.length-g}function p(w,g){if(g+1<w.length&&r(w,g)){var c=4,n=a(w,g),s=c;n!=null&&n.frameLength&&(s=n.frameLength);var d=g+s;return d===w.length||h(w,d)}return!1}},"./src/demux/sample-aes.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/crypt/decrypter.ts"),f=_("./src/demux/tsdemuxer.ts"),l=function(){function C(o,a,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new D.default(o,a,{removePKCS7Padding:!1})}var v=C.prototype;return v.decryptBuffer=function(a,r){this.decrypter.decrypt(a,this.keyData.key.buffer,this.keyData.iv.buffer,r)},v.decryptAacSample=function(a,r,h,m){var p=a[r].unit,w=p.subarray(16,p.length-p.length%16),g=w.buffer.slice(w.byteOffset,w.byteOffset+w.length),c=this;this.decryptBuffer(g,function(n){var s=new Uint8Array(n);p.set(s,16),m||c.decryptAacSamples(a,r+1,h)})},v.decryptAacSamples=function(a,r,h){for(;;r++){if(r>=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;q<re;q++)if(c[q].demux.probe(x)){H=c[q];break}H||(w.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:v.default,remux:h.default});var ee=this.demuxer,Ce=this.remuxer,Ee=H.remux,pe=H.demux;(!Ce||!(Ce instanceof Ee))&&(this.remuxer=new Ee(j,N,L,V)),(!ee||!(ee instanceof pe))&&(this.demuxer=new pe(j,N,L),this.probe=pe.probe),this.resetInitSegment(F,K,B,G),this.resetInitialTimestamp(W)},b.needsProbing=function(x,T,N){return!this.demuxer||!this.remuxer||T||N},b.getDecrypter=function(){var x=this.decrypter;return x||(x=this.decrypter=new l.default(this.observer,this.config)),x},O}();function d(O,b){var E=null;return O.byteLength>0&&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<b;){if(O[E]===71&&O[E+188]===71&&O[E+2*188]===71)return E;E++}return-1},y.createTrack=function(O,b){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:m[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?b:void 0}};var i=y.prototype;return i.resetInitSegment=function(O,b,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=y.createTrack("video",E),this._audioTrack=y.createTrack("audio",E),this._id3Track=y.createTrack("id3",E),this._txtTrack=y.createTrack("text",E),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=b,this._duration=E},i.resetTimeStamp=function(){},i.resetContiguity=function(){var O=this._audioTrack,b=this._avcTrack,E=this._id3Track;O&&(O.pesData=null),b&&(b.pesData=null),E&&(E.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},i.demux=function(O,b,E,x){E===void 0&&(E=!1),x===void 0&&(x=!1),E||(this.sampleAes=null);var T,N=this._avcTrack,j=this._audioTrack,L=this._id3Track,V=N.pid,K=N.pesData,W=j.pid,G=L.pid,F=j.pesData,B=L.pesData,H=!1,q=this.pmtParsed,re=this._pmtId,ee=O.length;if(this.remainderData&&(O=Object(a.appendUint8Array)(this.remainderData,O),ee=O.length,this.remainderData=null),ee<188&&!x)return this.remainderData=O,{audioTrack:j,avcTrack:N,id3Track:L,textTrack:this._txtTrack};var Ce=Math.max(0,y.syncOffset(O));ee-=(ee+Ce)%188,ee<O.byteLength&&!x&&(this.remainderData=new Uint8Array(O.buffer,ee,O.buffer.byteLength-ee));for(var Ee=Ce;Ee<ee;Ee+=188)if(O[Ee]===71){var pe=!!(O[Ee+1]&64),Me=((O[Ee+1]&31)<<8)+O[Ee+2],_e=(O[Ee+3]&48)>>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;oe<he;oe++)ce.push(F.readUByte()),ce.push(F.readUByte()),ce.push(F.readUByte());d(E._txtTrack.samples,{type:3,pts:O.pts,bytes:ce})}}}}}else if(B===5&&F.bytesAvailable!==0){if(q=!0,H>16){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<ue;le++)Oe[le]=F.readUByte();d(E._txtTrack.samples,{pts:O.pts,payloadType:B,uuid:Se.join(""),userData:Object(C.utf8ArrayToStr)(Oe),userDataBytes:Oe})}}else if(H<F.bytesAvailable)for(var Q=0;Q<H;Q++)F.readUByte()}break}case 7:if(L=!0,V=!0,N&&j&&(j.debug+="SPS "),!x.sps){var Y=new l.default(K.data),Z=Y.readSPS();x.width=Z.width,x.height=Z.height,x.pixelRatio=Z.pixelRatio,x.sps=[K.data],x.duration=E._duration;for(var be=K.data.subarray(1,4),ge="avc1.",Re=0;Re<3;Re++){var Ze=be[Re].toString(16);Ze.length<2&&(Ze="0"+Ze),ge+=Ze}x.codec=ge}break;case 8:L=!0,N&&j&&(j.debug+="PPS "),x.pps||(x.pps=[K.data]);break;case 9:L=!1,x.audFound=!0,j&&s(j,x),j=E.avcSample=w(!1,O.pts,O.dts,N?"AUD ":"");break;case 12:L=!1;break;default:L=!1,j&&(j.debug+="unknown NAL "+K.type+" ");break}if(j&&L){var qe=j.units;qe.push(K)}}),b&&j&&(s(j,x),this.avcSample=null)},i.getLastNalUnit=function(){var O,b=this.avcSample,E;if(!b||b.units.length===0){var x=this._avcTrack.samples;b=x[x.length-1]}if((O=b)!==null&&O!==void 0&&O.units){var T=b.units;E=T[T.length-1]}return E},i.parseAVCNALu=function(O){var b=O.byteLength,E=this._avcTrack,x=E.naluState||0,T=x,N=[],j=0,L,V,K,W=-1,G=0;for(x===-1&&(W=0,G=O[0]&31,x=0,j=1);j<b;){if(L=O[j++],!x){x=L?0:1;continue}if(x===1){x=L?0:2;continue}if(!L)x=3;else if(L===1){if(W>=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<b?(K=O[j]&31,W=j,G=K,x=0):x=-1}else x=0}if(W>=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;V<K-1&&!D.isHeader(T,V);V++);if(V!==b){var W,G;if(V<K-1?(W="AAC PES did not start with ADTS header,offset:"+V,G=!1):(W="no ADTS header found in AAC PES",G=!0),r.logger.warn("parsing error:"+W),this.observer.emit(o.Events.ERROR,o.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:G,reason:W}),G)return}D.initTrackConfig(E,this.observer,T,V,this.audioCodec);var F;if(O.pts!==void 0)F=O.pts;else if(x){var B=D.getFrameDuration(E.samplerate);F=x.sample.pts+B}else{r.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;V<K;)if(D.isHeader(T,V)){if(V+5<K){var q=D.appendFrame(E,T,V,F,H);if(q)if(q.missing)this.aacOverFlow=q;else{V+=q.length,H++;continue}}break}else V++},i.parseMPEGPES=function(O){var b=O.data,E=b.length,x=0,T=0,N=O.pts;if(N===void 0){r.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;T<E;)if(f.isHeader(b,T)){var j=f.appendFrame(this._audioTrack,b,T,N,x);if(j)T+=j.length,x++;else break}else T++},i.parseID3PES=function(O){if(O.pts===void 0){r.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},y}();p.minProbeByteLength=188;function w(y,i,k,O){return{key:y,frame:!1,pts:i,dts:k,units:[],debug:O,length:0}}function g(y,i){return(y[i+10]&31)<<8|y[i+11]}function c(y,i,k,O){var b={audio:-1,avc:-1,id3:-1,isAAC:!0},E=(y[i+1]&15)<<8|y[i+2],x=i+3+E-4,T=(y[i+10]&15)<<8|y[i+11];for(i+=12+T;i<x;){var N=(y[i+1]&31)<<8|y[i+2];switch(y[i]){case 207:if(!O){r.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:b.audio===-1&&(b.audio=N);break;case 21:b.id3===-1&&(b.id3=N);break;case 219:if(!O){r.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:b.avc===-1&&(b.avc=N);break;case 3:case 4:k?b.audio===-1&&(b.audio=N,b.isAAC=!1):r.logger.log("MPEG audio found, not supported in this browser");break;case 36:r.logger.warn("Unsupported HEVC stream type found");break;default:break}i+=((y[i+3]&15)<<8|y[i+4])+5}return b}function n(y){var i=0,k,O,b,E,x,T=y.data;if(!y||y.size===0)return null;for(;T[0].length<19&&T.length>1;){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;W<G;W++){k=T[W];var F=k.byteLength;if(V)if(V>F){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.pts<y[O].pts){y.splice(O,0,i);break}}else y.push(i)}function S(y){for(var i=y.byteLength,k=[],O=1;O<i-2;)y[O]===0&&y[O+1]===0&&y[O+2]===3?(k.push(O+2),O+=2):O++;if(k.length===0)return y;var b=i-k.length,E=new Uint8Array(b),x=0;for(O=0;O<b;x++,O++)x===k[0]&&(x++,k.shift()),E[O]=y[x];return E}u.default=p},"./src/errors.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"ErrorTypes",function(){return D}),_.d(u,"ErrorDetails",function(){return f});var D;(function(l){l.NETWORK_ERROR="networkError",l.MEDIA_ERROR="mediaError",l.KEY_SYSTEM_ERROR="keySystemError",l.MUX_ERROR="muxError",l.OTHER_ERROR="otherError"})(D||(D={}));var f;(function(l){l.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",l.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",l.KEY_SYSTEM_NO_SESSION="keySystemNoSession",l.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",l.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",l.MANIFEST_LOAD_ERROR="manifestLoadError",l.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",l.MANIFEST_PARSING_ERROR="manifestParsingError",l.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",l.LEVEL_EMPTY_ERROR="levelEmptyError",l.LEVEL_LOAD_ERROR="levelLoadError",l.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",l.LEVEL_SWITCH_ERROR="levelSwitchError",l.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",l.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",l.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",l.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",l.FRAG_LOAD_ERROR="fragLoadError",l.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",l.FRAG_DECRYPT_ERROR="fragDecryptError",l.FRAG_PARSING_ERROR="fragParsingError",l.REMUX_ALLOC_ERROR="remuxAllocError",l.KEY_LOAD_ERROR="keyLoadError",l.KEY_LOAD_TIMEOUT="keyLoadTimeOut",l.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",l.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",l.BUFFER_APPEND_ERROR="bufferAppendError",l.BUFFER_APPENDING_ERROR="bufferAppendingError",l.BUFFER_STALLED_ERROR="bufferStalledError",l.BUFFER_FULL_ERROR="bufferFullError",l.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",l.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",l.INTERNAL_EXCEPTION="internalException",l.INTERNAL_ABORTED="aborted",l.UNKNOWN="unknown"})(f||(f={}))},"./src/events.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"Events",function(){return D});var D;(function(f){f.MEDIA_ATTACHING="hlsMediaAttaching",f.MEDIA_ATTACHED="hlsMediaAttached",f.MEDIA_DETACHING="hlsMediaDetaching",f.MEDIA_DETACHED="hlsMediaDetached",f.BUFFER_RESET="hlsBufferReset",f.BUFFER_CODECS="hlsBufferCodecs",f.BUFFER_CREATED="hlsBufferCreated",f.BUFFER_APPENDING="hlsBufferAppending",f.BUFFER_APPENDED="hlsBufferAppended",f.BUFFER_EOS="hlsBufferEos",f.BUFFER_FLUSHING="hlsBufferFlushing",f.BUFFER_FLUSHED="hlsBufferFlushed",f.MANIFEST_LOADING="hlsManifestLoading",f.MANIFEST_LOADED="hlsManifestLoaded",f.MANIFEST_PARSED="hlsManifestParsed",f.LEVEL_SWITCHING="hlsLevelSwitching",f.LEVEL_SWITCHED="hlsLevelSwitched",f.LEVEL_LOADING="hlsLevelLoading",f.LEVEL_LOADED="hlsLevelLoaded",f.LEVEL_UPDATED="hlsLevelUpdated",f.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",f.LEVELS_UPDATED="hlsLevelsUpdated",f.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",f.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",f.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",f.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",f.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",f.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",f.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",f.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",f.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",f.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",f.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",f.CUES_PARSED="hlsCuesParsed",f.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",f.INIT_PTS_FOUND="hlsInitPtsFound",f.FRAG_LOADING="hlsFragLoading",f.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",f.FRAG_LOADED="hlsFragLoaded",f.FRAG_DECRYPTED="hlsFragDecrypted",f.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",f.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",f.FRAG_PARSING_METADATA="hlsFragParsingMetadata",f.FRAG_PARSED="hlsFragParsed",f.FRAG_BUFFERED="hlsFragBuffered",f.FRAG_CHANGED="hlsFragChanged",f.FPS_DROP="hlsFpsDrop",f.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",f.ERROR="hlsError",f.DESTROYING="hlsDestroying",f.KEY_LOADING="hlsKeyLoading",f.KEY_LOADED="hlsKeyLoaded",f.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",f.BACK_BUFFER_REACHED="hlsBackBufferReached"})(D||(D={}))},"./src/hls.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return y});var D=_("./node_modules/url-toolkit/src/url-toolkit.js"),f=_.n(D),l=_("./src/loader/playlist-loader.ts"),C=_("./src/loader/key-loader.ts"),v=_("./src/controller/id3-track-controller.ts"),o=_("./src/controller/latency-controller.ts"),a=_("./src/controller/level-controller.ts"),r=_("./src/controller/fragment-tracker.ts"),h=_("./src/controller/stream-controller.ts"),m=_("./src/is-supported.ts"),p=_("./src/utils/logger.ts"),w=_("./src/config.ts"),g=_("./node_modules/eventemitter3/index.js"),c=_.n(g),n=_("./src/events.ts"),s=_("./src/errors.ts");function d(i,k){for(var O=0;O<k.length;O++){var b=k[O];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(i,b.key,b)}}function S(i,k,O){return k&&d(i.prototype,k),O&&d(i,O),i}var y=function(){i.isSupported=function(){return Object(m.isSupported)()};function i(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new g.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var b=this.config=Object(w.mergeConfig)(i.DefaultConfig,O);this.userConfig=O,Object(p.enableLogs)(b.debug),this._autoLevelCapping=-1,b.progressive&&Object(w.enableStreamingMode)(b);var E=b.abrController,x=b.bufferController,T=b.capLevelController,N=b.fpsController,j=this.abrController=new E(this),L=this.bufferController=new x(this),V=this.capLevelController=new T(this),K=new N(this),W=new l.default(this),G=new C.default(this),F=new v.default(this),B=this.levelController=new a.default(this),H=new r.FragmentTracker(this),q=this.streamController=new h.default(this,H);V.setStreamController(q),K.setStreamController(q);var re=[B,q];this.networkControllers=re;var ee=[W,G,j,L,V,K,F,H];this.audioTrackController=this.createController(b.audioTrackController,null,re),this.createController(b.audioStreamController,H,re),this.subtitleTrackController=this.createController(b.subtitleTrackController,null,re),this.createController(b.subtitleStreamController,H,re),this.createController(b.timelineController,null,ee),this.emeController=this.createController(b.emeController,null,ee),this.cmcdController=this.createController(b.cmcdController,null,ee),this.latencyController=this.createController(o.default,null,ee),this.coreComponents=ee}var k=i.prototype;return k.createController=function(b,E,x){if(b){var T=E?new b(this,E):new b(this);return x&&x.push(T),T}return null},k.on=function(b,E,x){x===void 0&&(x=this),this._emitter.on(b,E,x)},k.once=function(b,E,x){x===void 0&&(x=this),this._emitter.once(b,E,x)},k.removeAllListeners=function(b){this._emitter.removeAllListeners(b)},k.off=function(b,E,x,T){x===void 0&&(x=this),this._emitter.off(b,E,x,T)},k.listeners=function(b){return this._emitter.listeners(b)},k.emit=function(b,E,x){return this._emitter.emit(b,E,x)},k.trigger=function(b,E){if(this.config.debug)return this.emit(b,b,E);try{return this.emit(b,b,E)}catch(x){p.logger.error("An internal error happened while handling event "+b+'. Error message: "'+x.message+'". Here is a stacktrace:',x),this.trigger(n.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:b,error:x})}return!1},k.listenerCount=function(b){return this._emitter.listenerCount(b)},k.destroy=function(){p.logger.log("destroy"),this.trigger(n.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(b){return b.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(b){return b.destroy()}),this.coreComponents.length=0},k.attachMedia=function(b){p.logger.log("attachMedia"),this._media=b,this.trigger(n.Events.MEDIA_ATTACHING,{media:b})},k.detachMedia=function(){p.logger.log("detachMedia"),this.trigger(n.Events.MEDIA_DETACHING,void 0),this._media=null},k.loadSource=function(b){this.stopLoad();var E=this.media,x=this.url,T=this.url=D.buildAbsoluteURL(self.location.href,b,{alwaysNormalize:!0});p.logger.log("loadSource:"+T),E&&x&&x!==T&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(n.Events.MANIFEST_LOADING,{url:b})},k.startLoad=function(b){b===void 0&&(b=-1),p.logger.log("startLoad("+b+")"),this.networkControllers.forEach(function(E){E.startLoad(b)})},k.stopLoad=function(){p.logger.log("stopLoad"),this.networkControllers.forEach(function(b){b.stopLoad()})},k.swapAudioCodec=function(){p.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},k.recoverMediaError=function(){p.logger.log("recoverMediaError");var b=this._media;this.detachMedia(),b&&this.attachMedia(b)},k.removeLevel=function(b,E){E===void 0&&(E=0),this.levelController.removeLevel(b,E)},S(i,[{key:"levels",get:function(){var b=this.levelController.levels;return b||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(b){p.logger.log("set currentLevel:"+b),this.loadLevel=b,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(b){p.logger.log("set nextLevel:"+b),this.levelController.manualLevel=b,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(b){p.logger.log("set loadLevel:"+b),this.levelController.manualLevel=b}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(b){this.levelController.nextLoadLevel=b}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(b){p.logger.log("set firstLevel:"+b),this.levelController.firstLevel=b}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(b){p.logger.log("set startLevel:"+b),b!==-1&&(b=Math.max(b,this.minAutoLevel)),this.levelController.startLevel=b}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(b){var E=!!b;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(b){this._autoLevelCapping!==b&&(p.logger.log("set autoLevelCapping:"+b),this._autoLevelCapping=b)}},{key:"bandwidthEstimate",get:function(){var b=this.abrController.bwEstimator;return b?b.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var b=this.levels,E=this.config.minAutoBitrate;if(!b)return 0;for(var x=b.length,T=0;T<x;T++)if(b[T].maxBitrate>E)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<S;i++)y[i-1]=arguments[i];return d=c.call.apply(c,[this].concat(y))||this,d.data=void 0,d.data=s,d}return n}(C(Error))},"./src/loader/fragment.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"ElementaryStreamTypes",function(){return p}),_.d(u,"BaseSegment",function(){return w}),_.d(u,"Fragment",function(){return g}),_.d(u,"Part",function(){return c});var D=_("./src/polyfills/number.ts"),f=_("./node_modules/url-toolkit/src/url-toolkit.js"),l=_.n(f),C=_("./src/utils/logger.ts"),v=_("./src/loader/level-key.ts"),o=_("./src/loader/load-stats.ts");function a(n,s){n.prototype=Object.create(s.prototype),n.prototype.constructor=n,r(n,s)}function r(n,s){return r=Object.setPrototypeOf||function(S,y){return S.__proto__=y,S},r(n,s)}function h(n,s){for(var d=0;d<s.length;d++){var S=s[d];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(n,S.key,S)}}function m(n,s,d){return s&&h(n.prototype,s),d&&h(n,d),n}var p;(function(n){n.AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo"})(p||(p={}));var w=function(){function n(d){var S;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(S={},S[p.AUDIO]=null,S[p.VIDEO]=null,S[p.AUDIOVIDEO]=null,S),this.baseurl=d}var s=n.prototype;return s.setByteRange=function(S,y){var i=S.split("@",2),k=[];i.length===1?k[0]=y?y.byteRangeEndOffset:0:k[0]=parseInt(i[1]),k[1]=parseInt(i[0])+k[0],this._byteRange=k},m(n,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(f.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(S){this._url=S}}]),n}(),g=function(n){a(s,n);function s(S,y){var i;return i=n.call(this,y)||this,i._decryptdata=null,i.rawProgramDateTime=null,i.programDateTime=null,i.tagList=[],i.duration=0,i.sn=0,i.levelkey=void 0,i.type=void 0,i.loader=null,i.level=-1,i.cc=0,i.startPTS=void 0,i.endPTS=void 0,i.appendedPTS=void 0,i.startDTS=void 0,i.endDTS=void 0,i.start=0,i.deltaPTS=void 0,i.maxStartPTS=void 0,i.minEndPTS=void 0,i.stats=new o.LoadStats,i.urlId=0,i.data=void 0,i.bitrateTest=!1,i.title=null,i.initSegment=null,i.type=S,i}var d=s.prototype;return d.createInitializationVector=function(y){for(var i=new Uint8Array(16),k=12;k<16;k++)i[k]=y>>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;r<a.length;r++){var h=a[r];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(o,h.key,h)}}function l(o,a,r){return a&&f(o.prototype,a),r&&f(o,r),o}var C=10,v=function(){function o(r){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=r}var a=o.prototype;return a.reloaded=function(h){if(!h){this.advanced=!0,this.updated=!0;return}var m=this.lastPartSn-h.lastPartSn,p=this.lastPartIndex-h.lastPartIndex;this.updated=this.endSN!==h.endSN||!!p||!!m,this.advanced=this.endSN>h.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;r<a.length;r++){var h=a[r];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(o,h.key,h)}}function C(o,a,r){return a&&l(o.prototype,a),r&&l(o,r),o}var v=function(){o.fromURL=function(r,h){return new o(r,h)},o.fromURI=function(r){return new o(r)};function o(a,r){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,r?this._uri=Object(D.buildAbsoluteURL)(a,r,{alwaysNormalize:!0}):this._uri=a}return C(o,[{key:"uri",get:function(){return this._uri}}]),o}()},"./src/loader/load-stats.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"LoadStats",function(){return D});var D=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return s});var D=_("./src/polyfills/number.ts"),f=_("./node_modules/url-toolkit/src/url-toolkit.js"),l=_.n(f),C=_("./src/loader/fragment.ts"),v=_("./src/loader/level-details.ts"),o=_("./src/loader/level-key.ts"),a=_("./src/utils/attr-list.ts"),r=_("./src/utils/logger.ts"),h=_("./src/utils/codecs.ts"),m=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,p=/#EXT-X-MEDIA:(.*)/g,w=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),g=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),c=/\.(mp4|m4s|m4v|m4a)$/i;function n(k){var O,b;return c.test((O=(b=f.parseURL(k))===null||b===void 0?void 0:b.path)!=null?O:"")}var s=function(){function k(){}return k.findGroup=function(b,E){for(var x=0;x<b.length;x++){var T=b[x];if(T.id===E)return T}},k.convertAVC1ToAVCOTI=function(b){var E=b.split(".");if(E.length>2){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<q.length&&!(typeof q[re]!="undefined");re++);var he=(" "+q[re]).slice(1),ce=(" "+q[re+1]).slice(1),oe=q[re+2]?(" "+q[re+2]).slice(1):"";switch(he){case"PLAYLIST-TYPE":j.type=ce.toUpperCase();break;case"MEDIA-SEQUENCE":K=j.startSN=parseInt(ce);break;case"SKIP":{var Se=new a.AttrList(ce),te=Se.decimalInteger("SKIPPED-SEGMENTS");if(Object(D.isFiniteNumber)(te)){j.skippedSegments=te;for(var ue=te;ue--;)L.unshift(null);K+=te}var Oe=Se.enumeratedString("RECENTLY-REMOVED-DATERANGES");Oe&&(j.recentlyRemovedDateranges=Oe.split(" "));break}case"TARGETDURATION":j.targetduration=parseFloat(ce);break;case"VERSION":j.version=parseInt(ce);break;case"EXTM3U":break;case"ENDLIST":j.live=!1;break;case"#":(ce||oe)&&H.tagList.push(oe?[ce,oe]:[ce]);break;case"DIS":F++;case"GAP":H.tagList.push([he]);break;case"BITRATE":H.tagList.push([he,ce]);break;case"DISCONTINUITY-SEQ":F=parseInt(ce);break;case"KEY":{var le,Q=new a.AttrList(ce),Y=Q.enumeratedString("METHOD"),Z=Q.URI,be=Q.hexadecimalInteger("IV"),ge=Q.enumeratedString("KEYFORMATVERSIONS"),Re=Q.enumeratedString("KEYID"),Ze=(le=Q.enumeratedString("KEYFORMAT"))!=null?le:"identity",qe=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(qe.indexOf(Ze)>-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<a;h++)r[h-1]=arguments[h];for(var m=r.length,p=m;m--;)o+=r[m].byteLength;var w=new Uint8Array(o);for(w[0]=o>>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<p;m++)w.set(r[m],o),o+=r[m].byteLength;return w},l.hdlr=function(v){return l.box(l.types.hdlr,l.HDLR_TYPES[v])},l.mdat=function(v){return l.box(l.types.mdat,v)},l.mdhd=function(v,o){o*=v;var a=Math.floor(o/(D+1)),r=Math.floor(o%(D+1));return l.box(l.types.mdhd,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,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<o.length;r++)h=o[r].flags,a[r+4]=h.dependsOn<<4|h.isDependedOn<<2|h.hasRedundancy;return l.box(l.types.sdtp,a)},l.stbl=function(v){return l.box(l.types.stbl,l.stsd(v),l.box(l.types.stts,l.STTS),l.box(l.types.stsc,l.STSC),l.box(l.types.stsz,l.STSZ),l.box(l.types.stco,l.STCO))},l.avc1=function(v){var o=[],a=[],r,h,m;for(r=0;r<v.sps.length;r++)h=v.sps[r],m=h.byteLength,o.push(m>>>8&255),o.push(m&255),o=o.concat(Array.prototype.slice.call(h));for(r=0;r<v.pps.length;r++)h=v.pps[r],m=h.byteLength,a.push(m>>>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<r;p++)w=a[p],g=w.duration,c=w.size,n=w.flags,s=w.cts,m.set([g>>>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;O<arguments.length;O++){var b=arguments[O];for(var E in b)Object.prototype.hasOwnProperty.call(b,E)&&(k[E]=b[E])}return k},h.apply(this,arguments)}var m=10*1e3,p=1024,w=1152,g=null,c=null,n=!1,s=function(){function k(b,E,x,T){if(T===void 0&&(T=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=b,this.config=E,this.typeSupported=x,this.ISGenerated=!1,g===null){var N=navigator.userAgent||"",j=N.match(/Chrome\/(\d+)/i);g=j?parseInt(j[1]):0}if(c===null){var L=navigator.userAgent.match(/Safari\/(\d+)/i);c=L?parseInt(L[1]):0}n=!!g&&g<75||!!c&&c<600}var O=k.prototype;return O.destroy=function(){},O.resetTimeStamp=function(E){o.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=E},O.resetNextTimestamp=function(){o.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){o.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(E){var x=!1,T=E.reduce(function(N,j){var L=j.pts-N;return L<-4294967296?(x=!0,d(N,j.pts)):L>0?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;_e<K;_e++){var he=L[_e];if(he.pts=d(he.pts-W,G),he.dts=d(he.dts-W,G),he.dts>he.pts){var ce=9e4*.2;Ce=Math.max(Math.min(Ce,he.pts-he.dts),-1*ce)}he.dts<L[_e>0?_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(Ce<oe*-2){o.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(r.toMsFromMpegTsClock)(-oe,!0)+" ms");for(var Se=Ce,te=0;te<K;te++)L[te].dts=Se=Math.max(Se,L[te].pts-oe),L[te].pts=Math.max(Se,L[te].pts)}else{o.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(r.toMsFromMpegTsClock)(Ce,!0)+" ms to overcome this issue");for(var ue=0;ue<K;ue++)L[ue].dts=L[ue].dts+Ce}H=L[0].dts}if(T){var Oe=H-G,le=Oe>oe,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;ge<K;ge++){for(var Re=L[ge],Ze=Re.units,qe=Ze.length,et=0,nt=0;nt<qe;nt++)et+=Ze[nt].data.length;be+=et,Z+=qe,Re.length=et,Re.dts=Math.max(Re.dts,H),Re.pts=Math.max(Re.pts,Re.dts,0),re=Math.min(Re.pts,re),ee=Math.max(Re.pts,ee)}q=L[K-1].dts;var ut=be+4*Z+8,ot;try{ot=new Uint8Array(ut)}catch(It){this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:v.ErrorTypes.MUX_ERROR,details:v.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ut,reason:"fail allocating video mdat "+ut});return}var je=new DataView(ot.buffer);je.setUint32(0,ut),ot.set(l.default.types.mdat,4);for(var De=0;De<K;De++){for(var rt=L[De],lt=rt.units,Je=0,tt=0,Ue=lt.length;tt<Ue;tt++){var ke=lt[tt],Ie=ke.data,ye=ke.data.byteLength;je.setUint32(F,ye),F+=4,ot.set(Ie,F),F+=ye,Je+=4+ye}if(De<K-1)B=L[De+1].dts-rt.dts;else{var Te=this.config,Ae=rt.dts-L[De>0?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<q.length;Me++){var he=q[Me],ce=he.pts,oe=ce-_e,Se=Math.abs(1e3*oe/L);if(oe<=-pe*G&&Ee)Me===0&&(o.logger.warn("Audio frame @ "+(ce/L).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*oe/L)+" ms."),this.nextAudioPts=ee=_e=ce);else if(oe>=pe*G&&Se<m&&Ee){var te=Math.round(oe/G);_e=ce-te*G,_e<0&&(te--,_e+=G),Me===0&&(this.nextAudioPts=ee=_e),o.logger.warn("[mp4-remuxer]: Injecting "+te+" audio frame @ "+(_e/L).toFixed(3)+"s due to "+Math.round(1e3*oe/L)+" ms gap.");for(var ue=0;ue<te;ue++){var Oe=Math.max(_e,0),le=f.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);le||(o.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),le=he.unit.subarray()),q.splice(Me,0,{unit:le,pts:Oe}),_e+=G,Me++}}he.pts=_e,_e+=G}for(var Q=null,Y=null,Z,be=0,ge=q.length;ge--;)be+=q[ge].unit.byteLength;for(var Re=0,Ze=q.length;Re<Ze;Re++){var qe=q[Re],et=qe.unit,nt=qe.pts;if(Y!==null){var ut=H[Re-1];ut.duration=Math.round((nt-Y)/K)}else if(T&&E.isAAC&&(nt=ee),Q=nt,be>0){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;re<B;re++){var ee=W+re*F;q.push({unit:H,pts:ee,dts:ee})}return E.samples=q,this.remuxAudio(E,x,T,!1)},O.remuxID3=function(E,x){var T=E.samples.length;if(!T)return;for(var N=E.inputTimeScale,j=this._initPTS,L=this._initDTS,V=0;V<T;V++){var K=E.samples[V];K.pts=d(K.pts-j,x*N)/N,K.dts=d(K.dts-L,x*N)/N}var W=E.samples;return E.samples=[],{samples:W}},O.remuxText=function(E,x){var T=E.samples.length;if(!T)return;for(var N=E.inputTimeScale,j=this._initPTS,L=0;L<T;L++){var V=E.samples[L];V.pts=d(V.pts-j,x*N)/N}E.samples.sort(function(W,G){return W.pts-G.pts});var K=E.samples;return E.samples=[],{samples:K}},k}();function d(k,O){var b;if(O===null)return k;for(O<k?b=-8589934592:b=8589934592;Math.abs(k-O)>4294967296;)k+=b;return k}function S(k){for(var O=0;O<k.length;O++)if(k[O].key)return O;return-1}var y=function(O,b,E,x){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=b,this.size=E,this.cts=x,this.flags=new i(O)},i=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/polyfills/number.ts"),f=_("./src/utils/mp4-tools.ts"),l=_("./src/loader/fragment.ts"),C=_("./src/utils/logger.ts"),v=function(){function r(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var h=r.prototype;return h.destroy=function(){},h.resetTimeStamp=function(p){this.initPTS=p,this.lastEndDTS=null},h.resetNextTimestamp=function(){this.lastEndDTS=null},h.resetInitSegment=function(p,w,g){this.audioCodec=w,this.videoCodec=g,this.generateInitSegment(p),this.emitInitSegment=!0},h.generateInitSegment=function(p){var w=this.audioCodec,g=this.videoCodec;if(!p||!p.byteLength){this.initTracks=void 0,this.initData=void 0;return}var c=this.initData=Object(f.parseInitSegment)(p);w||(w=a(c.audio,l.ElementaryStreamTypes.AUDIO)),g||(g=a(c.video,l.ElementaryStreamTypes.VIDEO));var n={};c.audio&&c.video?n.audiovideo={container:"video/mp4",codec:w+","+g,initSegment:p,id:"main"}:c.audio?n.audio={container:"audio/mp4",codec:w,initSegment:p,id:"audio"}:c.video?n.video={container:"video/mp4",codec:g,initSegment:p,id:"main"}:C.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},h.remux=function(p,w,g,c,n){var s=this.initPTS,d=this.lastEndDTS,S={audio:void 0,video:void 0,text:c,id3:g,initSegment:void 0};Object(D.isFiniteNumber)(d)||(d=this.lastEndDTS=n||0);var y=w.samples;if(!y||!y.length)return S;var i={initPTS:void 0,timescale:1},k=this.initData;if((!k||!k.length)&&(this.generateInitSegment(y),k=this.initData),!k||!k.length)return C.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(i.tracks=this.initTracks,this.emitInitSegment=!1),Object(D.isFiniteNumber)(s)||(this.initPTS=i.initPTS=s=o(k,y,d));var O=Object(f.getDuration)(y,k),b=d,E=O+b;Object(f.offsetStartDTS)(k,y,s),O>0?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;h<r.length;h++){var m=r[h];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(a,m.key,m)}}function f(a,r,h){return r&&D(a.prototype,r),h&&D(a,h),a}var l;(function(a){a.No="",a.Yes="YES",a.v2="v2"})(l||(l={}));function C(a,r){var h=a.canSkipUntil,m=a.canSkipDateRanges,p=a.endSN,w=r!==void 0?r-p:0;return h&&w<h?m?l.v2:l.Yes:l.No}var v=function(){function a(h,m,p){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=h,this.part=m,this.skip=p}var r=a.prototype;return r.addDirectives=function(m){var p=new self.URL(m);return this.msn!==void 0&&p.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&p.searchParams.set("_HLS_part",this.part.toString()),this.skip&&p.searchParams.set("_HLS_skip",this.skip),p.toString()},a}(),o=function(){function a(r){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[r.url],this.attrs=r.attrs,this.bitrate=r.bitrate,r.details&&(this.details=r.details),this.id=r.id||0,this.name=r.name,this.width=r.width||0,this.height=r.height||0,this.audioCodec=r.audioCodec,this.videoCodec=r.videoCodec,this.unknownCodecs=r.unknownCodecs,this.codecSet=[r.videoCodec,r.audioCodec].filter(function(h){return h}).join(",").replace(/\.[^.,]+/g,"")}return f(a,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(h){var m=h%this.url.length;this._urlId!==m&&(this.details=void 0,this._urlId=m)}}]),a}()},"./src/types/loader.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"PlaylistContextType",function(){return D}),_.d(u,"PlaylistLevelType",function(){return f});var D;(function(l){l.MANIFEST="manifest",l.LEVEL="level",l.AUDIO_TRACK="audioTrack",l.SUBTITLE_TRACK="subtitleTrack"})(D||(D={}));var f;(function(l){l.MAIN="main",l.AUDIO="audio",l.SUBTITLE="subtitle"})(f||(f={}))},"./src/types/transmuxer.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"ChunkMetadata",function(){return D});var D=function(C,v,o,a,r,h){a===void 0&&(a=0),r===void 0&&(r=-1),h===void 0&&(h=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=f(),this.buffering={audio:f(),video:f(),audiovideo:f()},this.level=C,this.sn=v,this.id=o,this.size=a,this.part=r,this.partial=h};function f(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"AttrList",function(){return l});var D=/^(\d+)x(\d+)$/,f=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,l=function(){function C(o){typeof o=="string"&&(o=C.parseAttrList(o));for(var a in o)o.hasOwnProperty(a)&&(this[a]=o[a])}var v=C.prototype;return v.decimalInteger=function(a){var r=parseInt(this[a],10);return r>Number.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;m<r.length/2;m++)h[m]=parseInt(r.slice(m*2,m*2+2),16);return h}else return null},v.hexadecimalIntegerAsNumber=function(a){var r=parseInt(this[a],16);return r>Number.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.length;h++)if(a>=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;p<h.length;p++)m.push({start:h.start(p),end:h.end(p)});return this.bufferedInfo(m,a,r)}}catch(w){}return{len:0,start:a,end:a,nextStart:void 0}},C.bufferedInfo=function(o,a,r){a=Math.max(0,a),o.sort(function(i,k){var O=i.start-k.start;return O||k.end-i.end});var h=[];if(r)for(var m=0;m<o.length;m++){var p=h.length;if(p){var w=h[p-1].end;o[m].start-w<r?o[m].end>w&&(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<h.length;d++){var S=h[d].start,y=h[d].end;if(a+r>=S&&a<y)n=S,s=y,g=s-a;else if(a+r<S){c=S;break}}return{len:g,start:n||0,end:s||0,nextStart:c}},C.getBuffered=function(o){try{return o.buffered}catch(a){return D.logger.log("failed to get media.buffered",a),f}},C}()},"./src/utils/cea-608-parser.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"Row",function(){return s}),_.d(u,"CaptionScreen",function(){return d});var D=_("./src/utils/logger.ts"),f={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},l=function(E){var x=E;return f.hasOwnProperty(E)&&(x=f[E]),String.fromCharCode(x)},C=15,v=100,o={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},a={17:2,18:4,21:6,22:8,23:10,19:13,20:15},r={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},h={25:2,26:4,29:6,30:8,31:10,27:13,28:15},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],p;(function(b){b[b.ERROR=0]="ERROR",b[b.TEXT=1]="TEXT",b[b.WARNING=2]="WARNING",b[b.INFO=2]="INFO",b[b.DEBUG=3]="DEBUG",b[b.DATA=3]="DATA"})(p||(p={}));var w=function(){function b(){this.time=null,this.verboseLevel=p.ERROR}var E=b.prototype;return E.log=function(T,N){this.verboseLevel>=T&&D.logger.log(this.time+" ["+T+"] "+N)},b}(),g=function(E){for(var x=[],T=0;T<E.length;T++)x.push(E[T].toString(16));return x},c=function(){function b(x,T,N,j,L){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=x||"white",this.underline=T||!1,this.italics=N||!1,this.background=j||"black",this.flash=L||!1}var E=b.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(T){for(var N=["foreground","underline","italics","background","flash"],j=0;j<N.length;j++){var L=N[j];T.hasOwnProperty(L)&&(this[L]=T[L])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(T){return this.foreground===T.foreground&&this.underline===T.underline&&this.italics===T.italics&&this.background===T.background&&this.flash===T.flash},E.copy=function(T){this.foreground=T.foreground,this.underline=T.underline,this.italics=T.italics,this.background=T.background,this.flash=T.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},b}(),n=function(){function b(x,T,N,j,L,V){this.uchar=void 0,this.penState=void 0,this.uchar=x||" ",this.penState=new c(T,N,j,L,V)}var E=b.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(T,N){this.uchar=T,this.penState.copy(N)},E.setPenState=function(T){this.penState.copy(T)},E.equals=function(T){return this.uchar===T.uchar&&this.penState.equals(T.penState)},E.copy=function(T){this.uchar=T.uchar,this.penState.copy(T.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},b}(),s=function(){function b(x){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var T=0;T<v;T++)this.chars.push(new n);this.logger=x,this.pos=0,this.currPenState=new c}var E=b.prototype;return E.equals=function(T){for(var N=!0,j=0;j<v;j++)if(!this.chars[j].equals(T.chars[j])){N=!1;break}return N},E.copy=function(T){for(var N=0;N<v;N++)this.chars[N].copy(T.chars[N])},E.isEmpty=function(){for(var T=!0,N=0;N<v;N++)if(!this.chars[N].isEmpty()){T=!1;break}return T},E.setCursor=function(T){this.pos!==T&&(this.pos=T),this.pos<0?(this.logger.log(p.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>v&&(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<N+1;j++)this.chars[j].setPenState(this.currPenState);this.setCursor(N)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(T){T>=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;N<v;N++)this.chars[N].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var T=[],N=!0,j=0;j<v;j++){var L=this.chars[j].uchar;L!==" "&&(N=!1),T.push(L)}return N?"":T.join("")},E.setPenStyles=function(T){this.currPenState.setStyles(T);var N=this.chars[this.pos];N.setPenState(this.currPenState)},b}(),d=function(){function b(x){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var T=0;T<C;T++)this.rows.push(new s(x));this.logger=x,this.currRow=C-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=b.prototype;return E.reset=function(){for(var T=0;T<C;T++)this.rows[T].clear();this.currRow=C-1},E.equals=function(T){for(var N=!0,j=0;j<C;j++)if(!this.rows[j].equals(T.rows[j])){N=!1;break}return N},E.copy=function(T){for(var N=0;N<C;N++)this.rows[N].copy(T.rows[N])},E.isEmpty=function(){for(var T=!0,N=0;N<C;N++)if(!this.rows[N].isEmpty()){T=!1;break}return T},E.backSpace=function(){var T=this.rows[this.currRow];T.backSpace()},E.clearToEndOfRow=function(){var T=this.rows[this.currRow];T.clearToEndOfRow()},E.insertChar=function(T){var N=this.rows[this.currRow];N.insertChar(T)},E.setPen=function(T){var N=this.rows[this.currRow];N.setPenStyles(T)},E.moveCursor=function(T){var N=this.rows[this.currRow];N.moveCursor(T)},E.setCursor=function(T){this.logger.log(p.INFO,"setCursor: "+T);var N=this.rows[this.currRow];N.setCursor(T)},E.setPAC=function(T){this.logger.log(p.INFO,"pacData = "+JSON.stringify(T));var N=T.row-1;if(this.nrRollUpRows&&N<this.nrRollUpRows-1&&(N=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==N){for(var j=0;j<C;j++)this.rows[j].clear();var L=this.currRow+1-this.nrRollUpRows,V=this.lastOutputScreen;if(V){var K=V.rows[L].cueStartTime,W=this.logger.time;if(K&&W!==null&&K<W)for(var G=0;G<this.nrRollUpRows;G++)this.rows[N-this.nrRollUpRows+G+1].copy(V.rows[L+G])}}this.currRow=N;var F=this.rows[this.currRow];if(T.indent!==null){var B=T.indent,H=Math.max(B-1,0);F.setCursor(T.indent),T.color=F.chars[H].penState.foreground}var q={foreground:T.color,underline:T.underline,italics:T.italics,background:"black",flash:!1};this.setPen(q)},E.setBkgData=function(T){this.logger.log(p.INFO,"bkgData = "+JSON.stringify(T)),this.backSpace(),this.setPen(T),this.insertChar(32)},E.setRollUpRows=function(T){this.nrRollUpRows=T},E.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(p.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(p.TEXT,this.getDisplayText());var T=this.currRow+1-this.nrRollUpRows,N=this.rows.splice(T,1)[0];N.clear(),this.rows.splice(this.currRow,0,N),this.logger.log(p.INFO,"Rolling up")},E.getDisplayText=function(T){T=T||!1;for(var N=[],j="",L=-1,V=0;V<C;V++){var K=this.rows[V].getTextString();K&&(L=V+1,T?N.push("Row "+L+": '"+K+"'"):N.push(K.trim()))}return N.length>0&&(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<T.length;N++)this.writeScreen.insertChar(T[N]);var j=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(p.INFO,j+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(p.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},E.ccRCL=function(){this.logger.log(p.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){if(this.logger.log(p.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},E.ccAOF=function(){},E.ccAON=function(){},E.ccDER=function(){this.logger.log(p.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.ccRU=function(T){this.logger.log(p.INFO,"RU("+T+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(T)},E.ccFON=function(){this.logger.log(p.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(p.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(p.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(p.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(p.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(p.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(p.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.ccEOC=function(){if(this.logger.log(p.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var T=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=T,this.writeScreen=this.nonDisplayedMemory,this.logger.log(p.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},E.ccTO=function(T){this.logger.log(p.INFO,"TO("+T+") - Tab Offset"),this.writeScreen.moveCursor(T)},E.ccMIDROW=function(T){var N={flash:!1};if(N.underline=T%2===1,N.italics=T>=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<N.length;W+=2){if(L=N[W]&127,V=N[W+1]&127,L===0&&V===0)continue;if(this.logger.log(p.DATA,"["+g([N[W],N[W+1]])+"] -> ("+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<Object.keys(this.channels).length;T++){var N=this.channels[T];N&&N.reset()}this.cmdHistory=O()},E.cueSplitAtTime=function(T){for(var N=0;N<this.channels.length;N++){var j=this.channels[N];j&&j.cueSplitAtTime(T)}},b}();function i(b,E,x){x.a=b,x.b=E}function k(b,E,x){return x.a===b&&x.b===E}function O(){return{a:null,b:null}}u.default=y},"./src/utils/codecs.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"isCodecType",function(){return f}),_.d(u,"isCodecSupportedInMp4",function(){return l});var D={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function f(C,v){var o=D[v];return!!o&&o[C.slice(0,4)]===!0}function l(C,v){return MediaSource.isTypeSupported((v||"video")+'/mp4;codecs="'+C+'"')}},"./src/utils/cues.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/utils/vttparser.ts"),f=_("./src/utils/webvtt-parser.ts"),l=_("./src/utils/texttrack-utils.ts"),C=/\s/,v={newCue:function(a,r,h,m){for(var p=[],w,g,c,n,s,d=self.VTTCue||self.TextTrackCue,S=0;S<m.rows.length;S++)if(w=m.rows[S],c=!0,n=0,s="",!w.isEmpty()){for(var y=0;y<w.chars.length;y++)C.test(w.chars[y].uchar)&&c?n++:(s+=w.chars[y].uchar,c=!1);w.cueStartTime=r,r===h&&(h+=1e-4),n>=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;d<S;d++){var y=c[d];if(y&&y.cc===n){s=y;break}}return s}function v(c,n,s){return!!(n.details&&(s.endCC>s.startCC||c&&c.cc<s.startCC))}function o(c,n){var s=c.fragments,d=n.fragments;if(!d.length||!s.length){f.logger.log("No fragments to align");return}var S=C(s,d[0].cc);if(!S||S&&!S.startPTS){f.logger.log("No frag in previous level to align on");return}return S}function a(c,n){if(c){var s=c.start+n;c.start=c.startPTS=s,c.endPTS=s+c.duration}}function r(c,n){for(var s=n.fragments,d=0,S=s.length;d<S;d++)a(s[d],c);n.fragmentHint&&a(n.fragmentHint,c),n.alignedSliding=!0}function h(c,n,s){if(!n)return;m(c,s,n),!s.alignedSliding&&n.details&&p(s,n.details),!s.alignedSliding&&n.details&&!s.skippedSegments&&Object(l.adjustSliding)(n.details,s)}function m(c,n,s){if(v(c,s,n)){var d=o(s.details,n);d&&Object(D.isFiniteNumber)(d.start)&&(f.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),r(d.start,n))}}function p(c,n){if(!n.fragments.length||!c.hasProgramDateTime||!n.hasProgramDateTime)return;var s=n.fragments[0].programDateTime,d=c.fragments[0].programDateTime,S=(d-s)/1e3+n.fragments[0].start;S&&Object(D.isFiniteNumber)(S)&&(f.logger.log("Adjusting PTS using programDateTime delta "+(d-s)+"ms, sliding:"+S.toFixed(3)+" "+c.url+" "),r(S,c))}function w(c,n){var s=c.programDateTime;if(!s)return;var d=(s-n)/1e3;c.start=c.startPTS=d,c.endPTS=d+c.duration}function g(c,n){if(!n.fragments.length||!c.hasProgramDateTime||!n.hasProgramDateTime)return;var s=n.fragments[0].programDateTime,d=n.fragments[0].start,S=s-d*1e3;c.fragments.forEach(function(y){w(y,S)}),c.fragmentHint&&w(c.fragmentHint,S),c.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(M,u,_){"use strict";_.r(u);var D=_("./src/utils/ewma.ts"),f=function(){function l(v,o,a){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=a,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new D.default(v),this.fast_=new D.default(o)}var C=l.prototype;return C.update=function(o,a){var r=this.slow_,h=this.fast_;this.slow_.halfLife!==o&&(this.slow_=new D.default(o,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==a&&(this.fast_=new D.default(a,h.getEstimate(),h.getTotalWeight()))},C.sample=function(o,a){o=Math.max(o,this.minDelayMs_);var r=8*a,h=o/1e3,m=r/h;this.fast_.sample(h,m),this.slow_.sample(h,m)},C.canEstimate=function(){var o=this.fast_;return o&&o.getTotalWeight()>=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<arguments.length;S++){var y=arguments[S];for(var i in y)Object.prototype.hasOwnProperty.call(y,i)&&(d[i]=y[i])}return d},p.apply(this,arguments)}function w(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var g=function(){function d(y){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=y.fetchSetup||n,this.controller=new self.AbortController,this.stats=new f.LoadStats}var S=d.prototype;return S.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},S.abortInternal=function(){var i=this.response;(!i||!i.ok)&&(this.stats.aborted=!0,this.controller.abort())},S.abort=function(){var i;this.abortInternal(),(i=this.callbacks)!==null&&i!==void 0&&i.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},S.load=function(i,k,O){var b=this,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var x=c(i,this.controller.signal),T=O.onProgress,N=i.responseType==="arraybuffer",j=N?"byteLength":"length";this.context=i,this.config=k,this.callbacks=O,this.request=this.fetchSetup(i,x),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){b.abortInternal(),O.onTimeout(E,i,b.response)},k.timeout),self.fetch(this.request).then(function(L){if(b.response=b.loader=L,!L.ok){var V=L.status,K=L.statusText;throw new s(K||"fetch, bad network response",V,L)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(L.headers.get("Content-Length")||"0"),T&&Object(D.isFiniteNumber)(k.highWaterMark)?b.loadProgressively(L,E,i,k.highWaterMark,T):N?L.arrayBuffer():L.text()}).then(function(L){var V=b.response;self.clearTimeout(b.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=L[j];var K={url:V.url,data:L};T&&!Object(D.isFiniteNumber)(k.highWaterMark)&&T(E,i,L,V),O.onSuccess(K,E,i,V)}).catch(function(L){if(self.clearTimeout(b.requestTimeout),E.aborted)return;var V=L.code||0;O.onError({code:V,text:L.message},i,L.details)})},S.getCacheAge=function(){var i=null;if(this.response){var k=this.response.headers.get("age");i=k?parseFloat(k):null}return i},S.loadProgressively=function(i,k,O,b,E){b===void 0&&(b=0);var x=new l.default,T=i.body.getReader(),N=function j(){return T.read().then(function(L){if(L.done)return x.dataLength&&E(k,O,x.flush(),i),Promise.resolve(new ArrayBuffer(0));var V=L.value,K=V.length;return k.loaded+=K,K<b||x.dataLength?(x.push(V),x.dataLength>=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<arguments.length;E++){var x=arguments[E];for(var T in x)Object.prototype.hasOwnProperty.call(x,T)&&(b[T]=x[T])}return b},a.apply(this,arguments)}var r="stpp.ttml.im1t",h=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,p={left:"start",center:"center",right:"end",start:"start",end:"end"};function w(b,E,x,T,N){var j=Object(D.findBox)(new Uint8Array(b),["mdat"]);if(j.length===0){N(new Error("Could not parse IMSC1 mdat"));return}var L=j[0],V=Object(C.utf8ArrayToStr)(new Uint8Array(b,L.start,L.end-L.start)),K=Object(v.toTimescaleFromScale)(E,1,x);try{T(g(V,K))}catch(W){N(W)}}function g(b,E){var x=new DOMParser,T=x.parseFromString(b,"text/xml"),N=T.getElementsByTagName("tt")[0];if(!N)throw new Error("Invalid ttml");var j={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},L=Object.keys(j).reduce(function(F,B){return F[B]=N.getAttribute("ttp:"+B)||j[B],F},{}),V=N.getAttribute("xml:space")!=="preserve",K=n(c(N,"styling","style")),W=n(c(N,"layout","region")),G=c(N,"body","[begin]");return[].map.call(G,function(F){var B=s(F,V);if(!B||!F.hasAttribute("begin"))return null;var H=i(F.getAttribute("begin"),L),q=i(F.getAttribute("dur"),L),re=i(F.getAttribute("end"),L);if(H===null)throw y(F);if(re===null){if(q===null)throw y(F);re=H+q}var ee=new l.default(H-E,re-E,B);ee.id=Object(o.generateCueId)(ee.startTime,ee.endTime,ee.text);var Ce=W[F.getAttribute("region")],Ee=K[F.getAttribute("style")];ee.position=10,ee.size=80;var pe=d(Ce,Ee),Me=pe.textAlign;if(Me){var _e=p[Me];_e&&(ee.lineAlign=_e),ee.align=Me}return a(ee,pe),ee}).filter(function(F){return F!==null})}function c(b,E,x){var T=b.getElementsByTagName(E)[0];return T?[].slice.call(T.querySelectorAll(x)):[]}function n(b){return b.reduce(function(E,x){var T=x.getAttribute("xml:id");return T&&(E[T]=x),E},{})}function s(b,E){return[].slice.call(b.childNodes).reduce(function(x,T,N){var j;return T.nodeName==="br"&&N?x+`
|
|
|
`:(j=T.childNodes)!==null&&j!==void 0&&j.length?s(T,E):E?x+T.textContent.trim().replace(/\s+/g," "):x+T.textContent},"")}function d(b,E){var x="http://www.w3.org/ns/ttml#styling",T=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return T.reduce(function(N,j){var L=S(E,x,j)||S(b,x,j);return L&&(N[j]=L),N},{})}function S(b,E,x){return b.hasAttributeNS(E,x)?b.getAttributeNS(E,x):null}function y(b){return new Error("Could not parse ttml timestamp "+b)}function i(b,E){if(!b)return null;var x=Object(f.parseTimeStamp)(b);return x===null&&(h.test(b)?x=k(b,E):m.test(b)&&(x=O(b,E))),x}function k(b,E){var x=h.exec(b),T=(x[4]|0)+(x[5]|0)/E.subFrameRate;return(x[1]|0)*3600+(x[2]|0)*60+(x[3]|0)+T/E.frameRate}function O(b,E){var x=m.exec(b),T=Number(x[1]),N=x[2];switch(N){case"h":return T*3600;case"m":return T*60;case"ms":return T*1e3;case"f":return T/E.frameRate;case"t":return T/E.tickRate}return T}},"./src/utils/logger.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"enableLogs",function(){return o}),_.d(u,"logger",function(){return a});var D=function(){},f={trace:D,debug:D,log:D,warn:D,info:D,error:D},l=f;function C(r){var h=self.console[r];return h?h.bind(self.console,"["+r+"] >"):D}function v(r){for(var h=arguments.length,m=new Array(h>1?h-1:0),p=1;p<h;p++)m[p-1]=arguments[p];m.forEach(function(w){l[w]=r[w]?r[w].bind(r):C(w)})}function o(r){if(self.console&&r===!0||typeof r=="object"){v(r,"debug","log","info","warn","error");try{l.log()}catch(h){l=f}}else l=f}var a=l},"./src/utils/mediakeys-helper.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"KeySystems",function(){return D}),_.d(u,"requestMediaKeySystemAccess",function(){return f});var D;(function(l){l.WIDEVINE="com.widevine.alpha",l.PLAYREADY="com.microsoft.playready"})(D||(D={}));var f=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"getMediaSource",function(){return D});function D(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"bin2str",function(){return v}),_.d(u,"readUint16",function(){return o}),_.d(u,"readUint32",function(){return a}),_.d(u,"writeUint32",function(){return r}),_.d(u,"findBox",function(){return h}),_.d(u,"parseSegmentIndex",function(){return m}),_.d(u,"parseInitSegment",function(){return p}),_.d(u,"getStartDTS",function(){return w}),_.d(u,"getDuration",function(){return g}),_.d(u,"computeRawDurationFromSamples",function(){return c}),_.d(u,"offsetStartDTS",function(){return n}),_.d(u,"segmentValidRange",function(){return s}),_.d(u,"appendUint8Array",function(){return d});var D=_("./src/utils/typed-array.ts"),f=_("./src/loader/fragment.ts"),l=Math.pow(2,32)-1,C=[].push;function v(S){return String.fromCharCode.apply(null,S)}function o(S,y){"data"in S&&(y+=S.start,S=S.data);var i=S[y]<<8|S[y+1];return i<0?65536+i:i}function a(S,y){"data"in S&&(y+=S.start,S=S.data);var i=S[y]<<24|S[y+1]<<16|S[y+2]<<8|S[y+3];return i<0?4294967296+i:i}function r(S,y,i){"data"in S&&(y+=S.start,S=S.data),S[y]=i>>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;E<b;){var x=a(k,E),T=v(k.subarray(E+4,E+8)),N=x>1?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<K;W++){var G=T,F=a(E,G);G+=4;var B=F&2147483647,H=(F&2147483648)>>>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;k<i.length;k++){var O=i[k],b=h(O,["tkhd"])[0];if(b){var E=b.data[b.start],x=E===0?12:20,T=a(b,x),N=h(O,["mdia","mdhd"])[0];if(N){E=N.data[N.start],x=E===0?12:20;var j=a(N,x),L=h(O,["mdia","hdlr"])[0];if(L){var V=v(L.data.subarray(L.start+8,L.start+12)),K={soun:f.ElementaryStreamTypes.AUDIO,vide:f.ElementaryStreamTypes.VIDEO}[V];if(K){var W=h(O,["mdia","minf","stbl","stsd"])[0],G=void 0;W&&(G=v(W.data.subarray(W.start+12,W.start+16))),y[T]={timescale:j,type:K},y[K]={timescale:j,id:T,codec:G}}}}}}var F=h(S,["moov","mvex","trex"]);return F.forEach(function(B){var H=a(B,4),q=y[H];q&&(q.default={duration:a(B,12),flags:a(B,20)})}),y}function w(S,y){return h(y,["moof","traf"]).reduce(function(i,k){var O=h(k,["tfdt"])[0],b=O.data[O.start],E=h(k,["tfhd"]).reduce(function(x,T){var N=a(T,4),j=S[N];if(j){var L=a(O,4);b===1&&(L*=Math.pow(2,32),L+=a(O,8));var V=j.timescale||9e4,K=L/V;if(isFinite(K)&&(x===null||K<x))return K}return x},null);return E!==null&&isFinite(E)&&(i===null||E<i)?E:i},null)||0}function g(S,y){for(var i=0,k=0,O=0,b=h(S,["moof","traf"]),E=0;E<b.length;E++){var x=b[E],T=h(x,["tfhd"])[0],N=a(T,4),j=y[N];if(!j)continue;var L=j.default,V=a(T,0)|(L==null?void 0:L.flags),K=L==null?void 0:L.duration;V&8&&(V&2?K=a(T,12):K=a(T,8));for(var W=j.timescale||9e4,G=h(x,["trun"]),F=0;F<G.length;F++){if(K){var B=a(G[F],4);i=K*B}else i=c(G[F]);j.type===f.ElementaryStreamTypes.VIDEO?k+=i/W:j.type===f.ElementaryStreamTypes.AUDIO&&(O+=i/W)}}if(k===0&&O===0){var H=m(S);if(H!=null&&H.references)return H.references.reduce(function(q,re){return q+re.info.duration||0},0)}return k||O}function c(S){var y=a(S,0),i=8;y&1&&(i+=4),y&4&&(i+=4);for(var k=0,O=a(S,4),b=0;b<O;b++){if(y&256){var E=a(S,i);k+=E,i+=4}y&512&&(i+=4),y&1024&&(i+=4),y&2048&&(i+=4)}return k}function n(S,y,i){h(y,["moof","traf"]).forEach(function(k){h(k,["tfhd"]).forEach(function(O){var b=a(O,4),E=S[b];if(!E)return;var x=E.timescale||9e4;h(k,["tfdt"]).forEach(function(T){var N=T.data[T.start],j=a(T,4);if(N===0)r(T,4,j-i*x);else{j*=Math.pow(2,32),j+=a(T,8),j-=i*x,j=Math.max(j,0);var L=Math.floor(j/(l+1)),V=Math.floor(j%(l+1));r(T,4,L),r(T,8,V)}})})})}function s(S){var y={valid:null,remainder:null},i=h(S,["moof"]);if(i){if(i.length<2)return y.remainder=S,y}else return y;var k=i[i.length-1];return y.valid=Object(D.sliceUint8)(S,0,k.start-8),y.remainder=Object(D.sliceUint8)(S,k.start-8),y}function d(S,y){var i=new Uint8Array(S.length+y.length);return i.set(S),i.set(y,S.length),i}},"./src/utils/output-filter.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"default",function(){return D});var D=function(){function f(C,v){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=C,this.trackName=v}var l=f.prototype;return l.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},l.newCue=function(v,o,a){(this.startTime===null||this.startTime>v)&&(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;g<w.length;g++)r.removeCue(w[g]);p==="disabled"&&(r.mode=p)}function o(r,h){if(h<r[0].startTime)return 0;var m=r.length-1;if(h>r[m].endTime)return-1;for(var p=0,w=m;p<=w;){var g=Math.floor((w+p)/2);if(h<r[g].startTime)w=g-1;else if(h>r[g].startTime&&p<m)p=g+1;else return g}return r[p].startTime-h<h-r[w].startTime?p:w}function a(r,h,m){var p=[],w=o(r,h);if(w>-1)for(var g=w,c=r.length;g<c;g++){var n=r[g];if(n.startTime>=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;o<v;o++)C+="["+l.start(o).toFixed(3)+","+l.end(o).toFixed(3)+"]";return C}};u.default=D},"./src/utils/timescale-conversion.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"toTimescaleFromBase",function(){return f}),_.d(u,"toTimescaleFromScale",function(){return l}),_.d(u,"toMsFromMpegTsClock",function(){return C}),_.d(u,"toMpegTsClockFromTimescale",function(){return v});var D=9e4;function f(o,a,r,h){r===void 0&&(r=1),h===void 0&&(h=!1);var m=o*a*r;return h?Math.round(m):m}function l(o,a,r,h){return r===void 0&&(r=1),h===void 0&&(h=!1),f(o,a,1/r,h)}function C(o,a){return a===void 0&&(a=!1),f(o,1e3,1/D,a)}function v(o,a){return a===void 0&&(a=1),f(o,D,1/a)}},"./src/utils/typed-array.ts":function(M,u,_){"use strict";_.r(u),_.d(u,"sliceUint8",function(){return D});function D(f,l,C){return Uint8Array.prototype.slice?f.slice(l,C):new Uint8Array(Array.prototype.slice.call(f,l,C))}},"./src/utils/vttcue.ts":function(M,u,_){"use strict";_.r(u),u.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var D=["","lr","rl"],f=["start","middle","end","left","right"];function l(r,h){if(typeof h!="string")return!1;if(!Array.isArray(r))return!1;var m=h.toLowerCase();return~r.indexOf(m)?m:!1}function C(r){return l(D,r)}function v(r){return l(f,r)}function o(r){for(var h=arguments.length,m=new Array(h>1?h-1:0),p=1;p<h;p++)m[p-1]=arguments[p];for(var w=1;w<arguments.length;w++){var g=arguments[w];for(var c in g)r[c]=g[c]}return r}function a(r,h,m){var p=this,w={enumerable:!0};p.hasBeenReset=!1;var g="",c=!1,n=r,s=h,d=m,S=null,y="",i=!0,k="auto",O="start",b=50,E="middle",x=50,T="middle";Object.defineProperty(p,"id",o({},w,{get:function(){return g},set:function(j){g=""+j}})),Object.defineProperty(p,"pauseOnExit",o({},w,{get:function(){return c},set:function(j){c=!!j}})),Object.defineProperty(p,"startTime",o({},w,{get:function(){return n},set:function(j){if(typeof j!="number")throw new TypeError("Start time must be set to a number.");n=j,this.hasBeenReset=!0}})),Object.defineProperty(p,"endTime",o({},w,{get:function(){return s},set:function(j){if(typeof j!="number")throw new TypeError("End time must be set to a number.");s=j,this.hasBeenReset=!0}})),Object.defineProperty(p,"text",o({},w,{get:function(){return d},set:function(j){d=""+j,this.hasBeenReset=!0}})),Object.defineProperty(p,"region",o({},w,{get:function(){return S},set:function(j){S=j,this.hasBeenReset=!0}})),Object.defineProperty(p,"vertical",o({},w,{get:function(){return y},set:function(j){var L=C(j);if(L===!1)throw new SyntaxError("An invalid or illegal string was specified.");y=L,this.hasBeenReset=!0}})),Object.defineProperty(p,"snapToLines",o({},w,{get:function(){return i},set:function(j){i=!!j,this.hasBeenReset=!0}})),Object.defineProperty(p,"line",o({},w,{get:function(){return k},set:function(j){if(typeof j!="number"&&j!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");k=j,this.hasBeenReset=!0}})),Object.defineProperty(p,"lineAlign",o({},w,{get:function(){return O},set:function(j){var L=v(j);if(!L)throw new SyntaxError("An invalid or illegal string was specified.");O=L,this.hasBeenReset=!0}})),Object.defineProperty(p,"position",o({},w,{get:function(){return b},set:function(j){if(j<0||j>100)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<s.length;++d)if(n===s[d]){this.set(c,n);break}},w.integer=function(c,n){/^-?\d+$/.test(n)&&this.set(c,parseInt(n,10))},w.percent=function(c,n){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(n)){var s=parseFloat(n);if(s>=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(/<br(?: \/)?>/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<O.length&&O[b]!=="\r"&&O[b]!==`
|
|
|
`;)++b;var E=O.substr(0,b);return O[b]==="\r"&&++b,O[b]===`
|
|
|
`&&++b,n.buffer=O.substr(b),E}function d(O){v(O,function(b,E){},/:/)}try{var S="";if(n.state==="INITIAL"){if(!/\r\n|\n/.test(n.buffer))return this;S=s();var y=S.match(/^()?WEBVTT([ \t].*)?$/);if(!y||!y[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var i=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;i?i=!1:S=s();switch(n.state){case"HEADER":/:/.test(S)?d(S):S||(n.state="ID");continue;case"NOTE":S||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){n.state="NOTE";break}if(!S)continue;if(n.cue=new D.default(0,0,""),n.state="CUE",S.indexOf("-->")===-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<lt;tt+=1)Je(tt);return De}function O(je){var De=je.stickyOffsets,rt=je.columns,lt=je.flattenColumns,Je=je.onHeaderRow,tt=l.useContext(s.a),Ue=tt.prefixCls,ke=tt.getComponent,Ie=l.useMemo(function(){return k(rt)},[rt]),ye=ke(["header","wrapper"],"thead"),Te=ke(["header","row"],"tr"),Ae=ke(["header","cell"],"th");return l.createElement(ye,{className:"".concat(Ue,"-thead")},Ie.map(function(Pe,$e){var Ke=l.createElement(i,{key:$e,flattenColumns:lt,cells:Pe,stickyOffsets:De,rowComponent:Te,cellComponent:Ae,onHeaderRow:Je,index:$e});return Ke}))}var b=O,E=P("hW8S");function x(je){for(var De=je.colWidths,rt=je.columns,lt=je.columCount,Je=[],tt=lt||rt.length,Ue=!1,ke=tt-1;ke>=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;lt<De;lt+=1){var Je=je[lt];if(Je!==void 0)rt[lt]=Je;else return null}return rt},[je.join("_"),De])}var j=l.forwardRef(function(je,De){var rt=je.noData,lt=je.columns,Je=je.flattenColumns,tt=je.colWidths,Ue=je.columCount,ke=je.stickyOffsets,Ie=je.direction,ye=je.fixHeader,Te=je.offsetHeader,Ae=je.stickyClassName,Pe=je.onScroll,$e=Object(g.a)(je,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Ke=l.useContext(s.a),ct=Ke.prefixCls,gt=Ke.scrollbarSize,wt=Ke.isSticky,vt=wt&&!ye?0:gt,It=l.useRef(null),Lt=l.useCallback(function(Lr){Object(c.b)(De,Lr),Object(c.b)(It,Lr)},[]);l.useEffect(function(){var Lr;function Cr(Ct){var lr=Ct.currentTarget,Fr=Ct.deltaX;Fr&&(Pe({currentTarget:lr,scrollLeft:lr.scrollLeft+Fr}),Ct.preventDefault())}return(Lr=It.current)===null||Lr===void 0||Lr.addEventListener("wheel",Cr),function(){var Ct;(Ct=It.current)===null||Ct===void 0||Ct.removeEventListener("wheel",Cr)}},[]);var _t=Je[Je.length-1],rr={fixed:_t?_t.fixed:null,onHeaderCell:function(){return{className:"".concat(ct,"-cell-scrollbar")}}},sr=Object(l.useMemo)(function(){return vt?[].concat(Object(_.a)(lt),[rr]):lt},[vt,lt]),$t=Object(l.useMemo)(function(){return vt?[].concat(Object(_.a)(Je),[rr]):Je},[vt,Je]),cr=Object(l.useMemo)(function(){var Lr=ke.right,Cr=ke.left;return Object(u.a)(Object(u.a)({},ke),{},{left:Ie==="rtl"?[].concat(Object(_.a)(Cr.map(function(Ct){return Ct+vt})),[0]):Cr,right:Ie==="rtl"?Lr:[].concat(Object(_.a)(Lr.map(function(Ct){return Ct+vt})),[0]),isSticky:wt})},[vt,ke,wt]),Wt=N(tt,Ue);return l.createElement("div",{style:Object(u.a)({overflow:"hidden"},wt?{top:Te}:{}),ref:Lt,className:v()("".concat(ct,"-header"),Object(M.a)({},Ae,!!Ae))},l.createElement("table",{style:{tableLayout:"fixed",visibility:rt||Wt?null:"hidden"}},l.createElement(T,{colWidths:Wt?[].concat(Object(_.a)(Wt),[vt]):[],columCount:Ue+1,columns:$t}),l.createElement(b,Object.assign({},$e,{stickyOffsets:cr,columns:sr,flattenColumns:$t}))))});j.displayName="FixedHeader";var L=j,V=l.createContext(null),K=V;function W(je){var De=je.prefixCls,rt=je.children,lt=je.component,Je=je.cellComponent,tt=je.fixHeader,Ue=je.fixColumn,ke=je.horizonScroll,Ie=je.className,ye=je.expanded,Te=je.componentWidth,Ae=je.colSpan,Pe=l.useContext(s.a),$e=Pe.scrollbarSize;return l.useMemo(function(){var Ke=rt;return Ue&&(Ke=l.createElement("div",{style:{width:Te-(tt?$e:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(De,"-expanded-row-fixed")},Ke)),l.createElement(lt,{className:Ie,style:{display:ye?null:"none"}},l.createElement(n.a,{component:Je,prefixCls:De,colSpan:Ae},Ke))},[rt,lt,tt,ke,Ie,ye,Te,Ae,$e])}var G=W;function F(je){var De=je.className,rt=je.style,lt=je.record,Je=je.index,tt=je.rowKey,Ue=je.getRowKey,ke=je.rowExpandable,Ie=je.expandedKeys,ye=je.onRow,Te=je.indent,Ae=Te===void 0?0:Te,Pe=je.rowComponent,$e=je.cellComponent,Ke=je.childrenColumnName,ct=l.useContext(s.a),gt=ct.prefixCls,wt=ct.fixedInfoList,vt=l.useContext(K),It=vt.fixHeader,Lt=vt.fixColumn,_t=vt.horizonScroll,rr=vt.componentWidth,sr=vt.flattenColumns,$t=vt.expandableType,cr=vt.expandRowByClick,Wt=vt.onTriggerExpand,Lr=vt.rowClassName,Cr=vt.expandedRowClassName,Ct=vt.indentSize,lr=vt.expandIcon,Fr=vt.expandedRowRender,$r=vt.expandIconColumnIndex,Hr=l.useState(!1),oi=Object(f.a)(Hr,2),Tt=oi[0],Rt=oi[1],Et=Ie&&Ie.has(je.recordKey);l.useEffect(function(){Et&&Rt(!0)},[Et]);var Ar=$t==="row"&&(!ke||ke(lt)),Br=$t==="nest",Xt=Ke&<&<[Ke],Nt=Ar||Br,jr;ye&&(jr=ye(lt,Je));var bn=function(z){if(cr&&Nt&&Wt(lt,z),jr&&jr.onClick){for(var X,ne=arguments.length,de=new Array(ne>1?ne-1:0),ie=1;ie<ne;ie++)de[ie-1]=arguments[ie];(X=jr).onClick.apply(X,[z].concat(de))}},zr;typeof Lr=="string"?zr=Lr:typeof Lr=="function"&&(zr=Lr(lt,Je,Ae));var mt=Object(S.a)(sr),Ut=l.createElement(Pe,Object.assign({},jr,{"data-row-key":tt,className:v()(De,"".concat(gt,"-row"),"".concat(gt,"-row-level-").concat(Ae),zr,jr&&jr.className),style:Object(u.a)(Object(u.a)({},rt),jr?jr.style:null),onClick:bn}),sr.map(function(se,z){var X=se.render,ne=se.dataIndex,de=se.className,ie=mt[z],ze=wt[z],ht;z===($r||0)&&Br&&(ht=l.createElement(l.Fragment,null,l.createElement("span",{style:{paddingLeft:"".concat(Ct*Ae,"px")},className:"".concat(gt,"-row-indent indent-level-").concat(Ae)}),lr({prefixCls:gt,expanded:Et,expandable:Xt,record:lt,onExpand:Wt})));var St;return se.onCell&&(St=se.onCell(lt,Je)),l.createElement(n.a,Object.assign({className:de,ellipsis:se.ellipsis,align:se.align,component:$e,prefixCls:gt,key:ie,record:lt,index:Je,dataIndex:ne,render:X,shouldCellUpdate:se.shouldCellUpdate},ze,{appendNode:ht,additionalProps:St}))})),an;if(Ar&&(Tt||Et)){var xn=Fr(lt,Je,Ae+1,Et),On=Cr&&Cr(lt,Je,Ae);an=l.createElement(G,{expanded:Et,className:v()("".concat(gt,"-expanded-row"),"".concat(gt,"-expanded-row-level-").concat(Ae+1),On),prefixCls:gt,fixHeader:It,fixColumn:Lt,horizonScroll:_t,component:Pe,componentWidth:rr,cellComponent:$e,colSpan:sr.length},xn)}var An;return Xt&&Et&&(An=(lt[Ke]||[]).map(function(se,z){var X=Ue(se,z);return l.createElement(F,Object.assign({},je,{key:X,rowKey:X,record:se,recordKey:X,index:z,indent:Ae+1}))})),l.createElement(l.Fragment,null,Ut,an,An)}F.displayName="BodyRow";var B=F,H=l.createContext(null),q=H;function re(je){var De=je.columnKey,rt=je.onColumnResize,lt=l.useRef();return l.useEffect(function(){lt.current&&rt(De,lt.current.offsetWidth)},[]),l.createElement(h.a,{onResize:function(tt){var Ue=tt.offsetWidth;rt(De,Ue)}},l.createElement("td",{ref:lt,style:{padding:0,border:0,height:0}},l.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ee(je){var De=je.data,rt=je.getRowKey,lt=je.measureColumnWidth,Je=je.expandedKeys,tt=je.onRow,Ue=je.rowExpandable,ke=je.emptyNode,Ie=je.childrenColumnName,ye=l.useContext(q),Te=ye.onColumnResize,Ae=l.useContext(s.a),Pe=Ae.prefixCls,$e=Ae.getComponent,Ke=l.useContext(K),ct=Ke.fixHeader,gt=Ke.horizonScroll,wt=Ke.flattenColumns,vt=Ke.componentWidth;return l.useMemo(function(){var It=$e(["body","wrapper"],"tbody"),Lt=$e(["body","row"],"tr"),_t=$e(["body","cell"],"td"),rr;De.length?rr=De.map(function($t,cr){var Wt=rt($t,cr);return l.createElement(B,{key:Wt,rowKey:Wt,record:$t,recordKey:Wt,index:cr,rowComponent:Lt,cellComponent:_t,expandedKeys:Je,onRow:tt,getRowKey:rt,rowExpandable:Ue,childrenColumnName:Ie})}):rr=l.createElement(G,{expanded:!0,className:"".concat(Pe,"-placeholder"),prefixCls:Pe,fixHeader:ct,fixColumn:gt,horizonScroll:gt,component:Lt,componentWidth:vt,cellComponent:_t,colSpan:wt.length},ke);var sr=Object(S.a)(wt);return l.createElement(It,{className:"".concat(Pe,"-tbody")},lt&&l.createElement("tr",{"aria-hidden":"true",className:"".concat(Pe,"-measure-row"),style:{height:0}},sr.map(function($t){return l.createElement(re,{key:$t,columnKey:$t,onColumnResize:Te})})),rr)},[De,Pe,tt,lt,Je,rt,$e,vt,ke,wt])}var Ce=l.memo(ee);Ce.displayName="Body";var Ee=Ce,pe=P("wRmb"),Me=P("xEkU"),_e=P.n(Me);function he(je){var De=Object(l.useRef)(je),rt=Object(l.useState)({}),lt=Object(f.a)(rt,2),Je=lt[1],tt=Object(l.useRef)(null),Ue=Object(l.useRef)([]);function ke(Ie){tt.current===null&&(Ue.current=[],tt.current=_e()(function(){Ue.current.forEach(function(ye){De.current=ye(De.current)}),tt.current=null,Je({})})),Ue.current.push(Ie)}return Object(l.useEffect)(function(){return function(){_e.a.cancel(tt.current)}},[]),[De.current,ke]}function ce(je){var De=Object(l.useRef)(je),rt=Object(l.useRef)(null);function lt(){window.clearTimeout(rt.current)}function Je(Ue){De.current=Ue,lt(),rt.current=window.setTimeout(function(){De.current=null,rt.current=null},100)}function tt(){return De.current}return Object(l.useEffect)(function(){return lt},[]),[Je,tt]}function oe(je,De,rt){var lt=Object(l.useMemo)(function(){for(var Je=[],tt=[],Ue=0,ke=0,Ie=0;Ie<De;Ie+=1)if(rt==="rtl"){tt[Ie]=ke,ke+=je[Ie]||0;var ye=De-Ie-1;Je[ye]=Ue,Ue+=je[ye]||0}else{Je[Ie]=Ue,Ue+=je[Ie]||0;var Te=De-Ie-1;tt[Te]=ke,ke+=je[Te]||0}return{left:Je,right:tt}},[je,De,rt]);return lt}var Se=oe;function te(je){var De=je.className,rt=je.children;return l.createElement("div",{className:De},rt)}var ue=te,Oe=P("n6Qo");function le(je){var De,rt=je.prefixCls,lt=je.record,Je=je.onExpand,tt=je.expanded,Ue=je.expandable,ke="".concat(rt,"-row-expand-icon");if(!Ue)return l.createElement("span",{className:v()(ke,"".concat(rt,"-row-spaced"))});var Ie=function(Te){Je(lt,Te),Te.stopPropagation()};return l.createElement("span",{className:v()(ke,(De={},Object(M.a)(De,"".concat(rt,"-row-expanded"),tt),Object(M.a)(De,"".concat(rt,"-row-collapsed"),!tt),De)),onClick:Ie})}function Q(je,De,rt){var lt=[];function Je(tt){(tt||[]).forEach(function(Ue,ke){lt.push(De(Ue,ke)),Je(Ue[rt])})}return Je(je),lt}var Y=P("zT1h"),Z=P("y0+3"),be=function(De,rt){var lt,Je,tt=De.scrollBodyRef,Ue=De.onScroll,ke=De.offsetScroll,Ie=l.useContext(s.a),ye=Ie.prefixCls,Te=((lt=tt.current)===null||lt===void 0?void 0:lt.scrollWidth)||0,Ae=((Je=tt.current)===null||Je===void 0?void 0:Je.clientWidth)||0,Pe=Te&&Ae*(Ae/Te),$e=l.useRef(),Ke=he({scrollLeft:0,isHiddenScrollBar:!1}),ct=Object(f.a)(Ke,2),gt=ct[0],wt=ct[1],vt=l.useRef({delta:0,x:0}),It=l.useState(!1),Lt=Object(f.a)(It,2),_t=Lt[0],rr=Lt[1],sr=function(){rr(!1)},$t=function(Ct){Ct.persist(),vt.current.delta=Ct.pageX-gt.scrollLeft,vt.current.x=0,rr(!0),Ct.preventDefault()},cr=function(Ct){var lr,Fr=Ct||((lr=window)===null||lr===void 0?void 0:lr.event),$r=Fr.buttons;if(!_t||$r===0){_t&&rr(!1);return}var Hr=vt.current.x+Ct.pageX-vt.current.x-vt.current.delta;Hr<=0&&(Hr=0),Hr+Pe>=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(Xi<Mt-ur)}},en=function(){Qt.current&&li({currentTarget:Qt.current})},Qi=function(Dr){var Er=Dr.width;en(),St(on.current?on.current.offsetWidth:Er)};l.useEffect(function(){return en},[]),l.useEffect(function(){ir&&en()},[ir]),l.useEffect(function(){Lt===et&&rr&&(rr.body.current=Qt.current)});var Ft=Fr(["table"],"table"),Jt=l.useMemo(function(){return ye||(qr?Ie.x==="max-content"?"auto":"fixed":Gr||zt.some(function(Pr){var Dr=Pr.ellipsis;return Dr})?"fixed":"auto")},[Gr,qr,zt,ye]),Gt,hr={colWidths:sn,columCount:zt.length,stickyOffsets:hi,onHeaderRow:It,fixHeader:Gr},xr=l.useMemo(function(){return cr?null:typeof wt=="function"?wt():wt},[cr,wt]),Vr=l.createElement(Ee,{data:$t,measureColumnWidth:Gr||ir||_r,expandedKeys:ne,rowExpandable:jr,getRowKey:$r,onRow:vt,emptyNode:xr,childrenColumnName:xn}),vr=l.createElement(T,{colWidths:zt.map(function(Pr){var Dr=Pr.width;return Dr}),columns:zt}),_n=$e&&l.createElement(Oe.b,null,$e($t)),zn=Fr(["body"]);if(Gr||_r){var mr;typeof zn=="function"?(mr=zn($t,{scrollbarSize:Cr,ref:Qt,onScroll:li}),hr.colWidths=zt.map(function(Pr,Dr){var Er=Pr.width,ui=Dr===Ht.length-1?Er-Cr:Er;return typeof ui=="number"&&!Number.isNaN(ui)?ui:(Object(r.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):mr=l.createElement("div",{style:Object(u.a)(Object(u.a)({},Di),yi),onScroll:li,ref:Qt,className:v()("".concat(rt,"-body"))},l.createElement(Ft,{style:Object(u.a)(Object(u.a)({},Zn),{},{tableLayout:Jt})},vr,Vr,_n),_r&&l.createElement(ge,{ref:Tr,offsetScroll:hn,scrollBodyRef:Qt,onScroll:li})),Gt=l.createElement(l.Fragment,null,ct!==!1&&l.createElement(L,Object.assign({noData:!$t.length},hr,Mr,{direction:Te,offsetHeader:fi,stickyClassName:Hn,ref:Zr,onScroll:li})),mr)}else Gt=l.createElement("div",{style:Object(u.a)(Object(u.a)({},Di),yi),className:v()("".concat(rt,"-content")),onScroll:li,ref:Qt},l.createElement(Ft,{style:Object(u.a)(Object(u.a)({},Zn),{},{tableLayout:Jt})},vr,ct!==!1&&l.createElement(b,Object.assign({},hr,Mr)),Vr,_n));var ji=Object(E.b)(je),Rr=l.createElement("div",Object.assign({className:v()(rt,lt,(De={},Object(M.a)(De,"".concat(rt,"-rtl"),Te==="rtl"),Object(M.a)(De,"".concat(rt,"-ping-left"),Yt),Object(M.a)(De,"".concat(rt,"-ping-right"),un),Object(M.a)(De,"".concat(rt,"-layout-fixed"),ye==="fixed"),Object(M.a)(De,"".concat(rt,"-fixed-header"),Gr),Object(M.a)(De,"".concat(rt,"-fixed-column"),qr),Object(M.a)(De,"".concat(rt,"-scroll-horizontal"),ir),Object(M.a)(De,"".concat(rt,"-has-fix-left"),zt[0]&&zt[0].fixed),Object(M.a)(De,"".concat(rt,"-has-fix-right"),zt[zt.length-1]&&zt[zt.length-1].fixed==="right"),De)),style:tt,id:Ke,ref:on},ji),l.createElement(nt,{pingLeft:Yt,pingRight:un,props:Object(u.a)(Object(u.a)({},je),{},{stickyOffsets:hi,mergedExpandedKeys:ne})},Ae&&l.createElement(ue,{className:"".concat(rt,"-title")},Ae($t)),l.createElement("div",{className:"".concat(rt,"-container")},Gt),Pe&&l.createElement(ue,{className:"".concat(rt,"-footer")},Pe($t))));ir&&(Rr=l.createElement(h.a,{onResize:Qi},Rr));var Mn=l.useMemo(function(){return{prefixCls:rt,getComponent:Fr,scrollbarSize:Cr,direction:Te,fixedInfoList:zt.map(function(Pr,Dr){return d(Dr,Dr,zt,hi,Te)}),isSticky:_r}},[rt,Fr,Cr,Te,zt,hi,Te,_r]),mi=l.useMemo(function(){return Object(u.a)(Object(u.a)({},Mr),{},{tableLayout:Jt,rowClassName:Je,expandedRowClassName:zr,componentWidth:ht,fixHeader:Gr,fixColumn:qr,horizonScroll:ir,expandIcon:an,expandableType:On,expandRowByClick:Nt,expandedRowRender:Ar,onTriggerExpand:de,expandIconColumnIndex:bn,indentSize:Ut})},[Mr,Jt,Je,zr,ht,Gr,qr,ir,an,On,Nt,Ar,de,bn,Ut]),qn=l.useMemo(function(){return{onColumnResize:Si}},[Si]);return l.createElement(s.a.Provider,{value:Mn},l.createElement(K.Provider,{value:mi},l.createElement(q.Provider,{value:qn},Rr)))}ut.Column=w.a,ut.ColumnGroup=p.a,ut.Summary=Oe.a,ut.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var ot=J.b=ut},wRmb:function(I,J,P){"use strict";P.d(J,"a",function(){return a});var M=P("rePB"),u=P("KQm4"),_=P("VTBJ"),D=P("Ff2n"),f=P("q1tI"),l=P.n(f),C=P("Kwbf"),v=P("Zm9Q"),o=P("hW8S");function a(w){return Object(v.a)(w).filter(function(g){return f.isValidElement(g)}).map(function(g){var c=g.key,n=g.props,s=n.children,d=Object(D.a)(n,["children"]),S=Object(_.a)({key:c},d);return s&&(S.children=a(s)),S})}function r(w){return w.reduce(function(g,c){var n=c.fixed,s=n===!0?"left":n,d=c.children;return d&&d.length>0?[].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<w.length;c+=1){var n=w[c];if(g&&n.fixed!=="left")g=!1;else if(!g&&n.fixed==="left"){Object(C.a)(!1,"Index ".concat(c-1," of `columns` missing `fixed='left'` prop."));break}}for(var s=!0,d=w.length-1;d>=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;O<i;O++)O<S?k[O]=d[O]:(n=k[O-1],O%S?S>6&&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<i;E++){var O=i-E;if(E%4)var n=k[O];else var n=k[O-4];E<4||O<=4?b[E]=n:b[E]=h[l[n>>>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<b;L++){var V=S[E>>>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<r;p+=3)for(var w=a[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<r;s++)m.push(h.charAt(n>>>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<r.length;m++)h[r.charCodeAt(m)]=m}var p=r.charAt(64);if(p){var w=v.indexOf(p);w!==-1&&(a=w)}return C(v,a,h)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function C(v,o,a){for(var r=[],h=0,m=0;m<o;m++)if(m%4){var p=a[v.charCodeAt(m-1)]<<m%4*2,w=a[v.charCodeAt(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]})}}}]);
|