You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
453 lines
1.5 MiB
453 lines
1.5 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[241,3,5,7,8,9],{"++UQ":function(He,pe,I){},"+NIl":function(He,pe,I){(function(J){J(I("VrN/"))})(function(J){"use strict";J.defineMode("stex",function(z,P){"use strict";function X(c,o){c.cmdState.push(o)}function N(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function C(c){var o=c.cmdState.pop();o&&o.closeBracket()}function B(c){for(var o=c.cmdState,d=o.length-1;d>=0;d--){var r=o[d];if(r.name=="DEFAULT")continue;return r}return{styleIdentifier:function(){return null}}}function M(c,o,d){return function(){this.name=c,this.bracketNo=0,this.style=o,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=M("importmodule","tag",["string","builtin"]),n.documentclass=M("documentclass","tag",["","atom"]),n.usepackage=M("usepackage","tag",["atom"]),n.begin=M("begin","tag",["atom"]),n.end=M("end","tag",["atom"]),n.label=M("label","tag",["atom"]),n.ref=M("ref","tag",["atom"]),n.eqref=M("eqref","tag",["atom"]),n.cite=M("cite","tag",["atom"]),n.bibitem=M("bibitem","tag",["atom"]),n.Bibitem=M("Bibitem","tag",["atom"]),n.RBibitem=M("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(c,o){c.f=o}function g(c,o){var d;if(c.match(/^\\[a-zA-Z@]+/)){var r=c.current().slice(1);return d=n.hasOwnProperty(r)?n[r]:n.DEFAULT,d=new d,X(o,d),D(o,h),d.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return D(o,function(i,s){return p(i,s,"\\]")}),"keyword";if(c.match("\\("))return D(o,function(i,s){return p(i,s,"\\)")}),"keyword";if(c.match("$$"))return D(o,function(i,s){return p(i,s,"$$")}),"keyword";if(c.match("$"))return D(o,function(i,s){return p(i,s,"$")}),"keyword";var a=c.next();if(a=="%")return c.skipToEnd(),"comment";if(a=="}"||a=="]"){if(d=N(o),d)d.closeBracket(a),D(o,h);else return"error";return"bracket"}else return a=="{"||a=="["?(d=n.DEFAULT,d=new d,X(o,d),"bracket"):/\d/.test(a)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),d=B(o),d.name=="begin"&&(d.argument=c.current()),d.styleIdentifier())}function p(c,o,d){if(c.eatSpace())return null;if(d&&c.match(d))return D(o,g),"keyword";if(c.match(/^\\[a-zA-Z@]+/))return"tag";if(c.match(/^[a-zA-Z]+/))return"variable-2";if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/]/))return"tag";if(c.match(/^[\^_&]/))return"tag";if(c.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(c.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=c.next();return r=="{"||r=="}"||r=="["||r=="]"||r=="("||r==")"?"bracket":r=="%"?(c.skipToEnd(),"comment"):"error"}function h(c,o){var d=c.peek(),r;return d=="{"||d=="["?(r=N(o),r.openBracket(d),c.eat(d),D(o,g),"bracket"):/[ \t\r]/.test(d)?(c.eat(d),null):(D(o,g),C(o),g(c,o))}return{startState:function(){var c=P.inMathMode?function(o,d){return p(o,d)}:g;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,o){return o.f(c,o)},blankLine:function(c){c.f=g,c.cmdState.length=0},lineComment:"%"}}),J.defineMIME("text/x-stex","stex"),J.defineMIME("text/x-latex","stex")})},"+QRC":function(He,pe,I){"use strict";var J=I("E9nw"),z={"text/plain":"Text","text/html":"Url",default:"Text"},P="Copy to clipboard: #{key}, Enter";function X(C){var B=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return C.replace(/#{\s*key\s*}/g,B)}function N(C,B){var M,n,D,g,p,h,c=!1;B||(B={}),M=B.debug||!1;try{D=J(),g=document.createRange(),p=document.getSelection(),h=document.createElement("span"),h.textContent=C,h.style.all="unset",h.style.position="fixed",h.style.top=0,h.style.clip="rect(0, 0, 0, 0)",h.style.whiteSpace="pre",h.style.webkitUserSelect="text",h.style.MozUserSelect="text",h.style.msUserSelect="text",h.style.userSelect="text",h.addEventListener("copy",function(d){if(d.stopPropagation(),B.format)if(d.preventDefault(),typeof d.clipboardData=="undefined"){M&&console.warn("unable to use e.clipboardData"),M&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=z[B.format]||z.default;window.clipboardData.setData(r,C)}else d.clipboardData.clearData(),d.clipboardData.setData(B.format,C);B.onCopy&&(d.preventDefault(),B.onCopy(d.clipboardData))}),document.body.appendChild(h),g.selectNodeContents(h),p.addRange(g);var o=document.execCommand("copy");if(!o)throw new Error("copy command was unsuccessful");c=!0}catch(d){M&&console.error("unable to copy using execCommand: ",d),M&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(B.format||"text",C),B.onCopy&&B.onCopy(window.clipboardData),c=!0}catch(r){M&&console.error("unable to copy using clipboardData: ",r),M&&console.error("falling back to prompt"),n=X("message"in B?B.message:P),window.prompt(n,C)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(g):p.removeAllRanges()),h&&document.body.removeChild(h),D()}return c}He.exports=N},"+aKw":function(He,pe,I){"use strict";var J=I("tJVT"),z=I("q1tI"),P=I.n(z),X=function(B){return String(B).length===1?"0".concat(B):B},N=function(B){var M=B.className,n=M===void 0?"":M,D=B.onChange,g=B.defaultValue,p=g===void 0?0:g,h=Object(z.useState)(p),c=Object(J.a)(h,2),o=c[0],d=c[1];Object(z.useEffect)(function(){var s=setTimeout(function(){d(o+1e3)},1e3);return D(o+1e3),function(){clearInterval(s)}},[o]);var r=parseInt(o/(60*6e4))||"00",a=parseInt(o%(60*6e4)/6e4)||"00",i=parseInt(o%6e4/1e3)||"00";return P.a.createElement("div",{className:n},X(r),":",X(a),":",X(i))};pe.a=N},"+ua5":function(He,pe,I){},"/cxE":function(He,pe,I){"use strict";I.d(pe,"f",function(){return P}),I.d(pe,"g",function(){return X}),I.d(pe,"h",function(){return N}),I.d(pe,"e",function(){return B}),I.d(pe,"b",function(){return M}),I.d(pe,"c",function(){return n}),I.d(pe,"d",function(){return D}),I.d(pe,"a",function(){return g});class J{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
|
|
|
|
`+p.stack):p},0)}}emit(p){this.listeners.forEach(h=>{h(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const z=new J;function P(p){B(p)||z.onUnexpectedError(p);return}function X(p){B(p)||z.onUnexpectedExternalError(p);return}function N(p){if(p instanceof Error){let{name:h,message:c}=p;const o=p.stacktrace||p.stack;return{$isError:!0,name:h,message:c,stack:o}}return p}const C="Canceled";function B(p){return p instanceof Error&&p.name===C&&p.message===C}function M(){const p=new Error(C);return p.name=p.message,p}function n(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function D(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class g extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"07cG":function(He,pe,I){He.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(He,pe){var I=arguments[3],J=arguments[4],z=arguments[5],P=JSON.stringify;He.exports=function(X,N){for(var C,B=Object.keys(z),M=0,n=B.length;M<n;M++){var D=B[M],g=z[D].exports;if(g===X||g&&g.default===X){C=D;break}}if(!C){C=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var p={},M=0,n=B.length;M<n;M++){var D=B[M];p[D]=D}J[C]=["function(require,module,exports){"+X+"(self); }",p]}var h=Math.floor(Math.pow(16,8)*Math.random()).toString(16),c={};c[C]=C,J[h]=["function(require,module,exports){var f = require("+P(C)+");(f.default ? f.default : f)(self);}",c];var o={};d(h);function d(x){o[x]=!0;for(var T in J[x][1]){var A=J[x][1][T];o[A]||d(A)}}var r="("+I+")({"+Object.keys(o).map(function(x){return P(x)+":["+J[x][0]+","+P(J[x][1])+"]"}).join(",")+"},{},["+P(h)+"])",a=window.URL||window.webkitURL||window.mozURL||window.msURL,i=new Blob([r],{type:"text/javascript"});if(N&&N.bare)return i;var s=a.createObjectURL(i),S=new Worker(s);return S.objectURL=s,S}},"19Vz":function(He,pe,I){(function(J){J(I("VrN/"))})(function(J){J.defineOption("placeholder","",function(M,n,D){var g=D&&D!=J.Init;if(n&&!g)M.on("blur",N),M.on("change",C),M.on("swapDoc",C),J.on(M.getInputField(),"compositionupdate",M.state.placeholderCompose=function(){X(M)}),C(M);else if(!n&&g){M.off("blur",N),M.off("change",C),M.off("swapDoc",C),J.off(M.getInputField(),"compositionupdate",M.state.placeholderCompose),z(M);var p=M.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}n&&!M.hasFocus()&&N(M)});function z(M){M.state.placeholder&&(M.state.placeholder.parentNode.removeChild(M.state.placeholder),M.state.placeholder=null)}function P(M){z(M);var n=M.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=M.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var D=M.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),n.appendChild(D),M.display.lineSpace.insertBefore(n,M.display.lineSpace.firstChild)}function X(M){setTimeout(function(){var n=!1,D=M.getInputField();D.nodeName=="TEXTAREA"?n=!D.value:M.lineCount()==1&&(n=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),n?P(M):z(M)},20)}function N(M){B(M)&&P(M)}function C(M){var n=M.getWrapperElement(),D=B(M);n.className=n.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?P(M):z(M)}function B(M){return M.lineCount()===1&&M.getLine(0)===""}})},"1FX+":function(He,pe,I){He.exports={flex_box_center:"flex_box_center___t3HuD",flex_space_between:"flex_space_between___3eY6W",flex_box_vertical_center:"flex_box_vertical_center___SMD2f",flex_box_center_end:"flex_box_center_end___1qy96",flex_box_column:"flex_box_column___1iEso",wrap:"wrap___3Vyua",head:"head___HUi2n",sort:"sort___1UPxB",btn:"btn___2b6SJ",listWarp:"listWarp___1pNnP",pagination:"pagination___3I0F3",fixedRight:"fixedRight___527Xj","oj-width-input":"oj-width-input___QQMFK"}},"1eCo":function(He,pe,I){(function(J){J(I("VrN/"))})(function(J){"use strict";var z={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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};J.defineMode("xml",function(X,N){var C=X.indentUnit,B={},M=N.htmlMode?z:P;for(var n in M)B[n]=M[n];for(var n in N)B[n]=N[n];var D,g;function p(f,O){function E(F){return O.tokenize=F,F(f,O)}var _=f.next();if(_=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?E(o("atom","]]>")):null:f.match("--")?E(o("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),E(d(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),O.tokenize=o("meta","?>"),"meta"):(D=f.eat("/")?"closeTag":"openTag",O.tokenize=h,"tag bracket");if(_=="&"){var k;return f.eat("#")?f.eat("x")?k=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):k=f.eatWhile(/[\d]/)&&f.eat(";"):k=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),k?"atom":"error"}else return f.eatWhile(/[^&<]/),null}p.isInText=!0;function h(f,O){var E=f.next();if(E==">"||E=="/"&&f.eat(">"))return O.tokenize=p,D=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return D="equals",null;if(E=="<"){O.tokenize=p,O.state=s,O.tagName=O.tagStart=null;var _=O.tokenize(f,O);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(E)?(O.tokenize=c(E),O.stringStartCol=f.column(),O.tokenize(f,O)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(f){var O=function(E,_){for(;!E.eol();)if(E.next()==f){_.tokenize=h;break}return"string"};return O.isInAttribute=!0,O}function o(f,O){return function(E,_){for(;!E.eol();){if(E.match(O)){_.tokenize=p;break}E.next()}return f}}function d(f){return function(O,E){for(var _;(_=O.next())!=null;){if(_=="<")return E.tokenize=d(f+1),E.tokenize(O,E);if(_==">")if(f==1){E.tokenize=p;break}else return E.tokenize=d(f-1),E.tokenize(O,E)}return"meta"}}function r(f,O,E){this.prev=f.context,this.tagName=O,this.indent=f.indented,this.startOfLine=E,(B.doNotIndent.hasOwnProperty(O)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function a(f){f.context&&(f.context=f.context.prev)}function i(f,O){for(var E;;){if(!f.context)return;if(E=f.context.tagName,!B.contextGrabbers.hasOwnProperty(E)||!B.contextGrabbers[E].hasOwnProperty(O))return;a(f)}}function s(f,O,E){return f=="openTag"?(E.tagStart=O.column(),S):f=="closeTag"?x:s}function S(f,O,E){return f=="word"?(E.tagName=O.current(),g="tag",w):B.allowMissingTagName&&f=="endTag"?(g="tag bracket",w(f,O,E)):(g="error",S)}function x(f,O,E){if(f=="word"){var _=O.current();return E.context&&E.context.tagName!=_&&B.implicitlyClosed.hasOwnProperty(E.context.tagName)&&a(E),E.context&&E.context.tagName==_||B.matchClosing===!1?(g="tag",T):(g="tag error",A)}else return B.allowMissingTagName&&f=="endTag"?(g="tag bracket",T(f,O,E)):(g="error",A)}function T(f,O,E){return f!="endTag"?(g="error",T):(a(E),s)}function A(f,O,E){return g="error",T(f,O,E)}function w(f,O,E){if(f=="word")return g="attribute",v;if(f=="endTag"||f=="selfcloseTag"){var _=E.tagName,k=E.tagStart;return E.tagName=E.tagStart=null,f=="selfcloseTag"||B.autoSelfClosers.hasOwnProperty(_)?i(E,_):(i(E,_),E.context=new r(E,_,k==E.indented)),s}return g="error",w}function v(f,O,E){return f=="equals"?b:(B.allowMissing||(g="error"),w(f,O,E))}function b(f,O,E){return f=="string"?m:f=="word"&&B.allowUnquoted?(g="string",w):(g="error",w(f,O,E))}function m(f,O,E){return f=="string"?m:w(f,O,E)}return{startState:function(f){var O={tokenize:p,state:s,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(O.baseIndent=f),O},token:function(f,O){if(!O.tagName&&f.sol()&&(O.indented=f.indentation()),f.eatSpace())return null;D=null;var E=O.tokenize(f,O);return(E||D)&&E!="comment"&&(g=null,O.state=O.state(D||E,f,O),g&&(E=g=="error"?E+" error":g)),E},indent:function(f,O,E){var _=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+C;if(_&&_.noIndent)return J.Pass;if(f.tokenize!=h&&f.tokenize!=p)return E?E.match(/^(\s*)/)[0].length:0;if(f.tagName)return B.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+C*(B.multilineTagIndentFactor||1);if(B.alignCDATA&&/<!\[CDATA\[/.test(O))return 0;var k=O&&/^<(\/)?([\w_:\.-]*)/.exec(O);if(k&&k[1])for(;_;)if(_.tagName==k[2]){_=_.prev;break}else if(B.implicitlyClosed.hasOwnProperty(_.tagName))_=_.prev;else break;else if(k)for(;_;){var F=B.contextGrabbers[_.tagName];if(F&&F.hasOwnProperty(k[2]))_=_.prev;else break}for(;_&&_.prev&&!_.startOfLine;)_=_.prev;return _?_.indent+C:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:B.htmlMode?"html":"xml",helperType:B.htmlMode?"html":"xml",skipAttribute:function(f){f.state==b&&(f.state=w)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var O=[],E=f.context;E;E=E.prev)E.tagName&&O.push(E.tagName);return O.reverse()}}}),J.defineMIME("text/xml","xml"),J.defineMIME("application/xml","xml"),J.mimeModes.hasOwnProperty("text/html")||J.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(He,pe,I){"use strict";I.d(pe,"d",function(){return Ke}),I.d(pe,"b",function(){return Le}),I.d(pe,"c",function(){return tt}),I.d(pe,"a",function(){return Ct});var J=I("VTBJ"),z=I("1OyB"),P=I("vuIU"),X=I("JX7q"),N=I("Ji7U"),C=I("LK+K"),B=I("q1tI"),M=I("I8Z2"),n=I("BGR+"),D=I("wx14"),g=I("rePB"),p=I("4IlW"),h=I("2GS6"),c=I("Gytx"),o=I.n(c),d=I("TSYQ"),r=I.n(d),a=I("U8pU"),i=I("ODXe"),s=/iPhone/i,S=/iPod/i,x=/iPad/i,T=/\bAndroid(?:.+)Mobile\b/i,A=/Android/i,w=/\bAndroid(?:.+)SD4930UR\b/i,v=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,b=/Windows Phone/i,m=/\bWindows(?:.+)ARM\b/i,f=/BlackBerry/i,O=/BB10/i,E=/Opera Mini/i,_=/\b(CriOS|Chrome)(?:.+)Mobile/i,k=/Mobile(?:.+)Firefox\b/i;function F(St,Ye){return St.test(Ye)}function L(St){var Ye=St||(typeof navigator!="undefined"?navigator.userAgent:""),at=Ye.split("[FBAN");if(typeof at[1]!="undefined"){var Ve=at,be=Object(i.a)(Ve,1);Ye=be[0]}if(at=Ye.split("Twitter"),typeof at[1]!="undefined"){var Ie=at,ot=Object(i.a)(Ie,1);Ye=ot[0]}var Xe={apple:{phone:F(s,Ye)&&!F(b,Ye),ipod:F(S,Ye),tablet:!F(s,Ye)&&F(x,Ye)&&!F(b,Ye),device:(F(s,Ye)||F(S,Ye)||F(x,Ye))&&!F(b,Ye)},amazon:{phone:F(w,Ye),tablet:!F(w,Ye)&&F(v,Ye),device:F(w,Ye)||F(v,Ye)},android:{phone:!F(b,Ye)&&F(w,Ye)||!F(b,Ye)&&F(T,Ye),tablet:!F(b,Ye)&&!F(w,Ye)&&!F(T,Ye)&&(F(v,Ye)||F(A,Ye)),device:!F(b,Ye)&&(F(w,Ye)||F(v,Ye)||F(T,Ye)||F(A,Ye))||F(/\bokhttp\b/i,Ye)},windows:{phone:F(b,Ye),tablet:F(m,Ye),device:F(b,Ye)||F(m,Ye)},other:{blackberry:F(f,Ye),blackberry10:F(O,Ye),opera:F(E,Ye),firefox:F(k,Ye),chrome:F(_,Ye),device:F(f,Ye)||F(O,Ye)||F(E,Ye)||F(k,Ye)||F(_,Ye)},any:null,phone:null,tablet:null};return Xe.any=Xe.apple.device||Xe.android.device||Xe.windows.device||Xe.other.device,Xe.phone=Xe.apple.phone||Xe.android.phone||Xe.windows.phone,Xe.tablet=Xe.apple.tablet||Xe.android.tablet||Xe.windows.tablet,Xe}var G=Object(J.a)(Object(J.a)({},L()),{},{isMobile:L}),j=G;function R(){}function V(St,Ye,at){var Ve=Ye||"";return St.key||"".concat(Ve,"item_").concat(at)}function ne(St){return"".concat(St,"-menu-")}function se(St,Ye){var at=-1;B.Children.forEach(St,function(Ve){at+=1,Ve&&Ve.type&&Ve.type.isMenuItemGroup?B.Children.forEach(Ve.props.children,function(be){at+=1,Ye(be,at)}):Ye(Ve,at)})}function Se(St,Ye,at){if(!St||at.find)return;B.Children.forEach(St,function(Ve){if(Ve){var be=Ve.type;if(!be||!(be.isSubMenu||be.isMenuItem||be.isMenuItemGroup))return;Ye.indexOf(Ve.key)!==-1?at.find=!0:Ve.props.children&&Se(Ve.props.children,Ye,at)}})}var De=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Ae=function(Ye){var at=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ve=Ye&&typeof Ye.getBoundingClientRect=="function"&&Ye.getBoundingClientRect().width;if(Ve){if(at){var be=getComputedStyle(Ye),Ie=be.marginLeft,ot=be.marginRight;Ve+=+Ie.replace("px","")+ +ot.replace("px","")}Ve=+Ve.toFixed(6)}return Ve||0},ke=function(Ye,at,Ve){Ye&&Object(a.a)(Ye.style)==="object"&&(Ye.style[at]=Ve)},je=function(){return j.any},Be=I("KQm4"),we=I("Ff2n"),Z=I("i8i4"),U=I("bdgK"),K=I("uciX"),ee=I("8XRh"),oe={adjustX:1,adjustY:1},Q={topLeft:{points:["bl","tl"],overflow:oe,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:oe,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:oe,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:oe,offset:[4,0]}},Ce={topLeft:{points:["bl","tl"],overflow:oe,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:oe,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:oe,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:oe,offset:[4,0]}},ze=Q,nt=0,xe={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Re=function(Ye,at,Ve){var be=ne(at),Ie=Ye.getState();Ye.setState({defaultActiveFirst:Object(J.a)(Object(J.a)({},Ie.defaultActiveFirst),{},Object(g.a)({},be,Ve))})},Te=function(St){Object(N.a)(at,St);var Ye=Object(C.a)(at);function at(Ve){var be;Object(z.a)(this,at),be=Ye.call(this,Ve),be.onDestroy=function(et){be.props.onDestroy(et)},be.onKeyDown=function(et){var dt=et.keyCode,vt=be.menuInstance,Tt=be.props,Pt=Tt.isOpen,_e=Tt.store;if(dt===p.a.ENTER)return be.onTitleClick(et),Re(_e,be.props.eventKey,!0),!0;if(dt===p.a.RIGHT)return Pt?vt.onKeyDown(et):(be.triggerOpenChange(!0),Re(_e,be.props.eventKey,!0)),!0;if(dt===p.a.LEFT){var ce;if(Pt)ce=vt.onKeyDown(et);else return;return ce||(be.triggerOpenChange(!1),ce=!0),ce}return Pt&&(dt===p.a.UP||dt===p.a.DOWN)?vt.onKeyDown(et):void 0},be.onOpenChange=function(et){be.props.onOpenChange(et)},be.onPopupVisibleChange=function(et){be.triggerOpenChange(et,et?"mouseenter":"mouseleave")},be.onMouseEnter=function(et){var dt=be.props,vt=dt.eventKey,Tt=dt.onMouseEnter,Pt=dt.store;Re(Pt,be.props.eventKey,!1),Tt({key:vt,domEvent:et})},be.onMouseLeave=function(et){var dt=be.props,vt=dt.parentMenu,Tt=dt.eventKey,Pt=dt.onMouseLeave;vt.subMenuInstance=Object(X.a)(be),Pt({key:Tt,domEvent:et})},be.onTitleMouseEnter=function(et){var dt=be.props,vt=dt.eventKey,Tt=dt.onItemHover,Pt=dt.onTitleMouseEnter;Tt({key:vt,hover:!0}),Pt({key:vt,domEvent:et})},be.onTitleMouseLeave=function(et){var dt=be.props,vt=dt.parentMenu,Tt=dt.eventKey,Pt=dt.onItemHover,_e=dt.onTitleMouseLeave;vt.subMenuInstance=Object(X.a)(be),Pt({key:Tt,hover:!1}),_e({key:Tt,domEvent:et})},be.onTitleClick=function(et){var dt=Object(X.a)(be),vt=dt.props;if(vt.onTitleClick({key:vt.eventKey,domEvent:et}),vt.triggerSubMenuAction==="hover")return;be.triggerOpenChange(!vt.isOpen,"click"),Re(vt.store,be.props.eventKey,!1)},be.onSubMenuClick=function(et){typeof be.props.onClick=="function"&&be.props.onClick(be.addKeyPath(et))},be.onSelect=function(et){be.props.onSelect(et)},be.onDeselect=function(et){be.props.onDeselect(et)},be.getPrefixCls=function(){return"".concat(be.props.rootPrefixCls,"-submenu")},be.getActiveClassName=function(){return"".concat(be.getPrefixCls(),"-active")},be.getDisabledClassName=function(){return"".concat(be.getPrefixCls(),"-disabled")},be.getSelectedClassName=function(){return"".concat(be.getPrefixCls(),"-selected")},be.getOpenClassName=function(){return"".concat(be.props.rootPrefixCls,"-submenu-open")},be.saveMenuInstance=function(et){be.menuInstance=et},be.addKeyPath=function(et){return Object(J.a)(Object(J.a)({},et),{},{keyPath:(et.keyPath||[]).concat(be.props.eventKey)})},be.triggerOpenChange=function(et,dt){var vt=be.props.eventKey,Tt=function(){be.onOpenChange({key:vt,item:Object(X.a)(be),trigger:dt,open:et})};dt==="mouseenter"?be.mouseenterTimeout=setTimeout(function(){Tt()},0):Tt()},be.isChildrenSelected=function(){var et={find:!1};return Se(be.props.children,be.props.selectedKeys,et),et.find},be.isOpen=function(){return be.props.openKeys.indexOf(be.props.eventKey)!==-1},be.adjustWidth=function(){if(!be.subMenuTitle||!be.menuInstance)return;var et=Z.findDOMNode(be.menuInstance);if(et.offsetWidth>=be.subMenuTitle.offsetWidth)return;et.style.minWidth="".concat(be.subMenuTitle.offsetWidth,"px")},be.saveSubMenuTitle=function(et){be.subMenuTitle=et},be.getBaseProps=function(){var et=Object(X.a)(be),dt=et.props;return{mode:dt.mode==="horizontal"?"vertical":dt.mode,visible:be.props.isOpen,level:dt.level+1,inlineIndent:dt.inlineIndent,focusable:!1,onClick:be.onSubMenuClick,onSelect:be.onSelect,onDeselect:be.onDeselect,onDestroy:be.onDestroy,selectedKeys:dt.selectedKeys,eventKey:"".concat(dt.eventKey,"-menu-"),openKeys:dt.openKeys,motion:dt.motion,onOpenChange:be.onOpenChange,subMenuOpenDelay:dt.subMenuOpenDelay,parentMenu:Object(X.a)(be),subMenuCloseDelay:dt.subMenuCloseDelay,forceSubMenuRender:dt.forceSubMenuRender,triggerSubMenuAction:dt.triggerSubMenuAction,builtinPlacements:dt.builtinPlacements,defaultActiveFirst:dt.store.getState().defaultActiveFirst[ne(dt.eventKey)],multiple:dt.multiple,prefixCls:dt.rootPrefixCls,id:be.internalMenuId,manualRef:be.saveMenuInstance,itemIcon:dt.itemIcon,expandIcon:dt.expandIcon,direction:dt.direction}},be.getMotion=function(et,dt){var vt=Object(X.a)(be),Tt=vt.haveRendered,Pt=be.props,_e=Pt.motion,ce=Pt.rootPrefixCls,W=Object(J.a)(Object(J.a)({},_e),{},{leavedClassName:"".concat(ce,"-hidden"),removeOnLeave:!1,motionAppear:Tt||!dt||et!=="inline"});return W};var Ie=Ve.store,ot=Ve.eventKey,Xe=Ie.getState(),Rt=Xe.defaultActiveFirst;be.isRootMenu=!1;var Lt=!1;return Rt&&(Lt=Rt[ot]),Re(Ie,ot,Lt),be}return Object(P.a)(at,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var be=this,Ie=this.props,ot=Ie.mode,Xe=Ie.parentMenu,Rt=Ie.manualRef;if(Rt&&Rt(this),ot!=="horizontal"||!Xe.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return be.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var be=this.props,Ie=be.onDestroy,ot=be.eventKey;Ie&&Ie(ot),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(be){var Ie=this,ot=this.getBaseProps(),Xe=this.getMotion(ot.mode,ot.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ot.visible||ot.forceSubMenuRender,!this.haveOpened)return B.createElement("div",null);var Rt=ot.direction;return B.createElement(ee.default,Object.assign({visible:ot.visible},Xe),function(Lt){var et=Lt.className,dt=Lt.style,vt=r()("".concat(ot.prefixCls,"-sub"),et,Object(g.a)({},"".concat(ot.prefixCls,"-rtl"),Rt==="rtl"));return B.createElement(re,Object.assign({},ot,{id:Ie.internalMenuId,className:vt,style:dt}),be)})}},{key:"render",value:function(){var be,Ie=Object(J.a)({},this.props),ot=Ie.isOpen,Xe=this.getPrefixCls(),Rt=Ie.mode==="inline",Lt=r()(Xe,"".concat(Xe,"-").concat(Ie.mode),(be={},Object(g.a)(be,Ie.className,!!Ie.className),Object(g.a)(be,this.getOpenClassName(),ot),Object(g.a)(be,this.getActiveClassName(),Ie.active||ot&&!Rt),Object(g.a)(be,this.getDisabledClassName(),Ie.disabled),Object(g.a)(be,this.getSelectedClassName(),this.isChildrenSelected()),be));this.internalMenuId||(Ie.eventKey?this.internalMenuId="".concat(Ie.eventKey,"$Menu"):(nt+=1,this.internalMenuId="$__$".concat(nt,"$Menu")));var et={},dt={},vt={};Ie.disabled||(et={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},dt={onClick:this.onTitleClick},vt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Tt={},Pt=Ie.direction;Rt&&(Pt==="rtl"?Tt.paddingRight=Ie.inlineIndent*Ie.level:Tt.paddingLeft=Ie.inlineIndent*Ie.level);var _e={};this.props.isOpen&&(_e={"aria-owns":this.internalMenuId});var ce=null;Ie.mode!=="horizontal"&&(ce=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ce=B.createElement(this.props.expandIcon,Object(J.a)({},this.props))));var W=B.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Tt,className:"".concat(Xe,"-title"),role:"button"},vt,dt,{"aria-expanded":ot},_e,{"aria-haspopup":"true",title:typeof Ie.title=="string"?Ie.title:void 0}),Ie.title,ce||B.createElement("i",{className:"".concat(Xe,"-arrow")})),Y=this.renderChildren(Ie.children),$=Ie.parentMenu.isRootMenu?Ie.parentMenu.props.getPopupContainer:function(sn){return sn.parentNode},te=xe[Ie.mode],ve=Ie.popupOffset?{offset:Ie.popupOffset}:{},Pe=Ie.mode==="inline"?"":Ie.popupClassName;Pe+=Pt==="rtl"?" ".concat(Xe,"-rtl"):"";var Ge=Ie.disabled,_t=Ie.triggerSubMenuAction,bt=Ie.subMenuOpenDelay,$e=Ie.forceSubMenuRender,At=Ie.subMenuCloseDelay,Jt=Ie.builtinPlacements;De.forEach(function(sn){return delete Ie[sn]}),delete Ie.onClick;var Et=Pt==="rtl"?Object.assign({},Ce,Jt):Object.assign({},Q,Jt);return delete Ie.direction,B.createElement("li",Object.assign({},Ie,et,{className:Lt,role:"menuitem"}),Rt&&W,Rt&&Y,!Rt&&B.createElement(K.a,{prefixCls:Xe,popupClassName:r()("".concat(Xe,"-popup"),Pe),getPopupContainer:$,builtinPlacements:Et,popupPlacement:te,popupVisible:ot,popupAlign:ve,popup:Y,action:Ge?[]:[_t],mouseEnterDelay:bt,mouseLeaveDelay:At,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:$e},W))}}]),at}(B.Component);Te.defaultProps={onMouseEnter:R,onMouseLeave:R,onTitleMouseEnter:R,onTitleMouseLeave:R,onTitleClick:R,manualRef:R,mode:"vertical",title:""};var Oe=Object(M.b)(function(St,Ye){var at=St.openKeys,Ve=St.activeKey,be=St.selectedKeys,Ie=Ye.eventKey,ot=Ye.subMenuKey;return{isOpen:at.indexOf(Ie)>-1,active:Ve[ot]===Ie,selectedKeys:be}})(Te);Oe.isSubMenu=!0;var Ke=Oe,Qe="menuitem-overflowed",st=.5,ut=function(St){Object(N.a)(at,St);var Ye=Object(C.a)(at);function at(){var Ve;return Object(z.a)(this,at),Ve=Ye.apply(this,arguments),Ve.resizeObserver=null,Ve.mutationObserver=null,Ve.originalTotalWidth=0,Ve.overflowedItems=[],Ve.menuItemSizes=[],Ve.cancelFrameId=null,Ve.state={lastVisibleIndex:void 0},Ve.getMenuItemNodes=function(){var be=Ve.props.prefixCls,Ie=Z.findDOMNode(Object(X.a)(Ve));return Ie?[].slice.call(Ie.children).filter(function(ot){return ot.className.split(" ").indexOf("".concat(be,"-overflowed-submenu"))<0}):[]},Ve.getOverflowedSubMenuItem=function(be,Ie,ot){var Xe=Ve.props,Rt=Xe.overflowedIndicator,Lt=Xe.level,et=Xe.mode,dt=Xe.prefixCls,vt=Xe.theme;if(Lt!==1||et!=="horizontal")return null;var Tt=Ve.props.children[0],Pt=Tt.props,_e=Pt.children,ce=Pt.title,W=Pt.style,Y=Object(we.a)(Pt,["children","title","style"]),$=Object(J.a)({},W),te="".concat(be,"-overflowed-indicator"),ve="".concat(be,"-overflowed-indicator");Ie.length===0&&ot!==!0?$=Object(J.a)(Object(J.a)({},$),{},{display:"none"}):ot&&($=Object(J.a)(Object(J.a)({},$),{},{visibility:"hidden",position:"absolute"}),te="".concat(te,"-placeholder"),ve="".concat(ve,"-placeholder"));var Pe=vt?"".concat(dt,"-").concat(vt):"",Ge={};return De.forEach(function(_t){Y[_t]!==void 0&&(Ge[_t]=Y[_t])}),B.createElement(Ke,Object.assign({title:Rt,className:"".concat(dt,"-overflowed-submenu"),popupClassName:Pe},Ge,{key:te,eventKey:ve,disabled:!1,style:$}),Ie)},Ve.setChildrenWidthAndResize=function(){if(Ve.props.mode!=="horizontal")return;var be=Z.findDOMNode(Object(X.a)(Ve));if(!be)return;var Ie=be.children;if(!Ie||Ie.length===0)return;var ot=be.children[Ie.length-1];ke(ot,"display","inline-block");var Xe=Ve.getMenuItemNodes(),Rt=Xe.filter(function(Lt){return Lt.className.split(" ").indexOf(Qe)>=0});Rt.forEach(function(Lt){ke(Lt,"display","inline-block")}),Ve.menuItemSizes=Xe.map(function(Lt){return Ae(Lt,!0)}),Rt.forEach(function(Lt){ke(Lt,"display","none")}),Ve.overflowedIndicatorWidth=Ae(be.children[be.children.length-1],!0),Ve.originalTotalWidth=Ve.menuItemSizes.reduce(function(Lt,et){return Lt+et},0),Ve.handleResize(),ke(ot,"display","none")},Ve.handleResize=function(){if(Ve.props.mode!=="horizontal")return;var be=Z.findDOMNode(Object(X.a)(Ve));if(!be)return;var Ie=Ae(be);Ve.overflowedItems=[];var ot=0,Xe;Ve.originalTotalWidth>Ie+st&&(Xe=-1,Ve.menuItemSizes.forEach(function(Rt){ot+=Rt,ot+Ve.overflowedIndicatorWidth<=Ie&&(Xe+=1)})),Ve.setState({lastVisibleIndex:Xe})},Ve}return Object(P.a)(at,[{key:"componentDidMount",value:function(){var be=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ie=Z.findDOMNode(this);if(!Ie)return;this.resizeObserver=new U.default(function(ot){ot.forEach(function(){var Xe=be.cancelFrameId;cancelAnimationFrame(Xe),be.cancelFrameId=requestAnimationFrame(be.setChildrenWidthAndResize)})}),[].slice.call(Ie.children).concat(Ie).forEach(function(ot){be.resizeObserver.observe(ot)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){be.resizeObserver.disconnect(),[].slice.call(Ie.children).concat(Ie).forEach(function(ot){be.resizeObserver.observe(ot)}),be.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ie,{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(be){var Ie=this,ot=this.state.lastVisibleIndex;return(be||[]).reduce(function(Xe,Rt,Lt){var et=Rt;if(Ie.props.mode==="horizontal"){var dt=Ie.getOverflowedSubMenuItem(Rt.props.eventKey,[]);ot!==void 0&&Ie.props.className.indexOf("".concat(Ie.props.prefixCls,"-root"))!==-1&&(Lt>ot&&(et=B.cloneElement(Rt,{style:{display:"none"},eventKey:"".concat(Rt.props.eventKey,"-hidden"),className:"".concat(Qe)})),Lt===ot+1&&(Ie.overflowedItems=be.slice(ot+1).map(function(Tt){return B.cloneElement(Tt,{key:Tt.props.eventKey,mode:"vertical-left"})}),dt=Ie.getOverflowedSubMenuItem(Rt.props.eventKey,Ie.overflowedItems)));var vt=[].concat(Object(Be.a)(Xe),[dt,et]);return Lt===be.length-1&&vt.push(Ie.getOverflowedSubMenuItem(Rt.props.eventKey,[],!0)),vt}return[].concat(Object(Be.a)(Xe),[et])},[])}},{key:"render",value:function(){var be=this.props,Ie=be.visible,ot=be.prefixCls,Xe=be.overflowedIndicator,Rt=be.mode,Lt=be.level,et=be.tag,dt=be.children,vt=be.theme,Tt=Object(we.a)(be,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Pt=et;return B.createElement(Pt,Object.assign({},Tt),this.renderChildren(dt))}}]),at}(B.Component);ut.defaultProps={tag:"div",className:""};var xt=ut;function wt(St){return St.length?St.every(function(Ye){return!!Ye.props.disabled}):!0}function Fe(St,Ye,at){var Ve=St.getState();St.setState({activeKey:Object(J.a)(Object(J.a)({},Ve.activeKey),{},Object(g.a)({},Ye,at))})}function Ue(St){return St.eventKey||"0-menu-"}function it(St,Ye){var at=Ye,Ve=St.children,be=St.eventKey;if(at){var Ie;if(se(Ve,function(ot,Xe){ot&&ot.props&&!ot.props.disabled&&at===V(ot,be,Xe)&&(Ie=!0)}),Ie)return at}return at=null,St.defaultActiveFirst&&se(Ve,function(ot,Xe){!at&&ot&&!ot.props.disabled&&(at=V(ot,be,Xe))}),at}function lt(St){if(St){var Ye=this.instanceArray.indexOf(St);Ye!==-1?this.instanceArray[Ye]=St:this.instanceArray.push(St)}}var fe=function(St){Object(N.a)(at,St);var Ye=Object(C.a)(at);function at(Ve){var be;return Object(z.a)(this,at),be=Ye.call(this,Ve),be.onKeyDown=function(Ie,ot){var Xe=Ie.keyCode,Rt;if(be.getFlatInstanceArray().forEach(function(et){et&&et.props.active&&et.onKeyDown&&(Rt=et.onKeyDown(Ie))}),Rt)return 1;var Lt=null;return(Xe===p.a.UP||Xe===p.a.DOWN)&&(Lt=be.step(Xe===p.a.UP?-1:1)),Lt?(Ie.preventDefault(),Fe(be.props.store,Ue(be.props),Lt.props.eventKey),typeof ot=="function"&&ot(Lt),1):void 0},be.onItemHover=function(Ie){var ot=Ie.key,Xe=Ie.hover;Fe(be.props.store,Ue(be.props),Xe?ot:null)},be.onDeselect=function(Ie){be.props.onDeselect(Ie)},be.onSelect=function(Ie){be.props.onSelect(Ie)},be.onClick=function(Ie){be.props.onClick(Ie)},be.onOpenChange=function(Ie){be.props.onOpenChange(Ie)},be.onDestroy=function(Ie){be.props.onDestroy(Ie)},be.getFlatInstanceArray=function(){return be.instanceArray},be.step=function(Ie){var ot=be.getFlatInstanceArray(),Xe=be.props.store.getState().activeKey[Ue(be.props)],Rt=ot.length;if(!Rt)return null;Ie<0&&(ot=ot.concat().reverse());var Lt=-1;if(ot.every(function(Tt,Pt){return Tt&&Tt.props.eventKey===Xe?(Lt=Pt,!1):!0}),!be.props.defaultActiveFirst&&Lt!==-1&&wt(ot.slice(Lt,Rt-1)))return;var et=(Lt+1)%Rt,dt=et;do{var vt=ot[dt];if(!vt||vt.props.disabled)dt=(dt+1)%Rt;else return vt}while(dt!==et);return null},be.renderCommonMenuItem=function(Ie,ot,Xe){var Rt=be.props.store.getState(),Lt=Object(X.a)(be),et=Lt.props,dt=V(Ie,et.eventKey,ot),vt=Ie.props;if(!vt||typeof Ie.type=="string")return Ie;var Tt=dt===Rt.activeKey,Pt=Object(J.a)(Object(J.a)({mode:vt.mode||et.mode,level:et.level,inlineIndent:et.inlineIndent,renderMenuItem:be.renderMenuItem,rootPrefixCls:et.prefixCls,index:ot,parentMenu:et.parentMenu,manualRef:vt.disabled?void 0:Object(h.a)(Ie.ref,lt.bind(Object(X.a)(be))),eventKey:dt,active:!vt.disabled&&Tt,multiple:et.multiple,onClick:function(ce){(vt.onClick||R)(ce),be.onClick(ce)},onItemHover:be.onItemHover,motion:et.motion,subMenuOpenDelay:et.subMenuOpenDelay,subMenuCloseDelay:et.subMenuCloseDelay,forceSubMenuRender:et.forceSubMenuRender,onOpenChange:be.onOpenChange,onDeselect:be.onDeselect,onSelect:be.onSelect,builtinPlacements:et.builtinPlacements,itemIcon:vt.itemIcon||be.props.itemIcon,expandIcon:vt.expandIcon||be.props.expandIcon},Xe),{},{direction:et.direction});return(et.mode==="inline"||je())&&(Pt.triggerSubMenuAction="click"),B.cloneElement(Ie,Pt)},be.renderMenuItem=function(Ie,ot,Xe){if(!Ie)return null;var Rt=be.props.store.getState(),Lt={openKeys:Rt.openKeys,selectedKeys:Rt.selectedKeys,triggerSubMenuAction:be.props.triggerSubMenuAction,subMenuKey:Xe};return be.renderCommonMenuItem(Ie,ot,Lt)},Ve.store.setState({activeKey:Object(J.a)(Object(J.a)({},Ve.store.getState().activeKey),{},Object(g.a)({},Ve.eventKey,it(Ve,Ve.activeKey)))}),be.instanceArray=[],be}return Object(P.a)(at,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(be){return this.props.visible||be.visible||this.props.className!==be.className||!o()(this.props.style,be.style)}},{key:"componentDidUpdate",value:function(be){var Ie=this.props,ot="activeKey"in Ie?Ie.activeKey:Ie.store.getState().activeKey[Ue(Ie)],Xe=it(Ie,ot);if(Xe!==ot)Fe(Ie.store,Ue(Ie),Xe);else if("activeKey"in be){var Rt=it(be,be.activeKey);Xe!==Rt&&Fe(Ie.store,Ue(Ie),Xe)}}},{key:"render",value:function(){var be=this,Ie=Object(D.a)({},this.props);this.instanceArray=[];var ot=r()(Ie.prefixCls,Ie.className,"".concat(Ie.prefixCls,"-").concat(Ie.mode)),Xe={className:ot,role:Ie.role||"menu"};Ie.id&&(Xe.id=Ie.id),Ie.focusable&&(Xe.tabIndex=0,Xe.onKeyDown=this.onKeyDown);var Rt=Ie.prefixCls,Lt=Ie.eventKey,et=Ie.visible,dt=Ie.level,vt=Ie.mode,Tt=Ie.overflowedIndicator,Pt=Ie.theme;return De.forEach(function(_e){return delete Ie[_e]}),delete Ie.onClick,B.createElement(xt,Object.assign({},Ie,{prefixCls:Rt,mode:vt,tag:"ul",level:dt,theme:Pt,visible:et,overflowedIndicator:Tt},Xe),B.Children.map(Ie.children,function(_e,ce){return be.renderMenuItem(_e,ce,Lt||"0-menu-")}))}}]),at}(B.Component);fe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:R};var ie=Object(M.b)()(fe),re=ie,de=I("Kwbf");function me(St,Ye,at){var Ve=St.prefixCls,be=St.motion,Ie=St.defaultMotions,ot=Ie===void 0?{}:Ie,Xe=St.openAnimation,Rt=St.openTransitionName,Lt=Ye.switchingModeFromInline;if(be)return be;if(Object(a.a)(Xe)==="object"&&Xe)Object(de.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Xe=="string")return{motionName:"".concat(Ve,"-open-").concat(Xe)};if(Rt)return{motionName:Rt};var et=ot[at];return et||(Lt?null:ot.other)}var le=function(St){Object(N.a)(at,St);var Ye=Object(C.a)(at);function at(Ve){var be;Object(z.a)(this,at),be=Ye.call(this,Ve),be.inlineOpenKeys=[],be.onSelect=function(Xe){var Rt=Object(X.a)(be),Lt=Rt.props;if(Lt.selectable){var et=be.store.getState(),dt=et.selectedKeys,vt=Xe.key;Lt.multiple?dt=dt.concat([vt]):dt=[vt],"selectedKeys"in Lt||be.store.setState({selectedKeys:dt}),Lt.onSelect(Object(J.a)(Object(J.a)({},Xe),{},{selectedKeys:dt}))}},be.onClick=function(Xe){var Rt=be.getRealMenuMode(),Lt=Object(X.a)(be),et=Lt.store,dt=Lt.props.onOpenChange;Rt!=="inline"&&!("openKeys"in be.props)&&(et.setState({openKeys:[]}),dt([])),be.props.onClick(Xe)},be.onKeyDown=function(Xe,Rt){be.innerMenu.getWrappedInstance().onKeyDown(Xe,Rt)},be.onOpenChange=function(Xe){var Rt=Object(X.a)(be),Lt=Rt.props,et=be.store.getState().openKeys.concat(),dt=!1,vt=function(Pt){var _e=!1;if(Pt.open)_e=et.indexOf(Pt.key)===-1,_e&&et.push(Pt.key);else{var ce=et.indexOf(Pt.key);_e=ce!==-1,_e&&et.splice(ce,1)}dt=dt||_e};Array.isArray(Xe)?Xe.forEach(vt):vt(Xe),dt&&("openKeys"in be.props||be.store.setState({openKeys:et}),Lt.onOpenChange(et))},be.onDeselect=function(Xe){var Rt=Object(X.a)(be),Lt=Rt.props;if(Lt.selectable){var et=be.store.getState().selectedKeys.concat(),dt=Xe.key,vt=et.indexOf(dt);vt!==-1&&et.splice(vt,1),"selectedKeys"in Lt||be.store.setState({selectedKeys:et}),Lt.onDeselect(Object(J.a)(Object(J.a)({},Xe),{},{selectedKeys:et}))}},be.onMouseEnter=function(Xe){be.restoreModeVerticalFromInline();var Rt=be.props.onMouseEnter;Rt&&Rt(Xe)},be.onTransitionEnd=function(Xe){var Rt=Xe.propertyName==="width"&&Xe.target===Xe.currentTarget,Lt=Xe.target.className,et=Object.prototype.toString.call(Lt)==="[object SVGAnimatedString]"?Lt.animVal:Lt,dt=Xe.propertyName==="font-size"&&et.indexOf("anticon")>=0;(Rt||dt)&&be.restoreModeVerticalFromInline()},be.setInnerMenu=function(Xe){be.innerMenu=Xe},be.isRootMenu=!0;var Ie=Ve.defaultSelectedKeys,ot=Ve.defaultOpenKeys;return"selectedKeys"in Ve&&(Ie=Ve.selectedKeys||[]),"openKeys"in Ve&&(ot=Ve.openKeys||[]),be.store=Object(M.c)({selectedKeys:Ie,openKeys:ot,activeKey:{"0-menu-":it(Ve,Ve.activeKey)}}),be.state={switchingModeFromInline:!1},be}return Object(P.a)(at,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(be){this.updateOpentKeysWhenSwitchMode(be),this.updateMiniStore();var Ie=this.props,ot=Ie.siderCollapsed,Xe=Ie.inlineCollapsed,Rt=Ie.onOpenChange;(!be.inlineCollapsed&&Xe||!be.siderCollapsed&&ot)&&Rt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(be){var Ie=this.props,ot=this.store,Xe=this.inlineOpenKeys,Rt=ot.getState(),Lt={};be.mode==="inline"&&Ie.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ie||((Ie.inlineCollapsed&&!be.inlineCollapsed||Ie.siderCollapsed&&!be.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Rt.openKeys.concat(),Lt.openKeys=[]),(!Ie.inlineCollapsed&&be.inlineCollapsed||!Ie.siderCollapsed&&be.siderCollapsed)&&(Lt.openKeys=Xe,this.inlineOpenKeys=[])),Object.keys(Lt).length&&ot.setState(Lt)}},{key:"updateMenuDisplay",value:function(){var be=this.props.collapsedWidth,Ie=this.store,ot=this.prevOpenKeys,Xe=this.getInlineCollapsed()&&(be===0||be==="0"||be==="0px");Xe?(this.prevOpenKeys=Ie.getState().openKeys.concat(),this.store.setState({openKeys:[]})):ot&&(this.store.setState({openKeys:ot}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var be=this.props.mode,Ie=this.state.switchingModeFromInline,ot=this.getInlineCollapsed();return Ie&&ot?"inline":ot?"vertical":be}},{key:"getInlineCollapsed",value:function(){var be=this.props,Ie=be.inlineCollapsed,ot=be.siderCollapsed;return ot!==void 0?ot:Ie}},{key:"restoreModeVerticalFromInline",value:function(){var be=this.state.switchingModeFromInline;be&&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 be=Object(J.a)({},Object(n.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ie=this.getRealMenuMode();return be.className+=" ".concat(be.prefixCls,"-root"),be.direction==="rtl"&&(be.className+=" ".concat(be.prefixCls,"-rtl")),be=Object(J.a)(Object(J.a)({},be),{},{mode:Ie,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:me(this.props,this.state,Ie)}),delete be.openAnimation,delete be.openTransitionName,B.createElement(M.a,{store:this.store},B.createElement(re,Object.assign({},be,{ref:this.setInnerMenu}),this.props.children))}}]),at}(B.Component);le.defaultProps={selectable:!0,onClick:R,onSelect:R,onOpenChange:R,onDeselect:R,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:B.createElement("span",null,"\xB7\xB7\xB7")};var he=le,Ee=function(St){Object(N.a)(at,St);var Ye=Object(C.a)(at);function at(){var Ve;return Object(z.a)(this,at),Ve=Ye.apply(this,arguments),Ve.onKeyDown=function(be){var Ie=be.keyCode;return Ie===p.a.ENTER?(Ve.onClick(be),!0):void 0},Ve.onMouseLeave=function(be){var Ie=Ve.props,ot=Ie.eventKey,Xe=Ie.onItemHover,Rt=Ie.onMouseLeave;Xe({key:ot,hover:!1}),Rt({key:ot,domEvent:be})},Ve.onMouseEnter=function(be){var Ie=Ve.props,ot=Ie.eventKey,Xe=Ie.onItemHover,Rt=Ie.onMouseEnter;Xe({key:ot,hover:!0}),Rt({key:ot,domEvent:be})},Ve.onClick=function(be){var Ie=Ve.props,ot=Ie.eventKey,Xe=Ie.multiple,Rt=Ie.onClick,Lt=Ie.onSelect,et=Ie.onDeselect,dt=Ie.isSelected,vt={key:ot,keyPath:[ot],item:Object(X.a)(Ve),domEvent:be};Rt(vt),Xe?dt?et(vt):Lt(vt):dt||Lt(vt)},Ve.saveNode=function(be){Ve.node=be},Ve}return Object(P.a)(at,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var be=this.props;be.onDestroy&&be.onDestroy(be.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 be,Ie=Object(J.a)({},this.props),ot=r()(this.getPrefixCls(),Ie.className,(be={},Object(g.a)(be,this.getActiveClassName(),!Ie.disabled&&Ie.active),Object(g.a)(be,this.getSelectedClassName(),Ie.isSelected),Object(g.a)(be,this.getDisabledClassName(),Ie.disabled),be)),Xe=Object(J.a)(Object(J.a)({},Ie.attribute),{},{title:typeof Ie.title=="string"?Ie.title:void 0,className:ot,role:Ie.role||"menuitem","aria-disabled":Ie.disabled});Ie.role==="option"?Xe=Object(J.a)(Object(J.a)({},Xe),{},{role:"option","aria-selected":Ie.isSelected}):(Ie.role===null||Ie.role==="none")&&(Xe.role="none");var Rt={onClick:Ie.disabled?null:this.onClick,onMouseLeave:Ie.disabled?null:this.onMouseLeave,onMouseEnter:Ie.disabled?null:this.onMouseEnter},Lt=Object(J.a)({},Ie.style);Ie.mode==="inline"&&(Ie.direction==="rtl"?Lt.paddingRight=Ie.inlineIndent*Ie.level:Lt.paddingLeft=Ie.inlineIndent*Ie.level),De.forEach(function(dt){return delete Ie[dt]}),delete Ie.direction;var et=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(et=B.createElement(this.props.itemIcon,this.props)),B.createElement("li",Object.assign({},Object(n.default)(Ie,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Xe,Rt,{style:Lt,ref:this.saveNode}),Ie.children,et)}}]),at}(B.Component);Ee.isMenuItem=!0,Ee.defaultProps={onSelect:R,onMouseEnter:R,onMouseLeave:R,manualRef:R};var ye=Object(M.b)(function(St,Ye){var at=St.activeKey,Ve=St.selectedKeys,be=Ye.eventKey,Ie=Ye.subMenuKey;return{active:at[Ie]===be,isSelected:Ve.indexOf(be)!==-1}})(Ee),Le=ye,Ne=function(St){Object(N.a)(at,St);var Ye=Object(C.a)(at);function at(){var Ve;return Object(z.a)(this,at),Ve=Ye.apply(this,arguments),Ve.renderInnerMenuItem=function(be){var Ie=Ve.props,ot=Ie.renderMenuItem,Xe=Ie.index;return ot(be,Xe,Ve.props.subMenuKey)},Ve}return Object(P.a)(at,[{key:"render",value:function(){var be=Object(D.a)({},this.props),Ie=be.className,ot=Ie===void 0?"":Ie,Xe=be.rootPrefixCls,Rt="".concat(Xe,"-item-group-title"),Lt="".concat(Xe,"-item-group-list"),et=be.title,dt=be.children;return De.forEach(function(vt){return delete be[vt]}),delete be.onClick,delete be.direction,B.createElement("li",Object.assign({},be,{className:"".concat(ot," ").concat(Xe,"-item-group")}),B.createElement("div",{className:Rt,title:typeof et=="string"?et:void 0},et),B.createElement("ul",{className:Lt},B.Children.map(dt,this.renderInnerMenuItem)))}}]),at}(B.Component);Ne.isMenuItemGroup=!0,Ne.defaultProps={disabled:!0};var tt=Ne,gt=function(Ye){var at=Ye.className,Ve=Ye.rootPrefixCls,be=Ye.style;return B.createElement("li",{className:"".concat(at," ").concat(Ve,"-item-divider"),style:be})};gt.defaultProps={disabled:!0,className:"",style:{}};var Ct=gt,Ot=pe.e=he},"24hK":function(He,pe,I){"use strict";I.d(pe,"a",function(){return z});class J{constructor(P){this.element=P,this.next=J.Undefined,this.prev=J.Undefined}}J.Undefined=new J(void 0);class z{constructor(){this._first=J.Undefined,this._last=J.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===J.Undefined}clear(){let P=this._first;for(;P!==J.Undefined;){const X=P.next;P.prev=J.Undefined,P.next=J.Undefined,P=X}this._first=J.Undefined,this._last=J.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,X){const N=new J(P);if(this._first===J.Undefined)this._first=N,this._last=N;else if(X){const B=this._last;this._last=N,N.prev=B,B.next=N}else{const B=this._first;this._first=N,N.next=B,B.prev=N}this._size+=1;let C=!1;return()=>{C||(C=!0,this._remove(N))}}shift(){if(this._first===J.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===J.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==J.Undefined&&P.next!==J.Undefined){const X=P.prev;X.next=P.next,P.next.prev=X}else P.prev===J.Undefined&&P.next===J.Undefined?(this._first=J.Undefined,this._last=J.Undefined):P.next===J.Undefined?(this._last=this._last.prev,this._last.next=J.Undefined):P.prev===J.Undefined&&(this._first=this._first.next,this._first.prev=J.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==J.Undefined;)yield P.element,P=P.next}}},"3/fG":function(He,pe,I){"use strict";I.d(pe,"a",function(){return z});function J(P,X){let N;return X.length===0?N=P:N=P.replace(/\{(\d+)\}/g,function(C,B){const M=B[0];return typeof X[M]!="undefined"?X[M]:C}),N}function z(P,X,...N){return J(X,N)}},"3tLw":function(He,pe,I){He.exports=I.p+"static/a.39070d50.svg"},"4xil":function(He,pe,I){He.exports={watermark:"watermark___2DVjg",videovideo:"videovideo___3jScv",animate__loop:"animate__loop___36IZ1",upDown:"upDown___3FGkz",container:"container___GV_Ds","video-container":"video-container___35tqx","video-controls":"video-controls___u99fM",hide:"hide___2GDit","video-progress":"video-progress___2LKQJ",seek:"seek___3b-US","seek-tooltip":"seek-tooltip___bZ9sZ","bottom-controls":"bottom-controls___74sQw","left-controls":"left-controls___2kBb3","right-controls":"right-controls___3oxDi","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","fullscreen-button1":"fullscreen-button1___1murk","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"55Ip":function(He,pe,I){"use strict";I.d(pe,"a",function(){return i});var J=I("Ty5D"),z=I("dI71"),P=I("q1tI"),X=I.n(P),N=I("YS25"),C=I("17x9"),B=I.n(C),M=I("wx14"),n=I("zLVn"),D=I("9R94"),g=function(b){Object(z.a)(m,b);function m(){for(var O,E=arguments.length,_=new Array(E),k=0;k<E;k++)_[k]=arguments[k];return O=b.call.apply(b,[this].concat(_))||this,O.history=Object(N.a)(O.props),O}var f=m.prototype;return f.render=function(){return X.a.createElement(J.c,{history:this.history,children:this.props.children})},m}(X.a.Component),p=function(b){Object(z.a)(m,b);function m(){for(var O,E=arguments.length,_=new Array(E),k=0;k<E;k++)_[k]=arguments[k];return O=b.call.apply(b,[this].concat(_))||this,O.history=Object(N.b)(O.props),O}var f=m.prototype;return f.render=function(){return X.a.createElement(J.c,{history:this.history,children:this.props.children})},m}(X.a.Component),h=function(m,f){return typeof m=="function"?m(f):m},c=function(m,f){return typeof m=="string"?Object(N.c)(m,null,null,f):m},o=function(m){return m},d=X.a.forwardRef;typeof d=="undefined"&&(d=o);function r(b){return!!(b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)}var a=d(function(b,m){var f=b.innerRef,O=b.navigate,E=b.onClick,_=Object(n.a)(b,["innerRef","navigate","onClick"]),k=_.target,F=Object(M.a)({},_,{onClick:function(G){try{E&&E(G)}catch(j){throw G.preventDefault(),j}!G.defaultPrevented&&G.button===0&&(!k||k==="_self")&&!r(G)&&(G.preventDefault(),O())}});return o!==d?F.ref=m||f:F.ref=f,X.a.createElement("a",F)}),i=d(function(b,m){var f=b.component,O=f===void 0?a:f,E=b.replace,_=b.to,k=b.innerRef,F=Object(n.a)(b,["component","replace","to","innerRef"]);return X.a.createElement(J.e.Consumer,null,function(L){L||Object(D.a)(!1);var G=L.history,j=c(h(_,L.location),L.location),R=j?G.createHref(j):"",V=Object(M.a)({},F,{href:R,navigate:function(){var se=h(_,L.location),Se=E?G.replace:G.push;Se(se)}});return o!==d?V.ref=m||k:V.innerRef=k,X.a.createElement(O,V)})});if(!1)var s,S;var x=function(m){return m},T=X.a.forwardRef;typeof T=="undefined"&&(T=x);function A(){for(var b=arguments.length,m=new Array(b),f=0;f<b;f++)m[f]=arguments[f];return m.filter(function(O){return O}).join(" ")}var w=T(function(b,m){var f=b["aria-current"],O=f===void 0?"page":f,E=b.activeClassName,_=E===void 0?"active":E,k=b.activeStyle,F=b.className,L=b.exact,G=b.isActive,j=b.location,R=b.sensitive,V=b.strict,ne=b.style,se=b.to,Se=b.innerRef,De=Object(n.a)(b,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return X.a.createElement(J.e.Consumer,null,function(Ae){Ae||Object(D.a)(!1);var ke=j||Ae.location,je=c(h(se,ke),ke),Be=je.pathname,we=Be&&Be.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),Z=we?Object(J.f)(ke.pathname,{path:we,exact:L,sensitive:R,strict:V}):null,U=!!(G?G(Z,ke):Z),K=U?A(F,_):F,ee=U?Object(M.a)({},ne,{},k):ne,oe=Object(M.a)({"aria-current":U&&O||null,className:K,style:ee,to:je},De);return x!==T?oe.ref=m||Se:oe.innerRef=Se,X.a.createElement(i,oe)})});if(!1)var v},"5VLF":function(He,pe,I){"use strict";var J,z;function P(X,N,C){var B=function(M,n){return X.js_beautify(M,n)};return B.js=X.js_beautify,B.css=N.css_beautify,B.html=C.html_beautify,B.js_beautify=X.js_beautify,B.css_beautify=N.css_beautify,B.html_beautify=C.html_beautify,B}!(J=[I("6UM0"),I("TXwP"),I("psGv")],z=function(X,N,C){return P(X,N,C)}.apply(pe,J),z!==void 0&&(He.exports=z))},"5Y4S":function(He,pe,I){"use strict";I.d(pe,"a",function(){return P});var J=I("MNsG");const z=J.b.performance&&typeof J.b.performance.now=="function";class P{constructor(X){this._highResolution=z&&X,this._startTime=this._now(),this._stopTime=-1}static create(X=!0){return new P(X)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?J.b.performance.now():Date.now()}}},"5nXd":function(He,pe,I){var J=I("MFOe"),z=J.slice,P=J.pluck,X=J.each,N=J.bind,C=J.create,B=J.isList,M=J.isFunction,n=J.isObject;He.exports={createStore:p};var D={version:"2.0.12",enabled:!1,get:function(h,c){var o=this.storage.read(this._namespacePrefix+h);return this._deserialize(o,c)},set:function(h,c){return c===void 0?this.remove(h):(this.storage.write(this._namespacePrefix+h,this._serialize(c)),c)},remove:function(h){this.storage.remove(this._namespacePrefix+h)},each:function(h){var c=this;this.storage.each(function(o,d){h.call(c,c._deserialize(o),(d||"").replace(c._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(h){return this._namespacePrefix=="__storejs_"+h+"_"},createStore:function(){return p.apply(this,arguments)},addPlugin:function(h){this._addPlugin(h)},namespace:function(h){return p(this.storage,this.plugins,h)}};function g(){var h=typeof console=="undefined"?null:console;if(!h)return;var c=h.warn?h.warn:h.log;c.apply(h,arguments)}function p(h,c,o){o||(o=""),h&&!B(h)&&(h=[h]),c&&!B(c)&&(c=[c]);var d=o?"__storejs_"+o+"_":"",r=o?new RegExp("^"+d):null,a=/^[a-zA-Z0-9_\-]*$/;if(!a.test(o))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var i={_namespacePrefix:d,_namespaceRegexp:r,_testStorage:function(S){try{var x="__storejs__test__";S.write(x,x);var T=S.read(x)===x;return S.remove(x),T}catch(A){return!1}},_assignPluginFnProp:function(S,x){var T=this[x];this[x]=function(){var w=z(arguments,0),v=this;function b(){return T?(X(arguments,function(f,O){w[O]=f}),T.apply(v,w)):void 0}var m=[b].concat(w);return S.apply(v,m)}},_serialize:function(S){return JSON.stringify(S)},_deserialize:function(S,x){if(!S)return x;var T="";try{T=JSON.parse(S)}catch(A){T=S}return T!==void 0?T:x},_addStorage:function(S){if(this.enabled)return;this._testStorage(S)&&(this.storage=S,this.enabled=!0)},_addPlugin:function(S){var x=this;if(B(S)){X(S,function(w){x._addPlugin(w)});return}var T=P(this.plugins,function(w){return S===w});if(T)return;if(this.plugins.push(S),!M(S))throw new Error("Plugins must be function values that return objects");var A=S.call(this);if(!n(A))throw new Error("Plugins must return an object of function properties");X(A,function(w,v){if(!M(w))throw new Error("Bad plugin property: "+v+" from plugin "+S.name+". Plugins should only return functions.");x._assignPluginFnProp(w,v)})},addStorage:function(S){g("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(S)}},s=C(i,D,{plugins:[]});return s.raw={},X(s,function(S,x){M(S)&&(s.raw[x]=N(s,S))}),X(h,function(S){s._addStorage(S)}),X(c,function(S){s._addPlugin(S)}),s}},"6+eU":function(He,pe,I){"use strict";I.d(pe,"a",function(){return T});var J=I("wx14"),z=I("rePB"),P=I("VTBJ"),X=I("1OyB"),N=I("vuIU"),C=I("Ji7U"),B=I("LK+K"),M=I("q1tI"),n=I.n(M),D=I("TSYQ"),g=I.n(D),p=function(w){var v,b="".concat(w.rootPrefixCls,"-item"),m=g()(b,"".concat(b,"-").concat(w.page),(v={},Object(z.a)(v,"".concat(b,"-active"),w.active),Object(z.a)(v,w.className,!!w.className),Object(z.a)(v,"".concat(b,"-disabled"),!w.page),v)),f=function(){w.onClick(w.page)},O=function(_){w.onKeyPress(_,w.onClick,w.page)};return n.a.createElement("li",{title:w.showTitle?w.page:null,className:m,onClick:f,onKeyPress:O,tabIndex:"0"},w.itemRender(w.page,"page",n.a.createElement("a",{rel:"nofollow"},w.page)))},h=p,c={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},o=function(A){Object(C.a)(v,A);var w=Object(B.a)(v);function v(){var b;Object(X.a)(this,v);for(var m=arguments.length,f=new Array(m),O=0;O<m;O++)f[O]=arguments[O];return b=w.call.apply(w,[this].concat(f)),b.state={goInputText:""},b.buildOptionText=function(E){return"".concat(E," ").concat(b.props.locale.items_per_page)},b.changeSize=function(E){b.props.changeSize(Number(E))},b.handleChange=function(E){b.setState({goInputText:E.target.value})},b.handleBlur=function(E){var _=b.props,k=_.goButton,F=_.quickGo,L=_.rootPrefixCls,G=b.state.goInputText;if(k||G==="")return;if(E.relatedTarget&&(E.relatedTarget.className.indexOf("".concat(L,"-prev"))>=0||E.relatedTarget.className.indexOf("".concat(L,"-next"))>=0))return;b.setState({goInputText:""}),F(b.getValidValue())},b.go=function(E){var _=b.state.goInputText;if(_==="")return;(E.keyCode===c.ENTER||E.type==="click")&&(b.setState({goInputText:""}),b.props.quickGo(b.getValidValue()))},b}return Object(N.a)(v,[{key:"getValidValue",value:function(){var m=this.state,f=m.goInputText,O=m.current;return!f||isNaN(f)?O:Number(f)}},{key:"getPageSizeOptions",value:function(){var m=this.props,f=m.pageSize,O=m.pageSizeOptions;return O.some(function(E){return E.toString()===f.toString()})?O:O.concat([f.toString()]).sort(function(E,_){var k=isNaN(Number(E))?0:Number(E),F=isNaN(Number(_))?0:Number(_);return k-F})}},{key:"render",value:function(){var m=this,f=this.props,O=f.pageSize,E=f.locale,_=f.rootPrefixCls,k=f.changeSize,F=f.quickGo,L=f.goButton,G=f.selectComponentClass,j=f.buildOptionText,R=f.selectPrefixCls,V=f.disabled,ne=this.state.goInputText,se="".concat(_,"-options"),Se=G,De=null,Ae=null,ke=null;if(!k&&!F)return null;var je=this.getPageSizeOptions();if(k&&Se){var Be=je.map(function(we,Z){return n.a.createElement(Se.Option,{key:Z,value:we.toString()},(j||m.buildOptionText)(we))});De=n.a.createElement(Se,{disabled:V,prefixCls:R,showSearch:!1,className:"".concat(se,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(O||je[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Z){return Z.parentNode}},Be)}return F&&(L&&(ke=typeof L=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:V,className:"".concat(se,"-quick-jumper-button")},E.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},L)),Ae=n.a.createElement("div",{className:"".concat(se,"-quick-jumper")},E.jump_to,n.a.createElement("input",{disabled:V,type:"text",value:ne,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,ke)),n.a.createElement("li",{className:"".concat(se)},De,Ae)}}]),v}(n.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var d=o,r=I("N2Kk");function a(){}function i(A){return typeof A=="number"&&isFinite(A)&&Math.floor(A)===A}function s(A,w,v){return v}function S(A,w,v){var b=typeof A=="undefined"?w.pageSize:A;return Math.floor((v.total-1)/b)+1}var x=function(A){Object(C.a)(v,A);var w=Object(B.a)(v);function v(b){var m;Object(X.a)(this,v),m=w.call(this,b),m.getJumpPrevPage=function(){return Math.max(1,m.state.current-(m.props.showLessItems?3:5))},m.getJumpNextPage=function(){return Math.min(S(void 0,m.state,m.props),m.state.current+(m.props.showLessItems?3:5))},m.getItemIcon=function(k,F){var L=m.props.prefixCls,G=k||n.a.createElement("button",{type:"button","aria-label":F,className:"".concat(L,"-item-link")});return typeof k=="function"&&(G=n.a.createElement(k,Object(P.a)({},m.props))),G},m.savePaginationNode=function(k){m.paginationNode=k},m.isValid=function(k){return i(k)&&k!==m.state.current},m.shouldDisplayQuickJumper=function(){var k=m.props,F=k.showQuickJumper,L=k.pageSize,G=k.total;return G<=L?!1:F},m.handleKeyDown=function(k){(k.keyCode===c.ARROW_UP||k.keyCode===c.ARROW_DOWN)&&k.preventDefault()},m.handleKeyUp=function(k){var F=m.getValidValue(k),L=m.state.currentInputValue;F!==L&&m.setState({currentInputValue:F}),k.keyCode===c.ENTER?m.handleChange(F):k.keyCode===c.ARROW_UP?m.handleChange(F-1):k.keyCode===c.ARROW_DOWN&&m.handleChange(F+1)},m.changePageSize=function(k){var F=m.state.current,L=S(k,m.state,m.props);F=F>L?L:F,L===0&&(F=m.state.current),typeof k=="number"&&("pageSize"in m.props||m.setState({pageSize:k}),"current"in m.props||m.setState({current:F,currentInputValue:F})),m.props.onShowSizeChange(F,k),"onChange"in m.props&&m.props.onChange&&m.props.onChange(F,k)},m.handleChange=function(k){var F=m.props.disabled,L=k;if(m.isValid(L)&&!F){var G=S(void 0,m.state,m.props);L>G?L=G:L<1&&(L=1),"current"in m.props||m.setState({current:L,currentInputValue:L});var j=m.state.pageSize;return m.props.onChange(L,j),L}return m.state.current},m.prev=function(){m.hasPrev()&&m.handleChange(m.state.current-1)},m.next=function(){m.hasNext()&&m.handleChange(m.state.current+1)},m.jumpPrev=function(){m.handleChange(m.getJumpPrevPage())},m.jumpNext=function(){m.handleChange(m.getJumpNextPage())},m.hasPrev=function(){return m.state.current>1},m.hasNext=function(){return m.state.current<S(void 0,m.state,m.props)},m.runIfEnter=function(k,F){if(k.key==="Enter"||k.charCode===13){for(var L=arguments.length,G=new Array(L>2?L-2:0),j=2;j<L;j++)G[j-2]=arguments[j];F.apply(void 0,G)}},m.runIfEnterPrev=function(k){m.runIfEnter(k,m.prev)},m.runIfEnterNext=function(k){m.runIfEnter(k,m.next)},m.runIfEnterJumpPrev=function(k){m.runIfEnter(k,m.jumpPrev)},m.runIfEnterJumpNext=function(k){m.runIfEnter(k,m.jumpNext)},m.handleGoTO=function(k){(k.keyCode===c.ENTER||k.type==="click")&&m.handleChange(m.state.currentInputValue)};var f=b.onChange!==a,O="current"in b;O&&!f&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var E=b.defaultCurrent;"current"in b&&(E=b.current);var _=b.defaultPageSize;return"pageSize"in b&&(_=b.pageSize),E=Math.min(E,S(_,void 0,b)),m.state={current:E,currentInputValue:E,pageSize:_},m}return Object(N.a)(v,[{key:"componentDidUpdate",value:function(m,f){var O=this.props.prefixCls;if(f.current!==this.state.current&&this.paginationNode){var E=this.paginationNode.querySelector(".".concat(O,"-item-").concat(f.current));E&&document.activeElement===E&&E.blur()}}},{key:"getValidValue",value:function(m){var f=m.target.value,O=S(void 0,this.state,this.props),E=this.state.currentInputValue,_;return f===""?_=f:isNaN(Number(f))?_=E:f>=O?_=O:_=Number(f),_}},{key:"getShowSizeChanger",value:function(){var m=this.props,f=m.showSizeChanger,O=m.total,E=m.totalBoundaryShowSizeChanger;return typeof f!="undefined"?f:O>E}},{key:"renderPrev",value:function(m){var f=this.props,O=f.prevIcon,E=f.itemRender,_=E(m,"prev",this.getItemIcon(O,"prev page")),k=!this.hasPrev();return Object(M.isValidElement)(_)?Object(M.cloneElement)(_,{disabled:k}):_}},{key:"renderNext",value:function(m){var f=this.props,O=f.nextIcon,E=f.itemRender,_=E(m,"next",this.getItemIcon(O,"next page")),k=!this.hasNext();return Object(M.isValidElement)(_)?Object(M.cloneElement)(_,{disabled:k}):_}},{key:"render",value:function(){var m=this,f=this.props,O=f.prefixCls,E=f.className,_=f.style,k=f.disabled,F=f.hideOnSinglePage,L=f.total,G=f.locale,j=f.showQuickJumper,R=f.showLessItems,V=f.showTitle,ne=f.showTotal,se=f.simple,Se=f.itemRender,De=f.showPrevNextJumpers,Ae=f.jumpPrevIcon,ke=f.jumpNextIcon,je=f.selectComponentClass,Be=f.selectPrefixCls,we=f.pageSizeOptions,Z=this.state,U=Z.current,K=Z.pageSize,ee=Z.currentInputValue;if(F===!0&&L<=K)return null;var oe=S(void 0,this.state,this.props),Q=[],Ce=null,ze=null,nt=null,xe=null,Re=null,Te=j&&j.goButton,Oe=R?1:2,Ke=U-1>0?U-1:0,Qe=U+1<oe?U+1:oe,st=Object.keys(this.props).reduce(function(le,he){return(he.substr(0,5)==="data-"||he.substr(0,5)==="aria-"||he==="role")&&(le[he]=m.props[he]),le},{});if(se)return Te&&(typeof Te=="boolean"?Re=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},G.jump_to_confirm):Re=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Te),Re=n.a.createElement("li",{title:V?"".concat(G.jump_to).concat(U,"/").concat(oe):null,className:"".concat(O,"-simple-pager")},Re)),n.a.createElement("ul",Object(J.a)({className:g()(O,"".concat(O,"-simple"),Object(z.a)({},"".concat(O,"-disabled"),k),E),style:_,ref:this.savePaginationNode},st),n.a.createElement("li",{title:V?G.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:g()("".concat(O,"-prev"),Object(z.a)({},"".concat(O,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Ke)),n.a.createElement("li",{title:V?"".concat(U,"/").concat(oe):null,className:"".concat(O,"-simple-pager")},n.a.createElement("input",{type:"text",value:ee,disabled:k,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(O,"-slash")},"/"),oe),n.a.createElement("li",{title:V?G.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:g()("".concat(O,"-next"),Object(z.a)({},"".concat(O,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Qe)),Re);if(oe<=3+Oe*2){var ut={locale:G,rootPrefixCls:O,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:V,itemRender:Se};oe||Q.push(n.a.createElement(h,Object(J.a)({},ut,{key:"noPager",page:oe,className:"".concat(O,"-disabled")})));for(var xt=1;xt<=oe;xt+=1){var wt=U===xt;Q.push(n.a.createElement(h,Object(J.a)({},ut,{key:xt,page:xt,active:wt})))}}else{var Fe=R?G.prev_3:G.prev_5,Ue=R?G.next_3:G.next_5;De&&(Ce=n.a.createElement("li",{title:V?Fe:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:g()("".concat(O,"-jump-prev"),Object(z.a)({},"".concat(O,"-jump-prev-custom-icon"),!!Ae))},Se(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Ae,"prev page"))),ze=n.a.createElement("li",{title:V?Ue:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:g()("".concat(O,"-jump-next"),Object(z.a)({},"".concat(O,"-jump-next-custom-icon"),!!ke))},Se(this.getJumpNextPage(),"jump-next",this.getItemIcon(ke,"next page")))),xe=n.a.createElement(h,{locale:G,last:!0,rootPrefixCls:O,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:oe,page:oe,active:!1,showTitle:V,itemRender:Se}),nt=n.a.createElement(h,{locale:G,rootPrefixCls:O,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:V,itemRender:Se});var it=Math.max(1,U-Oe),lt=Math.min(U+Oe,oe);U-1<=Oe&&(lt=1+Oe*2),oe-U<=Oe&&(it=oe-Oe*2);for(var fe=it;fe<=lt;fe+=1){var ie=U===fe;Q.push(n.a.createElement(h,{locale:G,rootPrefixCls:O,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:fe,page:fe,active:ie,showTitle:V,itemRender:Se}))}U-1>=Oe*2&&U!==1+2&&(Q[0]=Object(M.cloneElement)(Q[0],{className:"".concat(O,"-item-after-jump-prev")}),Q.unshift(Ce)),oe-U>=Oe*2&&U!==oe-2&&(Q[Q.length-1]=Object(M.cloneElement)(Q[Q.length-1],{className:"".concat(O,"-item-before-jump-next")}),Q.push(ze)),it!==1&&Q.unshift(nt),lt!==oe&&Q.push(xe)}var re=null;ne&&(re=n.a.createElement("li",{className:"".concat(O,"-total-text")},ne(L,[L===0?0:(U-1)*K+1,U*K>L?L:U*K])));var de=!this.hasPrev()||!oe,me=!this.hasNext()||!oe;return n.a.createElement("ul",Object(J.a)({className:g()(O,E,Object(z.a)({},"".concat(O,"-disabled"),k)),style:_,unselectable:"unselectable",ref:this.savePaginationNode},st),re,n.a.createElement("li",{title:V?G.prev_page:null,onClick:this.prev,tabIndex:de?null:0,onKeyPress:this.runIfEnterPrev,className:g()("".concat(O,"-prev"),Object(z.a)({},"".concat(O,"-disabled"),de)),"aria-disabled":de},this.renderPrev(Ke)),Q,n.a.createElement("li",{title:V?G.next_page:null,onClick:this.next,tabIndex:me?null:0,onKeyPress:this.runIfEnterNext,className:g()("".concat(O,"-next"),Object(z.a)({},"".concat(O,"-disabled"),me)),"aria-disabled":me},this.renderNext(Qe)),n.a.createElement(d,{disabled:k,locale:G,rootPrefixCls:O,selectComponentClass:je,selectPrefixCls:Be,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:U,pageSize:K,pageSizeOptions:we,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Te}))}}],[{key:"getDerivedStateFromProps",value:function(m,f){var O={};if("current"in m&&(O.current=m.current,m.current!==f.current&&(O.currentInputValue=O.current)),"pageSize"in m&&m.pageSize!==f.pageSize){var E=f.current,_=S(m.pageSize,f,m);E=E>_?_:E,"current"in m||(O.current=E,O.currentInputValue=E),O.pageSize=m.pageSize}return O}}]),v}(n.a.Component);x.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:a,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:a,locale:r.a,style:{},itemRender:s,totalBoundaryShowSizeChanger:50};var T=x},"6RRn":function(He,pe,I){"use strict";var J=I("wCXF"),z=I("n6Qo");I.d(pe,"b",function(){return z.a});var P=I("IBYe"),X=I("6eGT"),N=I("hW8S");I.d(pe,"a",function(){return N.a}),pe.c=J.b},"6UM0":function(He,pe,I){var J,z;(function(){var P;(function(){"use strict";var N=[function(n,D,g){var p=g(1).Beautifier,h=g(5).Options;function c(o,d){var r=new p(o,d);return r.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new h}},function(n,D,g){var p=g(2).Output,h=g(3).Token,c=g(4),o=g(5).Options,d=g(7).Tokenizer,r=g(7).line_starters,a=g(7).positionable_operators,i=g(7).TOKEN;function s(R,V){return V.indexOf(R)!==-1}function S(R){return R.replace(/^\s+/g,"")}function x(R){for(var V={},ne=0;ne<R.length;ne++)V[R[ne].replace(/-/g,"_")]=R[ne];return V}function T(R,V){return R&&R.type===i.RESERVED&&R.text===V}function A(R,V){return R&&R.type===i.RESERVED&&s(R.text,V)}var w=["case","return","do","if","throw","else","await","break","continue","async"],v=["before-newline","after-newline","preserve-newline"],b=x(v),m=[b.before_newline,b.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function O(R,V){if(V.multiline_frame||V.mode===f.ForInitializer||V.mode===f.Conditional)return;R.remove_indent(V.start_line_index)}function E(R){R=R.replace(c.allLineBreaks,`
|
|
`);for(var V=[],ne=R.indexOf(`
|
|
`);ne!==-1;)V.push(R.substring(0,ne)),R=R.substring(ne+1),ne=R.indexOf(`
|
|
`);return R.length&&V.push(R),V}function _(R){return R===f.ArrayLiteral}function k(R){return s(R,[f.Expression,f.ForInitializer,f.Conditional])}function F(R,V){for(var ne=0;ne<R.length;ne++){var se=R[ne].trim();if(se.charAt(0)!==V)return!1}return!0}function L(R,V){for(var ne=0,se=R.length,Se;ne<se;ne++)if(Se=R[ne],Se&&Se.indexOf(V)!==0)return!1;return!0}function G(R,V){V=V||{},this._source_text=R||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new o(V)}G.prototype.create_flags=function(R,V){var ne=0;R&&(ne=R.indentation_level,!this._output.just_added_newline()&&R.line_indent_level>ne&&(ne=R.line_indent_level));var se={mode:V,parent:R,last_token:R?R.last_token:new h(i.START_BLOCK,""),last_word:R?R.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:ne,alignment:0,line_indent_level:R?R.line_indent_level:ne,start_line_index:this._output.get_line_number(),ternary_depth:0};return se},G.prototype._reset=function(R){var V=R.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,V),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var ne=new d(R,this._options);return this._tokens=ne.tokenize(),R},G.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R,V=this._reset(this._source_text),ne=this._options.eol;this._options.eol==="auto"&&(ne=`
|
|
`,V&&c.lineBreak.test(V||"")&&(ne=V.match(c.lineBreak)[0]));for(var se=this._tokens.next();se;)this.handle_token(se),this._last_last_text=this._flags.last_token.text,this._flags.last_token=se,se=this._tokens.next();return R=this._output.get_code(ne),R},G.prototype.handle_token=function(R,V){R.type===i.START_EXPR?this.handle_start_expr(R):R.type===i.END_EXPR?this.handle_end_expr(R):R.type===i.START_BLOCK?this.handle_start_block(R):R.type===i.END_BLOCK?this.handle_end_block(R):R.type===i.WORD?this.handle_word(R):R.type===i.RESERVED?this.handle_word(R):R.type===i.SEMICOLON?this.handle_semicolon(R):R.type===i.STRING?this.handle_string(R):R.type===i.EQUALS?this.handle_equals(R):R.type===i.OPERATOR?this.handle_operator(R):R.type===i.COMMA?this.handle_comma(R):R.type===i.BLOCK_COMMENT?this.handle_block_comment(R,V):R.type===i.COMMENT?this.handle_comment(R,V):R.type===i.DOT?this.handle_dot(R):R.type===i.EOF?this.handle_eof(R):R.type===i.UNKNOWN?this.handle_unknown(R,V):this.handle_unknown(R,V)},G.prototype.handle_whitespace_and_comments=function(R,V){var ne=R.newlines,se=this._options.keep_array_indentation&&_(this._flags.mode);if(R.comments_before)for(var Se=R.comments_before.next();Se;)this.handle_whitespace_and_comments(Se,V),this.handle_token(Se,V),Se=R.comments_before.next();if(se)for(var De=0;De<ne;De+=1)this.print_newline(De>0,V);else if(this._options.max_preserve_newlines&&ne>this._options.max_preserve_newlines&&(ne=this._options.max_preserve_newlines),this._options.preserve_newlines&&ne>1){this.print_newline(!1,V);for(var Ae=1;Ae<ne;Ae+=1)this.print_newline(!0,V)}};var j=["async","break","continue","return","throw","yield"];G.prototype.allow_wrap_or_preserved_newline=function(R,V){if(V=V===void 0?!1:V,this._output.just_added_newline())return;var ne=this._options.preserve_newlines&&R.newlines||V,se=s(this._flags.last_token.text,a)||s(R.text,a);if(se){var Se=s(this._flags.last_token.text,a)&&s(this._options.operator_position,m)||s(R.text,a);ne=ne&&Se}if(ne)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(A(this._flags.last_token,j))return;this._output.set_wrap_point()}},G.prototype.print_newline=function(R,V){if(!V&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var ne=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&T(ne,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(R)&&(this._flags.multiline_frame=!0)},G.prototype.print_token_line_indentation=function(R){this._output.just_added_newline()&&(this._options.keep_array_indentation&&R.newlines&&(R.text==="["||_(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(R.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},G.prototype.print_token=function(R){if(this._output.raw){this._output.add_raw_token(R);return}if(this._options.comma_first&&R.previous&&R.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var V=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(V),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(R),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(R),this._output.non_breaking_space=!0,this._output.add_token(R.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},G.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.set_mode=function(R){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,R),this._flags=this.create_flags(this._previous_flags,R),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&O(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"]))},G.prototype.start_of_statement=function(R){var V=!1;return V=V||A(this._flags.last_token,["var","let","const"])&&R.type===i.WORD,V=V||T(this._flags.last_token,"do"),V=V||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&A(this._flags.last_token,j)&&!R.newlines,V=V||T(this._flags.last_token,"else")&&!(T(R,"if")&&!R.comments_before),V=V||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),V=V||this._flags.last_token.type===i.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(R.text==="--"||R.text==="++")&&this._last_last_text!=="function"&&R.type!==i.WORD&&R.type!==i.RESERVED,V=V||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"])),V?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(R,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R,A(R,["do","for","if","while"])),!0):!1},G.prototype.handle_start_expr=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R);var V=f.Expression;if(R.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){A(this._flags.last_token,r)&&(this._output.space_before_token=!0),this.print_token(R),this.set_mode(V),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}V=f.ArrayLiteral,_(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),s(this._flags.last_token.type,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,V=f.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,V=f.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&R.whitespace_before===""?this._output.space_before_token=!1:(s(this._flags.last_token.text,r)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var ne=this._tokens.peek(-3);if(this._options.space_after_named_function&&ne){var se=this._tokens.peek(-4);A(ne,["async","function"])||ne.text==="*"&&A(se,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(ne.text==="{"||ne.text===","||ne.text==="*"&&(se.text==="{"||se.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(R);(this._flags.last_token.type===i.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&s(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(R,R.newlines),this.print_token(R),this.set_mode(V),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},G.prototype.handle_end_expr=function(R){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(R,R.text==="]"&&_(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(R),this.restore_mode(),O(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},G.prototype.handle_start_block=function(R){this.handle_whitespace_and_comments(R);var V=this._tokens.peek(),ne=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):ne&&(s(ne.text,[":",","])&&s(V.type,[i.STRING,i.WORD,i.RESERVED])||s(V.text,["get","set","..."])&&s(ne.type,[i.WORD,i.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(ne.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):s(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||A(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(A(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var se=!V.comments_before&&V.text==="}",Se=se&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var De=0,Ae=null;this._flags.inline_frame=!0;do if(De+=1,Ae=this._tokens.peek(De-1),Ae.newlines){this._flags.inline_frame=!1;break}while(Ae.type!==i.EOF&&!(Ae.type===i.END_BLOCK&&Ae.opened===R))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(Se||this._flags.last_token.type===i.EQUALS||A(this._flags.last_token,w)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(_(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(R),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(R),this.indent(),!se&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},G.prototype.handle_end_block=function(R){for(this.handle_whitespace_and_comments(R);this._flags.mode===f.Statement;)this.restore_mode();var V=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!V?this._output.space_before_token=!0:this._options.brace_style==="expand"?V||this.print_newline():V||(_(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(R)},G.prototype.handle_word=function(R){if(R.type===i.RESERVED){if(s(R.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)R.type=i.WORD;else if(R.text==="import"&&s(this._tokens.peek().text,["(","."]))R.type=i.WORD;else if(s(R.text,["as","from"])&&!this._flags.import_block)R.type=i.WORD;else if(this._flags.mode===f.ObjectLiteral){var V=this._tokens.peek();V.text===":"&&(R.type=i.WORD)}}if(this.start_of_statement(R)?A(this._flags.last_token,["var","let","const"])&&R.type===i.WORD&&(this._flags.declaration_statement=!0):R.newlines&&!k(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!A(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(R),this.print_newline()):this.handle_whitespace_and_comments(R),this._flags.do_block&&!this._flags.do_while)if(T(R,"while")){this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&T(R,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&A(R,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(R),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R)),T(R,"function")){(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(s(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!R.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?A(this._flags.last_token,["get","set","new","export"])||A(this._flags.last_token,j)?this._output.space_before_token=!0:T(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(k(this._flags.mode)||_(this._flags.mode))||this.print_newline(),this.print_token(R),this._flags.last_word=R.text;return}var ne="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?ne="SPACE":A(R,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines?ne="NEWLINE":(ne="SPACE",this._output.space_before_token=!0):ne="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===f.BlockStatement?ne="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&k(this._flags.mode)?ne="SPACE":this._flags.last_token.type===i.STRING?ne="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&s(this._last_last_text,["{",","]))?ne="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?ne="SPACE":ne="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,ne="NEWLINE"),A(R,r)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ne="SPACE":ne="NEWLINE"),A(R,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var se=this._output.current_line;se.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ne==="NEWLINE"?A(this._flags.last_token,w)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&A(R,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!A(R,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(R,"if")&&T(R.previous,"else")?this._output.space_before_token=!0:this.print_newline()):A(R,r)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&_(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ne==="SPACE"&&(this._output.space_before_token=!0);R.previous&&(R.previous.type===i.WORD||R.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(R),this._flags.last_word=R.text,R.type===i.RESERVED&&(R.text==="do"?this._flags.do_block=!0:R.text==="if"?this._flags.if_block=!0:R.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(R,"from")&&(this._flags.import_block=!1))},G.prototype.handle_semicolon=function(R){this.start_of_statement(R)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(R);for(var V=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&T(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(R)},G.prototype.handle_string=function(R){R.text.startsWith("`")&&R.newlines===0&&R.whitespace_before===""&&(R.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(R)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(R),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R):R.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(R.previous.text==="]"||R.previous.text===")")&&R.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(R)},G.prototype.handle_equals=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0},G.prototype.handle_comma=function(R){this.handle_whitespace_and_comments(R,!0),this.print_token(R),this._output.space_before_token=!0,this._flags.declaration_statement?(k(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(R)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(R)},G.prototype.handle_operator=function(R){var V=R.text==="*"&&(A(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),ne=s(R.text,["-","+"])&&(s(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||s(this._flags.last_token.text,r)||this._flags.last_token.text===",");if(!this.start_of_statement(R)){var se=!V;this.handle_whitespace_and_comments(R,se)}if(R.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(R);return}if(R.text==="::"){this.print_token(R);return}if(this._flags.last_token.type===i.OPERATOR&&s(this._options.operator_position,m)&&this.allow_wrap_or_preserved_newline(R),R.text===":"&&this._flags.in_case){this.print_token(R),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var Se=!0,De=!0,Ae=!1;if(R.text===":"?this._flags.ternary_depth===0?Se=!1:(this._flags.ternary_depth-=1,Ae=!0):R.text==="?"&&(this._flags.ternary_depth+=1),!ne&&!V&&this._options.preserve_newlines&&s(R.text,a)){var ke=R.text===":",je=ke&&Ae,Be=ke&&!Ae;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!Be,this.print_token(R),(!ke||je)&&this.allow_wrap_or_preserved_newline(R),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!ke||je?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(R):this._output.space_before_token=!1,this.print_token(R),this._output.space_before_token=!0;return;case b.preserve_newline:Be||this.allow_wrap_or_preserved_newline(R),Se=!(this._output.just_added_newline()||Be),this._output.space_before_token=Se,this.print_token(R),this._output.space_before_token=!0;return}}if(V){this.allow_wrap_or_preserved_newline(R),Se=!1;var we=this._tokens.peek();De=we&&s(we.type,[i.WORD,i.RESERVED])}else if(R.text==="...")this.allow_wrap_or_preserved_newline(R),Se=this._flags.last_token.type===i.START_BLOCK,De=!1;else if(s(R.text,["--","++","!","~"])||ne){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(R),Se=!1,De=!1,R.newlines&&(R.text==="--"||R.text==="++"||R.text==="~")){var Z=A(this._flags.last_token,w)&&R.newlines;Z&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Z,!0)}this._flags.last_token.text===";"&&k(this._flags.mode)&&(Se=!0),this._flags.last_token.type===i.RESERVED?Se=!0:this._flags.last_token.type===i.END_EXPR?Se=!(this._flags.last_token.text==="]"&&(R.text==="--"||R.text==="++")):this._flags.last_token.type===i.OPERATOR&&(Se=s(R.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(R.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(De=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Se,this.print_token(R),this._output.space_before_token=De},G.prototype.handle_block_comment=function(R,V){if(this._output.raw){this._output.add_raw_token(R),R.directives&&R.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(R.directives){this.print_newline(!1,V),this.print_token(R),R.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(R.text)&&!R.newlines){this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0;return}else this.print_block_commment(R,V)},G.prototype.print_block_commment=function(R,V){var ne=E(R.text),se,Se=!1,De=!1,Ae=R.whitespace_before,ke=Ae.length;if(this.print_newline(!1,V),this.print_token_line_indentation(R),this._output.add_token(ne[0]),this.print_newline(!1,V),ne.length>1){for(ne=ne.slice(1),Se=F(ne,"*"),De=L(ne,Ae),Se&&(this._flags.alignment=1),se=0;se<ne.length;se++)Se?(this.print_token_line_indentation(R),this._output.add_token(S(ne[se]))):De&&ne[se]?(this.print_token_line_indentation(R),this._output.add_token(ne[se].substring(ke))):(this._output.current_line.set_indent(-1),this._output.add_token(ne[se])),this.print_newline(!1,V);this._flags.alignment=0}},G.prototype.handle_comment=function(R,V){R.newlines?this.print_newline(!1,V):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(R),this.print_newline(!1,V)},G.prototype.handle_dot=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),A(this._flags.last_token,w)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(R,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(R)},G.prototype.handle_unknown=function(R,V){this.print_token(R),R.text[R.text.length-1]===`
|
|
`&&this.print_newline(!1,V)},G.prototype.handle_eof=function(R){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R)},n.exports.Beautifier=G},function(n){function D(h){this.__parent=h,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var h=new D(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},D.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},D.prototype.has_match=function(h){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(h))return!0;return!1},D.prototype.set_indent=function(h,c){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(h){this.__items.push(h);var c=h.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=h.length-c:this.__character_count+=h.length},D.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function g(h,c){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),c=c||"",h.indent_level>0&&(c=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}g.prototype.get_indent_size=function(h,c){var o=this.__base_string_length;return c=c||0,h<0&&(o=0),o+=h*this.__indent_size,o+=c,o},g.prototype.get_indent_string=function(h,c){var o=this.__base_string;return c=c||0,h<0&&(h=0,o=""),c+=h*this.__indent_size,this.__ensure_cache(c),o+=this.__cache[c],o},g.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var h=this.__cache.length,c=0,o="";this.__indent_size&&h>=this.__indent_size&&(c=Math.floor(h/this.__indent_size),h-=c*this.__indent_size,o=new Array(c+1).join(this.__indent_string)),h&&(o+=new Array(h+1).join(" ")),this.__cache.push(o)};function p(h,c){this.__indent_cache=new g(h,c),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(h,c){return this.__indent_cache.get_indent_string(h,c)},p.prototype.get_indent_size=function(h,c){return this.__indent_cache.get_indent_size(h,c)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(h){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
|
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(o=o.replace(/[\n]/g,h)),o},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(h,c){return h=h||0,c=c||0,this.next_line.set_indent(h,c),this.__lines.length>1?(this.current_line.set_indent(h,c),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(h){for(var c=0;c<h.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(h){for(var c=this.__lines.length;h<c;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(h,c){for(var o=this.__lines.length-2;o>=0;){var d=this.__lines[o];if(d.is_empty())break;if(d.item(0).indexOf(h)!==0&&d.item(-1)!==c){this.__lines.splice(o+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=p},function(n){function D(g,p,h,c){this.type=g,this.text=p,this.comments_before=null,this.newlines=h||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=D},function(n,D){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",c="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+g+h+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+p+h+c+"])*";D.identifier=new RegExp(o+d,"g"),D.identifierStart=new RegExp(o),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+h+c+"])+");var r=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|
|
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(n,D,g){var p=g(6).Options,h=["before-newline","after-newline","preserve-newline"];function c(o){p.call(this,o,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<r.length;a++)r[a]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=r[a];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",h),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new p,n.exports.Options=c},function(n){function D(h,c){this.raw_options=g(h,c),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}D.prototype._get_array=function(h,c){var o=this.raw_options[h],d=c||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(d=o.concat()):typeof o=="string"&&(d=o.split(/[^a-zA-Z0-9_\/\-]+/)),d},D.prototype._get_boolean=function(h,c){var o=this.raw_options[h],d=o===void 0?!!c:!!o;return d},D.prototype._get_characters=function(h,c){var o=this.raw_options[h],d=c||"";return typeof o=="string"&&(d=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},D.prototype._get_number=function(h,c){var o=this.raw_options[h];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(o,10);return isNaN(d)&&(d=c),d},D.prototype._get_selection=function(h,c,o){var d=this._get_selection_list(h,c,o);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[h]+"'");return d[0]},D.prototype._get_selection_list=function(h,c,o){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[c[0]],!this._is_valid_selection(o,c))throw new Error("Invalid Default Value!");var d=this._get_array(h,o);if(!this._is_valid_selection(d,c))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[h]+"'");return d},D.prototype._is_valid_selection=function(h,c){return h.length&&c.length&&!h.some(function(o){return c.indexOf(o)===-1})};function g(h,c){var o={};h=p(h);var d;for(d in h)d!==c&&(o[d]=h[d]);if(c&&h[c])for(d in h[c])o[d]=h[c][d];return o}function p(h){var c={},o;for(o in h){var d=o.replace(/-/g,"_");c[d]=h[o]}return c}n.exports.Options=D,n.exports.normalizeOpts=p,n.exports.mergeOpts=g},function(n,D,g){var p=g(8).InputScanner,h=g(9).Tokenizer,c=g(9).TOKEN,o=g(13).Directives,d=g(4),r=g(12).Pattern,a=g(14).TemplatablePattern;function i(F,L){return L.indexOf(F)!==-1}var s={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:c.START,RAW:c.RAW,EOF:c.EOF},S=new o(/\/\*/,/\*\//),x=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[0-9]/,A=/[^\d\.]/,w=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),v=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";v=v.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),v="\\?\\.(?!\\d) "+v,v=v.replace(/ /g,"|");var b=new RegExp(v),m="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=m.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),O=new RegExp("^(?:"+f.join("|")+")$"),E,_=function(F,L){h.call(this,F,L),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var G=new r(this._input),j=new a(this._input).read_options(this._options);this.__patterns={template:j,identifier:j.starting_with(d.identifier).matching(d.identifierMatch),number:G.matching(x),punct:G.matching(b),comment:G.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:G.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:G.matching(/<!--/),html_comment_end:G.matching(/-->/),include:G.starting_with(/#include/).until_after(d.lineBreak),shebang:G.starting_with(/#!/).until_after(d.lineBreak),xml:G.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:j.until(/['\\\n\r\u2028\u2029]/),double_quote:j.until(/["\\\n\r\u2028\u2029]/),template_text:j.until(/[`\\$]/),template_expression:j.until(/[`}\\]/)}};_.prototype=new h,_.prototype._is_comment=function(F){return F.type===s.COMMENT||F.type===s.BLOCK_COMMENT||F.type===s.UNKNOWN},_.prototype._is_opening=function(F){return F.type===s.START_BLOCK||F.type===s.START_EXPR},_.prototype._is_closing=function(F,L){return(F.type===s.END_BLOCK||F.type===s.END_EXPR)&&L&&(F.text==="]"&&L.text==="["||F.text===")"&&L.text==="("||F.text==="}"&&L.text==="{")},_.prototype._reset=function(){E=!1},_.prototype._get_next_token=function(F,L){var G=null;this._readWhitespace();var j=this._input.peek();return j===null?this._create_token(s.EOF,""):(G=G||this._read_non_javascript(j),G=G||this._read_string(j),G=G||this._read_word(F),G=G||this._read_singles(j),G=G||this._read_comment(j),G=G||this._read_regexp(j,F),G=G||this._read_xml(j,F),G=G||this._read_punctuation(),G=G||this._create_token(s.UNKNOWN,this._input.next()),G)},_.prototype._read_word=function(F){var L;if(L=this.__patterns.identifier.read(),L!=="")return L=L.replace(d.allLineBreaks,`
|
|
`),!(F.type===s.DOT||F.type===s.RESERVED&&(F.text==="set"||F.text==="get"))&&O.test(L)?(L==="in"||L==="of")&&(F.type===s.WORD||F.type===s.STRING)?this._create_token(s.OPERATOR,L):this._create_token(s.RESERVED,L):this._create_token(s.WORD,L);if(L=this.__patterns.number.read(),L!=="")return this._create_token(s.WORD,L)},_.prototype._read_singles=function(F){var L=null;return F==="("||F==="["?L=this._create_token(s.START_EXPR,F):F===")"||F==="]"?L=this._create_token(s.END_EXPR,F):F==="{"?L=this._create_token(s.START_BLOCK,F):F==="}"?L=this._create_token(s.END_BLOCK,F):F===";"?L=this._create_token(s.SEMICOLON,F):F==="."&&A.test(this._input.peek(1))?L=this._create_token(s.DOT,F):F===","&&(L=this._create_token(s.COMMA,F)),L&&this._input.next(),L},_.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(s.EQUALS,F):F==="?."?this._create_token(s.DOT,F):this._create_token(s.OPERATOR,F)},_.prototype._read_non_javascript=function(F){var L="";if(F==="#"){if(this._is_first_token()&&(L=this.__patterns.shebang.read(),L))return this._create_token(s.UNKNOWN,L.trim()+`
|
|
`);if(L=this.__patterns.include.read(),L)return this._create_token(s.UNKNOWN,L.trim()+`
|
|
`);F=this._input.next();var G="#";if(this._input.hasNext()&&this._input.testChar(T)){do F=this._input.next(),G+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(G+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(G+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,G)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(L=this.__patterns.html_comment_start.read(),L){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)L+=this._input.next();return E=!0,this._create_token(s.COMMENT,L)}}else if(E&&F==="-"&&(L=this.__patterns.html_comment_end.read(),L))return E=!1,this._create_token(s.COMMENT,L);return null},_.prototype._read_comment=function(F){var L=null;if(F==="/"){var G="";if(this._input.peek(1)==="*"){G=this.__patterns.block_comment.read();var j=S.get_directives(G);j&&j.ignore==="start"&&(G+=S.readIgnored(this._input)),G=G.replace(d.allLineBreaks,`
|
|
`),L=this._create_token(s.BLOCK_COMMENT,G),L.directives=j}else this._input.peek(1)==="/"&&(G=this.__patterns.comment.read(),L=this._create_token(s.COMMENT,G))}return L},_.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var L=this._input.next();return this.has_char_escapes=!1,F==="`"?L+=this._read_string_recursive("`",!0,"${"):L+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(L=k(L)),this._input.peek()===F&&(L+=this._input.next()),L=L.replace(d.allLineBreaks,`
|
|
`),this._create_token(s.STRING,L)}return null},_.prototype._allow_regexp_or_xml=function(F){return F.type===s.RESERVED&&i(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===s.END_EXPR&&F.text===")"&&F.opened.previous.type===s.RESERVED&&i(F.opened.previous.text,["if","while","for"])||i(F.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},_.prototype._read_regexp=function(F,L){if(F==="/"&&this._allow_regexp_or_xml(L)){for(var G=this._input.next(),j=!1,R=!1;this._input.hasNext()&&(j||R||this._input.peek()!==F)&&!this._input.testChar(d.newline);)G+=this._input.peek(),j?j=!1:(j=this._input.peek()==="\\",this._input.peek()==="["?R=!0:this._input.peek()==="]"&&(R=!1)),this._input.next();return this._input.peek()===F&&(G+=this._input.next(),G+=this._input.read(d.identifier)),this._create_token(s.STRING,G)}return null},_.prototype._read_xml=function(F,L){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(L)){var G="",j=this.__patterns.xml.read_match();if(j){for(var R=j[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),V=R.indexOf("{")===0,ne=0;j;){var se=!!j[1],Se=j[2],De=!!j[j.length-1]||Se.slice(0,8)==="![CDATA[";if(!De&&(Se===R||V&&Se.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(se?--ne:++ne),G+=j[0],ne<=0)break;j=this.__patterns.xml.read_match()}return j||(G+=this._input.match(/[\s\S]*/g)[0]),G=G.replace(d.allLineBreaks,`
|
|
`),this._create_token(s.STRING,G)}}return null};function k(F){for(var L="",G=0,j=new p(F),R=null;j.hasNext();)if(R=j.match(/([\s]|[^\\]|\\\\)+/g),R&&(L+=R[0]),j.peek()==="\\"){if(j.next(),j.peek()==="x")R=j.match(/x([0-9A-Fa-f]{2})/g);else if(j.peek()==="u")R=j.match(/u([0-9A-Fa-f]{4})/g);else{L+="\\",j.hasNext()&&(L+=j.next());continue}if(!R)return F;if(G=parseInt(R[1],16),G>126&&G<=255&&R[0].indexOf("x")===0)return F;if(G>=0&&G<32){L+="\\"+R[0];continue}else G===34||G===39||G===92?L+="\\"+String.fromCharCode(G):L+=String.fromCharCode(G)}return L}_.prototype._read_string_recursive=function(F,L,G){var j,R;F==="'"?R=this.__patterns.single_quote:F==='"'?R=this.__patterns.double_quote:F==="`"?R=this.__patterns.template_text:F==="}"&&(R=this.__patterns.template_expression);for(var V=R.read(),ne="";this._input.hasNext();){if(ne=this._input.next(),ne===F||!L&&d.newline.test(ne)){this._input.back();break}else ne==="\\"&&this._input.hasNext()?(j=this._input.peek(),j==="x"||j==="u"?this.has_char_escapes=!0:j==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),ne+=this._input.next()):G&&(G==="${"&&ne==="$"&&this._input.peek()==="{"&&(ne+=this._input.next()),G===ne&&(F==="`"?ne+=this._read_string_recursive("}",L,"`"):ne+=this._read_string_recursive("`",L,"${"),this._input.hasNext()&&(ne+=this._input.next())));ne+=R.read(),V+=ne}return V},n.exports.Tokenizer=_,n.exports.TOKEN=s,n.exports.positionable_operators=w.slice(),n.exports.line_starters=m.slice()},function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function g(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},g.prototype.peek=function(p){var h=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(h=this.__input.charAt(p)),h},g.prototype.__match=function(p,h){p.lastIndex=h;var c=p.exec(this.__input);return c&&!(D&&p.sticky)&&(c.index!==h&&(c=null)),c},g.prototype.test=function(p,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(p,h):!1},g.prototype.testChar=function(p,h){var c=this.peek(h);return p.lastIndex=0,c!==null&&p.test(c)},g.prototype.match=function(p){var h=this.__match(p,this.__position);return h?this.__position+=h[0].length:h=null,h},g.prototype.read=function(p,h,c){var o="",d;return p&&(d=this.match(p),d&&(o+=d[0])),h&&(d||!p)&&(o+=this.readUntil(h,c)),o},g.prototype.readUntil=function(p,h){var c="",o=this.__position;p.lastIndex=this.__position;var d=p.exec(this.__input);return d?(o=d.index,h&&(o+=d[0].length)):o=this.__input_length,c=this.__input.substring(this.__position,o),this.__position=o,c},g.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},g.prototype.get_regexp=function(p,h){var c=null,o="g";return h&&D&&(o="y"),typeof p=="string"&&p!==""?c=new RegExp(p,o):p&&(c=new RegExp(p.source,o)),c},g.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(p){var h=this.__position,c=this.readUntilAfter(p);return this.__position=h,c},g.prototype.lookBack=function(p){var h=this.__position-1;return h>=p.length&&this.__input.substring(h-p.length,h).toLowerCase()===p},n.exports.InputScanner=g},function(n,D,g){var p=g(8).InputScanner,h=g(3).Token,c=g(10).TokenStream,o=g(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(a,i){this._input=new p(a),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var a,i=new h(d.START,""),s=null,S=[],x=new c;i.type!==d.EOF;){for(a=this._get_next_token(i,s);this._is_comment(a);)x.add(a),a=this._get_next_token(i,s);x.isEmpty()||(a.comments_before=x,x=new c),a.parent=s,this._is_opening(a)?(S.push(s),s=a):s&&this._is_closing(a,s)&&(a.opened=s,s.closed=a,s=S.pop(),a.parent=s),a.previous=i,i.next=a,this.__tokens.add(a),i=a}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(a,i){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(d.RAW,s):this._create_token(d.EOF,"")},r.prototype._is_comment=function(a){return!1},r.prototype._is_opening=function(a){return!1},r.prototype._is_closing=function(a,i){return!1},r.prototype._create_token=function(a,i){var s=new h(a,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=r,n.exports.TOKEN=d},function(n){function D(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position<this.__tokens_length},D.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},D.prototype.peek=function(g){var p=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(p=this.__tokens[g]),p},D.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},n.exports.TokenStream=D},function(n,D,g){var p=g(12).Pattern;function h(c,o){p.call(this,c,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}h.prototype=new p,h.prototype.__set_whitespace_patterns=function(c,o){c+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},h.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var c=this._input.read(this._match_pattern);if(c===" ")this.whitespace_before_token=" ";else if(c){var o=this.__split(this._newline_regexp,c);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return c},h.prototype.matching=function(c,o){var d=this._create();return d.__set_whitespace_patterns(c,o),d._update(),d},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(c,o){c.lastIndex=0;for(var d=0,r=[],a=c.exec(o);a;)r.push(o.substring(d,a.index)),d=a.index+a[0].length,a=c.exec(o);return d<o.length?r.push(o.substring(d,o.length)):r.push(""),r},n.exports.WhitespacePattern=h},function(n){function D(g,p){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}D.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(g){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(g),p._update(),p},D.prototype.until=function(g){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(g),p._update(),p},D.prototype.starting_with=function(g){var p=this._create();return p._starting_pattern=this._input.get_regexp(g,!0),p._update(),p},D.prototype.matching=function(g){var p=this._create();return p._match_pattern=this._input.get_regexp(g,!0),p._update(),p},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},n.exports.Pattern=D},function(n){function D(g,p){g=typeof g=="string"?g:g.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+p,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(g);h;)p[h[1]]=h[2],h=this.__directive_pattern.exec(g);return p},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},function(n,D,g){var p=g(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(o,d){p.call(this,o,d),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),d&&(this.__template_pattern=this._input.get_regexp(d.__template_pattern),this._excluded=Object.assign(this._excluded,d._excluded),this._disabled=Object.assign(this._disabled,d._disabled));var r=new p(o);this.__patterns={handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:r.starting_with(/{{{/).until_after(/}}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),php:r.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:r.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:r.starting_with(/{%/).until_after(/%}/),django_value:r.starting_with(/{{/).until_after(/}}/),django_comment:r.starting_with(/{#/).until_after(/#}/),smarty:r.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:r.starting_with(/{\*/).until_after(/\*}/),smarty_literal:r.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new p,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(o){var d=this._create();return d._disabled[o]=!0,d._update(),d},c.prototype.read_options=function(o){var d=this._create();for(var r in h)d._disabled[r]=o.templating.indexOf(r)===-1;return d._update(),d},c.prototype.exclude=function(o){var d=this._create();return d._excluded[o]=!0,d._update(),d},c.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),o+=d,d=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},c.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},c.prototype._read_template=function(){var o="",d=this._input.peek();if(d==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(o=o||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},n.exports.TemplatablePattern=c}],C={};function B(n){var D=C[n];if(D!==void 0)return D.exports;var g=C[n]={exports:{}};return N[n](g,g.exports,B),g.exports}var M=B(0);P=M})();var X=P;!(J=[],z=function(){return{js_beautify:X}}.apply(pe,J),z!==void 0&&(He.exports=z))})()},"6eGT":function(He,pe,I){"use strict";function J(z){return null}pe.a=J},"7+5b":function(He,pe,I){He.exports=I.p+"static/v.e7f297d6.svg"},"746U":function(He,pe,I){"use strict";I.d(pe,"f",function(){return J}),I.d(pe,"l",function(){return z}),I.d(pe,"k",function(){return P}),I.d(pe,"j",function(){return X}),I.d(pe,"g",function(){return N}),I.d(pe,"m",function(){return C}),I.d(pe,"h",function(){return B}),I.d(pe,"n",function(){return M}),I.d(pe,"c",function(){return n}),I.d(pe,"a",function(){return D}),I.d(pe,"i",function(){return g}),I.d(pe,"o",function(){return p}),I.d(pe,"e",function(){return o}),I.d(pe,"d",function(){return d}),I.d(pe,"p",function(){return r}),I.d(pe,"b",function(){return a});function J(i){return Array.isArray(i)}function z(i){return typeof i=="string"}function P(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function X(i){return typeof i=="number"&&!isNaN(i)}function N(i){return i===!0||i===!1}function C(i){return typeof i=="undefined"}function B(i){return!M(i)}function M(i){return C(i)||i===null}function n(i,s){if(!i)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function D(i){if(M(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function g(i){return typeof i=="function"}function p(i,s){const S=Math.min(i.length,s.length);for(let x=0;x<S;x++)h(i[x],s[x])}function h(i,s){if(z(s)){if(typeof i!==s)throw new Error(`argument does not match constraint: typeof ${s}`)}else if(g(s)){try{if(i instanceof s)return}catch(S){}if(!M(i)&&i.constructor===s)return;if(s.length===1&&s.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function c(i){let s=[],S=Object.getPrototypeOf(i);for(;Object.prototype!==S;)s=s.concat(Object.getOwnPropertyNames(S)),S=Object.getPrototypeOf(S);return s}function o(i){const s=[];for(const S of c(i))typeof i[S]=="function"&&s.push(S);return s}function d(i,s){const S=T=>function(){const A=Array.prototype.slice.call(arguments,0);return s(T,A)};let x={};for(const T of i)x[T]=S(T);return x}function r(i){return i===null?void 0:i}function a(i,s="Unreachable"){throw new Error(s)}},"7Cbv":function(He,pe,I){"use strict";var J=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),z=new Uint8Array(16);function P(){if(!J)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return J(z)}var X=/^(?:[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 N(h){return typeof h=="string"&&X.test(h)}for(var C=N,B=[],M=0;M<256;++M)B.push((M+256).toString(16).substr(1));function n(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(B[h[c+0]]+B[h[c+1]]+B[h[c+2]]+B[h[c+3]]+"-"+B[h[c+4]]+B[h[c+5]]+"-"+B[h[c+6]]+B[h[c+7]]+"-"+B[h[c+8]]+B[h[c+9]]+"-"+B[h[c+10]]+B[h[c+11]]+B[h[c+12]]+B[h[c+13]]+B[h[c+14]]+B[h[c+15]]).toLowerCase();if(!C(o))throw TypeError("Stringified UUID is invalid");return o}var D=n;function g(h,c,o){h=h||{};var d=h.random||(h.rng||P)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,c){o=o||0;for(var r=0;r<16;++r)c[o+r]=d[r];return c}return D(d)}var p=pe.a=g},"7ahc":function(He,pe,I){"use strict";I.d(pe,"a",function(){return S});var J=I("k1fw"),z=I("0Owb"),P=I("+L6B"),X=I("2/Rp"),N=I("y8nQ"),C=I("Vl3Y"),B=I("tJVT"),M=I("OaEy"),n=I("2fM7"),D=I("q1tI"),g=I.n(D),p=I("VrN/"),h=I.n(p),c=I("p77/"),o=I.n(c),d=I("c5Ni"),r=I.n(d),a=n.a.Option,i={labelCol:{span:4},wrapperCol:{span:20}},s={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"]};pe.b=function(x){var T=x.callback,A=x.onCancel,w=Object(D.useState)("python"),v=Object(B.a)(w,2),b=v[0],m=v[1];function f(E){m(s[E][1])}function O(E){T(E)}return g.a.createElement(C.a,Object(z.a)({},i,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:O}),g.a.createElement(C.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(n.a,{onChange:f},Object.keys(s).map(function(E){return g.a.createElement(a,{key:E,value:E},s[E][0])}))),g.a.createElement(C.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(S,{mode:b})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(X.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function S(x){var T=x.value,A=x.onChange,w=x.mode,v=x.options,b=v===void 0?{}:v,m=Object(D.useRef)(),f=Object(D.useState)(),O=Object(B.a)(f,2),E=O[0],_=O[1];return Object(D.useEffect)(function(){if(E){function k(F){var L=F.getValue();A&&A(L)}return E.on("change",k),function(){E.off("change",k)}}},[E,A]),Object(D.useEffect)(function(){E&&E.setOption("mode",w)},[E,w]),Object(D.useEffect)(function(){E&&((T!==E.getValue()||T==="")&&setTimeout(function(){E.setValue(T||" ")},300))},[E,T]),Object(D.useEffect)(function(){if(m.current&&!E){var k=h.a.fromTextArea(m.current,Object(J.a)({mode:w,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));_(k)}},[m.current,E]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:m}))}},"7ixt":function(He,pe,I){"use strict";I.d(pe,"a",function(){return P});var J={adjustX:1,adjustY:1},z=[0,0],P={left:{points:["cr","cl"],overflow:J,offset:[-4,0],targetOffset:z},right:{points:["cl","cr"],overflow:J,offset:[4,0],targetOffset:z},top:{points:["bc","tc"],overflow:J,offset:[0,-4],targetOffset:z},bottom:{points:["tc","bc"],overflow:J,offset:[0,4],targetOffset:z},topLeft:{points:["bl","tl"],overflow:J,offset:[0,-4],targetOffset:z},leftTop:{points:["tr","tl"],overflow:J,offset:[-4,0],targetOffset:z},topRight:{points:["br","tr"],overflow:J,offset:[0,-4],targetOffset:z},rightTop:{points:["tl","tr"],overflow:J,offset:[4,0],targetOffset:z},bottomRight:{points:["tr","br"],overflow:J,offset:[0,4],targetOffset:z},rightBottom:{points:["bl","br"],overflow:J,offset:[4,0],targetOffset:z},bottomLeft:{points:["tl","bl"],overflow:J,offset:[0,4],targetOffset:z},leftBottom:{points:["br","bl"],overflow:J,offset:[-4,0],targetOffset:z}},X=P},"7qur":function(He,pe,I){"use strict";I.d(pe,"m",function(){return z}),I.d(pe,"s",function(){return P}),I.d(pe,"h",function(){return X}),I.d(pe,"o",function(){return N}),I.d(pe,"n",function(){return C}),I.d(pe,"l",function(){return B}),I.d(pe,"b",function(){return M}),I.d(pe,"q",function(){return n}),I.d(pe,"t",function(){return D}),I.d(pe,"v",function(){return g}),I.d(pe,"w",function(){return p}),I.d(pe,"u",function(){return h}),I.d(pe,"p",function(){return c}),I.d(pe,"f",function(){return o}),I.d(pe,"a",function(){return d}),I.d(pe,"j",function(){return r}),I.d(pe,"k",function(){return a}),I.d(pe,"d",function(){return i}),I.d(pe,"g",function(){return s}),I.d(pe,"c",function(){return S}),I.d(pe,"e",function(){return x}),I.d(pe,"i",function(){return T}),I.d(pe,"r",function(){return A});var J=I("ErOA");function z(w){return Object(J.c)("mypractices/".concat(w,".json"),{hidePopLogin:!0})}function P(w,v){return Object(J.f)("mypractices/".concat(w,"/code_submit.json"),v)}function X(w,v){return Object(J.c)("mypractices/".concat(w,"/code_debug.json"),v)}function N(w,v){return Object(J.c)("mypractices/".concat(w,"/submit_records.json"),v)}function C(w){return Object(J.c)("mypractices/record_detail.json",{id:w})}function B(w,v){return Object(J.c)("mypractices/".concat(w,"/result.json"),{mode:v})}function M(w,v){return Object(J.f)("mypractices/".concat(w,"/add_notes.json"),v)}function n(w,v){return Object(J.f)("mypractices/".concat(w,"/restore_initial_code.json"),v)}function D(w,v){return Object(J.f)("mypractices/".concat(w,"/sync_code.json"),v)}function g(w,v){return Object(J.f)("mypractices/".concat(w,"/update_code.json"),v)}function p(w){return Object(J.f)("mypractices/".concat(w,"/initial_codes.json"))}function h(w,v){return Object(J.f)("discusses/".concat(w,"/plus.json"),v)}function c(w){return Object(J.c)("practices/practices_list.json",w)}function o(w,v){return Object(J.c)("practices/".concat(w,"/question_solution_articles"),v)}function d(w,v){return Object(J.f)("practices/".concat(w,"/question_solution_articles"),v)}function r(w,v){return Object(J.g)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function a(w,v){return Object(J.c)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/edit"),v)}function i(w,v){return Object(J.c)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function s(w,v){return Object(J.f)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/set_authority_or_excellent"),v)}function S(w,v){return Object(J.f)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/praise_or_treads"),v)}function x(w,v){return Object(J.f)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/hide"))}function T(w,v){return Object(J.b)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function A(w,v){return Object(J.f)("mypractices/".concat(w,"/update_practice_time_sum"),v)}},"815F":function(He,pe,I){"use strict";I.d(pe,"e",function(){return B}),I.d(pe,"c",function(){return n}),I.d(pe,"d",function(){return D}),I.d(pe,"a",function(){return p}),I.d(pe,"f",function(){return h}),I.d(pe,"b",function(){return c});var J=I("KQm4"),z=I("VTBJ"),P=I("Ff2n"),X=I("Zm9Q"),N=I("Kwbf"),C=I("OZM5");function B(o,d){return o!=null?o:d}function M(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=new Map;function r(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(s){var S=s.key,x=s.children;Object(N.a)(S!=null,"Tree node must have a certain key: [".concat(i).concat(S,"]"));var T=String(S);Object(N.a)(!d.has(T)||S===null||S===void 0,"Same 'key' exist in the Tree: ".concat(T)),d.set(T,!0),r(x,"".concat(i).concat(T," > "))})}r(o)}function n(o){function d(r){var a=Object(X.a)(r);return a.map(function(i){if(!Object(C.i)(i))return Object(N.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var s=i.key,S=i.props,x=S.children,T=Object(P.a)(S,["children"]),A=Object(z.a)({key:s},T),w=d(x);return w.length&&(A.children=w),A}).filter(function(i){return i})}return d(o)}function D(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=new Set(d===!0?[]:d),a=[];function i(s){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return s.map(function(x,T){var A=Object(C.h)(S?S.pos:"0",T),w=B(x.key,A),v=Object(z.a)(Object(z.a)({},x),{},{parent:S,pos:A,children:null,data:x,isStart:[].concat(Object(J.a)(S?S.isStart:[]),[T===0]),isEnd:[].concat(Object(J.a)(S?S.isEnd:[]),[T===s.length-1])});return a.push(v),d===!0||r.has(w)?v.children=i(x.children||[],v):v.children=[],v})}return i(o),a}function g(o,d,r){var a;r?typeof r=="string"?a=function(S){return S[r]}:typeof r=="function"&&(a=function(S){return r(S)}):a=function(S,x){return B(S.key,x)};function i(s,S,x){var T=s?s.children:o,A=s?Object(C.h)(x.pos,S):"0";if(s){var w=a(s,A),v={node:s,index:S,pos:A,key:w,parentPos:x.node?x.pos:null,level:x.level+1};d(v)}T&&T.forEach(function(b,m){i(b,m,{node:s,pos:A,level:x?x.level+1:-1})})}i(null)}function p(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=d.initWrapper,a=d.processEntity,i=d.onProcessFinished,s=arguments.length>2?arguments[2]:void 0,S={},x={},T={posEntities:S,keyEntities:x};return r&&(T=r(T)||T),g(o,function(A){var w=A.node,v=A.index,b=A.pos,m=A.key,f=A.parentPos,O=A.level,E={node:w,index:v,key:m,pos:b,level:O},_=B(m,b);S[b]=E,x[_]=E,E.parent=S[f],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),a&&a(E,T)},s),i&&i(T),T}function h(o,d){var r=d.expandedKeys,a=d.selectedKeys,i=d.loadedKeys,s=d.loadingKeys,S=d.checkedKeys,x=d.halfCheckedKeys,T=d.dragOverNodeKey,A=d.dropPosition,w=d.keyEntities,v=w[o],b={eventKey:o,expanded:r.indexOf(o)!==-1,selected:a.indexOf(o)!==-1,loaded:i.indexOf(o)!==-1,loading:s.indexOf(o)!==-1,checked:S.indexOf(o)!==-1,halfChecked:x.indexOf(o)!==-1,pos:String(v?v.pos:""),dragOver:T===o&&A===0,dragOverGapTop:T===o&&A===-1,dragOverGapBottom:T===o&&A===1};return b}function c(o){var d=o.data,r=o.expanded,a=o.selected,i=o.checked,s=o.loaded,S=o.loading,x=o.halfChecked,T=o.dragOver,A=o.dragOverGapTop,w=o.dragOverGapBottom,v=o.pos,b=o.active,m=Object(z.a)(Object(z.a)({},d),{},{expanded:r,selected:a,checked:i,loaded:s,loading:S,halfChecked:x,dragOver:T,dragOverGapTop:A,dragOverGapBottom:w,pos:v,active:b});return"props"in m||Object.defineProperty(m,"props",{get:function(){return Object(N.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),m}},"8EBN":function(He,pe,I){(function(J){J(I("VrN/"))})(function(J){"use strict";J.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 z=0;z<J.modeInfo.length;z++){var P=J.modeInfo[z];P.mimes&&(P.mime=P.mimes[0])}J.findModeByMIME=function(X){X=X.toLowerCase();for(var N=0;N<J.modeInfo.length;N++){var C=J.modeInfo[N];if(C.mime==X)return C;if(C.mimes){for(var B=0;B<C.mimes.length;B++)if(C.mimes[B]==X)return C}}if(/\+xml$/.test(X))return J.findModeByMIME("application/xml");if(/\+json$/.test(X))return J.findModeByMIME("application/json")},J.findModeByExtension=function(X){X=X.toLowerCase();for(var N=0;N<J.modeInfo.length;N++){var C=J.modeInfo[N];if(C.ext){for(var B=0;B<C.ext.length;B++)if(C.ext[B]==X)return C}}},J.findModeByFileName=function(X){for(var N=0;N<J.modeInfo.length;N++){var C=J.modeInfo[N];if(C.file&&C.file.test(X))return C}var B=X.lastIndexOf("."),M=B>-1&&X.substring(B+1,X.length);if(M)return J.findModeByExtension(M)},J.findModeByName=function(X){X=X.toLowerCase();for(var N=0;N<J.modeInfo.length;N++){var C=J.modeInfo[N];if(C.name.toLowerCase()==X)return C;if(C.alias){for(var B=0;B<C.alias.length;B++)if(C.alias[B].toLowerCase()==X)return C}}}})},"8HAY":function(He,pe,I){"use strict";I.d(pe,"a",function(){return N}),I.d(pe,"b",function(){return C}),I.d(pe,"d",function(){return B}),I.d(pe,"e",function(){return M}),I.d(pe,"c",function(){return n});var J=I("MI8n"),z=I("pmY6"),P=I("3/fG"),X=function(D,g,p,h){function c(o){return o instanceof p?o:new p(function(d){d(o)})}return new(p||(p=Promise))(function(o,d){function r(s){try{i(h.next(s))}catch(S){d(S)}}function a(s){try{i(h.throw(s))}catch(S){d(S)}}function i(s){s.done?o(s.value):c(s.value).then(r,a)}i((h=h.apply(D,g||[])).next())})};class N extends z.a{constructor(D,g="",p="",h=!0,c){super();this._onDidChange=this._register(new J.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=g,this._cssClass=p,this._enabled=h,this._actionCallback=c}get id(){return this._id}get label(){return this._label}set label(D){this._setLabel(D)}_setLabel(D){this._label!==D&&(this._label=D,this._onDidChange.fire({label:D}))}get tooltip(){return this._tooltip||""}set tooltip(D){this._setTooltip(D)}_setTooltip(D){this._tooltip!==D&&(this._tooltip=D,this._onDidChange.fire({tooltip:D}))}get class(){return this._cssClass}set class(D){this._setClass(D)}_setClass(D){this._cssClass!==D&&(this._cssClass=D,this._onDidChange.fire({class:D}))}get enabled(){return this._enabled}set enabled(D){this._setEnabled(D)}_setEnabled(D){this._enabled!==D&&(this._enabled=D,this._onDidChange.fire({enabled:D}))}get checked(){return this._checked}set checked(D){this._setChecked(D)}_setChecked(D){this._checked!==D&&(this._checked=D,this._onDidChange.fire({checked:D}))}run(D,g){return X(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class C extends z.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new J.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new J.b),this.onDidRun=this._onDidRun.event}run(D,g){return X(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let p;try{yield this.runAction(D,g)}catch(h){p=h}this._onDidRun.fire({action:D,error:p})})}runAction(D,g){return X(this,void 0,void 0,function*(){yield D.run(g)})}}class B extends N{constructor(D){super(B.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}B.ID="vs.actions.separator";class M{constructor(D,g,p,h){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=g,this.class=h,this._actions=p}get actions(){return this._actions}dispose(){}run(){return X(this,void 0,void 0,function*(){})}}class n extends N{constructor(){super(n.ID,P.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(He,pe,I){He.exports={button:"button___1wy9m"}},"9+Du":function(He,pe,I){"use strict";var J=I("k1fw"),z=I("9og8"),P=I("tJVT"),X=I("WmNS"),N=I.n(X),C=I("q1tI"),B=I.n(C),M=I("ErOA"),n=I("7Cbv"),D=I("TSYQ"),g=I.n(D),p=I("vef1"),h=I.n(p),c=function(d,r){var a=d.chunkSize,i=a===void 0?1024*1024*2:a,s=d.options,S=s===void 0?{}:s,x=d.onCancel,T=d.onComplete,A=d.onError,w=d.onProgress,v=d.onBefore,b=d.onBeginInitFile,m=d.children,f=d.accept,O=d.className,E=d.style,_=E===void 0?{}:E,k=d.concurrency,F=k===void 0?4:k,L=Object(C.useState)("ready"),G=Object(P.a)(L,2),j=G[0],R=G[1],V=Object(C.useState)(0),ne=Object(P.a)(V,2),se=ne[0],Se=ne[1],De=Object(C.useState)(""),Ae=Object(P.a)(De,2),ke=Ae[0],je=Ae[1],Be=Object(C.useState)(null),we=Object(P.a)(Be,2),Z=we[0],U=we[1],K=Object(C.useRef)(null),ee=Object(C.useRef)(Object(n.a)()),oe=Object(C.useRef)(!1);Object(C.useImperativeHandle)(r,function(){return{cancel:ze,file:Z,uploadStatus:j}});var Q=function(){var Re=document.getElementById(ee.current);Re&&(Re.value="")},Ce=function(){var xe=Object(z.a)(N.a.mark(function Re(Te){var Oe,Ke;return N.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:if(!(j==="uploading")){st.next=2;break}return st.abrupt("return");case 2:return b&&b(Te),Oe=Te.size,Ke=Math.ceil(Oe/i),oe.current=!1,R("uploading"),Se(0),je(""),st.prev=9,st.delegateYield(N.a.mark(function ut(){var xt,wt,Fe,Ue,it,lt,fe,ie,re,de,me,le;return N.a.wrap(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:return Ee.next=2,Object(M.a)("/api/attachments/multipart_upload_start",{method:"POST",body:Object(J.a)({fileName:Te.name,chunkCount:Ke},S)});case 2:if(xt=Ee.sent,!(oe.current||(xt==null?void 0:xt.status)!==0)){Ee.next=5;break}throw new Error;case 5:for(wt=xt.upload_id,K.current=new AbortController,Fe=[],Ue=0,it=function(Le){var Ne=Le*i,tt=Math.min(Ne+i,Oe),gt=Te.slice(Ne,tt),Ct=new FormData;Ct.append("chunk",gt),Ct.append("fileName",Te.name),Ct.append("chunkIndex",(Le+1).toString()),Ct.append("uploadId",wt);for(var Ot in S)Object.prototype.hasOwnProperty.call(S,Ot)&&Ct.append(Ot,S[Ot]);Fe.push(function(){return Object(M.a)("/api/attachments/multipart_upload",{method:"POST",body:Ct,signal:K.current.signal},!0).then(function(St){Ue++;var Ye=Math.round(Ue/Ke*100);Se(Ye),w&&w(Object(J.a)(Object(J.a)({},St),{},{file:Te,percent:Ye}))})})},lt=0;lt<Ke;lt++)it(lt);fe=0,ie=F;case 13:if(!(fe<Fe.length)){Ee.next=22;break}if(de=(re=Fe.slice(fe,fe+ie))===null||re===void 0?void 0:re.map(function(ye){return ye()}),!(de.length>0)){Ee.next=20;break}return Ee.next=18,Promise.all(de);case 18:me=Ee.sent,fe+=ie;case 20:Ee.next=13;break;case 22:return Ee.next=24,Object(M.a)("/api/attachments/multipart_upload_end",{method:"POST",body:Object(J.a)({fileName:Te.name,chunkCount:Ke,uploadId:wt},S)});case 24:le=Ee.sent,le.object?(R("success"),Q(),T&&T(Object(J.a)(Object(J.a)({},le),{},{file:Te,percent:100}))):(R("error"),je("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),Q(),A&&A(Te.name));case 26:case"end":return Ee.stop()}},ut)})(),"t0",11);case 11:st.next=19;break;case 13:st.prev=13,st.t1=st.catch(9),R("error"),je("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),Q(),A&&A(Te.name);case 19:case"end":return st.stop()}},Re,null,[[9,13]])}));return function(Te){return xe.apply(this,arguments)}}(),ze=Object(C.useCallback)(function(){oe.current=!0,K.current&&(K.current.abort(),x&&x())},[x]),nt=function(Re){var Te,Oe,Ke=Re==null||((Te=Re.target)===null||Te===void 0||((Oe=Te.files)===null||Oe===void 0))?void 0:Oe[0];if(U(Ke),j="ready",!Ke)return;if(v){var Qe=v(Ke);Qe||Ce(Ke),Q();return}Ce(Ke)};return B.a.createElement(C.Fragment,null,B.a.createElement("input",{type:"file",id:ee.current,style:{display:"none"},onChange:nt,accept:f}),B.a.createElement("label",{className:g()(h.a.upload,O),htmlFor:ee.current,style:_},m))};pe.a=Object(C.forwardRef)(c)},"9Bee":function(He,pe,I){"use strict";var J=I("DYRE"),z=I("zeV3"),P=I("+L6B"),X=I("2/Rp"),N=I("k1fw"),C=I("9og8"),B=I("tJVT"),M=I("WmNS"),n=I.n(M),D=I("q1tI"),g=I.n(D),p=I("vg9a"),h=I("DlQD"),c=I.n(h),o=I("rUJ1");function d(fe,ie){var re=fe.match(/^(\s+)(?:```)/);if(re===null)return ie;var de=re[1];return ie.split(`
|
|
`).map(function(me){var le=me.match(/^\s+/);if(le===null)return me;var he=Object(B.a)(le,1),Ee=he[0];return Ee.length>=de.length?me.slice(de.length):me}).join(`
|
|
`)}var r=[],a=["<ul>"],i=new c.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function S(){r.length=0,a=["<ul>"]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(fe,ie,re,de){if(ie>=fe.length||fe[ie].level<=re)return ie;var me=fe[ie];de.push("<li><a href='#"+me.anchor+"'>"+me.text+"</a>"),ie++;var le=[];return ie=T(fe,ie,me.level,le),le.length>0&&(de.push("<ul>"),le.forEach(function(he){de.push(he)}),de.push("</ul>")),de.push("</li>"),ie=T(fe,ie,re,de),ie}function A(){return T(r,0,0,a),a.push("</ul>"),a.join("")}var w={heading:function(ie){var re=s.exec(ie);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},fences:function(ie){var re=this.rules.block.fences.exec(ie);if(re){var de=re[0],me=d(de,re[3]||""),le=re[2]?re[2].trim():re[2];if(["latex","katex","math"].indexOf(le)>=0){var he=m(),Ee=me;me=he,f[he]={type:"block",expression:Ee}}return{type:"code",raw:de,lang:le,text:me}}}},v=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,m=function(){return"__special_katext_id_".concat(b++,"__")},f={};function O(){return f}function E(){b=0,f={}}function _(fe){return fe=fe.replace(v,function(ie,re){var de=m();return f[de]={type:"inline",expression:re},de}),fe}var k=i.listitem;i.listitem=function(fe){return k(_(fe))};var F=i.paragraph;i.paragraph=function(fe){return F(_(fe))};var L=i.tablecell;i.tablecell=function(fe,ie){return L(_(fe),ie)},i.code=function(fe,ie,re){var de=(ie||"").match(/\S*/)[0];return de?["latex","katex","math"].indexOf(de)>=0?"<p class='editormd-tex'>".concat(fe,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ie,'">').concat(re?fe:Object(o.escape)(fe,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(re?fe:Object(o.escape)(fe,!0))+"</code></pre>"},i.heading=function(fe,ie,re){var de=this.options.headerPrefix+re.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return r.push({anchor:de,level:ie,text:fe}),"<h"+ie+' id="'+de+'">'+fe+"</h"+ie+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:w,renderer:i});var G=c.a,j=I("SJMd"),R=I("ulZh"),V=I.n(R),ne=I("m3rI"),se=I("Oy/b"),Se=I("p5ED"),De=I("ErOA"),Ae=I("STEk");/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var ke=function(fe,ie){return(ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(re,de){re.__proto__=de}||function(re,de){for(var me in de)Object.prototype.hasOwnProperty.call(de,me)&&(re[me]=de[me])})(fe,ie)};function je(fe,ie){if(typeof ie!="function"&&ie!==null)throw new TypeError("Class extends value "+String(ie)+" is not a constructor or null");function re(){this.constructor=fe}ke(fe,ie),fe.prototype=ie===null?Object.create(ie):(re.prototype=ie.prototype,new re)}function Be(fe,ie,re,de){return new(re||(re=Promise))(function(me,le){function he(Le){try{ye(de.next(Le))}catch(Ne){le(Ne)}}function Ee(Le){try{ye(de.throw(Le))}catch(Ne){le(Ne)}}function ye(Le){var Ne;Le.done?me(Le.value):(Ne=Le.value,Ne instanceof re?Ne:new re(function(tt){tt(Ne)})).then(he,Ee)}ye((de=de.apply(fe,ie||[])).next())})}function we(fe,ie){var re,de,me,le,he={label:0,sent:function(){if(1&me[0])throw me[1];return me[1]},trys:[],ops:[]};return le={next:Ee(0),throw:Ee(1),return:Ee(2)},typeof Symbol=="function"&&(le[Symbol.iterator]=function(){return this}),le;function Ee(ye){return function(Le){return function(Ne){if(re)throw new TypeError("Generator is already executing.");for(;he;)try{if(re=1,de&&(me=2&Ne[0]?de.return:Ne[0]?de.throw||((me=de.return)&&me.call(de),0):de.next)&&!(me=me.call(de,Ne[1])).done)return me;switch(de=0,me&&(Ne=[2&Ne[0],me.value]),Ne[0]){case 0:case 1:me=Ne;break;case 4:return he.label++,{value:Ne[1],done:!1};case 5:he.label++,de=Ne[1],Ne=[0];continue;case 7:Ne=he.ops.pop(),he.trys.pop();continue;default:if(!(me=he.trys,(me=me.length>0&&me[me.length-1])||Ne[0]!==6&&Ne[0]!==2)){he=0;continue}if(Ne[0]===3&&(!me||Ne[1]>me[0]&&Ne[1]<me[3])){he.label=Ne[1];break}if(Ne[0]===6&&he.label<me[1]){he.label=me[1],me=Ne;break}if(me&&he.label<me[2]){he.label=me[2],he.ops.push(Ne);break}me[2]&&he.ops.pop(),he.trys.pop();continue}Ne=ie.call(fe,he)}catch(tt){Ne=[6,tt],de=0}finally{re=me=0}if(5&Ne[0])throw Ne[1];return{value:Ne[0]?Ne[1]:void 0,done:!0}}([ye,Le])}}}var Z=function(){function fe(){}return fe.addKey=function(ie){fe.key=ie},Object.defineProperty(fe,"isLicensed",{get:function(){return!!fe.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(fe.key)},enumerable:!1,configurable:!0}),fe}(),U=function(){function fe(){}return fe.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},fe.setAttributes=function(ie,re){for(var de=0,me=re;de<me.length;de++){var le=me[de],he=le[0],Ee=le[1];ie.setAttribute(he,Ee)}},fe.createRect=function(ie,re,de){var me=document.createElementNS("http://www.w3.org/2000/svg","rect");return me.setAttribute("width",ie.toString()),me.setAttribute("height",re.toString()),de&&fe.setAttributes(me,de),me},fe.createLine=function(ie,re,de,me,le){var he=document.createElementNS("http://www.w3.org/2000/svg","line");return he.setAttribute("x1",ie.toString()),he.setAttribute("y1",re.toString()),he.setAttribute("x2",de.toString()),he.setAttribute("y2",me.toString()),le&&fe.setAttributes(he,le),he},fe.createPolygon=function(ie,re){var de=document.createElementNS("http://www.w3.org/2000/svg","polygon");return de.setAttribute("points",ie),re&&fe.setAttributes(de,re),de},fe.createCircle=function(ie,re){var de=document.createElementNS("http://www.w3.org/2000/svg","circle");return de.setAttribute("cx",(ie/2).toString()),de.setAttribute("cy",(ie/2).toString()),de.setAttribute("r",ie.toString()),re&&fe.setAttributes(de,re),de},fe.createEllipse=function(ie,re,de){var me=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return me.setAttribute("cx",(ie/2).toString()),me.setAttribute("cy",(re/2).toString()),me.setAttribute("rx",(ie/2).toString()),me.setAttribute("ry",(re/2).toString()),de&&fe.setAttributes(me,de),me},fe.createGroup=function(ie){var re=document.createElementNS("http://www.w3.org/2000/svg","g");return ie&&fe.setAttributes(re,ie),re},fe.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},fe.createMarker=function(ie,re,de,me,le,he,Ee){var ye=document.createElementNS("http://www.w3.org/2000/svg","marker");return fe.setAttributes(ye,[["id",ie],["orient",re],["markerWidth",de.toString()],["markerHeight",me.toString()],["refX",le.toString()],["refY",he.toString()]]),ye.appendChild(Ee),ye},fe.createText=function(ie){var re=document.createElementNS("http://www.w3.org/2000/svg","text");return re.setAttribute("x","0"),re.setAttribute("y","0"),ie&&fe.setAttributes(re,ie),re},fe.createTSpan=function(ie,re){var de=document.createElementNS("http://www.w3.org/2000/svg","tspan");return de.textContent=ie,re&&fe.setAttributes(de,re),de},fe.createImage=function(ie){var re=document.createElementNS("http://www.w3.org/2000/svg","image");return ie&&fe.setAttributes(re,ie),re},fe.createPoint=function(ie,re){var de=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return de.x=ie,de.y=re,de},fe.createPath=function(ie,re){var de=document.createElementNS("http://www.w3.org/2000/svg","path");return de.setAttribute("d",ie),re&&fe.setAttributes(de,re),de},fe.createElement=function(ie,re){var de=document.createElementNS("http://www.w3.org/2000/svg",ie);return re&&fe.setAttributes(de,re),de},fe.getHollowRectanglePath=function(ie,re,de,me,le,he,Ee,ye){return"M"+ie+","+re+"V"+(re+me)+"H"+(ie+de)+"V"+re+"H"+le+"V"+he+"H"+(le+Ee)+"V"+(he+ye)+"H"+le+"V"+re+"Z"},fe}(),K=function(){function fe(ie){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ie+"_"}return Object.defineProperty(fe.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(fe.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(fe.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),fe.prototype.addClass=function(ie){return this.styleSheet===void 0&&this.addStyleSheet(),ie.name=""+this.classNamePrefix+ie.localName,this.classes.push(ie),this.styleSheet.sheet.insertRule("."+ie.name+" {"+ie.style+"}",this.styleSheet.sheet.cssRules.length),ie},fe.prototype.addRule=function(ie){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ie),this.styleSheet.sheet.insertRule(ie.selector+" {"+ie.style+"}",this.styleSheet.sheet.cssRules.length)},fe.prototype.addStyleSheet=function(){var ie;this.styleSheet=document.createElement("style"),((ie=this.styleSheetRoot)!==null&&ie!==void 0?ie:document.head).appendChild(this.styleSheet),this.addRule(new ee("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ee("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new ee("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new oe("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new oe("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},fe.prototype.removeStyleSheet=function(){var ie;this.styleSheet&&(((ie=this.styleSheetRoot)!==null&&ie!==void 0?ie:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},fe}(),ee=function(fe,ie){this.selector=fe,this.style=ie},oe=function(fe,ie){this.localName=fe,this.style=ie},Q=function(){function fe(){this.blocks=[],this.display=""}return fe.prototype.addButtonBlock=function(ie){ie.className=this.blockClassName,ie.buttonClassName=this.buttonClassName,ie.buttonColorsClassName=this.buttonColorsClassName,ie.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(ie)},fe.prototype.addElementBlock=function(ie){ie.className===void 0&&(ie.className=this.blockClassName),this.blocks.push(ie)},fe.prototype.getUI=function(){var ie=document.createElement("div");return ie.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,ie.style.display=this.display,this.blocks.forEach(function(re){return ie.appendChild(re.getUI())}),ie},fe}(),Ce=function(){function fe(){}return fe.prototype.getUI=function(){var ie=document.createElement("div");if(ie.className=this.className,this.minWidth!==void 0&&(ie.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":ie.style.justifyContent="flex-start";break;case"center":ie.style.justifyContent="center";break;case"end":ie.style.justifyContent="flex-end"}return ie.style.whiteSpace="nowrap",ie},fe}(),ze=function(fe){function ie(){var re=fe!==null&&fe.apply(this,arguments)||this;return re.buttons=[],re}return je(ie,fe),ie.prototype.addButton=function(re){re.className=this.buttonClassName,re.colorsClassName=this.buttonColorsClassName,re.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(re)},ie.prototype.getUI=function(){var re=fe.prototype.getUI.call(this);return this.buttons.forEach(function(de){return re.appendChild(de.getUI())}),re},ie}(Ce),nt=function(){function fe(ie,re){this._isActive=!1,this._isHidden=!1,this._icon=ie,this.title=re,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(fe.prototype,"icon",{get:function(){return this._icon},set:function(ie){this._icon=ie,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"isActive",{get:function(){return this._isActive},set:function(ie){this._isActive=ie,this.adjustClassName()},enumerable:!1,configurable:!0}),fe.prototype.getUI=function(){var ie=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 ie.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},fe.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,"")))},fe.prototype.hide=function(){this._isHidden=!0},fe}(),xe=function(fe){function ie(){var re=fe!==null&&fe.apply(this,arguments)||this;return re.elements=[],re}return je(ie,fe),ie.prototype.addElement=function(re){this.elements.push(re)},ie.prototype.getUI=function(){var re=fe.prototype.getUI.call(this);return this.elements.forEach(function(de){return re.appendChild(de)}),re},ie}(Ce),Re=function(){function fe(ie,re){this.horizontal=ie,this.vertical=re}return Object.defineProperty(fe.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),fe.prototype.getVerticalLength=function(ie){return ie/this.ratio},fe.prototype.getHorizontalLength=function(ie){return ie*this.ratio},fe}(),Te=function(){function fe(){}return fe.getIcon=function(ie,re){if(ie>0&&re>0){var de=new Re(ie,re),me=de.ratio>=1?20:de.getHorizontalLength(20),le=de.ratio<1?20:de.getVerticalLength(20),he=document.createElementNS("http://www.w3.org/2000/svg","svg");he.setAttribute("xmlns","http://www.w3.org/2000/svg"),he.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(he);var Ee=U.createDefs();he.appendChild(Ee);var ye=U.createElement("clipPath",[["id","text-bg-clip"]]);Ee.appendChild(ye);var Le=U.createPath(U.getHollowRectanglePath((24-me)/2,(24-le)/2,me,le,(24-me)/2+2,(24-le)/2+2,me-4,le-4));he.appendChild(Le);var Ne=U.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ne.appendChild(U.createTSpan(ie+":"+re)),he.appendChild(Ne);var tt=Ne.getBBox();U.setAttributes(Ne,[["x",((24-tt.width)/2).toString()],["y",((24-tt.height)/2-tt.y).toString()]]);var gt=U.createPath(U.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(tt.width))/2,(24-Math.ceil(tt.height))/2,Math.ceil(tt.width),Math.ceil(tt.height)));return ye.appendChild(gt),U.setAttributes(Le,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(he),he.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>'},fe}(),Oe=function(fe){function ie(re,de,me){var le=fe.call(this,re,de)||this;return le.isDropdownOpen=!1,le.onClick=le.dropdownButtonClicked,le.dropdownButtons=me,le}return je(ie,fe),ie.prototype.setupDropdown=function(){var re=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(de){de.className=re.className,de.colorsClassName=re.colorsClassName,re.dropdownBlock.appendChild(de.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},ie.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},ie.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},ie.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},ie.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},ie.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},ie}(nt),Ke=function(){function fe(ie,re){this.GRIP_SIZE=10,this.color=ie,this.fillColor=re,this.visual=U.createGroup(),this.visual.appendChild(U.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(U.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return fe.prototype.ownsTarget=function(ie){return ie===this.visual||ie===this.visual.childNodes[0]||ie===this.visual.childNodes[1]},fe.prototype.setCenter=function(ie,re){this.visual.childNodes.forEach(function(de){return U.setAttributes(de,[["cx",ie.toString()],["cy",re.toString()]])})},fe}(),Qe=function(){function fe(ie,re,de,me){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=ie,this.canvasHeight=re,this.margin=de,this.container=me,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(fe.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(ie){this._aspectRatio=ie,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ie){this._isGridVisible=ie,this.gridContainer&&U.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(ie){this._zoomFactor=ie,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),fe.prototype.open=function(){var ie=this;this.cropShadeElement=U.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=U.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var re=0;re<this.numberOfGridLines;re++)this.horizontalGridLines.push(U.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(U.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(de){return ie.gridContainer.appendChild(de)}),this.verticalGridLines.forEach(function(de){return ie.gridContainer.appendChild(de)}),this.cropRectElement=U.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ke(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ke(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ke(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ke(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},fe.prototype.setCropRectangle=function(ie){this.cropRect=ie;var re=Object.assign({},this.cropRect);this.zoomFactor!==1&&(re.width=this.cropRect.width*this.zoomFactor,re.height=this.cropRect.height*this.zoomFactor,re.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-re.width/2,re.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-re.height/2),U.setAttributes(this.cropRectElement,[["x",re.x.toString()],["y",re.y.toString()],["width",re.width.toString()],["height",re.height.toString()]]);var de=re.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(le,he){var Ee=re.y+de*(he+1);U.setAttributes(le,[["x1",""+re.x],["y1",""+Ee],["x2",""+(re.x+re.width)],["y2",""+Ee]])});var me=re.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(le,he){var Ee=re.x+me*(he+1);U.setAttributes(le,[["x1",""+Ee],["y1",""+re.y],["x2",""+Ee],["y2",""+(re.y+re.height)]])}),U.setAttributes(this.cropShadeElement,[["d",U.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,re.x,re.y,re.width,re.height)]]),this.topLeftGrip.setCenter(re.x,re.y),this.topRightGrip.setCenter(re.x+re.width,re.y),this.bottomLeftGrip.setCenter(re.x,re.y+re.height),this.bottomRightGrip.setCenter(re.x+re.width,re.y+re.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},fe.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)},fe.prototype.clientToLocalCoordinates=function(ie,re){var de=this.container.getBoundingClientRect();return{x:ie-de.left+this.margin,y:re-de.top+this.margin}},fe.prototype.onPointerDown=function(ie){this.container.setPointerCapture(ie.pointerId),this.previousPoint=this.clientToLocalCoordinates(ie.clientX,ie.clientY),this.cropRectElement===ie.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(ie.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(ie.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(ie.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(ie.target)&&(this.activeGrip=this.bottomRightGrip)},fe.prototype.onPointerMove=function(ie){if(this.isMoving)this.move(this.clientToLocalCoordinates(ie.clientX,ie.clientY));else if(this.activeGrip){var re=this.clientToLocalCoordinates(ie.clientX,ie.clientY);this.resize(re)}ie.preventDefault()},fe.prototype.onPointerUp=function(ie){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(ie.pointerId)},fe.prototype.move=function(ie){var re=ie.x-this.previousPoint.x,de=ie.y-this.previousPoint.y;this.zoomFactor!==1&&(re=-re/this.zoomFactor,de=-de/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+re),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+de),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=ie},fe.prototype.resize=function(ie){var re=Object.assign({},this.cropRect),de=ie.x-this.previousPoint.x,me=ie.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:re.x+de<this.margin&&(de=this.margin-re.x),re.x+=de,re.width=this.cropRect.x+this.cropRect.width-re.x;break;case this.bottomRightGrip:case this.topRightGrip:re.width+de>this.canvasWidth*this.zoomFactor&&(de=this.canvasWidth*this.zoomFactor-re.width),re.width+=de}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(re.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(de),re.height=this.aspectRatio.getVerticalLength(re.width)):(re.y+=me,re.height=this.cropRect.y+this.cropRect.height-re.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?re.height=this.aspectRatio.getVerticalLength(re.width):re.height+=me}re.width<10&&(re.x=this.cropRect.x,re.width=10),re.height<10&&(re.y=this.cropRect.y,re.height=10),this.previousPoint=ie,re.x>=this.margin&&re.y>=this.margin&&re.x-this.margin+re.width<=this.canvasWidth&&re.y-this.margin+re.height<=this.canvasHeight&&(this.cropRect=re,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},fe.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var ie=this.cropRect.x+this.cropRect.width/2,re=this.cropRect.y+this.cropRect.height/2,de=this.aspectRatio.getHorizontalLength(this.cropRect.height),me=this.aspectRatio.getVerticalLength(this.cropRect.width);de/this.canvasWidth<me/this.canvasHeight?this.cropRect.width=de:this.cropRect.height=me,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=ie-this.cropRect.width/2,this.cropRect.y=re-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)}},fe.prototype.getRescaledRect=function(ie,re,de,me,le,he){var Ee=de/ie,ye=me/re;return{x:(le.x-he)*Ee+he,y:(le.y-he)*ye+he,width:le.width*Ee,height:le.height*ye}},fe.prototype.scaleCanvas=function(ie,re){var de=this.getRescaledRect(this.canvasWidth,this.canvasHeight,ie,re,this.cropRect,this.margin);this.canvasWidth=ie,this.canvasHeight=re,this.onCropChange&&this.onCropChange(de),this.setCropRectangle(de)},fe}(),st=function(){function fe(ie){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=ie,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(fe.prototype,"angle",{get:function(){return this._angle},set:function(ie){this._angle=ie,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),fe.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},fe.prototype.onPointerDown=function(ie){this.controlContainer.setPointerCapture(ie.pointerId),this.isDragging=!0,this.previousPoint={x:ie.clientX,y:ie.clientY}},fe.prototype.onPointerMove=function(ie){this.isDragging&&(this.onAngleChange&&this.onAngleChange((ie.clientX-this.previousPoint.x)/5),this.previousPoint.x=ie.clientX)},fe.prototype.onPointerUp=function(ie){this.isDragging&&this.onAngleChange&&this.onAngleChange((ie.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(ie.pointerId)},fe.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var ie=this.angleLabelText.getBBox();U.setAttributes(this.angleLabelElement,[["x",((this.width-ie.width)/2).toString()],["y",(this.height/2).toString()]])}},fe.prototype.positionScaleShape=function(){if(this.scaleShape){var ie=this.scaleShape.transform.baseVal.getItem(0);ie.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(ie,0)}},fe.prototype.getVisual=function(){var ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("width",this.width+"px"),ie.setAttribute("height",this.height+"px"),ie.setAttribute("viewBox","0 0 "+this.width+" "+this.height),ie.style.flexShrink="0",document.body.appendChild(ie);for(var re="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,de=1;de<=this.width/5+10;de++){var me=de%5==0?this.height/3:this.height/6;re+="h4v"+-me+"h1v"+me}re+="v1H0Z",this.scaleShape=U.createPath(re);var le=U.createTransform();this.scaleShape.transform.baseVal.appendItem(le),ie.appendChild(this.scaleShape),this.angleLabelElement=U.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=U.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var he=U.createTSpan("");return he.innerHTML="°",this.angleLabelElement.appendChild(he),ie.appendChild(this.angleLabelElement),document.body.removeChild(ie),ie},fe}(),ut=function(){function fe(){this.naturalSize=!1,this.imageType="image/png"}return fe.prototype.rasterize=function(ie,re,de,me,le,he,Ee){var ye=this;return new Promise(function(Le){var Ne=document.createElement("canvas");Ne.width=ie.width.baseVal.value-2*me,Ne.height=ie.height.baseVal.value-2*me;var tt=1,gt=1;ye.naturalSize===!0?(tt=re.naturalWidth/(ie.width.baseVal.value-2*me)/he,gt=re.naturalHeight/(ie.height.baseVal.value-2*me)/Ee,Ne.width=re.naturalWidth/he,Ne.height=re.naturalHeight/Ee):ye.width!==void 0&&ye.height!==void 0&&(tt=ye.width/de.width,gt=ye.height/de.height,Ne.width*=tt,Ne.height*=gt);var Ct=Ne.getContext("2d");Ct.translate(Ne.width/2,Ne.height/2),Ct.rotate(le*Math.PI/180),Ct.scale(he,Ee),Ct.translate(-Ne.width/2,-Ne.height/2),Ct.drawImage(re,0,0,Ne.width,Ne.height);var Ot=document.createElement("canvas");Ot.width=de.width*tt,Ot.height=de.height*gt,Ot.getContext("2d").putImageData(Ct.getImageData((de.x-me)*tt,(de.y-me)*gt,de.width*tt,de.height*gt),0,0),Le(Ot.toDataURL(ye.imageType,ye.imageQuality))})},fe}(),xt=function(){function fe(ie){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=fe.instanceCounter++,this.styles=new K(this.instanceNo),this.target=ie,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(fe.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(ie){this._zoomToCropEnabled=ie,ie?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ie){this._isGridVisible=ie,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"gridLines",{get:function(){return this._gridLines},set:function(ie){this._gridLines=ie,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(ie){this._rotationAngle=ie,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"aspectRatio",{get:function(){var ie;return(ie=this._aspectRatio)!==null&&ie!==void 0?ie:this.aspectRatios[0]},set:function(ie){this._aspectRatio=ie},enumerable:!1,configurable:!0}),fe.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},fe.prototype.show=function(){this.showUI(),this.open()},fe.prototype.close=function(ie){ie===void 0&&(ie=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),ie||this.closeEventListeners.forEach(function(re){return re()}),this._isOpen=!1)},fe.prototype.addRenderEventListener=function(ie){this.renderEventListeners.push(ie)},fe.prototype.removeRenderEventListener=function(ie){this.renderEventListeners.indexOf(ie)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(ie),1)},fe.prototype.addCloseEventListener=function(ie){this.closeEventListeners.push(ie)},fe.prototype.removeCloseEventListener=function(ie){this.closeEventListeners.indexOf(ie)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(ie),1)},fe.prototype.setupResizeObserver=function(){var ie=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ie.resize(ie.target.clientWidth,ie.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))},fe.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var ie=1*this.target.clientWidth/this.target.clientHeight,re=this.contentDiv.clientWidth/ie>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*ie:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,de=re+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/ie;this.resize(re,de)}},fe.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},fe.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",U.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},fe.prototype.resize=function(ie,re){this.imageWidth=Math.round(ie),this.imageHeight=Math.round(re),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()},fe.prototype.setEditingTarget=function(){var ie=document.createElement("canvas");ie.width=this.target.naturalWidth,ie.height=this.target.naturalHeight,ie.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var re=ie.toDataURL();U.setAttributes(this.editingTarget,[["href",re]]),this.setEditingTargetSize()},fe.prototype.setTopLeft=function(){var ie=this.target.getBoundingClientRect(),re=this.editorCanvas.getBoundingClientRect();this.left=ie.left-re.left-this.CANVAS_MARGIN,this.top=ie.top-re.top-this.CANVAS_MARGIN},fe.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=U.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=U.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=U.createGroup(),this.editingTargetRotationScaleContainer=U.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var ie=U.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(ie);var re=U.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(re),this.editingTargetContainer=U.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)},fe.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},fe.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=U.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Qe(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()},fe.prototype.zoomToCrop=function(){if(this.cropRect){var ie=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,re=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=ie+"px "+re+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-ie+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-re+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},fe.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)},fe.prototype.cropRectChanged=function(ie){this.cropRect=ie,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},fe.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},fe.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"},fe.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},fe.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 ie=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,re=this.target.offsetTop>ie+this.CANVAS_MARGIN?this.target.offsetTop-(ie+this.CANVAS_MARGIN):0;this.coverDiv.style.top=re+"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},fe.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},fe.prototype.addTopToolbar=function(){var ie=this;this.topToolbar=new Q,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 re=new ze;re.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(re);var de=[];this.aspectRatios.forEach(function(gt){var Ct=new nt(Te.getIcon(gt.horizontal,gt.vertical),gt.horizontal===0&>.vertical===0?"FREE":gt.horizontal+":"+gt.vertical);Ct.onClick=function(){return ie.ratioButtonClicked(gt)},de.push(Ct)}),this.aspectRatioButton=new Oe(Te.getIcon(0,0),"Aspect ratio",de),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,re.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var me=new nt('<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");me.isActive=this.isGridVisible,me.onClick=function(){ie.isGridVisible=!ie.isGridVisible,me.isActive=ie.isGridVisible},re.addButton(me);var le=new nt('<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(le.isActive=this.zoomToCropEnabled,le.onClick=function(){ie.zoomToCropEnabled=!ie.zoomToCropEnabled,le.isActive=ie.zoomToCropEnabled},re.addButton(le),!Z.isLicensed){var he=new xe;this.topToolbar.addElementBlock(he);var Ee=document.createElement("div");Ee.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ye=document.createElement("a");ye.style.color="currentColor",ye.href="https://markerjs.com/products/cropro",ye.target="_blank",ye.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>',Ee.appendChild(ye),he.addElement(Ee)}var Le=new ze;Le.minWidth=3*this.toolbarHeight+"px",Le.contentAlign="end",this.topToolbar.addButtonBlock(Le);var Ne=new nt('<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");Ne.onClick=this.startRenderAndClose,Le.addButton(Ne),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ne.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var tt=new nt('<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");tt.onClick=this.close,Le.addButton(tt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(tt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},fe.prototype.addBottomToolbar=function(){var ie=this;this.bottomToolbar=new Q,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 re=new ze;re.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(re);var de=new nt('<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");de.onClick=this.rotateLeftButtonClicked,re.addButton(de);var me=new nt('<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");me.onClick=this.rotateRightButtonClicked,re.addButton(me);var le=new xe;le.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(le),this.straightener=new st("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(Le){ie.rotateBy(Le),ie.straightener.angle=ie.rotationAngle},le.addElement(this.straightener.getUI());var he=new ze;he.minWidth=2*this.toolbarHeight+"px",he.contentAlign="end",this.bottomToolbar.addButtonBlock(he);var Ee=new nt('<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");Ee.onClick=this.flipHorizontallyButtonClicked,he.addButton(Ee);var ye=new nt('<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");ye.onClick=this.flipVerticallyButtonClicked,he.addButton(ye)},fe.prototype.ratioButtonClicked=function(ie){this.aspectRatio=ie,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},fe.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Te.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},fe.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Re(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},fe.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},fe.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},fe.prototype.restoreState=function(ie){if(ie){var re=this.cropLayer.getRescaledRect(ie.width,ie.height,this.imageWidth,this.imageHeight,ie.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(re),this.cropRectChanged(re),this.flippedHorizontally=ie.flippedHorizontally,this.flippedVertically=ie.flippedVertically,this.applyFlip(),this.rotationAngle=ie.rotationAngle,this.applyRotation()}},fe.prototype.clientToLocalCoordinates=function(ie,re){var de=this.cropImage.getBoundingClientRect();return{x:ie-de.left,y:re-de.top}},fe.prototype.onWindowResize=function(){this.positionUI()},fe.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var ie=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=ie+"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()},fe.prototype.rotateLeftButtonClicked=function(){var ie=this.rotationAngle-90;this.rotationAngle%90!=0&&(ie+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(ie)},fe.prototype.rotateRightButtonClicked=function(){var ie=this.rotationAngle+90;this.rotationAngle%90!=0&&(ie-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(ie)},fe.prototype.rotateTo=function(ie){ie=(ie=ie>180?ie-360:ie)<=-180?ie+360:ie,this.rotationAngle=ie,this.applyRotation()},fe.prototype.rotateBy=function(ie){this.rotateTo((this.rotationAngle+ie)%360)},fe.prototype.applyRotation=function(){var ie=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var re=this.editingTargetRotationContainer.transform.baseVal.getItem(0);re.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(re,0);var de=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/de.width,this.imageHeight/de.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=ie},fe.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},fe.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},fe.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},fe.prototype.startRenderAndClose=function(){return Be(this,void 0,void 0,function(){var ie,re;return we(this,function(de){switch(de.label){case 0:return[4,this.render()];case 1:return ie=de.sent(),re=this.getState(),this.renderEventListeners.forEach(function(me){return me(ie,re)}),this.close(!0),[2]}})})},fe.prototype.render=function(){return Be(this,void 0,void 0,function(){var ie;return we(this,function(re){switch(re.label){case 0:return(ie=new ut).naturalSize=this.renderAtNaturalSize,ie.imageType=this.renderImageType,ie.imageQuality=this.renderImageQuality,ie.width=this.renderWidth,ie.height=this.renderHeight,this.unzoomFromCrop(),U.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,ie.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 re.sent(),[4,ie.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,re.sent()]}})})},fe.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new oe("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 oe("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new oe("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var ie=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new oe("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*ie)+`px;
|
|
height: `+(this.toolbarHeight-2*ie)+`px;
|
|
padding: `+ie+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new oe("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new oe("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new ee("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new ee("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new oe("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 oe("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new oe("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 oe("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*ie)+`px;
|
|
padding: `+ie+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new oe("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},fe.instanceCounter=0,fe}(),wt=I("8hTe"),Fe=I.n(wt),Ue=/<pre[^>]*>/g;function it(fe){var ie=document.createElement("div");return ie.innerHTML=fe,ie.childNodes.length===0?"":ie.childNodes[0].nodeValue}var lt=pe.a=function(fe){var ie=fe.value,re=ie===void 0?"":ie,de=fe.edit,me=de===void 0?!1:de,le=fe.className,he=fe.showTextOnly,Ee=fe.showLines,ye=fe.replaces,Le=fe.zoomImg,Ne=fe.hasMask,tt=fe.style,gt=tt===void 0?{}:tt,Ct=fe.stylesPrev,Ot=Ct===void 0?{}:Ct,St=String(re),Ye=Object(D.useRef)(),at=Object(D.useRef)(),Ve=Object(D.useState)(""),be=Object(B.a)(Ve,2),Ie=be[0],ot=be[1],Xe=Object(D.useState)("office"),Rt=Object(B.a)(Xe,2),Lt=Rt[0],et=Rt[1],dt=function(){var $=new xt(at.current);$.displayMode="popup",$.addRenderEventListener(function(){var te=Object(C.a)(n.a.mark(function ve(Pe){var Ge;return n.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return Ye.current.style.display="none",bt.next=3,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Pe}});case 3:Ge=bt.sent,Ge!=null&&Ge.id&&ye(at.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(Ge==null?void 0:Ge.id,"?type=").concat(Ge.content_type));case 5:case"end":return bt.stop()}},ve)}));return function(ve){return te.apply(this,arguments)}}()),$.show()},vt=function(){var $=new Ae.a(at.current);$.settings.displayMode="popup",$.addEventListener("render",function(){var te=Object(C.a)(n.a.mark(function ve(Pe){var Ge;return n.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:if(Ye.current.style.display="none",!at.current){bt.next=6;break}return bt.next=4,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Pe.dataUrl}});case 4:Ge=bt.sent,Ge!=null&&Ge.id&&ye(at.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(Ge==null?void 0:Ge.id,"?type=").concat(Ge.content_type));case 6:case"end":return bt.stop()}},ve)}));return function(ve){return te.apply(this,arguments)}}()),$.show(),window.markerArea=$},Tt=Object(D.useMemo)(function(){Ye.current&&(Ye.current.style.zIndex=-1);try{var Y=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,$=/\"\/api\/attachments\/|\"\/attachments\/download\//g,te=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;St=St.replace(Y,"("+ne.a.API_SERVER+"/api/attachments/").replace($,'"'+ne.a.API_SERVER+"/api/attachments/").replace(te,'"'+ne.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(_t){}var ve=G(St),Pe=O();if(St.match(/\[TOC\]/)&&(ve=ve.replace("<p>[TOC]</p>",A()),S()),ve=ve.replace(/(__special_katext_id_\d+__)/g,function(_t,bt){var $e=Pe[bt],At=$e.type,Jt=$e.expression;return Object(se.renderToString)(it(Jt)||"",{displayMode:At==="block",throwOnError:!1,output:"html"})}),ve=ve.replace(/▁/g,"\u2581\u2581\u2581"),E(),he){var Ge=document.createElement("div");return Ge.innerHTML=ve,Ge.innerText}return setTimeout(function(){return ce()},500),ve},[St]),Pt=Object(D.useRef)();x.WebkitLineClamp=Ee,Ee&&(gt=Object(N.a)(Object(N.a)({},gt),x));function _e(Y){var $=Y.target;if($.tagName.toUpperCase()==="IMG"){if(Le){var te=$.getAttribute("src");ot(te),et("image")}}else if($.tagName.toUpperCase()==="A"){var ve=$.getAttribute("href");if(ve.indexOf("office")>-1)Y.preventDefault(),ot(ve),et("office");else if(ve.indexOf("application/pdf")>-1)Y.preventDefault(),ot(ve),et("pdf");else if(ve.indexOf("text/html")>-1)Y.preventDefault(),ot(ve),et("html");else if(ve.startsWith("#")){Y.preventDefault();var Pe=document.getElementById(ve.replace("#",""));Pe&&Pe.scrollIntoView(!0)}}}var ce=function(){var $,te=($=Pt.current)===null||$===void 0?void 0:$.querySelectorAll("video");te==null||te.forEach(function(ve){if(ve.oncontextmenu=function(){return!1},ve.src.indexOf(".m3u8")>-1&&!ve.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var Pe=new V.a;Pe.loadSource(ve.src),Pe.attachMedia(ve)}}})};Object(D.useEffect)(function(){if(Pt.current&&Tt&&(Tt.match(Ue)&&window.PR.prettyPrint()),Pt.current)return Pt.current.addEventListener("click",_e),function(){Pt.current.removeEventListener("click",_e),E(),S()}},[Tt,Pt.current,_e]);var W=function($){if(!me)return;$.target.nodeName==="IMG"?(Ye.current.style.zIndex=1,Ye.current.style.display="flex",Ye.current.style.width=$.target.clientWidth+"px",Ye.current.style.height=$.target.clientHeight+"px",Ye.current.style.top=$.target.offsetTop+"px",Ye.current.style.left=$.target.offsetLeft+"px",at.current.src=$.target.getAttribute("src")):Ye.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:Pt,style:Object(N.a)({},gt),className:"".concat(le||""," markdown-body ").concat(Fe.a.mdBody),onMouseOver:W,dangerouslySetInnerHTML:{__html:Tt}}),g.a.createElement("div",{ref:Ye,className:Fe.a.button},g.a.createElement(z.a,null,g.a.createElement(X.a,{onClick:function(){return dt()}},"\u88C1\u526A"),g.a.createElement(X.a,{onClick:function(){return vt()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:at,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(Se.a,{close:!0,data:Ie,type:Ie!=null&&Ie.length?Lt:"",style:Object(N.a)({},Ot),onClose:function(){return ot("")}}))}},"9VGf":function(He,pe,I){"use strict";I.d(pe,"a",function(){return P});var J=I("q1tI"),z=I.n(J);function P(X,N){var C=Object(J.useRef)();Object(J.useEffect)(function(){C.current=X}),Object(J.useEffect)(function(){function B(){C.current()}if(N!==null){var M=setInterval(B,N);return function(){return clearInterval(M)}}},[N])}},AMnG:function(He,pe,I){"use strict";var J=I("miYZ"),z=I("tsqr"),P=I("tJVT"),X=I("q1tI"),N=I.n(X),C=I("nWbc"),B=I.n(C),M=I("Ot1p");pe.a=function(n){var D=n.id,g=n.activeDiscussIndex,p=n.onReplyDiscuss,h=Object(X.useState)(""),c=Object(P.a)(h,2),o=c[0],d=c[1];function r(i){d(i)}function a(){if(!o){z.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}p(D,o),d("")}return N.a.createElement("div",{key:D,className:"discuss-item-editor",style:{display:g===D?"block":"none",width:"100%"}},N.a.createElement(M.a,{miniToolbar:!0,startInit:g===D,defaultValue:o,id:D,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:r}),N.a.createElement("a",{onClick:a,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(He,pe,I){"use strict";I.d(pe,"a",function(){return C});var J=I("MNnm"),z="rc-util-key";function P(B){if(B.attachTo)return B.attachTo;var M=document.querySelector("head");return M||document.body}function X(B){var M,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(J.a)())return null;var D=document.createElement("style");if((M=n.csp)===null||M===void 0?void 0:M.nonce){var g;D.nonce=(g=n.csp)===null||g===void 0?void 0:g.nonce}D.innerHTML=B;var p=P(n),h=p.firstChild;return n.prepend&&p.prepend?p.prepend(D):n.prepend&&h?p.insertBefore(D,h):p.appendChild(D),D}var N=new Map;function C(B,M){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=P(n);if(!N.has(D)){var g=X("",n),p=g.parentNode;N.set(D,p),p.removeChild(g)}var h=Array.from(N.get(D).children).find(function(a){return a.tagName==="STYLE"&&a[z]===M});if(h){var c,o;if(((c=n.csp)===null||c===void 0?void 0:c.nonce)&&h.nonce!==((o=n.csp)===null||o===void 0?void 0:o.nonce)){var d;h.nonce=(d=n.csp)===null||d===void 0?void 0:d.nonce}return h.innerHTML!==B&&(h.innerHTML=B),h}var r=X(B,n);return r[z]=M,r}},Bd2K:function(He,pe,I){(function(J){J(I("VrN/"),I("osHv"))})(function(J){J.defineOption("autoCloseTags",!1,function(n,D,g){if(g!=J.Init&&g&&n.removeKeyMap("autoCloseTags"),!D)return;var p={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(p["'/'"]=function(h){return C(h)}),(typeof D!="object"||D.whenOpening!==!1)&&(p["'>'"]=function(h){return X(h)}),n.addKeyMap(p)});var z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["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 X(n){if(n.getOption("disableInput"))return J.Pass;for(var D=n.listSelections(),g=[],p=n.getOption("autoCloseTags"),h=0;h<D.length;h++){if(!D[h].empty())return J.Pass;var c=D[h].head,o=n.getTokenAt(c),d=J.innerMode(n.getMode(),o.state),r=d.state,a=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(r),i=a&&a.name;if(!i)return J.Pass;var s=d.mode.configuration=="html",S=typeof p=="object"&&p.dontCloseTags||s&&z,x=typeof p=="object"&&p.indentTags||s&&P;o.end>c.ch&&(i=i.slice(0,i.length-o.end+c.ch));var T=i.toLowerCase();if(!i||o.type=="string"&&(o.end!=c.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&a.close||o.string.indexOf("/")==c.ch-o.start-1||S&&B(S,T)>-1||M(n,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(r)||[],i,c,!0))return J.Pass;var A=typeof p=="object"&&p.emptyTags;if(A&&B(A,i)>-1){g[h]={text:"/>",newPos:J.Pos(c.line,c.ch+2)};continue}var w=x&&B(x,T)>-1;g[h]={indent:w,text:">"+(w?`
|
|
|
|
`:"")+"</"+i+">",newPos:w?J.Pos(c.line+1,0):J.Pos(c.line,c.ch+1)}}for(var v=typeof p=="object"&&p.dontIndentOnAutoClose,h=D.length-1;h>=0;h--){var b=g[h];n.replaceRange(b.text,D[h].head,D[h].anchor,"+insert");var m=n.listSelections().slice(0);m[h]={head:b.newPos,anchor:b.newPos},n.setSelections(m),!v&&b.indent&&(n.indentLine(b.newPos.line,null,!0),n.indentLine(b.newPos.line+1,null,!0))}}function N(n,D){for(var g=n.listSelections(),p=[],h=D?"/":"</",c=n.getOption("autoCloseTags"),o=typeof c=="object"&&c.dontIndentOnSlash,d=0;d<g.length;d++){if(!g[d].empty())return J.Pass;var r=g[d].head,a=n.getTokenAt(r),i=J.innerMode(n.getMode(),a.state),s=i.state;if(D&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=r.ch-1))return J.Pass;var S,x=i.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(x&&i.mode.name=="javascript")S=h+"script";else if(x&&i.mode.name=="css")S=h+"style";else{var T=i.mode.xmlCurrentContext&&i.mode.xmlCurrentContext(s);if(!T||T.length&&M(n,T,T[T.length-1],r))return J.Pass;S=h+T[T.length-1]}n.getLine(r.line).charAt(a.end)!=">"&&(S+=">"),p[d]=S}if(n.replaceSelections(p),g=n.listSelections(),!o)for(var d=0;d<g.length;d++)(d==g.length-1||g[d].head.line<g[d+1].head.line)&&n.indentLine(g[d].head.line)}function C(n){return n.getOption("disableInput")?J.Pass:N(n,!0)}J.commands.closeTag=function(n){return N(n)};function B(n,D){if(n.indexOf)return n.indexOf(D);for(var g=0,p=n.length;g<p;++g)if(n[g]==D)return g;return-1}function M(n,D,g,p,h){if(!J.scanForClosingTag)return!1;var c=Math.min(n.lastLine()+1,p.line+500),o=J.scanForClosingTag(n,p,null,c);if(!o||o.tag!=g)return!1;for(var d=h?1:0,r=D.length-1;r>=0&&D[r]==g;r--)++d;p=o.to;for(var r=1;r<d;r++){var a=J.scanForClosingTag(n,p,null,c);if(!a||a.tag!=g)return!1;p=a.to}return!0}})},BdwD:function(He,pe,I){"use strict";var J=I("+L6B"),z=I("2/Rp"),P=I("0Owb"),X=I("k1fw"),N=I("q1tI"),C=I.n(N),B=I("FOrL"),M=I.n(B),n=function(g){var p=g.buttonProps,h=p===void 0?{}:p,c=g.styles,o=c===void 0?{}:c,d=g.imgStyles,r=d===void 0?{}:d,a=g.customText,i=g.ButtonText,s=g.ButtonClick,S=g.Buttonclass,x=g.ButtonTwo;return C.a.createElement("section",{className:"tc animated fadeIn",style:Object(X.a)(Object(X.a)({},{color:"#999",margin:"0 auto",padding:"100px 0"}),o)},C.a.createElement("img",{src:M.a,style:Object(X.a)(Object(X.a)({},{width:"200px",height:"150px"}),r)}),C.a.createElement("p",{className:"mt10 font14"},a||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),i&&C.a.createElement(z.a,Object(P.a)({className:S,onClick:s},h),i),x&&x)};pe.a=n},BjJ7:function(He,pe,I){"use strict";I.d(pe,"d",function(){return z}),I.d(pe,"c",function(){return P}),I.d(pe,"e",function(){return X}),I.d(pe,"b",function(){return N}),I.d(pe,"a",function(){return B});var J=I("m3rI");function z(M){var n=!0;if(M.length>0){for(var D=0;D<M.length;D++)if(M[D].compile_success==0||!M[D].compile_success){n=!1;break}}else n=!1;return n}function P(M){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],g=0;g<M.length;g++){var p=M[g],h=n?"".concat(n,"/").concat(p.name):"".concat(p.name);D.push({title:p.name,isLeaf:!(p.type==="tree"),key:h})}return D}function X(M,n,D){for(var g=0;g<M.length;g++){var p=M[g];if(p.key===n){p.children=D;break}p.children&&X(p.children,n,D)}return M}function N(M,n,D){var g;return function(){var p=this,h=arguments,c=function(){g=null,D||M.apply(p,h)},o=D&&!g;clearTimeout(g),g=setTimeout(c,n),o&&M.apply(p,h)}}var C=!0,B=J.a.API_SERVER},"C+DQ":function(He,pe,I){},"C/vA":function(He,pe,I){"use strict";I.d(pe,"a",function(){return J});function J(z){const P=this;let X=!1,N;return function(){return X||(X=!0,N=z.apply(P,arguments)),N}}},CNDd:function(He,pe,I){He.exports=I.p+"static/c1.7850f139.svg"},CaVn:function(He,pe,I){He.exports={flex_box_center:"flex_box_center___2wZ0h",flex_space_between:"flex_space_between___3MVWH",flex_box_vertical_center:"flex_box_vertical_center___O0jNB",flex_box_center_end:"flex_box_center_end___2q4xj",flex_box_column:"flex_box_column___13R-8",listDetails:"listDetails___3lMam",head:"head___2jzWe",name:"name___3xIfG",title:"title___3-ce8",a:"a___1ZME1",b:"b___oiiqU",tag:"tag___32Ulf",btn:"btn___lJ5fA",scroll:"scroll___anvih",video:"video___1gujl",html:"html___z0BU7",g:"g___3sfQf",btns:"btns___OWbut"}},"Cg/j":function(He,pe,I){"use strict";I.d(pe,"b",function(){return J}),I.d(pe,"a",function(){return z}),I.d(pe,"c",function(){return X}),I.d(pe,"d",function(){return N});var J;(function(C){C.serviceIds=new Map,C.DI_TARGET="$di$target",C.DI_DEPENDENCIES="$di$dependencies";function B(M){return M[C.DI_DEPENDENCIES]||[]}C.getServiceDependencies=B})(J||(J={}));const z=X("instantiationService");function P(C,B,M,n){B[J.DI_TARGET]===B?B[J.DI_DEPENDENCIES].push({id:C,index:M,optional:n}):(B[J.DI_DEPENDENCIES]=[{id:C,index:M,optional:n}],B[J.DI_TARGET]=B)}function X(C){if(J.serviceIds.has(C))return J.serviceIds.get(C);const B=function(M,n,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(B,M,D,!1)};return B.toString=()=>C,J.serviceIds.set(C,B),B}function N(C){return function(B,M,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(C,B,n,!0)}}},CrYA:function(He,pe,I){var J=I("MFOe"),z=J.Global;He.exports={name:"sessionStorage",read:X,write:N,each:C,remove:B,clearAll:M};function P(){return z.sessionStorage}function X(n){return P().getItem(n)}function N(n,D){return P().setItem(n,D)}function C(n){for(var D=P().length-1;D>=0;D--){var g=P().key(D);n(X(g),g)}}function B(n){return P().removeItem(n)}function M(){return P().clear()}},DlQD:function(He,pe,I){(function(J,z){He.exports=z()})(this,function(){"use strict";function J(re,de){for(var me=0;me<de.length;me++){var le=de[me];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(re,le.key,le)}}function z(re,de,me){return de&&J(re.prototype,de),me&&J(re,me),re}function P(re,de){if(!re)return;if(typeof re=="string")return X(re,de);var me=Object.prototype.toString.call(re).slice(8,-1);if(me==="Object"&&re.constructor&&(me=re.constructor.name),me==="Map"||me==="Set")return Array.from(re);if(me==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(me))return X(re,de)}function X(re,de){(de==null||de>re.length)&&(de=re.length);for(var me=0,le=new Array(de);me<de;me++)le[me]=re[me];return le}function N(re,de){var me;if(typeof Symbol=="undefined"||re[Symbol.iterator]==null){if(Array.isArray(re)||(me=P(re))||de&&re&&typeof re.length=="number"){me&&(re=me);var le=0;return function(){return le>=re.length?{done:!0}:{done:!1,value:re[le++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return me=re[Symbol.iterator](),me.next.bind(me)}function C(re,de){return de={exports:{}},re(de,de.exports),de.exports}var B=C(function(re){function de(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function me(le){re.exports.defaults=le}re.exports={defaults:de(),getDefaults:de,changeDefaults:me}}),M=B.defaults,n=B.getDefaults,D=B.changeDefaults,g=/[&<>"']/,p=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(de){return o[de]};function r(re,de){if(de){if(g.test(re))return re.replace(p,d)}else if(h.test(re))return re.replace(c,d);return re}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(re){return re.replace(a,function(de,me){return me=me.toLowerCase(),me==="colon"?":":me.charAt(0)==="#"?me.charAt(1)==="x"?String.fromCharCode(parseInt(me.substring(2),16)):String.fromCharCode(+me.substring(1)):""})}var s=/(^|[^\[])\^/g;function S(re,de){re=re.source||re,de=de||"";var me={replace:function(he,Ee){return Ee=Ee.source||Ee,Ee=Ee.replace(s,"$1"),re=re.replace(he,Ee),me},getRegex:function(){return new RegExp(re,de)}};return me}var x=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(re,de,me){if(re){var le;try{le=decodeURIComponent(i(me)).replace(x,"").toLowerCase()}catch(he){return null}if(le.indexOf("javascript:")===0||le.indexOf("vbscript:")===0||le.indexOf("data:")===0)return null}de&&!T.test(me)&&(me=f(de,me));try{me=encodeURI(me).replace(/%25/g,"%")}catch(he){return null}return me}var w={},v=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(re,de){w[" "+re]||(v.test(re)?w[" "+re]=re+"/":w[" "+re]=k(re,"/",!0)),re=w[" "+re];var me=re.indexOf(":")===-1;return de.substring(0,2)==="//"?me?de:re.replace(b,"$1")+de:de.charAt(0)==="/"?me?de:re.replace(m,"$1")+de:re+de}var O={exec:function(){}};function E(re){for(var de=1,me,le;de<arguments.length;de++){me=arguments[de];for(le in me)Object.prototype.hasOwnProperty.call(me,le)&&(re[le]=me[le])}return re}function _(re,de){var me=re.replace(/\|/g,function(Ee,ye,Le){for(var Ne=!1,tt=ye;--tt>=0&&Le[tt]==="\\";)Ne=!Ne;return Ne?"|":" |"}),le=me.split(/ \|/),he=0;if(le.length>de)le.splice(de);else for(;le.length<de;)le.push("");for(;he<le.length;he++)le[he]=le[he].trim().replace(/\\\|/g,"|");return le}function k(re,de,me){var le=re.length;if(le===0)return"";for(var he=0;he<le;){var Ee=re.charAt(le-he-1);if(Ee===de&&!me)he++;else if(Ee!==de&&me)he++;else break}return re.substr(0,le-he)}function F(re,de){if(re.indexOf(de[1])===-1)return-1;for(var me=re.length,le=0,he=0;he<me;he++)if(re[he]==="\\")he++;else if(re[he]===de[0])le++;else if(re[he]===de[1]&&(le--,le<0))return he;return-1}function L(re){re&&re.sanitize&&!re.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:r,unescape:i,edit:S,cleanUrl:A,resolveUrl:f,noopTest:O,merge:E,splitCells:_,rtrim:k,findClosingBracket:F,checkSanitizeDeprecation:L},j=B.defaults,R=G.rtrim,V=G.splitCells,ne=G.escape,se=G.findClosingBracket;function Se(re,de,me){var le=de.href,he=de.title?ne(de.title):null,Ee=re[1].replace(/\\([\[\]])/g,"$1");return re[0].charAt(0)!=="!"?{type:"link",raw:me,href:le,title:he,text:Ee}:{type:"image",raw:me,href:le,title:he,text:ne(Ee)}}function De(re,de){var me=re.match(/^(\s+)(?:```)/);if(me===null)return de;var le=me[1];return de.split(`
|
|
`).map(function(he){var Ee=he.match(/^\s+/);if(Ee===null)return he;var ye=Ee[0];return ye.length>=le.length?he.slice(le.length):he}).join(`
|
|
`)}var Ae=function(){function re(me){this.options=me||j}var de=re.prototype;return de.space=function(le){var he=this.rules.block.newline.exec(le);if(he)return he[0].length>1?{type:"space",raw:he[0]}:{raw:`
|
|
`}},de.code=function(le,he){var Ee=this.rules.block.code.exec(le);if(Ee){var ye=he[he.length-1];if(ye&&ye.type==="paragraph")return{raw:Ee[0],text:Ee[0].trimRight()};var Le=Ee[0].replace(/^ {4}/gm,"");return{type:"code",raw:Ee[0],codeBlockStyle:"indented",text:this.options.pedantic?Le:R(Le,`
|
|
`)}}},de.fences=function(le){var he=this.rules.block.fences.exec(le);if(he){var Ee=he[0],ye=De(Ee,he[3]||"");return{type:"code",raw:Ee,lang:he[2]?he[2].trim():he[2],text:ye}}},de.heading=function(le){var he=this.rules.block.heading.exec(le);if(he)return{type:"heading",raw:he[0],depth:he[1].length,text:he[2]}},de.nptable=function(le){var he=this.rules.block.nptable.exec(le);if(he){var Ee={type:"table",header:V(he[1].replace(/^ *| *\| *$/g,"")),align:he[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:he[3]?he[3].replace(/\n$/,"").split(`
|
|
`):[],raw:he[0]};if(Ee.header.length===Ee.align.length){var ye=Ee.align.length,Le;for(Le=0;Le<ye;Le++)/^ *-+: *$/.test(Ee.align[Le])?Ee.align[Le]="right":/^ *:-+: *$/.test(Ee.align[Le])?Ee.align[Le]="center":/^ *:-+ *$/.test(Ee.align[Le])?Ee.align[Le]="left":Ee.align[Le]=null;for(ye=Ee.cells.length,Le=0;Le<ye;Le++)Ee.cells[Le]=V(Ee.cells[Le],Ee.header.length);return Ee}}},de.hr=function(le){var he=this.rules.block.hr.exec(le);if(he)return{type:"hr",raw:he[0]}},de.blockquote=function(le){var he=this.rules.block.blockquote.exec(le);if(he){var Ee=he[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:he[0],text:Ee}}},de.list=function(le){var he=this.rules.block.list.exec(le);if(he){for(var Ee=he[0],ye=he[2],Le=ye.length>1,Ne=ye[ye.length-1]===")",tt={type:"list",raw:Ee,ordered:Le,start:Le?+ye.slice(0,-1):"",loose:!1,items:[]},gt=he[0].match(this.rules.block.item),Ct=!1,Ot,St,Ye,at,Ve,be,Ie,ot=gt.length,Xe=0;Xe<ot;Xe++)Ot=gt[Xe],Ee=Ot,St=Ot.length,Ot=Ot.replace(/^ *([*+-]|\d+[.)]) */,""),~Ot.indexOf(`
|
|
`)&&(St-=Ot.length,Ot=this.options.pedantic?Ot.replace(/^ {1,4}/gm,""):Ot.replace(new RegExp("^ {1,"+St+"}","gm"),"")),Xe!==ot-1&&(Ye=this.rules.block.bullet.exec(gt[Xe+1])[0],(Le?Ye.length===1||!Ne&&Ye[Ye.length-1]===")":Ye.length>1||this.options.smartLists&&Ye!==ye)&&(at=gt.slice(Xe+1).join(`
|
|
`),tt.raw=tt.raw.substring(0,tt.raw.length-at.length),Xe=ot-1)),Ve=Ct||/\n\n(?!\s*$)/.test(Ot),Xe!==ot-1&&(Ct=Ot.charAt(Ot.length-1)===`
|
|
`,Ve||(Ve=Ct)),Ve&&(tt.loose=!0),be=/^\[[ xX]\] /.test(Ot),Ie=void 0,be&&(Ie=Ot[1]!==" ",Ot=Ot.replace(/^\[[ xX]\] +/,"")),tt.items.push({type:"list_item",raw:Ee,task:be,checked:Ie,loose:Ve,text:Ot});return tt}},de.html=function(le){var he=this.rules.block.html.exec(le);if(he)return{type:this.options.sanitize?"paragraph":"html",raw:he[0],pre:!this.options.sanitizer&&(he[1]==="pre"||he[1]==="script"||he[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):ne(he[0]):he[0]}},de.def=function(le){var he=this.rules.block.def.exec(le);if(he){he[3]&&(he[3]=he[3].substring(1,he[3].length-1));var Ee=he[1].toLowerCase().replace(/\s+/g," ");return{tag:Ee,raw:he[0],href:he[2],title:he[3]}}},de.table=function(le){var he=this.rules.block.table.exec(le);if(he){var Ee={type:"table",header:V(he[1].replace(/^ *| *\| *$/g,"")),align:he[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:he[3]?he[3].replace(/\n$/,"").split(`
|
|
`):[]};if(Ee.header.length===Ee.align.length){Ee.raw=he[0];var ye=Ee.align.length,Le;for(Le=0;Le<ye;Le++)/^ *-+: *$/.test(Ee.align[Le])?Ee.align[Le]="right":/^ *:-+: *$/.test(Ee.align[Le])?Ee.align[Le]="center":/^ *:-+ *$/.test(Ee.align[Le])?Ee.align[Le]="left":Ee.align[Le]=null;for(ye=Ee.cells.length,Le=0;Le<ye;Le++)Ee.cells[Le]=V(Ee.cells[Le].replace(/^ *\| *| *\| *$/g,""),Ee.header.length);return Ee}}},de.lheading=function(le){var he=this.rules.block.lheading.exec(le);if(he)return{type:"heading",raw:he[0],depth:he[2].charAt(0)==="="?1:2,text:he[1]}},de.paragraph=function(le){var he=this.rules.block.paragraph.exec(le);if(he)return{type:"paragraph",raw:he[0],text:he[1].charAt(he[1].length-1)===`
|
|
`?he[1].slice(0,-1):he[1]}},de.text=function(le,he){var Ee=this.rules.block.text.exec(le);if(Ee){var ye=he[he.length-1];return ye&&ye.type==="text"?{raw:Ee[0],text:Ee[0]}:{type:"text",raw:Ee[0],text:Ee[0]}}},de.escape=function(le){var he=this.rules.inline.escape.exec(le);if(he)return{type:"escape",raw:he[0],text:ne(he[1])}},de.tag=function(le,he,Ee){var ye=this.rules.inline.tag.exec(le);if(ye)return!he&&/^<a /i.test(ye[0])?he=!0:he&&/^<\/a>/i.test(ye[0])&&(he=!1),!Ee&&/^<(pre|code|kbd|script)(\s|>)/i.test(ye[0])?Ee=!0:Ee&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ye[0])&&(Ee=!1),{type:this.options.sanitize?"text":"html",raw:ye[0],inLink:he,inRawBlock:Ee,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ye[0]):ne(ye[0]):ye[0]}},de.link=function(le){var he=this.rules.inline.link.exec(le);if(he){var Ee=se(he[2],"()");if(Ee>-1){var ye=he[0].indexOf("!")===0?5:4,Le=ye+he[1].length+Ee;he[2]=he[2].substring(0,Ee),he[0]=he[0].substring(0,Le).trim(),he[3]=""}var Ne=he[2],tt="";if(this.options.pedantic){var gt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ne);gt?(Ne=gt[1],tt=gt[3]):tt=""}else tt=he[3]?he[3].slice(1,-1):"";Ne=Ne.trim().replace(/^<([\s\S]*)>$/,"$1");var Ct=Se(he,{href:Ne&&Ne.replace(this.rules.inline._escapes,"$1"),title:tt&&tt.replace(this.rules.inline._escapes,"$1")},he[0]);return Ct}},de.reflink=function(le,he){var Ee;if((Ee=this.rules.inline.reflink.exec(le))||(Ee=this.rules.inline.nolink.exec(le))){var ye=(Ee[2]||Ee[1]).replace(/\s+/g," ");if(ye=he[ye.toLowerCase()],!ye||!ye.href){var Le=Ee[0].charAt(0);return{type:"text",raw:Le,text:Le}}var Ne=Se(Ee,ye,Ee[0]);return Ne}},de.strong=function(le,he,Ee){Ee===void 0&&(Ee="");var ye=this.rules.inline.strong.start.exec(le);if(ye&&(!ye[1]||ye[1]&&(Ee===""||this.rules.inline.punctuation.exec(Ee)))){he=he.slice(-1*le.length);var Le=ye[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Le.lastIndex=0;for(var Ne;(ye=Le.exec(he))!=null;)if(Ne=this.rules.inline.strong.middle.exec(he.slice(0,ye.index+3)),Ne)return{type:"strong",raw:le.slice(0,Ne[0].length),text:le.slice(2,Ne[0].length-2)}}},de.em=function(le,he,Ee){Ee===void 0&&(Ee="");var ye=this.rules.inline.em.start.exec(le);if(ye&&(!ye[1]||ye[1]&&(Ee===""||this.rules.inline.punctuation.exec(Ee)))){he=he.slice(-1*le.length);var Le=ye[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Le.lastIndex=0;for(var Ne;(ye=Le.exec(he))!=null;)if(Ne=this.rules.inline.em.middle.exec(he.slice(0,ye.index+2)),Ne)return{type:"em",raw:le.slice(0,Ne[0].length),text:le.slice(1,Ne[0].length-1)}}},de.codespan=function(le){var he=this.rules.inline.code.exec(le);if(he){var Ee=he[2].replace(/\n/g," "),ye=/[^ ]/.test(Ee),Le=Ee.startsWith(" ")&&Ee.endsWith(" ");return ye&&Le&&(Ee=Ee.substring(1,Ee.length-1)),Ee=ne(Ee,!0),{type:"codespan",raw:he[0],text:Ee}}},de.br=function(le){var he=this.rules.inline.br.exec(le);if(he)return{type:"br",raw:he[0]}},de.del=function(le){var he=this.rules.inline.del.exec(le);if(he)return{type:"del",raw:he[0],text:he[1]}},de.autolink=function(le,he){var Ee=this.rules.inline.autolink.exec(le);if(Ee){var ye,Le;return Ee[2]==="@"?(ye=ne(this.options.mangle?he(Ee[1]):Ee[1]),Le="mailto:"+ye):(ye=ne(Ee[1]),Le=ye),{type:"link",raw:Ee[0],text:ye,href:Le,tokens:[{type:"text",raw:ye,text:ye}]}}},de.url=function(le,he){var Ee;if(Ee=this.rules.inline.url.exec(le)){var ye,Le;if(Ee[2]==="@")ye=ne(this.options.mangle?he(Ee[0]):Ee[0]),Le="mailto:"+ye;else{var Ne;do Ne=Ee[0],Ee[0]=this.rules.inline._backpedal.exec(Ee[0])[0];while(Ne!==Ee[0]);ye=ne(Ee[0]),Ee[1]==="www."?Le="http://"+ye:Le=ye}return{type:"link",raw:Ee[0],text:ye,href:Le,tokens:[{type:"text",raw:ye,text:ye}]}}},de.inlineText=function(le,he,Ee){var ye=this.rules.inline.text.exec(le);if(ye){var Le;return he?Le=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ye[0]):ne(ye[0]):ye[0]:Le=ne(this.options.smartypants?Ee(ye[0]):ye[0]),{type:"text",raw:ye[0],text:Le}}},re}(),ke=G.noopTest,je=G.edit,Be=G.merge,we={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ke,table:ke,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};we._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,we._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,we.def=je(we.def).replace("label",we._label).replace("title",we._title).getRegex(),we.bullet=/(?:[*+-]|\d{1,9}[.)])/,we.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,we.item=je(we.item,"gm").replace(/bull/g,we.bullet).getRegex(),we.list=je(we.list).replace(/bull/g,we.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+we.def.source+")").getRegex(),we._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",we._comment=/<!--(?!-?>)[\s\S]*?-->/,we.html=je(we.html,"i").replace("comment",we._comment).replace("tag",we._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),we.paragraph=je(we._paragraph).replace("hr",we.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",we._tag).getRegex(),we.blockquote=je(we.blockquote).replace("paragraph",we.paragraph).getRegex(),we.normal=Be({},we),we.gfm=Be({},we.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),we.gfm.nptable=je(we.gfm.nptable).replace("hr",we.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",we._tag).getRegex(),we.gfm.table=je(we.gfm.table).replace("hr",we.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",we._tag).getRegex(),we.pedantic=Be({},we.normal,{html:je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",we._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ke,paragraph:je(we.normal._paragraph).replace("hr",we.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",we.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ke,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:ke,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Z._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Z.punctuation=je(Z.punctuation).replace(/punctuation/g,Z._punctuation).getRegex(),Z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Z.em.start=je(Z.em.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.middle=je(Z.em.middle).replace(/punctuation/g,Z._punctuation).replace(/overlapSkip/g,Z._overlapSkip).getRegex(),Z.em.endAst=je(Z.em.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.endUnd=je(Z.em.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.start=je(Z.strong.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.middle=je(Z.strong.middle).replace(/punctuation/g,Z._punctuation).replace(/blockSkip/g,Z._blockSkip).getRegex(),Z.strong.endAst=je(Z.strong.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.endUnd=je(Z.strong.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.blockSkip=je(Z._blockSkip,"g").getRegex(),Z.overlapSkip=je(Z._overlapSkip,"g").getRegex(),Z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Z._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])?)+(?![-_])/,Z.autolink=je(Z.autolink).replace("scheme",Z._scheme).replace("email",Z._email).getRegex(),Z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Z.tag=je(Z.tag).replace("comment",we._comment).replace("attribute",Z._attribute).getRegex(),Z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Z.link=je(Z.link).replace("label",Z._label).replace("href",Z._href).replace("title",Z._title).getRegex(),Z.reflink=je(Z.reflink).replace("label",Z._label).getRegex(),Z.reflinkSearch=je(Z.reflinkSearch,"g").replace("reflink",Z.reflink).replace("nolink",Z.nolink).getRegex(),Z.normal=Be({},Z),Z.pedantic=Be({},Z.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:je(/^!?\[(label)\]\((.*?)\)/).replace("label",Z._label).getRegex(),reflink:je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Z._label).getRegex()}),Z.gfm=Be({},Z.normal,{escape:je(Z.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),Z.gfm.url=je(Z.gfm.url,"i").replace("email",Z.gfm._extended_email).getRegex(),Z.breaks=Be({},Z.gfm,{br:je(Z.br).replace("{2,}","*").getRegex(),text:je(Z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var U={block:we,inline:Z},K=B.defaults,ee=U.block,oe=U.inline;function Q(re){return re.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 Ce(re){var de="",me,le,he=re.length;for(me=0;me<he;me++)le=re.charCodeAt(me),Math.random()>.5&&(le="x"+le.toString(16)),de+="&#"+le+";";return de}var ze=function(){function re(me){this.tokens=[],this.tokens.links=Object.create(null),this.options=me||K,this.options.tokenizer=this.options.tokenizer||new Ae,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var le={block:ee.normal,inline:oe.normal};this.options.pedantic?(le.block=ee.pedantic,le.inline=oe.pedantic):this.options.gfm&&(le.block=ee.gfm,this.options.breaks?le.inline=oe.breaks:le.inline=oe.gfm),this.tokenizer.rules=le}re.lex=function(le,he){var Ee=new re(he);return Ee.lex(le)};var de=re.prototype;return de.lex=function(le){return le=le.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(le,this.tokens,!0),this.inline(this.tokens),this.tokens},de.blockTokens=function(le,he,Ee){he===void 0&&(he=[]),Ee===void 0&&(Ee=!0),le=le.replace(/^ +$/gm,"");for(var ye,Le,Ne,tt;le;){if(ye=this.tokenizer.space(le)){le=le.substring(ye.raw.length),ye.type&&he.push(ye);continue}if(ye=this.tokenizer.code(le,he)){le=le.substring(ye.raw.length),ye.type?he.push(ye):(tt=he[he.length-1],tt.raw+=`
|
|
`+ye.raw,tt.text+=`
|
|
`+ye.text);continue}if(ye=this.tokenizer.fences(le)){le=le.substring(ye.raw.length),he.push(ye);continue}if(ye=this.tokenizer.heading(le)){le=le.substring(ye.raw.length),he.push(ye);continue}if(ye=this.tokenizer.nptable(le)){le=le.substring(ye.raw.length),he.push(ye);continue}if(ye=this.tokenizer.hr(le)){le=le.substring(ye.raw.length),he.push(ye);continue}if(ye=this.tokenizer.blockquote(le)){le=le.substring(ye.raw.length),ye.tokens=this.blockTokens(ye.text,[],Ee),he.push(ye);continue}if(ye=this.tokenizer.list(le)){for(le=le.substring(ye.raw.length),Ne=ye.items.length,Le=0;Le<Ne;Le++)ye.items[Le].tokens=this.blockTokens(ye.items[Le].text,[],!1);he.push(ye);continue}if(ye=this.tokenizer.html(le)){le=le.substring(ye.raw.length),he.push(ye);continue}if(Ee&&(ye=this.tokenizer.def(le))){le=le.substring(ye.raw.length),this.tokens.links[ye.tag]||(this.tokens.links[ye.tag]={href:ye.href,title:ye.title});continue}if(ye=this.tokenizer.table(le)){le=le.substring(ye.raw.length),he.push(ye);continue}if(ye=this.tokenizer.lheading(le)){le=le.substring(ye.raw.length),he.push(ye);continue}if(Ee&&(ye=this.tokenizer.paragraph(le))){le=le.substring(ye.raw.length),he.push(ye);continue}if(ye=this.tokenizer.text(le,he)){le=le.substring(ye.raw.length),ye.type?he.push(ye):(tt=he[he.length-1],tt.raw+=`
|
|
`+ye.raw,tt.text+=`
|
|
`+ye.text);continue}if(le){var gt="Infinite loop on byte: "+le.charCodeAt(0);if(this.options.silent){console.error(gt);break}else throw new Error(gt)}}return he},de.inline=function(le){var he,Ee,ye,Le,Ne,tt,gt=le.length;for(he=0;he<gt;he++){tt=le[he];switch(tt.type){case"paragraph":case"text":case"heading":{tt.tokens=[],this.inlineTokens(tt.text,tt.tokens);break}case"table":{for(tt.tokens={header:[],cells:[]},Le=tt.header.length,Ee=0;Ee<Le;Ee++)tt.tokens.header[Ee]=[],this.inlineTokens(tt.header[Ee],tt.tokens.header[Ee]);for(Le=tt.cells.length,Ee=0;Ee<Le;Ee++)for(Ne=tt.cells[Ee],tt.tokens.cells[Ee]=[],ye=0;ye<Ne.length;ye++)tt.tokens.cells[Ee][ye]=[],this.inlineTokens(Ne[ye],tt.tokens.cells[Ee][ye]);break}case"blockquote":{this.inline(tt.tokens);break}case"list":{for(Le=tt.items.length,Ee=0;Ee<Le;Ee++)this.inline(tt.items[Ee].tokens);break}}}return le},de.inlineTokens=function(le,he,Ee,ye,Le){he===void 0&&(he=[]),Ee===void 0&&(Ee=!1),ye===void 0&&(ye=!1),Le===void 0&&(Le="");var Ne,tt=le,gt;if(this.tokens.links){var Ct=Object.keys(this.tokens.links);if(Ct.length>0)for(;(gt=this.tokenizer.rules.inline.reflinkSearch.exec(tt))!=null;)Ct.includes(gt[0].slice(gt[0].lastIndexOf("[")+1,-1))&&(tt=tt.slice(0,gt.index)+"["+"a".repeat(gt[0].length-2)+"]"+tt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(gt=this.tokenizer.rules.inline.blockSkip.exec(tt))!=null;)tt=tt.slice(0,gt.index)+"["+"a".repeat(gt[0].length-2)+"]"+tt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;le;){if(Ne=this.tokenizer.escape(le)){le=le.substring(Ne.raw.length),he.push(Ne);continue}if(Ne=this.tokenizer.tag(le,Ee,ye)){le=le.substring(Ne.raw.length),Ee=Ne.inLink,ye=Ne.inRawBlock,he.push(Ne);continue}if(Ne=this.tokenizer.link(le)){le=le.substring(Ne.raw.length),Ne.type==="link"&&(Ne.tokens=this.inlineTokens(Ne.text,[],!0,ye)),he.push(Ne);continue}if(Ne=this.tokenizer.reflink(le,this.tokens.links)){le=le.substring(Ne.raw.length),Ne.type==="link"&&(Ne.tokens=this.inlineTokens(Ne.text,[],!0,ye)),he.push(Ne);continue}if(Ne=this.tokenizer.strong(le,tt,Le)){le=le.substring(Ne.raw.length),Ne.tokens=this.inlineTokens(Ne.text,[],Ee,ye),he.push(Ne);continue}if(Ne=this.tokenizer.em(le,tt,Le)){le=le.substring(Ne.raw.length),Ne.tokens=this.inlineTokens(Ne.text,[],Ee,ye),he.push(Ne);continue}if(Ne=this.tokenizer.codespan(le)){le=le.substring(Ne.raw.length),he.push(Ne);continue}if(Ne=this.tokenizer.br(le)){le=le.substring(Ne.raw.length),he.push(Ne);continue}if(Ne=this.tokenizer.del(le)){le=le.substring(Ne.raw.length),Ne.tokens=this.inlineTokens(Ne.text,[],Ee,ye),he.push(Ne);continue}if(Ne=this.tokenizer.autolink(le,Ce)){le=le.substring(Ne.raw.length),he.push(Ne);continue}if(!Ee&&(Ne=this.tokenizer.url(le,Ce))){le=le.substring(Ne.raw.length),he.push(Ne);continue}if(Ne=this.tokenizer.inlineText(le,ye,Q)){le=le.substring(Ne.raw.length),Le=Ne.raw.slice(-1),he.push(Ne);continue}if(le){var Ot="Infinite loop on byte: "+le.charCodeAt(0);if(this.options.silent){console.error(Ot);break}else throw new Error(Ot)}}return he},z(re,null,[{key:"rules",get:function(){return{block:ee,inline:oe}}}]),re}(),nt=B.defaults,xe=G.cleanUrl,Re=G.escape,Te=function(){function re(me){this.options=me||nt}var de=re.prototype;return de.code=function(le,he,Ee){var ye=(he||"").match(/\S*/)[0];if(this.options.highlight){var Le=this.options.highlight(le,ye);Le!=null&&Le!==le&&(Ee=!0,le=Le)}return ye?'<pre><code class="'+this.options.langPrefix+Re(ye,!0)+'">'+(Ee?le:Re(le,!0))+`</code></pre>
|
|
`:"<pre><code>"+(Ee?le:Re(le,!0))+`</code></pre>
|
|
`},de.blockquote=function(le){return`<blockquote>
|
|
`+le+`</blockquote>
|
|
`},de.html=function(le){return le},de.heading=function(le,he,Ee,ye){return this.options.headerIds?"<h"+he+' id="'+this.options.headerPrefix+ye.slug(Ee)+'">'+le+"</h"+he+`>
|
|
`:"<h"+he+">"+le+"</h"+he+`>
|
|
`},de.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},de.list=function(le,he,Ee){var ye=he?"ol":"ul",Le=he&&Ee!==1?' start="'+Ee+'"':"";return"<"+ye+Le+`>
|
|
`+le+"</"+ye+`>
|
|
`},de.listitem=function(le){return"<li>"+le+`</li>
|
|
`},de.checkbox=function(le){return"<input "+(le?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},de.paragraph=function(le){return"<p>"+le+`</p>
|
|
`},de.table=function(le,he){return he&&(he="<tbody>"+he+"</tbody>"),`<table>
|
|
<thead>
|
|
`+le+`</thead>
|
|
`+he+`</table>
|
|
`},de.tablerow=function(le){return`<tr>
|
|
`+le+`</tr>
|
|
`},de.tablecell=function(le,he){var Ee=he.header?"th":"td",ye=he.align?"<"+Ee+' align="'+he.align+'">':"<"+Ee+">";return ye+le+"</"+Ee+`>
|
|
`},de.strong=function(le){return"<strong>"+le+"</strong>"},de.em=function(le){return"<em>"+le+"</em>"},de.codespan=function(le){return"<code>"+le+"</code>"},de.br=function(){return this.options.xhtml?"<br/>":"<br>"},de.del=function(le){return"<del>"+le+"</del>"},de.link=function(le,he,Ee){if(le=xe(this.options.sanitize,this.options.baseUrl,le),le===null)return Ee;var ye='<a href="'+Re(le)+'"';return he&&(ye+=' title="'+he+'"'),ye+=">"+Ee+"</a>",ye},de.image=function(le,he,Ee){if(le=xe(this.options.sanitize,this.options.baseUrl,le),le===null)return Ee;var ye='<img src="'+le+'" alt="'+Ee+'"';return he&&(ye+=' title="'+he+'"'),ye+=this.options.xhtml?"/>":">",ye},de.text=function(le){return le},re}(),Oe=function(){function re(){}var de=re.prototype;return de.strong=function(le){return le},de.em=function(le){return le},de.codespan=function(le){return le},de.del=function(le){return le},de.html=function(le){return le},de.text=function(le){return le},de.link=function(le,he,Ee){return""+Ee},de.image=function(le,he,Ee){return""+Ee},de.br=function(){return""},re}(),Ke=function(){function re(){this.seen={}}var de=re.prototype;return de.slug=function(le){var he=le.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(he)){var Ee=he;do this.seen[Ee]++,he=Ee+"-"+this.seen[Ee];while(this.seen.hasOwnProperty(he))}return this.seen[he]=0,he},re}(),Qe=B.defaults,st=G.unescape,ut=function(){function re(me){this.options=me||Qe,this.options.renderer=this.options.renderer||new Te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Oe,this.slugger=new Ke}re.parse=function(le,he){var Ee=new re(he);return Ee.parse(le)};var de=re.prototype;return de.parse=function(le,he){he===void 0&&(he=!0);var Ee="",ye,Le,Ne,tt,gt,Ct,Ot,St,Ye,at,Ve,be,Ie,ot,Xe,Rt,Lt,et,dt=le.length;for(ye=0;ye<dt;ye++){at=le[ye];switch(at.type){case"space":continue;case"hr":{Ee+=this.renderer.hr();continue}case"heading":{Ee+=this.renderer.heading(this.parseInline(at.tokens),at.depth,st(this.parseInline(at.tokens,this.textRenderer)),this.slugger);continue}case"code":{Ee+=this.renderer.code(at.text,at.lang,at.escaped);continue}case"table":{for(St="",Ot="",tt=at.header.length,Le=0;Le<tt;Le++)Ot+=this.renderer.tablecell(this.parseInline(at.tokens.header[Le]),{header:!0,align:at.align[Le]});for(St+=this.renderer.tablerow(Ot),Ye="",tt=at.cells.length,Le=0;Le<tt;Le++){for(Ct=at.tokens.cells[Le],Ot="",gt=Ct.length,Ne=0;Ne<gt;Ne++)Ot+=this.renderer.tablecell(this.parseInline(Ct[Ne]),{header:!1,align:at.align[Ne]});Ye+=this.renderer.tablerow(Ot)}Ee+=this.renderer.table(St,Ye);continue}case"blockquote":{Ye=this.parse(at.tokens),Ee+=this.renderer.blockquote(Ye);continue}case"list":{for(Ve=at.ordered,be=at.start,Ie=at.loose,tt=at.items.length,Ye="",Le=0;Le<tt;Le++)Xe=at.items[Le],Rt=Xe.checked,Lt=Xe.task,ot="",Xe.task&&(et=this.renderer.checkbox(Rt),Ie?Xe.tokens.length>0&&Xe.tokens[0].type==="text"?(Xe.tokens[0].text=et+" "+Xe.tokens[0].text,Xe.tokens[0].tokens&&Xe.tokens[0].tokens.length>0&&Xe.tokens[0].tokens[0].type==="text"&&(Xe.tokens[0].tokens[0].text=et+" "+Xe.tokens[0].tokens[0].text)):Xe.tokens.unshift({type:"text",text:et}):ot+=et),ot+=this.parse(Xe.tokens,Ie),Ye+=this.renderer.listitem(ot,Lt,Rt);Ee+=this.renderer.list(Ye,Ve,be);continue}case"html":{Ee+=this.renderer.html(at.text);continue}case"paragraph":{Ee+=this.renderer.paragraph(this.parseInline(at.tokens));continue}case"text":{for(Ye=at.tokens?this.parseInline(at.tokens):at.text;ye+1<dt&&le[ye+1].type==="text";)at=le[++ye],Ye+=`
|
|
`+(at.tokens?this.parseInline(at.tokens):at.text);Ee+=he?this.renderer.paragraph(Ye):Ye;continue}default:{var vt='Token with "'+at.type+'" type was not found.';if(this.options.silent){console.error(vt);return}else throw new Error(vt)}}}return Ee},de.parseInline=function(le,he){he=he||this.renderer;var Ee="",ye,Le,Ne=le.length;for(ye=0;ye<Ne;ye++){Le=le[ye];switch(Le.type){case"escape":{Ee+=he.text(Le.text);break}case"html":{Ee+=he.html(Le.text);break}case"link":{Ee+=he.link(Le.href,Le.title,this.parseInline(Le.tokens,he));break}case"image":{Ee+=he.image(Le.href,Le.title,Le.text);break}case"strong":{Ee+=he.strong(this.parseInline(Le.tokens,he));break}case"em":{Ee+=he.em(this.parseInline(Le.tokens,he));break}case"codespan":{Ee+=he.codespan(Le.text);break}case"br":{Ee+=he.br();break}case"del":{Ee+=he.del(this.parseInline(Le.tokens,he));break}case"text":{Ee+=he.text(Le.text);break}default:{var tt='Token with "'+Le.type+'" type was not found.';if(this.options.silent){console.error(tt);return}else throw new Error(tt)}}}return Ee},re}(),xt=G.merge,wt=G.checkSanitizeDeprecation,Fe=G.escape,Ue=B.getDefaults,it=B.changeDefaults,lt=B.defaults;function fe(re,de,me){if(typeof re=="undefined"||re===null)throw new Error("marked(): input parameter is undefined or null");if(typeof re!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(re)+", string expected");if(typeof de=="function"&&(me=de,de=null),de=xt({},fe.defaults,de||{}),wt(de),me){var le=de.highlight,he;try{he=ze.lex(re,de)}catch(Ne){return me(Ne)}var Ee=function(tt){var gt;if(!tt)try{gt=ut.parse(he,de)}catch(Ct){tt=Ct}return de.highlight=le,tt?me(tt):me(null,gt)};if(!le||le.length<3)return Ee();if(delete de.highlight,!he.length)return Ee();var ye=0;fe.walkTokens(he,function(Ne){Ne.type==="code"&&(ye++,setTimeout(function(){le(Ne.text,Ne.lang,function(tt,gt){if(tt)return Ee(tt);gt!=null&>!==Ne.text&&(Ne.text=gt,Ne.escaped=!0),ye--,ye===0&&Ee()})},0))}),ye===0&&Ee();return}try{var Le=ze.lex(re,de);return de.walkTokens&&fe.walkTokens(Le,de.walkTokens),ut.parse(Le,de)}catch(Ne){if(Ne.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,de.silent)return"<p>An error occurred:</p><pre>"+Fe(Ne.message+"",!0)+"</pre>";throw Ne}}fe.options=fe.setOptions=function(re){return xt(fe.defaults,re),it(fe.defaults),fe},fe.getDefaults=Ue,fe.defaults=lt,fe.use=function(re){var de=xt({},re);if(re.renderer&&function(){var le=fe.defaults.renderer||new Te,he=function(Le){var Ne=le[Le];le[Le]=function(){for(var tt=arguments.length,gt=new Array(tt),Ct=0;Ct<tt;Ct++)gt[Ct]=arguments[Ct];var Ot=re.renderer[Le].apply(le,gt);return Ot===!1&&(Ot=Ne.apply(le,gt)),Ot}};for(var Ee in re.renderer)he(Ee);de.renderer=le}(),re.tokenizer&&function(){var le=fe.defaults.tokenizer||new Ae,he=function(Le){var Ne=le[Le];le[Le]=function(){for(var tt=arguments.length,gt=new Array(tt),Ct=0;Ct<tt;Ct++)gt[Ct]=arguments[Ct];var Ot=re.tokenizer[Le].apply(le,gt);return Ot===!1&&(Ot=Ne.apply(le,gt)),Ot}};for(var Ee in re.tokenizer)he(Ee);de.tokenizer=le}(),re.walkTokens){var me=fe.defaults.walkTokens;de.walkTokens=function(le){re.walkTokens(le),me&&me(le)}}fe.setOptions(de)},fe.walkTokens=function(re,de){for(var me=N(re),le;!(le=me()).done;){var he=le.value;de(he);switch(he.type){case"table":{for(var Ee=N(he.tokens.header),ye;!(ye=Ee()).done;){var Le=ye.value;fe.walkTokens(Le,de)}for(var Ne=N(he.tokens.cells),tt;!(tt=Ne()).done;)for(var gt=tt.value,Ct=N(gt),Ot;!(Ot=Ct()).done;){var St=Ot.value;fe.walkTokens(St,de)}break}case"list":{fe.walkTokens(he.items,de);break}default:he.tokens&&fe.walkTokens(he.tokens,de)}}},fe.Parser=ut,fe.parser=ut.parse,fe.Renderer=Te,fe.TextRenderer=Oe,fe.Lexer=ze,fe.lexer=ze.lex,fe.Tokenizer=Ae,fe.Slugger=Ke,fe.parse=fe;var ie=fe;return ie})},"DlR+":function(He,pe,I){var J=I("MFOe"),z=J.Global,P=J.trim;He.exports={name:"cookieStorage",read:N,write:B,each:C,remove:M,clearAll:n};var X=z.document;function N(g){if(!g||!D(g))return null;var p="(?:^|.*;\\s*)"+escape(g).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(X.cookie.replace(new RegExp(p),"$1"))}function C(g){for(var p=X.cookie.split(/; ?/g),h=p.length-1;h>=0;h--){if(!P(p[h]))continue;var c=p[h].split("="),o=unescape(c[0]),d=unescape(c[1]);g(d,o)}}function B(g,p){if(!g)return;X.cookie=escape(g)+"="+escape(p)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function M(g){if(!g||!D(g))return;X.cookie=escape(g)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function n(){C(function(g,p){M(p)})}function D(g){return new RegExp("(?:^|;\\s*)"+escape(g).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(X.cookie)}},E2g8:function(He,pe,I){(function(J,z){/*!
|
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
* @license Licensed under MIT license
|
|
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
|
* @version v4.2.8+1e68dce6
|
|
*/(function(P,X){He.exports=X()})(this,function(){"use strict";function P(Te){var Oe=typeof Te;return Te!==null&&(Oe==="object"||Oe==="function")}function X(Te){return typeof Te=="function"}var N=void 0;Array.isArray?N=Array.isArray:N=function(Te){return Object.prototype.toString.call(Te)==="[object Array]"};var C=N,B=0,M=void 0,n=void 0,D=function(Oe,Ke){T[B]=Oe,T[B+1]=Ke,B+=2,B===2&&(n?n(A):v())};function g(Te){n=Te}function p(Te){D=Te}var h=typeof window!="undefined"?window:void 0,c=h||{},o=c.MutationObserver||c.WebKitMutationObserver,d=typeof self=="undefined"&&typeof J!="undefined"&&{}.toString.call(J)==="[object process]",r=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function a(){return function(){return J.nextTick(A)}}function i(){return typeof M!="undefined"?function(){M(A)}:x()}function s(){var Te=0,Oe=new o(A),Ke=document.createTextNode("");return Oe.observe(Ke,{characterData:!0}),function(){Ke.data=Te=++Te%2}}function S(){var Te=new MessageChannel;return Te.port1.onmessage=A,function(){return Te.port2.postMessage(0)}}function x(){var Te=setTimeout;return function(){return Te(A,1)}}var T=new Array(1e3);function A(){for(var Te=0;Te<B;Te+=2){var Oe=T[Te],Ke=T[Te+1];Oe(Ke),T[Te]=void 0,T[Te+1]=void 0}B=0}function w(){try{var Te=Function("return this")().require("vertx");return M=Te.runOnLoop||Te.runOnContext,i()}catch(Oe){return x()}}var v=void 0;d?v=a():o?v=s():r?v=S():h===void 0&&!0?v=w():v=x();function b(Te,Oe){var Ke=this,Qe=new this.constructor(O);Qe[f]===void 0&&U(Qe);var st=Ke._state;if(st){var ut=arguments[st-1];D(function(){return je(st,Qe,ut,Ke._result)})}else Ae(Ke,Qe,Te,Oe);return Qe}function m(Te){var Oe=this;if(Te&&typeof Te=="object"&&Te.constructor===Oe)return Te;var Ke=new Oe(O);return ne(Ke,Te),Ke}var f=Math.random().toString(36).substring(2);function O(){}var E=void 0,_=1,k=2;function F(){return new TypeError("You cannot resolve a promise with itself")}function L(){return new TypeError("A promises callback cannot return that same promise.")}function G(Te,Oe,Ke,Qe){try{Te.call(Oe,Ke,Qe)}catch(st){return st}}function j(Te,Oe,Ke){D(function(Qe){var st=!1,ut=G(Ke,Oe,function(xt){if(st)return;st=!0,Oe!==xt?ne(Qe,xt):Se(Qe,xt)},function(xt){if(st)return;st=!0,De(Qe,xt)},"Settle: "+(Qe._label||" unknown promise"));!st&&ut&&(st=!0,De(Qe,ut))},Te)}function R(Te,Oe){Oe._state===_?Se(Te,Oe._result):Oe._state===k?De(Te,Oe._result):Ae(Oe,void 0,function(Ke){return ne(Te,Ke)},function(Ke){return De(Te,Ke)})}function V(Te,Oe,Ke){Oe.constructor===Te.constructor&&Ke===b&&Oe.constructor.resolve===m?R(Te,Oe):Ke===void 0?Se(Te,Oe):X(Ke)?j(Te,Oe,Ke):Se(Te,Oe)}function ne(Te,Oe){if(Te===Oe)De(Te,F());else if(P(Oe)){var Ke=void 0;try{Ke=Oe.then}catch(Qe){De(Te,Qe);return}V(Te,Oe,Ke)}else Se(Te,Oe)}function se(Te){Te._onerror&&Te._onerror(Te._result),ke(Te)}function Se(Te,Oe){if(Te._state!==E)return;Te._result=Oe,Te._state=_,Te._subscribers.length!==0&&D(ke,Te)}function De(Te,Oe){if(Te._state!==E)return;Te._state=k,Te._result=Oe,D(se,Te)}function Ae(Te,Oe,Ke,Qe){var st=Te._subscribers,ut=st.length;Te._onerror=null,st[ut]=Oe,st[ut+_]=Ke,st[ut+k]=Qe,ut===0&&Te._state&&D(ke,Te)}function ke(Te){var Oe=Te._subscribers,Ke=Te._state;if(Oe.length===0)return;for(var Qe=void 0,st=void 0,ut=Te._result,xt=0;xt<Oe.length;xt+=3)Qe=Oe[xt],st=Oe[xt+Ke],Qe?je(Ke,Qe,st,ut):st(ut);Te._subscribers.length=0}function je(Te,Oe,Ke,Qe){var st=X(Ke),ut=void 0,xt=void 0,wt=!0;if(st){try{ut=Ke(Qe)}catch(Fe){wt=!1,xt=Fe}if(Oe===ut){De(Oe,L());return}}else ut=Qe;Oe._state!==E||(st&&wt?ne(Oe,ut):wt===!1?De(Oe,xt):Te===_?Se(Oe,ut):Te===k&&De(Oe,ut))}function Be(Te,Oe){try{Oe(function(Qe){ne(Te,Qe)},function(Qe){De(Te,Qe)})}catch(Ke){De(Te,Ke)}}var we=0;function Z(){return we++}function U(Te){Te[f]=we++,Te._state=void 0,Te._result=void 0,Te._subscribers=[]}function K(){return new Error("Array Methods must be provided an Array")}var ee=function(){function Te(Oe,Ke){this._instanceConstructor=Oe,this.promise=new Oe(O),this.promise[f]||U(this.promise),C(Ke)?(this.length=Ke.length,this._remaining=Ke.length,this._result=new Array(this.length),this.length===0?Se(this.promise,this._result):(this.length=this.length||0,this._enumerate(Ke),this._remaining===0&&Se(this.promise,this._result))):De(this.promise,K())}return Te.prototype._enumerate=function(Ke){for(var Qe=0;this._state===E&&Qe<Ke.length;Qe++)this._eachEntry(Ke[Qe],Qe)},Te.prototype._eachEntry=function(Ke,Qe){var st=this._instanceConstructor,ut=st.resolve;if(ut===m){var xt=void 0,wt=void 0,Fe=!1;try{xt=Ke.then}catch(it){Fe=!0,wt=it}if(xt===b&&Ke._state!==E)this._settledAt(Ke._state,Qe,Ke._result);else if(typeof xt!="function")this._remaining--,this._result[Qe]=Ke;else if(st===xe){var Ue=new st(O);Fe?De(Ue,wt):V(Ue,Ke,xt),this._willSettleAt(Ue,Qe)}else this._willSettleAt(new st(function(it){return it(Ke)}),Qe)}else this._willSettleAt(ut(Ke),Qe)},Te.prototype._settledAt=function(Ke,Qe,st){var ut=this.promise;ut._state===E&&(this._remaining--,Ke===k?De(ut,st):this._result[Qe]=st),this._remaining===0&&Se(ut,this._result)},Te.prototype._willSettleAt=function(Ke,Qe){var st=this;Ae(Ke,void 0,function(ut){return st._settledAt(_,Qe,ut)},function(ut){return st._settledAt(k,Qe,ut)})},Te}();function oe(Te){return new ee(this,Te).promise}function Q(Te){var Oe=this;return C(Te)?new Oe(function(Ke,Qe){for(var st=Te.length,ut=0;ut<st;ut++)Oe.resolve(Te[ut]).then(Ke,Qe)}):new Oe(function(Ke,Qe){return Qe(new TypeError("You must pass an array to race."))})}function Ce(Te){var Oe=this,Ke=new Oe(O);return De(Ke,Te),Ke}function ze(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function nt(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var xe=function(){function Te(Oe){this[f]=Z(),this._result=this._state=void 0,this._subscribers=[],O!==Oe&&(typeof Oe!="function"&&ze(),this instanceof Te?Be(this,Oe):nt())}return Te.prototype.catch=function(Ke){return this.then(null,Ke)},Te.prototype.finally=function(Ke){var Qe=this,st=Qe.constructor;return X(Ke)?Qe.then(function(ut){return st.resolve(Ke()).then(function(){return ut})},function(ut){return st.resolve(Ke()).then(function(){throw ut})}):Qe.then(Ke,Ke)},Te}();xe.prototype.then=b,xe.all=oe,xe.race=Q,xe.resolve=m,xe.reject=Ce,xe._setScheduler=g,xe._setAsap=p,xe._asap=D;function Re(){var Te=void 0;if(typeof z!="undefined")Te=z;else if(typeof self!="undefined")Te=self;else try{Te=Function("return this")()}catch(Qe){throw new Error("polyfill failed because global object is unavailable in this environment")}var Oe=Te.Promise;if(Oe){var Ke=null;try{Ke=Object.prototype.toString.call(Oe.resolve())}catch(Qe){}if(Ke==="[object Promise]"&&!Oe.cast)return}Te.Promise=xe}return xe.polyfill=Re,xe.Promise=xe,xe})}).call(this,I("Q2Ig"),I("IyRk"))},E9nw:function(He,pe){He.exports=function(){var I=document.getSelection();if(!I.rangeCount)return function(){};for(var J=document.activeElement,z=[],P=0;P<I.rangeCount;P++)z.push(I.getRangeAt(P));switch(J.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":J.blur();break;default:J=null;break}return I.removeAllRanges(),function(){I.type==="Caret"&&I.removeAllRanges(),I.rangeCount||z.forEach(function(X){I.addRange(X)}),J&&J.focus()}}},EHPI:function(He,pe,I){"use strict";var J=I("bbsP"),z=I("/wGt"),P=I("tJVT"),X=I("k1fw"),N=I("q1tI"),C=I.n(N),B=I("ZW9T"),M=I("ZD9Y"),n=I("M8RZ"),D=I("bCnd"),g=I("fcyK"),p=I.n(g),h={theme:Object(D.a)("cmCodeMode","vs-dark"),fontSize:Object(D.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(D.a)("cmTabToSpace",!0)},c;(function(r){r[r.set_font_size=0]="set_font_size",r[r.set_theme=1]="set_theme",r[r.on_tab_to_space=2]="on_tab_to_space",r[r.set_show_editor_setting=3]="set_show_editor_setting"})(c||(c={}));function o(r,a){switch(a.type){case c.set_show_editor_setting:return Object(X.a)(Object(X.a)({},r),{},{showEditorSetting:a.payload});case c.set_theme:return Object(X.a)(Object(X.a)({},r),{},{theme:a.payload});case c.set_font_size:return Object(X.a)(Object(X.a)({},r),{},{fontSize:a.payload});case c.on_tab_to_space:return Object(X.a)(Object(X.a)({},r),{},{tabToSpace:a.payload});default:throw new Error}}pe.a=function(r){var a=r.isLoading,i=r.value,s=r.onChange,S=r.language,x=r.ActionBarRender,T=x===void 0?function(G){return C.a.createElement(d,{onShowCodeSetting:G})}:x,A=Object(N.useReducer)(o,h),w=Object(P.a)(A,2),v=w[0],b=w[1],m=v.theme,f=v.fontSize,O=v.showEditorSetting,E=v.tabToSpace,_={onFontSizeChange:function(j){b({type:c.set_font_size,payload:j}),Object(D.b)("cmFontSize",j)},tabToSpace:E,cmFontSize:f,className:"oj",cmCodeMode:m,onTabToSpace:function(j){b({type:c.on_tab_to_space,payload:j}),Object(D.b)("cmTabToSpace",j)},onCodeModeChange:function(j){b({type:c.set_theme,payload:j}),Object(D.b)("cmCodeMode",j)}};function k(){b({type:c.set_show_editor_setting,payload:!1})}function F(){b({type:c.set_show_editor_setting,payload:!0})}var L={value:i,language:S,onChange:s,theme:m,height:"calc(100% - 56px)",options:{fontSize:f,insertSpaces:E}};return C.a.createElement(N.Fragment,null,C.a.createElement("div",{className:"code-panel-container"},T(F),!a&&C.a.createElement(B.b,L)),C.a.createElement(n.a,null,C.a.createElement(z.a,{className:"oj",title:null,placement:"right",closable:!1,visible:O,onClose:k},C.a.createElement(M.a,_))))};function d(r){var a=r.onShowCodeSetting;return C.a.createElement("div",{className:"action-bar"},C.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),C.a.createElement("a",{onClick:a},C.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(He,pe,I){(function(J){J(I("VrN/"))})(function(J){var z={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=J.Pos;J.defineOption("autoCloseBrackets",!1,function(o,d,r){r&&r!=J.Init&&(o.removeKeyMap(N),o.state.closeBrackets=null),d&&(C(X(d,"pairs")),o.state.closeBrackets=d,o.addKeyMap(N))});function X(o,d){return d=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[d]!=null?o[d]:z[d]}var N={Backspace:n,Enter:D};function C(o){for(var d=0;d<o.length;d++){var r=o.charAt(d),a="'"+r+"'";N[a]||(N[a]=B(r))}}C(z.pairs+"`");function B(o){return function(d){return p(d,o)}}function M(o){var d=o.state.closeBrackets;if(!d||d.override)return d;var r=o.getModeAt(o.getCursor());return r.closeBrackets||d}function n(o){var d=M(o);if(!d||o.getOption("disableInput"))return J.Pass;for(var r=X(d,"pairs"),a=o.listSelections(),i=0;i<a.length;i++){if(!a[i].empty())return J.Pass;var s=h(o,a[i].head);if(!s||r.indexOf(s)%2!=0)return J.Pass}for(var i=a.length-1;i>=0;i--){var S=a[i].head;o.replaceRange("",P(S.line,S.ch-1),P(S.line,S.ch+1),"+delete")}}function D(o){var d=M(o),r=d&&X(d,"explode");if(!r||o.getOption("disableInput"))return J.Pass;for(var a=o.listSelections(),i=0;i<a.length;i++){if(!a[i].empty())return J.Pass;var s=h(o,a[i].head);if(!s||r.indexOf(s)%2!=0)return J.Pass}o.operation(function(){var S=o.lineSeparator()||`
|
|
`;o.replaceSelection(S+S,null),o.execCommand("goCharLeft"),a=o.listSelections();for(var x=0;x<a.length;x++){var T=a[x].head.line;o.indentLine(T,null,!0),o.indentLine(T+1,null,!0)}})}function g(o){var d=J.cmpPos(o.anchor,o.head)>0;return{anchor:new P(o.anchor.line,o.anchor.ch+(d?-1:1)),head:new P(o.head.line,o.head.ch+(d?1:-1))}}function p(o,d){var r=M(o);if(!r||o.getOption("disableInput"))return J.Pass;var a=X(r,"pairs"),i=a.indexOf(d);if(i==-1)return J.Pass;for(var s=X(r,"closeBefore"),S=X(r,"triples"),x=a.charAt(i+1)==d,T=o.listSelections(),A=i%2==0,w,v=0;v<T.length;v++){var b=T[v],m=b.head,f,O=o.getRange(m,P(m.line,m.ch+1));if(A&&!b.empty())f="surround";else if((x||!A)&&O==d)x&&c(o,m)?f="both":S.indexOf(d)>=0&&o.getRange(m,P(m.line,m.ch+3))==d+d+d?f="skipThree":f="skip";else if(x&&m.ch>1&&S.indexOf(d)>=0&&o.getRange(P(m.line,m.ch-2),m)==d+d){if(m.ch>2&&/\bstring/.test(o.getTokenTypeAt(P(m.line,m.ch-2))))return J.Pass;f="addFour"}else if(x){var E=m.ch==0?" ":o.getRange(P(m.line,m.ch-1),m);if(!J.isWordChar(O)&&E!=d&&!J.isWordChar(E))f="both";else return J.Pass}else if(A&&(O.length===0||/\s/.test(O)||s.indexOf(O)>-1))f="both";else return J.Pass;if(!w)w=f;else if(w!=f)return J.Pass}var _=i%2?a.charAt(i-1):d,k=i%2?d:a.charAt(i+1);o.operation(function(){if(w=="skip")o.execCommand("goCharRight");else if(w=="skipThree")for(var F=0;F<3;F++)o.execCommand("goCharRight");else if(w=="surround"){for(var L=o.getSelections(),F=0;F<L.length;F++)L[F]=_+L[F]+k;o.replaceSelections(L,"around"),L=o.listSelections().slice();for(var F=0;F<L.length;F++)L[F]=g(L[F]);o.setSelections(L)}else w=="both"?(o.replaceSelection(_+k,null),o.triggerElectric(_+k),o.execCommand("goCharLeft")):w=="addFour"&&(o.replaceSelection(_+_+_+_,"before"),o.execCommand("goCharRight"))})}function h(o,d){var r=o.getRange(P(d.line,d.ch-1),P(d.line,d.ch+1));return r.length==2?r:null}function c(o,d){var r=o.getTokenAt(P(d.line,d.ch+1));return/\bstring/.test(r.type)&&r.start==d.ch&&(d.ch==0||!/\bstring/.test(o.getTokenTypeAt(d)))}})},FOrL:function(He,pe,I){He.exports=I.p+"static/nodata.a6b3f948.png"},FWmy:function(He,pe,I){"use strict";I.d(pe,"a",function(){return J});function J(z,P){if(!z)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},GUcZ:function(He,pe,I){"use strict";var J=I("fWQN"),z=I("mtLc"),P=function(){function _e(){Object(J.a)(this,_e)}return Object(z.a)(_e,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(W,Y){return W.__proto__=Y,W},Object.assign=Object.assign||function(W){if(W==null)throw new TypeError("Cannot convert undefined or null to object");for(var Y=Object(W),$=1;$<arguments.length;$++){var te=arguments[$];if(te!=null)for(var ve in te)te.hasOwnProperty(ve)&&(Y[ve]=te[ve])}return Y},typeof self.Promise!="function"&&I("E2g8").polyfill()}}]),_e}();P.install();var X=P,N=I("+qE3"),C=I.n(N),B=function(){function _e(){Object(J.a)(this,_e)}return Object(z.a)(_e,null,[{key:"e",value:function(W,Y){(!W||_e.FORCE_GLOBAL_TAG)&&(W=_e.GLOBAL_TAG);var $="[".concat(W,"] > ").concat(Y);if(_e.ENABLE_CALLBACK&&_e.emitter.emit("log","error",$),!_e.ENABLE_ERROR)return;console.error?console.error($):console.warn?console.warn($):console.log($)}},{key:"i",value:function(W,Y){(!W||_e.FORCE_GLOBAL_TAG)&&(W=_e.GLOBAL_TAG);var $="[".concat(W,"] > ").concat(Y);if(_e.ENABLE_CALLBACK&&_e.emitter.emit("log","info",$),!_e.ENABLE_INFO)return;console.info?console.info($):console.log($)}},{key:"w",value:function(W,Y){(!W||_e.FORCE_GLOBAL_TAG)&&(W=_e.GLOBAL_TAG);var $="[".concat(W,"] > ").concat(Y);if(_e.ENABLE_CALLBACK&&_e.emitter.emit("log","warn",$),!_e.ENABLE_WARN)return;console.warn?console.warn($):console.log($)}},{key:"d",value:function(W,Y){(!W||_e.FORCE_GLOBAL_TAG)&&(W=_e.GLOBAL_TAG);var $="[".concat(W,"] > ").concat(Y);if(_e.ENABLE_CALLBACK&&_e.emitter.emit("log","debug",$),!_e.ENABLE_DEBUG)return;console.debug?console.debug($):console.log($)}},{key:"v",value:function(W,Y){(!W||_e.FORCE_GLOBAL_TAG)&&(W=_e.GLOBAL_TAG);var $="[".concat(W,"] > ").concat(Y);if(_e.ENABLE_CALLBACK&&_e.emitter.emit("log","verbose",$),!_e.ENABLE_VERBOSE)return;console.log($)}}]),_e}();B.GLOBAL_TAG="flv.js",B.FORCE_GLOBAL_TAG=!1,B.ENABLE_ERROR=!0,B.ENABLE_INFO=!0,B.ENABLE_WARN=!0,B.ENABLE_DEBUG=!0,B.ENABLE_VERBOSE=!0,B.ENABLE_CALLBACK=!1,B.emitter=new C.a;var M=B,n=function(){function _e(){Object(J.a)(this,_e),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return Object(z.a)(_e,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(W){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=W,this._totalBytes+=W):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=W,this._totalBytes+=W):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=W,this._totalBytes+=W,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var W=(this._now()-this._lastCheckpoint)/1e3;return W==0&&(W=1),this._intervalBytes/W/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var W=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/W/1024}}]),_e}(),D=n,g=I("yKVA"),p=I("879j"),h=function(){function _e(ce){Object(J.a)(this,_e),this._message=ce}return Object(z.a)(_e,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),_e}(),c=function(_e){Object(g.a)(W,_e);var ce=Object(p.a)(W);function W(Y){return Object(J.a)(this,W),ce.call(this,Y)}return Object(z.a)(W,[{key:"name",get:function(){return"IllegalStateException"}}]),W}(h),o=function(_e){Object(g.a)(W,_e);var ce=Object(p.a)(W);function W(Y){return Object(J.a)(this,W),ce.call(this,Y)}return Object(z.a)(W,[{key:"name",get:function(){return"InvalidArgumentException"}}]),W}(h),d=function(_e){Object(g.a)(W,_e);var ce=Object(p.a)(W);function W(Y){return Object(J.a)(this,W),ce.call(this,Y)}return Object(z.a)(W,[{key:"name",get:function(){return"NotImplementedException"}}]),W}(h),r={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},a={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},i=function(){function _e(ce){Object(J.a)(this,_e),this._type=ce||"undefined",this._status=r.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(z.a)(_e,[{key:"destroy",value:function(){this._status=r.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===r.kConnecting||this._status===r.kBuffering}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(W){this._onContentLengthKnown=W}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(W){this._onURLRedirect=W}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(W){this._onDataArrival=W}},{key:"onError",get:function(){return this._onError},set:function(W){this._onError=W}},{key:"onComplete",get:function(){return this._onComplete},set:function(W){this._onComplete=W}},{key:"open",value:function(W,Y){throw new d("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new d("Unimplemented abstract function!")}}]),_e}(),s=I("oZsa");function S(_e,ce){for(;!Object.prototype.hasOwnProperty.call(_e,ce)&&!(_e=Object(s.a)(_e),_e===null););return _e}function x(_e,ce,W){return typeof Reflect!="undefined"&&Reflect.get?x=Reflect.get:x=function($,te,ve){var Pe=S($,te);if(!Pe)return;var Ge=Object.getOwnPropertyDescriptor(Pe,te);return Ge.get?Ge.get.call(ve):Ge.value},x(_e,ce,W||_e)}var T={};function A(){var _e=self.navigator.userAgent.toLowerCase(),ce=/(edge)\/([\w.]+)/.exec(_e)||/(opr)[\/]([\w.]+)/.exec(_e)||/(chrome)[ \/]([\w.]+)/.exec(_e)||/(iemobile)[\/]([\w.]+)/.exec(_e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(_e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(_e)||/(webkit)[ \/]([\w.]+)/.exec(_e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(_e)||/(msie) ([\w.]+)/.exec(_e)||_e.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(_e)||_e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(_e)||[],W=/(ipad)/.exec(_e)||/(ipod)/.exec(_e)||/(windows phone)/.exec(_e)||/(iphone)/.exec(_e)||/(kindle)/.exec(_e)||/(android)/.exec(_e)||/(windows)/.exec(_e)||/(mac)/.exec(_e)||/(linux)/.exec(_e)||/(cros)/.exec(_e)||[],Y={browser:ce[5]||ce[3]||ce[1]||"",version:ce[2]||ce[4]||"0",majorVersion:ce[4]||ce[2]||"0",platform:W[0]||""},$={};if(Y.browser){$[Y.browser]=!0;var te=Y.majorVersion.split(".");$.version={major:parseInt(Y.majorVersion,10),string:Y.version},te.length>1&&($.version.minor=parseInt(te[1],10)),te.length>2&&($.version.build=parseInt(te[2],10))}if(Y.platform&&($[Y.platform]=!0),($.chrome||$.opr||$.safari)&&($.webkit=!0),$.rv||$.iemobile){$.rv&&delete $.rv;var ve="msie";Y.browser=ve,$[ve]=!0}if($.edge){delete $.edge;var Pe="msedge";Y.browser=Pe,$[Pe]=!0}if($.opr){var Ge="opera";Y.browser=Ge,$[Ge]=!0}if($.safari&&$.android){var _t="android";Y.browser=_t,$[_t]=!0}$.name=Y.browser,$.platform=Y.platform;for(var bt in T)T.hasOwnProperty(bt)&&delete T[bt];Object.assign(T,$)}A();var w=T,v=function(_e){Object(g.a)(W,_e);var ce=Object(p.a)(W);function W(Y,$){var te;return Object(J.a)(this,W),te=ce.call(this,"fetch-stream-loader"),te.TAG="FetchStreamLoader",te._seekHandler=Y,te._config=$,te._needStash=!0,te._requestAbort=!1,te._contentLength=null,te._receivedLength=0,te}return Object(z.a)(W,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),x(Object(s.a)(W.prototype),"destroy",this).call(this)}},{key:"open",value:function($,te){var ve=this;this._dataSource=$,this._range=te;var Pe=$.url;this._config.reuseRedirectedURL&&$.redirectedURL!=null&&(Pe=$.redirectedURL);var Ge=this._seekHandler.getConfig(Pe,te),_t=new self.Headers;if(typeof Ge.headers=="object"){var bt=Ge.headers;for(var $e in bt)bt.hasOwnProperty($e)&&_t.append($e,bt[$e])}var At={method:"GET",headers:_t,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var Jt in this._config.headers)_t.append(Jt,this._config.headers[Jt]);$.cors===!1&&(At.mode="same-origin"),$.withCredentials&&(At.credentials="include"),$.referrerPolicy&&(At.referrerPolicy=$.referrerPolicy),this._status=r.kConnecting,self.fetch(Ge.url,At).then(function(Et){if(ve._requestAbort){ve._requestAbort=!1,ve._status=r.kIdle;return}if(Et.ok&&Et.status>=200&&Et.status<=299){if(Et.url!==Ge.url&&ve._onURLRedirect){var sn=ve._seekHandler.removeURLParameters(Et.url);ve._onURLRedirect(sn)}var Yt=Et.headers.get("Content-Length");return Yt!=null&&(ve._contentLength=parseInt(Yt),ve._contentLength!==0&&(ve._onContentLengthKnown&&ve._onContentLengthKnown(ve._contentLength))),ve._pump.call(ve,Et.body.getReader())}else if(ve._status=r.kError,ve._onError)ve._onError(a.HTTP_STATUS_CODE_INVALID,{code:Et.status,msg:Et.statusText});else throw new h("FetchStreamLoader: Http code invalid, "+Et.status+" "+Et.statusText)}).catch(function(Et){if(ve._status=r.kError,ve._onError)ve._onError(a.EXCEPTION,{code:-1,msg:Et.message});else throw Et})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function($){var te=this;return $.read().then(function(ve){if(ve.done)if(te._contentLength!==null&&te._receivedLength<te._contentLength){te._status=r.kError;var Pe=a.EARLY_EOF,Ge={code:-1,msg:"Fetch stream meet Early-EOF"};if(te._onError)te._onError(Pe,Ge);else throw new h(Ge.msg)}else te._status=r.kComplete,te._onComplete&&te._onComplete(te._range.from,te._range.from+te._receivedLength-1);else{if(te._requestAbort===!0)return te._requestAbort=!1,te._status=r.kComplete,$.cancel();te._status=r.kBuffering;var _t=ve.value.buffer,bt=te._range.from+te._receivedLength;te._receivedLength+=_t.byteLength,te._onDataArrival&&te._onDataArrival(_t,bt,te._receivedLength),te._pump($)}}).catch(function(ve){if(ve.code===11&&w.msedge)return;te._status=r.kError;var Pe=0,Ge=null;if((ve.code===19||ve.message==="network error")&&(te._contentLength===null||te._contentLength!==null&&te._receivedLength<te._contentLength)?(Pe=a.EARLY_EOF,Ge={code:ve.code,msg:"Fetch stream meet Early-EOF"}):(Pe=a.EXCEPTION,Ge={code:ve.code,msg:ve.message}),te._onError)te._onError(Pe,Ge);else throw new h(Ge.msg)})}}],[{key:"isSupported",value:function(){try{var $=w.msedge&&w.version.minor>=15048,te=w.msedge?$:!0;return self.fetch&&self.ReadableStream&&te}catch(ve){return!1}}}]),W}(i),b=v,m=function(_e){Object(g.a)(W,_e);var ce=Object(p.a)(W);function W(Y,$){var te;return Object(J.a)(this,W),te=ce.call(this,"xhr-moz-chunked-loader"),te.TAG="MozChunkedLoader",te._seekHandler=Y,te._config=$,te._needStash=!0,te._xhr=null,te._requestAbort=!1,te._contentLength=null,te._receivedLength=0,te}return Object(z.a)(W,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),x(Object(s.a)(W.prototype),"destroy",this).call(this)}},{key:"open",value:function($,te){this._dataSource=$,this._range=te;var ve=$.url;this._config.reuseRedirectedURL&&$.redirectedURL!=null&&(ve=$.redirectedURL);var Pe=this._seekHandler.getConfig(ve,te);this._requestURL=Pe.url;var Ge=this._xhr=new XMLHttpRequest;if(Ge.open("GET",Pe.url,!0),Ge.responseType="moz-chunked-arraybuffer",Ge.onreadystatechange=this._onReadyStateChange.bind(this),Ge.onprogress=this._onProgress.bind(this),Ge.onloadend=this._onLoadEnd.bind(this),Ge.onerror=this._onXhrError.bind(this),$.withCredentials&&(Ge.withCredentials=!0),typeof Pe.headers=="object"){var _t=Pe.headers;for(var bt in _t)_t.hasOwnProperty(bt)&&Ge.setRequestHeader(bt,_t[bt])}if(typeof this._config.headers=="object"){var $e=this._config.headers;for(var At in $e)$e.hasOwnProperty(At)&&Ge.setRequestHeader(At,$e[At])}this._status=r.kConnecting,Ge.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=r.kComplete}},{key:"_onReadyStateChange",value:function($){var te=$.target;if(te.readyState===2){if(te.responseURL!=null&&te.responseURL!==this._requestURL&&this._onURLRedirect){var ve=this._seekHandler.removeURLParameters(te.responseURL);this._onURLRedirect(ve)}if(te.status!==0&&(te.status<200||te.status>299))if(this._status=r.kError,this._onError)this._onError(a.HTTP_STATUS_CODE_INVALID,{code:te.status,msg:te.statusText});else throw new h("MozChunkedLoader: Http code invalid, "+te.status+" "+te.statusText);else this._status=r.kBuffering}}},{key:"_onProgress",value:function($){if(this._status===r.kError)return;this._contentLength===null&&($.total!==null&&$.total!==0&&(this._contentLength=$.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var te=$.target.response,ve=this._range.from+this._receivedLength;this._receivedLength+=te.byteLength,this._onDataArrival&&this._onDataArrival(te,ve,this._receivedLength)}},{key:"_onLoadEnd",value:function($){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===r.kError)return;this._status=r.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function($){this._status=r.kError;var te=0,ve=null;if(this._contentLength&&$.loaded<this._contentLength?(te=a.EARLY_EOF,ve={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(te=a.EXCEPTION,ve={code:-1,msg:$.constructor.name+" "+$.type}),this._onError)this._onError(te,ve);else throw new h(ve.msg)}}],[{key:"isSupported",value:function(){try{var $=new XMLHttpRequest;return $.open("GET","https://example.com",!0),$.responseType="moz-chunked-arraybuffer",$.responseType==="moz-chunked-arraybuffer"}catch(te){return M.w("MozChunkedLoader",te.message),!1}}}]),W}(i),f=m,O=function(_e){Object(g.a)(W,_e);var ce=Object(p.a)(W);function W(Y,$){var te;return Object(J.a)(this,W),te=ce.call(this,"xhr-msstream-loader"),te.TAG="MSStreamLoader",te._seekHandler=Y,te._config=$,te._needStash=!0,te._xhr=null,te._reader=null,te._totalRange=null,te._currentRange=null,te._currentRequestURL=null,te._currentRedirectedURL=null,te._contentLength=null,te._receivedLength=0,te._bufferLimit=16*1024*1024,te._lastTimeBufferSize=0,te._isReconnecting=!1,te}return Object(z.a)(W,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),x(Object(s.a)(W.prototype),"destroy",this).call(this)}},{key:"open",value:function($,te){this._internalOpen($,te,!1)}},{key:"_internalOpen",value:function($,te,ve){this._dataSource=$,ve?this._currentRange=te:this._totalRange=te;var Pe=$.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Pe=this._currentRedirectedURL:$.redirectedURL!=null&&(Pe=$.redirectedURL));var Ge=this._seekHandler.getConfig(Pe,te);this._currentRequestURL=Ge.url;var _t=this._reader=new self.MSStreamReader;_t.onprogress=this._msrOnProgress.bind(this),_t.onload=this._msrOnLoad.bind(this),_t.onerror=this._msrOnError.bind(this);var bt=this._xhr=new XMLHttpRequest;if(bt.open("GET",Ge.url,!0),bt.responseType="ms-stream",bt.onreadystatechange=this._xhrOnReadyStateChange.bind(this),bt.onerror=this._xhrOnError.bind(this),$.withCredentials&&(bt.withCredentials=!0),typeof Ge.headers=="object"){var $e=Ge.headers;for(var At in $e)$e.hasOwnProperty(At)&&bt.setRequestHeader(At,$e[At])}if(typeof this._config.headers=="object"){var Jt=this._config.headers;for(var Et in Jt)Jt.hasOwnProperty(Et)&&bt.setRequestHeader(Et,Jt[Et])}this._isReconnecting?this._isReconnecting=!1:this._status=r.kConnecting,bt.send()}},{key:"abort",value:function(){this._internalAbort(),this._status=r.kComplete}},{key:"_internalAbort",value:function(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}},{key:"_xhrOnReadyStateChange",value:function($){var te=$.target;if(te.readyState===2)if(te.status>=200&&te.status<=299){if(this._status=r.kBuffering,te.responseURL!=null){var ve=this._seekHandler.removeURLParameters(te.responseURL);te.responseURL!==this._currentRequestURL&&ve!==this._currentRedirectedURL&&(this._currentRedirectedURL=ve,this._onURLRedirect&&this._onURLRedirect(ve))}var Pe=te.getResponseHeader("Content-Length");if(Pe!=null&&this._contentLength==null){var Ge=parseInt(Pe);Ge>0&&(this._contentLength=Ge,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=r.kError,this._onError)this._onError(a.HTTP_STATUS_CODE_INVALID,{code:te.status,msg:te.statusText});else throw new h("MSStreamLoader: Http code invalid, "+te.status+" "+te.statusText);else if(te.readyState===3&&(te.status>=200&&te.status<=299)){this._status=r.kBuffering;var _t=te.response;this._reader.readAsArrayBuffer(_t)}}},{key:"_xhrOnError",value:function($){this._status=r.kError;var te=a.EXCEPTION,ve={code:-1,msg:$.constructor.name+" "+$.type};if(this._onError)this._onError(te,ve);else throw new h(ve.msg)}},{key:"_msrOnProgress",value:function($){var te=$.target,ve=te.result;if(ve==null){this._doReconnectIfNeeded();return}var Pe=ve.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=ve.byteLength;var Ge=this._totalRange.from+this._receivedLength;this._receivedLength+=Pe.byteLength,this._onDataArrival&&this._onDataArrival(Pe,Ge,this._receivedLength),ve.byteLength>=this._bufferLimit&&(M.v(this.TAG,"MSStream buffer exceeded max size near ".concat(Ge+Pe.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();var $={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,$,!0)}}},{key:"_msrOnLoad",value:function($){this._status=r.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}},{key:"_msrOnError",value:function($){this._status=r.kError;var te=0,ve=null;if(this._contentLength&&this._receivedLength<this._contentLength?(te=a.EARLY_EOF,ve={code:-1,msg:"MSStream meet Early-Eof"}):(te=a.EARLY_EOF,ve={code:-1,msg:$.constructor.name+" "+$.type}),this._onError)this._onError(te,ve);else throw new h(ve.msg)}}],[{key:"isSupported",value:function(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;var $=new XMLHttpRequest;return $.open("GET","https://example.com",!0),$.responseType="ms-stream",$.responseType==="ms-stream"}catch(te){return M.w("MSStreamLoader",te.message),!1}}}]),W}(i),E=O,_=function(_e){Object(g.a)(W,_e);var ce=Object(p.a)(W);function W(Y,$){var te;return Object(J.a)(this,W),te=ce.call(this,"xhr-range-loader"),te.TAG="RangeLoader",te._seekHandler=Y,te._config=$,te._needStash=!1,te._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],te._currentChunkSizeKB=384,te._currentSpeedNormalized=0,te._zeroSpeedChunkCount=0,te._xhr=null,te._speedSampler=new D,te._requestAbort=!1,te._waitForTotalLength=!1,te._totalLengthReceived=!1,te._currentRequestURL=null,te._currentRedirectedURL=null,te._currentRequestRange=null,te._totalLength=null,te._contentLength=null,te._receivedLength=0,te._lastTimeLoaded=0,te}return Object(z.a)(W,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),x(Object(s.a)(W.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function($,te){this._dataSource=$,this._range=te,this._status=r.kConnecting;var ve=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(ve=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!ve?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}},{key:"_openSubRange",value:function(){var $=this._currentChunkSizeKB*1024,te=this._range.from+this._receivedLength,ve=te+$;this._contentLength!=null&&(ve-this._range.from>=this._contentLength&&(ve=this._range.from+this._contentLength-1)),this._currentRequestRange={from:te,to:ve},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function($,te){this._lastTimeLoaded=0;var ve=$.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?ve=this._currentRedirectedURL:$.redirectedURL!=null&&(ve=$.redirectedURL));var Pe=this._seekHandler.getConfig(ve,te);this._currentRequestURL=Pe.url;var Ge=this._xhr=new XMLHttpRequest;if(Ge.open("GET",Pe.url,!0),Ge.responseType="arraybuffer",Ge.onreadystatechange=this._onReadyStateChange.bind(this),Ge.onprogress=this._onProgress.bind(this),Ge.onload=this._onLoad.bind(this),Ge.onerror=this._onXhrError.bind(this),$.withCredentials&&(Ge.withCredentials=!0),typeof Pe.headers=="object"){var _t=Pe.headers;for(var bt in _t)_t.hasOwnProperty(bt)&&Ge.setRequestHeader(bt,_t[bt])}if(typeof this._config.headers=="object"){var $e=this._config.headers;for(var At in $e)$e.hasOwnProperty(At)&&Ge.setRequestHeader(At,$e[At])}Ge.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=r.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function($){var te=$.target;if(te.readyState===2){if(te.responseURL!=null){var ve=this._seekHandler.removeURLParameters(te.responseURL);te.responseURL!==this._currentRequestURL&&ve!==this._currentRedirectedURL&&(this._currentRedirectedURL=ve,this._onURLRedirect&&this._onURLRedirect(ve))}if(te.status>=200&&te.status<=299){if(this._waitForTotalLength)return;this._status=r.kBuffering}else if(this._status=r.kError,this._onError)this._onError(a.HTTP_STATUS_CODE_INVALID,{code:te.status,msg:te.statusText});else throw new h("RangeLoader: Http code invalid, "+te.status+" "+te.statusText)}}},{key:"_onProgress",value:function($){if(this._status===r.kError)return;if(this._contentLength===null){var te=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,te=!0;var ve=$.total;this._internalAbort(),ve!=null&ve!==0&&(this._totalLength=ve)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,te){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Pe=$.loaded-this._lastTimeLoaded;this._lastTimeLoaded=$.loaded,this._speedSampler.addBytes(Pe)}},{key:"_normalizeSpeed",value:function($){var te=this._chunkSizeKBList,ve=te.length-1,Pe=0,Ge=0,_t=ve;if($<te[0])return te[0];for(;Ge<=_t;){if(Pe=Ge+Math.floor((_t-Ge)/2),Pe===ve||$>=te[Pe]&&$<te[Pe+1])return te[Pe];te[Pe]<$?Ge=Pe+1:_t=Pe-1}}},{key:"_onLoad",value:function($){if(this._status===r.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var te=this._speedSampler.lastSecondKBps;if(te===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(te=this._speedSampler.currentKBps)),te!==0){var ve=this._normalizeSpeed(te);this._currentSpeedNormalized!==ve&&(this._currentSpeedNormalized=ve,this._currentChunkSizeKB=ve)}var Pe=$.target.response,Ge=this._range.from+this._receivedLength;this._receivedLength+=Pe.byteLength;var _t=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():_t=!0,this._onDataArrival&&this._onDataArrival(Pe,Ge,this._receivedLength),_t&&(this._status=r.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},{key:"_onXhrError",value:function($){this._status=r.kError;var te=0,ve=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(te=a.EARLY_EOF,ve={code:-1,msg:"RangeLoader meet Early-Eof"}):(te=a.EXCEPTION,ve={code:-1,msg:$.constructor.name+" "+$.type}),this._onError)this._onError(te,ve);else throw new h(ve.msg)}}],[{key:"isSupported",value:function(){try{var $=new XMLHttpRequest;return $.open("GET","https://example.com",!0),$.responseType="arraybuffer",$.responseType==="arraybuffer"}catch(te){return M.w("RangeLoader",te.message),!1}}}]),W}(i),k=_,F=function(_e){Object(g.a)(W,_e);var ce=Object(p.a)(W);function W(){var Y;return Object(J.a)(this,W),Y=ce.call(this,"websocket-loader"),Y.TAG="WebSocketLoader",Y._needStash=!0,Y._ws=null,Y._requestAbort=!1,Y._receivedLength=0,Y}return Object(z.a)(W,[{key:"destroy",value:function(){this._ws&&this.abort(),x(Object(s.a)(W.prototype),"destroy",this).call(this)}},{key:"open",value:function($){try{var te=this._ws=new self.WebSocket($.url);te.binaryType="arraybuffer",te.onopen=this._onWebSocketOpen.bind(this),te.onclose=this._onWebSocketClose.bind(this),te.onmessage=this._onWebSocketMessage.bind(this),te.onerror=this._onWebSocketError.bind(this),this._status=r.kConnecting}catch(Pe){this._status=r.kError;var ve={code:Pe.code,msg:Pe.message};if(this._onError)this._onError(a.EXCEPTION,ve);else throw new h(ve.msg)}}},{key:"abort",value:function(){var $=this._ws;$&&($.readyState===0||$.readyState===1)&&(this._requestAbort=!0,$.close()),this._ws=null,this._status=r.kComplete}},{key:"_onWebSocketOpen",value:function($){this._status=r.kBuffering}},{key:"_onWebSocketClose",value:function($){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=r.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}},{key:"_onWebSocketMessage",value:function($){var te=this;if($.data instanceof ArrayBuffer)this._dispatchArrayBuffer($.data);else if($.data instanceof Blob){var ve=new FileReader;ve.onload=function(){te._dispatchArrayBuffer(ve.result)},ve.readAsArrayBuffer($.data)}else{this._status=r.kError;var Pe={code:-1,msg:"Unsupported WebSocket message type: "+$.data.constructor.name};if(this._onError)this._onError(a.EXCEPTION,Pe);else throw new h(Pe.msg)}}},{key:"_dispatchArrayBuffer",value:function($){var te=$,ve=this._receivedLength;this._receivedLength+=te.byteLength,this._onDataArrival&&this._onDataArrival(te,ve,this._receivedLength)}},{key:"_onWebSocketError",value:function($){this._status=r.kError;var te={code:$.code,msg:$.message};if(this._onError)this._onError(a.EXCEPTION,te);else throw new h(te.msg)}}],[{key:"isSupported",value:function(){try{return typeof self.WebSocket!="undefined"}catch($){return!1}}}]),W}(i),L=F,G=function(){function _e(ce){Object(J.a)(this,_e),this._zeroStart=ce||!1}return Object(z.a)(_e,[{key:"getConfig",value:function(W,Y){var $={};if(Y.from!==0||Y.to!==-1){var te;Y.to!==-1?te="bytes=".concat(Y.from.toString(),"-").concat(Y.to.toString()):te="bytes=".concat(Y.from.toString(),"-"),$.Range=te}else this._zeroStart&&($.Range="bytes=0-");return{url:W,headers:$}}},{key:"removeURLParameters",value:function(W){return W}}]),_e}(),j=G,R=function(){function _e(ce,W){Object(J.a)(this,_e),this._startName=ce,this._endName=W}return Object(z.a)(_e,[{key:"getConfig",value:function(W,Y){var $=W;if(Y.from!==0||Y.to!==-1){var te=!0;$.indexOf("?")===-1&&($+="?",te=!1),te&&($+="&"),$+="".concat(this._startName,"=").concat(Y.from.toString()),Y.to!==-1&&($+="&".concat(this._endName,"=").concat(Y.to.toString()))}return{url:$,headers:{}}}},{key:"removeURLParameters",value:function(W){var Y=W.split("?")[0],$=void 0,te=W.indexOf("?");te!==-1&&($=W.substring(te+1));var ve="";if($!=null&&$.length>0)for(var Pe=$.split("&"),Ge=0;Ge<Pe.length;Ge++){var _t=Pe[Ge].split("="),bt=Ge>0;_t[0]!==this._startName&&_t[0]!==this._endName&&(bt&&(ve+="&"),ve+=Pe[Ge])}return ve.length===0?Y:Y+"?"+ve}}]),_e}(),V=R,ne=function(){function _e(ce,W,Y){Object(J.a)(this,_e),this.TAG="IOController",this._config=W,this._extraData=Y,this._stashInitialSize=1024*384,W.stashInitialSize!=null&&W.stashInitialSize>0&&(this._stashInitialSize=W.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,W.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=ce,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(ce.url),this._refTotalLength=ce.filesize?ce.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new D,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return Object(z.a)(_e,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(W){this._extraData=W}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(W){this._onDataArrival=W}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(W){this._onSeeked=W}},{key:"onError",get:function(){return this._onError},set:function(W){this._onError=W}},{key:"onComplete",get:function(){return this._onComplete},set:function(W){this._onComplete=W}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(W){this._onRedirect=W}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(W){this._onRecoveredEarlyEof=W}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===k?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var W=this._config;if(W.seekType==="range")this._seekHandler=new j(this._config.rangeLoadZeroStart);else if(W.seekType==="param"){var Y=W.seekParamStart||"bstart",$=W.seekParamEnd||"bend";this._seekHandler=new V(Y,$)}else if(W.seekType==="custom"){if(typeof W.customSeekHandler!="function")throw new o("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new W.customSeekHandler}else throw new o("Invalid seekType in config: ".concat(W.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=L;else if(b.isSupported())this._loaderClass=b;else if(f.isSupported())this._loaderClass=f;else if(k.isSupported())this._loaderClass=k;else throw new h("Your browser doesn't support xhr with arraybuffer responseType!")}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(W){this._currentRange={from:0,to:-1},W&&(this._currentRange.from=W),this._speedSampler.reset(),W||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var W=this._resumeFrom;this._resumeFrom=0,this._internalSeek(W,!0)}}},{key:"seek",value:function(W){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(W,!0)}},{key:"_internalSeek",value:function(W,Y){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(Y),this._loader.destroy(),this._loader=null;var $={from:W,to:-1};this._currentRange={from:$.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,$),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(W){if(!W||typeof W!="string"||W.length===0)throw new o("Url must be a non-empty string!");this._dataSource.url=W}},{key:"_expandBuffer",value:function(W){for(var Y=this._stashSize;Y+1024*1024*1<W;)Y*=2;if(Y+=1024*1024*1,Y===this._bufferSize)return;var $=new ArrayBuffer(Y);if(this._stashUsed>0){var te=new Uint8Array(this._stashBuffer,0,this._stashUsed),ve=new Uint8Array($,0,Y);ve.set(te,0)}this._stashBuffer=$,this._bufferSize=Y}},{key:"_normalizeSpeed",value:function(W){var Y=this._speedNormalizeList,$=Y.length-1,te=0,ve=0,Pe=$;if(W<Y[0])return Y[0];for(;ve<=Pe;){if(te=ve+Math.floor((Pe-ve)/2),te===$||W>=Y[te]&&W<Y[te+1])return Y[te];Y[te]<W?ve=te+1:Pe=te-1}}},{key:"_adjustStashSize",value:function(W){var Y=0;this._config.isLive||W<512?Y=W:W>=512&&W<=1024?Y=Math.floor(W*1.5):Y=W*2,Y>8192&&(Y=8192);var $=Y*1024+1024*1024*1;this._bufferSize<$&&this._expandBuffer($),this._stashSize=Y*1024}},{key:"_dispatchChunks",value:function(W,Y){return this._currentRange.to=Y+W.byteLength-1,this._onDataArrival(W,Y)}},{key:"_onURLRedirect",value:function(W){this._redirectedURL=W,this._onRedirect&&this._onRedirect(W)}},{key:"_onContentLengthKnown",value:function(W){W&&this._fullRequestFlag&&(this._totalLength=W,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(W,Y,$){if(!this._onDataArrival)throw new c("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(W.byteLength);var te=this._speedSampler.lastSecondKBps;if(te!==0){var ve=this._normalizeSpeed(te);this._speedNormalized!==ve&&(this._speedNormalized=ve,this._adjustStashSize(ve))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=Y),this._stashUsed+W.byteLength<=this._stashSize){var Jt=new Uint8Array(this._stashBuffer,0,this._stashSize);Jt.set(new Uint8Array(W),this._stashUsed),this._stashUsed+=W.byteLength}else{var Et=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var sn=this._stashBuffer.slice(0,this._stashUsed),Yt=this._dispatchChunks(sn,this._stashByteStart);if(Yt<sn.byteLength){if(Yt>0){var Ut=new Uint8Array(sn,Yt);Et.set(Ut,0),this._stashUsed=Ut.byteLength,this._stashByteStart+=Yt}}else this._stashUsed=0,this._stashByteStart+=Yt;this._stashUsed+W.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+W.byteLength),Et=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Et.set(new Uint8Array(W),this._stashUsed),this._stashUsed+=W.byteLength}else{var pt=this._dispatchChunks(W,Y);if(pt<W.byteLength){var Cn=W.byteLength-pt;Cn>this._bufferSize&&(this._expandBuffer(Cn),Et=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Et.set(new Uint8Array(W,pt),0),this._stashUsed+=Cn,this._stashByteStart=Y+pt}}}else if(this._stashUsed===0){var Pe=this._dispatchChunks(W,Y);if(Pe<W.byteLength){var Ge=W.byteLength-Pe;Ge>this._bufferSize&&this._expandBuffer(Ge);var _t=new Uint8Array(this._stashBuffer,0,this._bufferSize);_t.set(new Uint8Array(W,Pe),0),this._stashUsed+=Ge,this._stashByteStart=Y+Pe}}else{this._stashUsed+W.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+W.byteLength);var bt=new Uint8Array(this._stashBuffer,0,this._bufferSize);bt.set(new Uint8Array(W),this._stashUsed),this._stashUsed+=W.byteLength;var $e=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if($e<this._stashUsed&&$e>0){var At=new Uint8Array(this._stashBuffer,$e);bt.set(At,0)}this._stashUsed-=$e,this._stashByteStart+=$e}}},{key:"_flushStashBuffer",value:function(W){if(this._stashUsed>0){var Y=this._stashBuffer.slice(0,this._stashUsed),$=this._dispatchChunks(Y,this._stashByteStart),te=Y.byteLength-$;if($<Y.byteLength)if(W)M.w(this.TAG,"".concat(te," bytes unconsumed data remain when flush buffer, dropped"));else{if($>0){var ve=new Uint8Array(this._stashBuffer,0,this._bufferSize),Pe=new Uint8Array(Y,$);ve.set(Pe,0),this._stashUsed=Pe.byteLength,this._stashByteStart+=$}return 0}return this._stashUsed=0,this._stashByteStart=0,te}return 0}},{key:"_onLoaderComplete",value:function(W,Y){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(W,Y){M.e(this.TAG,"Loader error, code = ".concat(Y.code,", msg = ").concat(Y.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,W=a.UNRECOVERABLE_EARLY_EOF);switch(W){case a.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var $=this._currentRange.to+1;$<this._totalLength&&(M.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek($,!1));return}W=a.UNRECOVERABLE_EARLY_EOF;break}case a.UNRECOVERABLE_EARLY_EOF:case a.CONNECTING_TIMEOUT:case a.HTTP_STATUS_CODE_INVALID:case a.EXCEPTION:break}if(this._onError)this._onError(W,Y);else throw new h("IOException: "+Y.msg)}}]),_e}(),se=ne,Se={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function De(){return Object.assign({},Se)}var Ae=function(){function _e(){Object(J.a)(this,_e)}return Object(z.a)(_e,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var W=new se({},De()),Y=W.loaderType;return W.destroy(),Y=="fetch-stream-loader"||Y=="xhr-moz-chunked-loader"}},{key:"getNetworkLoaderTypeName",value:function(){var W=new se({},De()),Y=W.loaderType;return W.destroy(),Y}},{key:"supportNativeMediaPlayback",value:function(W){_e.videoElement==null&&(_e.videoElement=window.document.createElement("video"));var Y=_e.videoElement.canPlayType(W);return Y==="probably"||Y=="maybe"}},{key:"getFeatureList",value:function(){var W={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return W.mseFlvPlayback=_e.supportMSEH264Playback(),W.networkStreamIO=_e.supportNetworkStreamIO(),W.networkLoaderName=_e.getNetworkLoaderTypeName(),W.mseLiveFlvPlayback=W.mseFlvPlayback&&W.networkStreamIO,W.nativeMP4H264Playback=_e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),W.nativeWebmVP8Playback=_e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),W.nativeWebmVP9Playback=_e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),W}}]),_e}(),ke=Ae,je={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"},Be=je,we=function(){function _e(){Object(J.a)(this,_e)}return Object(z.a)(_e,null,[{key:"forceGlobalTag",get:function(){return M.FORCE_GLOBAL_TAG},set:function(W){M.FORCE_GLOBAL_TAG=W,_e._notifyChange()}},{key:"globalTag",get:function(){return M.GLOBAL_TAG},set:function(W){M.GLOBAL_TAG=W,_e._notifyChange()}},{key:"enableAll",get:function(){return M.ENABLE_VERBOSE&&M.ENABLE_DEBUG&&M.ENABLE_INFO&&M.ENABLE_WARN&&M.ENABLE_ERROR},set:function(W){M.ENABLE_VERBOSE=W,M.ENABLE_DEBUG=W,M.ENABLE_INFO=W,M.ENABLE_WARN=W,M.ENABLE_ERROR=W,_e._notifyChange()}},{key:"enableDebug",get:function(){return M.ENABLE_DEBUG},set:function(W){M.ENABLE_DEBUG=W,_e._notifyChange()}},{key:"enableVerbose",get:function(){return M.ENABLE_VERBOSE},set:function(W){M.ENABLE_VERBOSE=W,_e._notifyChange()}},{key:"enableInfo",get:function(){return M.ENABLE_INFO},set:function(W){M.ENABLE_INFO=W,_e._notifyChange()}},{key:"enableWarn",get:function(){return M.ENABLE_WARN},set:function(W){M.ENABLE_WARN=W,_e._notifyChange()}},{key:"enableError",get:function(){return M.ENABLE_ERROR},set:function(W){M.ENABLE_ERROR=W,_e._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:M.GLOBAL_TAG,forceGlobalTag:M.FORCE_GLOBAL_TAG,enableVerbose:M.ENABLE_VERBOSE,enableDebug:M.ENABLE_DEBUG,enableInfo:M.ENABLE_INFO,enableWarn:M.ENABLE_WARN,enableError:M.ENABLE_ERROR,enableCallback:M.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(W){M.GLOBAL_TAG=W.globalTag,M.FORCE_GLOBAL_TAG=W.forceGlobalTag,M.ENABLE_VERBOSE=W.enableVerbose,M.ENABLE_DEBUG=W.enableDebug,M.ENABLE_INFO=W.enableInfo,M.ENABLE_WARN=W.enableWarn,M.ENABLE_ERROR=W.enableError,M.ENABLE_CALLBACK=W.enableCallback}},{key:"_notifyChange",value:function(){var W=_e.emitter;if(W.listenerCount("change")>0){var Y=_e.getConfig();W.emit("change",Y)}}},{key:"registerListener",value:function(W){_e.emitter.addListener("change",W)}},{key:"removeListener",value:function(W){_e.emitter.removeListener("change",W)}},{key:"addLogListener",value:function(W){M.emitter.addListener("log",W),M.emitter.listenerCount("log")>0&&(M.ENABLE_CALLBACK=!0,_e._notifyChange())}},{key:"removeLogListener",value:function(W){M.emitter.removeListener("log",W),M.emitter.listenerCount("log")===0&&(M.ENABLE_CALLBACK=!1,_e._notifyChange())}}]),_e}();we.emitter=new C.a;var Z=we,U=function(){function _e(){Object(J.a)(this,_e),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return Object(z.a)(_e,[{key:"isComplete",value:function(){var W=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,Y=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&W&&Y}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(W){if(this.keyframesIndex==null)return null;var Y=this.keyframesIndex,$=this._search(Y.times,W);return{index:$,milliseconds:Y.times[$],fileposition:Y.filepositions[$]}}},{key:"_search",value:function(W,Y){var $=0,te=W.length-1,ve=0,Pe=0,Ge=te;for(Y<W[0]&&($=0,Pe=Ge+1);Pe<=Ge;)if(ve=Pe+Math.floor((Ge-Pe)/2),ve===te||Y>=W[ve]&&Y<W[ve+1]){$=ve;break}else W[ve]<Y?Pe=ve+1:Ge=ve-1;return $}}]),_e}(),K=U;function ee(_e,ce,W){var Y=_e;if(ce+W<Y.length){for(;W--;)if((Y[++ce]&192)!==128)return!1;return!0}else return!1}function oe(_e){for(var ce=[],W=_e,Y=0,$=_e.length;Y<$;){if(W[Y]<128){ce.push(String.fromCharCode(W[Y])),++Y;continue}else if(!(W[Y]<192)){if(W[Y]<224){if(ee(W,Y,1)){var te=(W[Y]&31)<<6|W[Y+1]&63;if(te>=128){ce.push(String.fromCharCode(te&65535)),Y+=2;continue}}}else if(W[Y]<240){if(ee(W,Y,2)){var ve=(W[Y]&15)<<12|(W[Y+1]&63)<<6|W[Y+2]&63;if(ve>=2048&&(ve&63488)!==55296){ce.push(String.fromCharCode(ve&65535)),Y+=3;continue}}}else if(W[Y]<248&&ee(W,Y,3)){var Pe=(W[Y]&7)<<18|(W[Y+1]&63)<<12|(W[Y+2]&63)<<6|W[Y+3]&63;if(Pe>65536&&Pe<1114112){Pe-=65536,ce.push(String.fromCharCode(Pe>>>10|55296)),ce.push(String.fromCharCode(Pe&1023|56320)),Y+=4;continue}}}ce.push(String.fromCharCode(65533)),++Y}return ce.join("")}var Q=oe,Ce=function(){var _e=new ArrayBuffer(2);return new DataView(_e).setInt16(0,256,!0),new Int16Array(_e)[0]===256}(),ze=function(){function _e(){Object(J.a)(this,_e)}return Object(z.a)(_e,null,[{key:"parseScriptData",value:function(W,Y,$){var te={};try{var ve=_e.parseValue(W,Y,$),Pe=_e.parseValue(W,Y+ve.size,$-ve.size);te[ve.data]=Pe.data}catch(Ge){M.e("AMF",Ge.toString())}return te}},{key:"parseObject",value:function(W,Y,$){if($<3)throw new c("Data not enough when parse ScriptDataObject");var te=_e.parseString(W,Y,$),ve=_e.parseValue(W,Y+te.size,$-te.size),Pe=ve.objectEnd;return{data:{name:te.data,value:ve.data},size:te.size+ve.size,objectEnd:Pe}}},{key:"parseVariable",value:function(W,Y,$){return _e.parseObject(W,Y,$)}},{key:"parseString",value:function(W,Y,$){if($<2)throw new c("Data not enough when parse String");var te=new DataView(W,Y,$),ve=te.getUint16(0,!Ce),Pe;return ve>0?Pe=Q(new Uint8Array(W,Y+2,ve)):Pe="",{data:Pe,size:2+ve}}},{key:"parseLongString",value:function(W,Y,$){if($<4)throw new c("Data not enough when parse LongString");var te=new DataView(W,Y,$),ve=te.getUint32(0,!Ce),Pe;return ve>0?Pe=Q(new Uint8Array(W,Y+4,ve)):Pe="",{data:Pe,size:4+ve}}},{key:"parseDate",value:function(W,Y,$){if($<10)throw new c("Data size invalid when parse Date");var te=new DataView(W,Y,$),ve=te.getFloat64(0,!Ce),Pe=te.getInt16(8,!Ce);return ve+=Pe*60*1e3,{data:new Date(ve),size:8+2}}},{key:"parseValue",value:function(W,Y,$){if($<1)throw new c("Data not enough when parse Value");var te=new DataView(W,Y,$),ve=1,Pe=te.getUint8(0),Ge,_t=!1;try{switch(Pe){case 0:Ge=te.getFloat64(1,!Ce),ve+=8;break;case 1:{var bt=te.getUint8(1);Ge=!!bt,ve+=1;break}case 2:{var $e=_e.parseString(W,Y+1,$-1);Ge=$e.data,ve+=$e.size;break}case 3:{Ge={};var At=0;for((te.getUint32($-4,!Ce)&16777215)===9&&(At=3);ve<$-4;){var Jt=_e.parseObject(W,Y+ve,$-ve-At);if(Jt.objectEnd)break;Ge[Jt.data.name]=Jt.data.value,ve+=Jt.size}if(ve<=$-3){var Et=te.getUint32(ve-1,!Ce)&16777215;Et===9&&(ve+=3)}break}case 8:{Ge={},ve+=4;var sn=0;for((te.getUint32($-4,!Ce)&16777215)===9&&(sn=3);ve<$-8;){var Yt=_e.parseVariable(W,Y+ve,$-ve-sn);if(Yt.objectEnd)break;Ge[Yt.data.name]=Yt.data.value,ve+=Yt.size}if(ve<=$-3){var Ut=te.getUint32(ve-1,!Ce)&16777215;Ut===9&&(ve+=3)}break}case 9:Ge=void 0,ve=1,_t=!0;break;case 10:{Ge=[];var pt=te.getUint32(1,!Ce);ve+=4;for(var Cn=0;Cn<pt;Cn++){var ft=_e.parseValue(W,Y+ve,$-ve);Ge.push(ft.data),ve+=ft.size}break}case 11:{var hn=_e.parseDate(W,Y+1,$-1);Ge=hn.data,ve+=hn.size;break}case 12:{var pn=_e.parseString(W,Y+1,$-1);Ge=pn.data,ve+=pn.size;break}default:ve=$,M.w("AMF","Unsupported AMF value type "+Pe)}}catch(Yn){M.e("AMF",Yn.toString())}return{data:Ge,size:ve,objectEnd:_t}}}]),_e}(),nt=ze,xe=function(){function _e(ce){Object(J.a)(this,_e),this.TAG="ExpGolomb",this._buffer=ce,this._buffer_index=0,this._total_bytes=ce.byteLength,this._total_bits=ce.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return Object(z.a)(_e,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var W=this._total_bytes-this._buffer_index;if(W<=0)throw new c("ExpGolomb: _fillCurrentWord() but no bytes available");var Y=Math.min(4,W),$=new Uint8Array(4);$.set(this._buffer.subarray(this._buffer_index,this._buffer_index+Y)),this._current_word=new DataView($.buffer).getUint32(0,!1),this._buffer_index+=Y,this._current_word_bits_left=Y*8}},{key:"readBits",value:function(W){if(W>32)throw new o("ExpGolomb: readBits() bits exceeded max 32bits!");if(W<=this._current_word_bits_left){var Y=this._current_word>>>32-W;return this._current_word<<=W,this._current_word_bits_left-=W,Y}var $=this._current_word_bits_left?this._current_word:0;$=$>>>32-this._current_word_bits_left;var te=W-this._current_word_bits_left;this._fillCurrentWord();var ve=Math.min(te,this._current_word_bits_left),Pe=this._current_word>>>32-ve;return this._current_word<<=ve,this._current_word_bits_left-=ve,$=$<<ve|Pe,$}},{key:"readBool",value:function(){return this.readBits(1)===1}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var W;for(W=0;W<this._current_word_bits_left;W++)if((this._current_word&2147483648>>>W)!==0)return this._current_word<<=W,this._current_word_bits_left-=W,W;return this._fillCurrentWord(),W+this._skipLeadingZero()}},{key:"readUEG",value:function(){var W=this._skipLeadingZero();return this.readBits(W+1)-1}},{key:"readSEG",value:function(){var W=this.readUEG();return W&1?W+1>>>1:-1*(W>>>1)}}]),_e}(),Re=xe,Te=function(){function _e(){Object(J.a)(this,_e)}return Object(z.a)(_e,null,[{key:"_ebsp2rbsp",value:function(W){for(var Y=W,$=Y.byteLength,te=new Uint8Array($),ve=0,Pe=0;Pe<$;Pe++){if(Pe>=2&&(Y[Pe]===3&&Y[Pe-1]===0&&Y[Pe-2]===0))continue;te[ve]=Y[Pe],ve++}return new Uint8Array(te.buffer,0,ve)}},{key:"parseSPS",value:function(W){var Y=_e._ebsp2rbsp(W),$=new Re(Y);$.readByte();var te=$.readByte();$.readByte();var ve=$.readByte();$.readUEG();var Pe=_e.getProfileString(te),Ge=_e.getLevelString(ve),_t=1,bt=420,$e=[0,420,422,444],At=8;if((te===100||te===110||te===122||te===244||te===44||te===83||te===86||te===118||te===128||te===138||te===144)&&(_t=$.readUEG(),_t===3&&$.readBits(1),_t<=3&&(bt=$e[_t]),At=$.readUEG()+8,$.readUEG(),$.readBits(1),$.readBool()))for(var Jt=_t!==3?8:12,Et=0;Et<Jt;Et++)$.readBool()&&(Et<6?_e._skipScalingList($,16):_e._skipScalingList($,64));$.readUEG();var sn=$.readUEG();if(sn===0)$.readUEG();else if(sn===1){$.readBits(1),$.readSEG(),$.readSEG();for(var Yt=$.readUEG(),Ut=0;Ut<Yt;Ut++)$.readSEG()}var pt=$.readUEG();$.readBits(1);var Cn=$.readUEG(),ft=$.readUEG(),hn=$.readBits(1);hn===0&&$.readBits(1),$.readBits(1);var pn=0,Yn=0,ni=0,En=0,gi=$.readBool();gi&&(pn=$.readUEG(),Yn=$.readUEG(),ni=$.readUEG(),En=$.readUEG());var Jn=1,An=1,Pn=0,Di=!0,Hi=0,vi=0,ii=$.readBool();if(ii){if($.readBool()){var _i=$.readByte(),Qi=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],yi=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];_i>0&&_i<16?(Jn=Qi[_i-1],An=yi[_i-1]):_i===255&&(Jn=$.readByte()<<8|$.readByte(),An=$.readByte()<<8|$.readByte())}if($.readBool()&&$.readBool(),$.readBool()&&($.readBits(4),$.readBool()&&$.readBits(24)),$.readBool()&&($.readUEG(),$.readUEG()),$.readBool()){var ri=$.readBits(32),Pi=$.readBits(32);Di=$.readBool(),Hi=Pi,vi=ri*2,Pn=Hi/vi}}var Li=1;(Jn!==1||An!==1)&&(Li=Jn/An);var Oi=0,Si=0;if(_t===0)Oi=1,Si=2-hn;else{var cr=_t===3?1:2,_r=_t===1?2:1;Oi=cr,Si=_r*(2-hn)}var rr=(Cn+1)*16,Zi=(2-hn)*((ft+1)*16);rr-=(pn+Yn)*Oi,Zi-=(ni+En)*Si;var Ar=Math.ceil(rr*Li);return $.destroy(),$=null,{profile_string:Pe,level_string:Ge,bit_depth:At,ref_frames:pt,chroma_format:bt,chroma_format_string:_e.getChromaFormatString(bt),frame_rate:{fixed:Di,fps:Pn,fps_den:vi,fps_num:Hi},sar_ratio:{width:Jn,height:An},codec_size:{width:rr,height:Zi},present_size:{width:Ar,height:Zi}}}},{key:"_skipScalingList",value:function(W,Y){for(var $=8,te=8,ve=0,Pe=0;Pe<Y;Pe++)te!==0&&(ve=W.readSEG(),te=($+ve+256)%256),$=te===0?$:te}},{key:"getProfileString",value:function(W){switch(W){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(W){return(W/10).toFixed(1)}},{key:"getChromaFormatString",value:function(W){switch(W){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),_e}(),Oe=Te,Ke={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"},Qe=Ke;function st(_e){return _e>>>8&255|(_e&255)<<8}function ut(_e){return(_e&4278190080)>>>24|(_e&16711680)>>>8|(_e&65280)<<8|(_e&255)<<24}function xt(_e,ce){return _e[ce]<<24|_e[ce+1]<<16|_e[ce+2]<<8|_e[ce+3]}var wt=function(){function _e(ce,W){Object(J.a)(this,_e),this.TAG="FLVDemuxer",this._config=W,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=ce.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=ce.hasAudioTrack,this._hasVideo=ce.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new K,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var Y=new ArrayBuffer(2);return new DataView(Y).setInt16(0,256,!0),new Int16Array(Y)[0]===256}()}return Object(z.a)(_e,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(W){return W.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(W){this._onTrackMetadata=W}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(W){this._onMediaInfo=W}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(W){this._onMetaDataArrived=W}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(W){this._onScriptDataArrived=W}},{key:"onError",get:function(){return this._onError},set:function(W){this._onError=W}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(W){this._onDataAvailable=W}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(W){this._timestampBase=W}},{key:"overridedDuration",get:function(){return this._duration},set:function(W){this._durationOverrided=!0,this._duration=W,this._mediaInfo.duration=W}},{key:"overridedHasAudio",set:function(W){this._hasAudioFlagOverrided=!0,this._hasAudio=W,this._mediaInfo.hasAudio=W}},{key:"overridedHasVideo",set:function(W){this._hasVideoFlagOverrided=!0,this._hasVideo=W,this._mediaInfo.hasVideo=W}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new K}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}},{key:"parseChunks",value:function(W,Y){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new c("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var $=0,te=this._littleEndian;if(Y===0)if(W.byteLength>13){var ve=_e.probe(W);$=ve.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,Y+$!==this._dataOffset&&M.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Pe=new DataView(W,$),Ge=Pe.getUint32(0,!te);Ge!==0&&M.w(this.TAG,"PrevTagSize0 !== 0 !!!"),$+=4}for(;$<W.byteLength;){this._dispatch=!0;var _t=new DataView(W,$);if($+11+4>W.byteLength)break;var bt=_t.getUint8(0),$e=_t.getUint32(0,!te)&16777215;if($+11+$e+4>W.byteLength)break;if(bt!==8&&bt!==9&&bt!==18){M.w(this.TAG,"Unsupported tag type ".concat(bt,", skipped")),$+=11+$e+4;continue}var At=_t.getUint8(4),Jt=_t.getUint8(5),Et=_t.getUint8(6),sn=_t.getUint8(7),Yt=Et|Jt<<8|At<<16|sn<<24,Ut=_t.getUint32(7,!te)&16777215;Ut!==0&&M.w(this.TAG,"Meet tag which has StreamID != 0!");var pt=$+11;switch(bt){case 8:this._parseAudioData(W,pt,$e,Yt);break;case 9:this._parseVideoData(W,pt,$e,Yt,Y+$);break;case 18:this._parseScriptData(W,pt,$e);break}var Cn=_t.getUint32(11+$e,!te);Cn!==11+$e&&M.w(this.TAG,"Invalid PrevTagSize ".concat(Cn)),$+=11+$e+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),$}},{key:"_parseScriptData",value:function(W,Y,$){var te=nt.parseScriptData(W,Y,$);if(te.hasOwnProperty("onMetaData")){if(te.onMetaData==null||typeof te.onMetaData!="object"){M.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&M.w(this.TAG,"Found another onMetaData tag!"),this._metadata=te;var ve=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},ve)),typeof ve.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=ve.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof ve.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=ve.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof ve.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=ve.audiodatarate),typeof ve.videodatarate=="number"&&(this._mediaInfo.videoDataRate=ve.videodatarate),typeof ve.width=="number"&&(this._mediaInfo.width=ve.width),typeof ve.height=="number"&&(this._mediaInfo.height=ve.height),typeof ve.duration=="number"){if(!this._durationOverrided){var Pe=Math.floor(ve.duration*this._timescale);this._duration=Pe,this._mediaInfo.duration=Pe}}else this._mediaInfo.duration=0;if(typeof ve.framerate=="number"){var Ge=Math.floor(ve.framerate*1e3);if(Ge>0){var _t=Ge/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=_t,this._referenceFrameRate.fps_num=Ge,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=_t}}if(typeof ve.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var bt=ve.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(bt),ve.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=ve,M.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(te).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},te)))}},{key:"_parseKeyframesIndex",value:function(W){for(var Y=[],$=[],te=1;te<W.times.length;te++){var ve=this._timestampBase+Math.floor(W.times[te]*1e3);Y.push(ve),$.push(W.filepositions[te])}return{times:Y,filepositions:$}}},{key:"_parseAudioData",value:function(W,Y,$,te){if($<=1){M.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;var ve=this._littleEndian,Pe=new DataView(W,Y,$),Ge=Pe.getUint8(0),_t=Ge>>>4;if(_t!==2&&_t!==10){this._onError(Qe.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+_t);return}var bt=0,$e=(Ge&12)>>>2;if($e>=0&&$e<=4)bt=this._flvSoundRateTable[$e];else{this._onError(Qe.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+$e);return}var At=(Ge&2)>>>1,Jt=Ge&1,Et=this._audioMetadata,sn=this._audioTrack;if(Et||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),Et=this._audioMetadata={},Et.type="audio",Et.id=sn.id,Et.timescale=this._timescale,Et.duration=this._duration,Et.audioSampleRate=bt,Et.channelCount=Jt===0?1:2),_t===10){var Yt=this._parseAACAudioData(W,Y+1,$-1);if(Yt==null)return;if(Yt.packetType===0){Et.config&&M.w(this.TAG,"Found another AudioSpecificConfig!");var Ut=Yt.data;Et.audioSampleRate=Ut.samplingRate,Et.channelCount=Ut.channelCount,Et.codec=Ut.codec,Et.originalCodec=Ut.originalCodec,Et.config=Ut.config,Et.refSampleDuration=1024/Et.audioSampleRate*Et.timescale,M.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",Et);var pt=this._mediaInfo;pt.audioCodec=Et.originalCodec,pt.audioSampleRate=Et.audioSampleRate,pt.audioChannelCount=Et.channelCount,pt.hasVideo?pt.videoCodec!=null&&(pt.mimeType='video/x-flv; codecs="'+pt.videoCodec+","+pt.audioCodec+'"'):pt.mimeType='video/x-flv; codecs="'+pt.audioCodec+'"',pt.isComplete()&&this._onMediaInfo(pt)}else if(Yt.packetType===1){var Cn=this._timestampBase+te,ft={unit:Yt.data,length:Yt.data.byteLength,dts:Cn,pts:Cn};sn.samples.push(ft),sn.length+=Yt.data.length}else M.e(this.TAG,"Flv: Unsupported AAC data type ".concat(Yt.packetType))}else if(_t===2){if(!Et.codec){var hn=this._parseMP3AudioData(W,Y+1,$-1,!0);if(hn==null)return;Et.audioSampleRate=hn.samplingRate,Et.channelCount=hn.channelCount,Et.codec=hn.codec,Et.originalCodec=hn.originalCodec,Et.refSampleDuration=1152/Et.audioSampleRate*Et.timescale,M.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Et);var pn=this._mediaInfo;pn.audioCodec=Et.codec,pn.audioSampleRate=Et.audioSampleRate,pn.audioChannelCount=Et.channelCount,pn.audioDataRate=hn.bitRate,pn.hasVideo?pn.videoCodec!=null&&(pn.mimeType='video/x-flv; codecs="'+pn.videoCodec+","+pn.audioCodec+'"'):pn.mimeType='video/x-flv; codecs="'+pn.audioCodec+'"',pn.isComplete()&&this._onMediaInfo(pn)}var Yn=this._parseMP3AudioData(W,Y+1,$-1,!1);if(Yn==null)return;var ni=this._timestampBase+te,En={unit:Yn,length:Yn.byteLength,dts:ni,pts:ni};sn.samples.push(En),sn.length+=Yn.length}}},{key:"_parseAACAudioData",value:function(W,Y,$){if($<=1){M.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var te={},ve=new Uint8Array(W,Y,$);return te.packetType=ve[0],ve[0]===0?te.data=this._parseAACAudioSpecificConfig(W,Y+1,$-1):te.data=ve.subarray(1),te}},{key:"_parseAACAudioSpecificConfig",value:function(W,Y,$){var te=new Uint8Array(W,Y,$),ve=null,Pe=0,Ge=0,_t=null,bt=0,$e=null;if(Pe=Ge=te[0]>>>3,bt=(te[0]&7)<<1|te[1]>>>7,bt<0||bt>=this._mpegSamplingRates.length){this._onError(Qe.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var At=this._mpegSamplingRates[bt],Jt=(te[1]&120)>>>3;if(Jt<0||Jt>=8){this._onError(Qe.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Pe===5&&($e=(te[1]&7)<<1|te[2]>>>7,_t=(te[2]&124)>>>2);var Et=self.navigator.userAgent.toLowerCase();return Et.indexOf("firefox")!==-1?bt>=6?(Pe=5,ve=new Array(4),$e=bt-3):(Pe=2,ve=new Array(2),$e=bt):Et.indexOf("android")!==-1?(Pe=2,ve=new Array(2),$e=bt):(Pe=5,$e=bt,ve=new Array(4),bt>=6?$e=bt-3:Jt===1&&(Pe=2,ve=new Array(2),$e=bt)),ve[0]=Pe<<3,ve[0]|=(bt&15)>>>1,ve[1]=(bt&15)<<7,ve[1]|=(Jt&15)<<3,Pe===5&&(ve[1]|=($e&15)>>>1,ve[2]=($e&1)<<7,ve[2]|=2<<2,ve[3]=0),{config:ve,samplingRate:At,channelCount:Jt,codec:"mp4a.40."+Pe,originalCodec:"mp4a.40."+Ge}}},{key:"_parseMP3AudioData",value:function(W,Y,$,te){if($<4){M.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var ve=this._littleEndian,Pe=new Uint8Array(W,Y,$),Ge=null;if(te){if(Pe[0]!==255)return;var _t=Pe[1]>>>3&3,bt=(Pe[1]&6)>>1,$e=(Pe[2]&240)>>>4,At=(Pe[2]&12)>>>2,Jt=Pe[3]>>>6&3,Et=Jt!==3?2:1,sn=0,Yt=0,Ut=34,pt="mp3";switch(_t){case 0:sn=this._mpegAudioV25SampleRateTable[At];break;case 2:sn=this._mpegAudioV20SampleRateTable[At];break;case 3:sn=this._mpegAudioV10SampleRateTable[At];break}switch(bt){case 1:Ut=34,$e<this._mpegAudioL3BitRateTable.length&&(Yt=this._mpegAudioL3BitRateTable[$e]);break;case 2:Ut=33,$e<this._mpegAudioL2BitRateTable.length&&(Yt=this._mpegAudioL2BitRateTable[$e]);break;case 3:Ut=32,$e<this._mpegAudioL1BitRateTable.length&&(Yt=this._mpegAudioL1BitRateTable[$e]);break}Ge={bitRate:Yt,samplingRate:sn,channelCount:Et,codec:pt,originalCodec:pt}}else Ge=Pe;return Ge}},{key:"_parseVideoData",value:function(W,Y,$,te,ve){if($<=1){M.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;var Pe=new Uint8Array(W,Y,$)[0],Ge=(Pe&240)>>>4,_t=Pe&15;if(_t!==7){this._onError(Qe.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(_t));return}this._parseAVCVideoPacket(W,Y+1,$-1,te,ve,Ge)}},{key:"_parseAVCVideoPacket",value:function(W,Y,$,te,ve,Pe){if($<4){M.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var Ge=this._littleEndian,_t=new DataView(W,Y,$),bt=_t.getUint8(0),$e=_t.getUint32(0,!Ge)&16777215,At=$e<<8>>8;if(bt===0)this._parseAVCDecoderConfigurationRecord(W,Y+4,$-4);else if(bt===1)this._parseAVCVideoData(W,Y+4,$-4,te,ve,Pe,At);else if(!(bt===2)){this._onError(Qe.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(bt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(W,Y,$){if($<7){M.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var te=this._videoMetadata,ve=this._videoTrack,Pe=this._littleEndian,Ge=new DataView(W,Y,$);te?typeof te.avcc!="undefined"&&M.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),te=this._videoMetadata={},te.type="video",te.id=ve.id,te.timescale=this._timescale,te.duration=this._duration);var _t=Ge.getUint8(0),bt=Ge.getUint8(1),$e=Ge.getUint8(2),At=Ge.getUint8(3);if(_t!==1||bt===0){this._onError(Qe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(Ge.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(Qe.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var Jt=Ge.getUint8(5)&31;if(Jt===0){this._onError(Qe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Jt>1&&M.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(Jt));for(var Et=6,sn=0;sn<Jt;sn++){var Yt=Ge.getUint16(Et,!Pe);if(Et+=2,Yt===0)continue;var Ut=new Uint8Array(W,Y+Et,Yt);Et+=Yt;var pt=Oe.parseSPS(Ut);if(sn!==0)continue;te.codecWidth=pt.codec_size.width,te.codecHeight=pt.codec_size.height,te.presentWidth=pt.present_size.width,te.presentHeight=pt.present_size.height,te.profile=pt.profile_string,te.level=pt.level_string,te.bitDepth=pt.bit_depth,te.chromaFormat=pt.chroma_format,te.sarRatio=pt.sar_ratio,te.frameRate=pt.frame_rate,(pt.frame_rate.fixed===!1||pt.frame_rate.fps_num===0||pt.frame_rate.fps_den===0)&&(te.frameRate=this._referenceFrameRate);var Cn=te.frameRate.fps_den,ft=te.frameRate.fps_num;te.refSampleDuration=te.timescale*(Cn/ft);for(var hn=Ut.subarray(1,4),pn="avc1.",Yn=0;Yn<3;Yn++){var ni=hn[Yn].toString(16);ni.length<2&&(ni="0"+ni),pn+=ni}te.codec=pn;var En=this._mediaInfo;En.width=te.codecWidth,En.height=te.codecHeight,En.fps=te.frameRate.fps,En.profile=te.profile,En.level=te.level,En.refFrames=pt.ref_frames,En.chromaFormat=pt.chroma_format_string,En.sarNum=te.sarRatio.width,En.sarDen=te.sarRatio.height,En.videoCodec=pn,En.hasAudio?En.audioCodec!=null&&(En.mimeType='video/x-flv; codecs="'+En.videoCodec+","+En.audioCodec+'"'):En.mimeType='video/x-flv; codecs="'+En.videoCodec+'"',En.isComplete()&&this._onMediaInfo(En)}var gi=Ge.getUint8(Et);if(gi===0){this._onError(Qe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else gi>1&&M.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(gi));Et++;for(var Jn=0;Jn<gi;Jn++){var An=Ge.getUint16(Et,!Pe);if(Et+=2,An===0)continue;Et+=An}te.avcc=new Uint8Array($),te.avcc.set(new Uint8Array(W,Y,$),0),M.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",te)}},{key:"_parseAVCVideoData",value:function(W,Y,$,te,ve,Pe,Ge){for(var _t=this._littleEndian,bt=new DataView(W,Y,$),$e=[],At=0,Jt=0,Et=this._naluLengthSize,sn=this._timestampBase+te,Yt=Pe===1;Jt<$;){if(Jt+4>=$){M.w(this.TAG,"Malformed Nalu near timestamp ".concat(sn,", offset = ").concat(Jt,", dataSize = ").concat($));break}var Ut=bt.getUint32(Jt,!_t);if(Et===3&&(Ut>>>=8),Ut>$-Et){M.w(this.TAG,"Malformed Nalus near timestamp ".concat(sn,", NaluSize > DataSize!"));return}var pt=bt.getUint8(Jt+Et)&31;pt===5&&(Yt=!0);var Cn=new Uint8Array(W,Y+Jt,Et+Ut),ft={type:pt,data:Cn};$e.push(ft),At+=Cn.byteLength,Jt+=Et+Ut}if($e.length){var hn=this._videoTrack,pn={units:$e,length:At,isKeyframe:Yt,dts:sn,cts:Ge,pts:sn+Ge};Yt&&(pn.fileposition=ve),hn.samples.push(pn),hn.length+=At}}}],[{key:"probe",value:function(W){var Y=new Uint8Array(W),$={match:!1};if(Y[0]!==70||Y[1]!==76||Y[2]!==86||Y[3]!==1)return $;var te=(Y[4]&4)>>>2!==0,ve=(Y[4]&1)!==0,Pe=xt(Y,5);return Pe<9?$:{match:!0,consumed:Pe,dataOffset:Pe,hasAudioTrack:te,hasVideoTrack:ve}}}]),_e}(),Fe=wt,Ue=function(){function _e(){Object(J.a)(this,_e)}return Object(z.a)(_e,null,[{key:"init",value:function(){_e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(var W in _e.types)_e.types.hasOwnProperty(W)&&(_e.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var Y=_e.constants={};Y.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),Y.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),Y.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),Y.STSC=Y.STCO=Y.STTS,Y.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Y.HDLR_VIDEO=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]),Y.HDLR_AUDIO=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]),Y.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Y.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Y.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(W){for(var Y=8,$=null,te=Array.prototype.slice.call(arguments,1),ve=te.length,Pe=0;Pe<ve;Pe++)Y+=te[Pe].byteLength;$=new Uint8Array(Y),$[0]=Y>>>24&255,$[1]=Y>>>16&255,$[2]=Y>>>8&255,$[3]=Y&255,$.set(W,4);for(var Ge=8,_t=0;_t<ve;_t++)$.set(te[_t],Ge),Ge+=te[_t].byteLength;return $}},{key:"generateInitSegment",value:function(W){var Y=_e.box(_e.types.ftyp,_e.constants.FTYP),$=_e.moov(W),te=new Uint8Array(Y.byteLength+$.byteLength);return te.set(Y,0),te.set($,Y.byteLength),te}},{key:"moov",value:function(W){var Y=_e.mvhd(W.timescale,W.duration),$=_e.trak(W),te=_e.mvex(W);return _e.box(_e.types.moov,Y,$,te)}},{key:"mvhd",value:function(W,Y){return _e.box(_e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&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]))}},{key:"trak",value:function(W){return _e.box(_e.types.trak,_e.tkhd(W),_e.mdia(W))}},{key:"tkhd",value:function(W){var Y=W.id,$=W.duration,te=W.presentWidth,ve=W.presentHeight;return _e.box(_e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255,0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&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,te>>>8&255,te&255,0,0,ve>>>8&255,ve&255,0,0]))}},{key:"mdia",value:function(W){return _e.box(_e.types.mdia,_e.mdhd(W),_e.hdlr(W),_e.minf(W))}},{key:"mdhd",value:function(W){var Y=W.timescale,$=W.duration;return _e.box(_e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255,$>>>24&255,$>>>16&255,$>>>8&255,$&255,85,196,0,0]))}},{key:"hdlr",value:function(W){var Y=null;return W.type==="audio"?Y=_e.constants.HDLR_AUDIO:Y=_e.constants.HDLR_VIDEO,_e.box(_e.types.hdlr,Y)}},{key:"minf",value:function(W){var Y=null;return W.type==="audio"?Y=_e.box(_e.types.smhd,_e.constants.SMHD):Y=_e.box(_e.types.vmhd,_e.constants.VMHD),_e.box(_e.types.minf,Y,_e.dinf(),_e.stbl(W))}},{key:"dinf",value:function(){var W=_e.box(_e.types.dinf,_e.box(_e.types.dref,_e.constants.DREF));return W}},{key:"stbl",value:function(W){var Y=_e.box(_e.types.stbl,_e.stsd(W),_e.box(_e.types.stts,_e.constants.STTS),_e.box(_e.types.stsc,_e.constants.STSC),_e.box(_e.types.stsz,_e.constants.STSZ),_e.box(_e.types.stco,_e.constants.STCO));return Y}},{key:"stsd",value:function(W){return W.type==="audio"?W.codec==="mp3"?_e.box(_e.types.stsd,_e.constants.STSD_PREFIX,_e.mp3(W)):_e.box(_e.types.stsd,_e.constants.STSD_PREFIX,_e.mp4a(W)):_e.box(_e.types.stsd,_e.constants.STSD_PREFIX,_e.avc1(W))}},{key:"mp3",value:function(W){var Y=W.channelCount,$=W.audioSampleRate,te=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Y,0,16,0,0,0,0,$>>>8&255,$&255,0,0]);return _e.box(_e.types[".mp3"],te)}},{key:"mp4a",value:function(W){var Y=W.channelCount,$=W.audioSampleRate,te=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Y,0,16,0,0,0,0,$>>>8&255,$&255,0,0]);return _e.box(_e.types.mp4a,te,_e.esds(W))}},{key:"esds",value:function(W){var Y=W.config||[],$=Y.length,te=new Uint8Array([0,0,0,0,3,23+$,0,1,0,4,15+$,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([$]).concat(Y).concat([6,1,2]));return _e.box(_e.types.esds,te)}},{key:"avc1",value:function(W){var Y=W.avcc,$=W.codecWidth,te=W.codecHeight,ve=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,$>>>8&255,$&255,te>>>8&255,te&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return _e.box(_e.types.avc1,ve,_e.box(_e.types.avcC,Y))}},{key:"mvex",value:function(W){return _e.box(_e.types.mvex,_e.trex(W))}},{key:"trex",value:function(W){var Y=W.id,$=new Uint8Array([0,0,0,0,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return _e.box(_e.types.trex,$)}},{key:"moof",value:function(W,Y){return _e.box(_e.types.moof,_e.mfhd(W.sequenceNumber),_e.traf(W,Y))}},{key:"mfhd",value:function(W){var Y=new Uint8Array([0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255]);return _e.box(_e.types.mfhd,Y)}},{key:"traf",value:function(W,Y){var $=W.id,te=_e.box(_e.types.tfhd,new Uint8Array([0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&255])),ve=_e.box(_e.types.tfdt,new Uint8Array([0,0,0,0,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255])),Pe=_e.sdtp(W),Ge=_e.trun(W,Pe.byteLength+16+16+8+16+8+8);return _e.box(_e.types.traf,te,ve,Ge,Pe)}},{key:"sdtp",value:function(W){for(var Y=W.samples||[],$=Y.length,te=new Uint8Array(4+$),ve=0;ve<$;ve++){var Pe=Y[ve].flags;te[ve+4]=Pe.isLeading<<6|Pe.dependsOn<<4|Pe.isDependedOn<<2|Pe.hasRedundancy}return _e.box(_e.types.sdtp,te)}},{key:"trun",value:function(W,Y){var $=W.samples||[],te=$.length,ve=12+16*te,Pe=new Uint8Array(ve);Y+=8+ve,Pe.set([0,0,15,1,te>>>24&255,te>>>16&255,te>>>8&255,te&255,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255],0);for(var Ge=0;Ge<te;Ge++){var _t=$[Ge].duration,bt=$[Ge].size,$e=$[Ge].flags,At=$[Ge].cts;Pe.set([_t>>>24&255,_t>>>16&255,_t>>>8&255,_t&255,bt>>>24&255,bt>>>16&255,bt>>>8&255,bt&255,$e.isLeading<<2|$e.dependsOn,$e.isDependedOn<<6|$e.hasRedundancy<<4|$e.isNonSync,0,0,At>>>24&255,At>>>16&255,At>>>8&255,At&255],12+16*Ge)}return _e.box(_e.types.trun,Pe)}},{key:"mdat",value:function(W){return _e.box(_e.types.mdat,W)}}]),_e}();Ue.init();var it=Ue,lt=function(){function _e(){Object(J.a)(this,_e)}return Object(z.a)(_e,null,[{key:"getSilentFrame",value:function(W,Y){if(W==="mp4a.40.2"){if(Y===1)return new Uint8Array([0,200,0,128,35,128]);if(Y===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(Y===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(Y===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(Y===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(Y===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])}else{if(Y===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(Y===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(Y===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])}return null}}]),_e}(),fe=lt,ie=function _e(ce,W,Y,$,te){Object(J.a)(this,_e),this.dts=ce,this.pts=W,this.duration=Y,this.originalDts=$,this.isSyncPoint=te,this.fileposition=null},re=function(){function _e(){Object(J.a)(this,_e),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return Object(z.a)(_e,[{key:"appendSyncPoint",value:function(W){W.isSyncPoint=!0,this.syncPoints.push(W)}}]),_e}(),de=function(){function _e(){Object(J.a)(this,_e),this._list=[]}return Object(z.a)(_e,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(W){var Y=this._list;if(W.length===0)return;Y.length>0&&W[0].originalDts<Y[Y.length-1].originalDts&&this.clear(),Array.prototype.push.apply(Y,W)}},{key:"getLastSyncPointBeforeDts",value:function(W){if(this._list.length==0)return null;var Y=this._list,$=0,te=Y.length-1,ve=0,Pe=0,Ge=te;for(W<Y[0].dts&&($=0,Pe=Ge+1);Pe<=Ge;)if(ve=Pe+Math.floor((Ge-Pe)/2),ve===te||W>=Y[ve].dts&&W<Y[ve+1].dts){$=ve;break}else Y[ve].dts<W?Pe=ve+1:Ge=ve-1;return this._list[$]}}]),_e}(),me=function(){function _e(ce){Object(J.a)(this,_e),this._type=ce,this._list=[],this._lastAppendLocation=-1}return Object(z.a)(_e,[{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}},{key:"isEmpty",value:function(){return this._list.length===0}},{key:"clear",value:function(){this._list=[],this._lastAppendLocation=-1}},{key:"_searchNearestSegmentBefore",value:function(W){var Y=this._list;if(Y.length===0)return-2;var $=Y.length-1,te=0,ve=0,Pe=$,Ge=0;if(W<Y[0].originalBeginDts)return Ge=-1,Ge;for(;ve<=Pe;)if(te=ve+Math.floor((Pe-ve)/2),te===$||W>Y[te].lastSample.originalDts&&W<Y[te+1].originalBeginDts){Ge=te;break}else Y[te].originalBeginDts<W?ve=te+1:Pe=te-1;return Ge}},{key:"_searchNearestSegmentAfter",value:function(W){return this._searchNearestSegmentBefore(W)+1}},{key:"append",value:function(W){var Y=this._list,$=W,te=this._lastAppendLocation,ve=0;te!==-1&&te<Y.length&&$.originalBeginDts>=Y[te].lastSample.originalDts&&(te===Y.length-1||te<Y.length-1&&$.originalBeginDts<Y[te+1].originalBeginDts)?ve=te+1:Y.length>0&&(ve=this._searchNearestSegmentBefore($.originalBeginDts)+1),this._lastAppendLocation=ve,this._list.splice(ve,0,$)}},{key:"getLastSegmentBefore",value:function(W){var Y=this._searchNearestSegmentBefore(W);return Y>=0?this._list[Y]:null}},{key:"getLastSampleBefore",value:function(W){var Y=this.getLastSegmentBefore(W);return Y!=null?Y.lastSample:null}},{key:"getLastSyncPointBefore",value:function(W){for(var Y=this._searchNearestSegmentBefore(W),$=this._list[Y].syncPoints;$.length===0&&Y>0;)Y--,$=this._list[Y].syncPoints;return $.length>0?$[$.length-1]:null}}]),_e}(),le=function(){function _e(ce){Object(J.a)(this,_e),this.TAG="MP4Remuxer",this._config=ce,this._isLive=ce.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=Infinity,this._videoDtsBase=Infinity,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new me("audio"),this._videoSegmentInfoList=new me("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(w.chrome&&(w.version.major<50||w.version.major===50&&w.version.build<2661)),this._fillSilentAfterSeek=w.msedge||w.msie,this._mp3UseMpegAudio=!w.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(z.a)(_e,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(W){return W.onDataAvailable=this.remux.bind(this),W.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(W){this._onInitSegment=W}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(W){this._onMediaSegment=W}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(W){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(W,Y){if(!this._onMediaSegment)throw new c("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(W,Y),this._remuxVideo(Y),this._remuxAudio(W)}},{key:"_onTrackMetadataReceived",value:function(W,Y){var $=null,te="mp4",ve=Y.codec;if(W==="audio")this._audioMeta=Y,Y.codec==="mp3"&&this._mp3UseMpegAudio?(te="mpeg",ve="",$=new Uint8Array):$=it.generateInitSegment(Y);else if(W==="video")this._videoMeta=Y,$=it.generateInitSegment(Y);else return;if(!this._onInitSegment)throw new c("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(W,{type:W,data:$.buffer,codec:ve,container:"".concat(W,"/").concat(te),mediaDuration:Y.duration})}},{key:"_calculateDtsBase",value:function(W,Y){if(this._dtsBaseInited)return;W.samples&&W.samples.length&&(this._audioDtsBase=W.samples[0].dts),Y.samples&&Y.samples.length&&(this._videoDtsBase=Y.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var W=this._videoStashedLastSample,Y=this._audioStashedLastSample,$={type:"video",id:1,sequenceNumber:0,samples:[],length:0};W!=null&&($.samples.push(W),$.length=W.length);var te={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};Y!=null&&(te.samples.push(Y),te.length=Y.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo($,!0),this._remuxAudio(te,!0)}},{key:"_remuxAudio",value:function(W,Y){if(this._audioMeta==null)return;var $=W,te=$.samples,ve=void 0,Pe=-1,Ge=-1,_t=-1,bt=this._audioMeta.refSampleDuration,$e=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,At=this._dtsBaseInited&&this._audioNextDts===void 0,Jt=!1;if(!te||te.length===0)return;if(te.length===1&&!Y)return;var Et=0,sn=null,Yt=0;$e?(Et=0,Yt=$.length):(Et=8,Yt=8+$.length);var Ut=null;if(te.length>1&&(Ut=te.pop(),Yt-=Ut.length),this._audioStashedLastSample!=null){var pt=this._audioStashedLastSample;this._audioStashedLastSample=null,te.unshift(pt),Yt+=pt.length}Ut!=null&&(this._audioStashedLastSample=Ut);var Cn=te[0].dts-this._dtsBase;if(this._audioNextDts)ve=Cn-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())ve=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(Jt=!0));else{var ft=this._audioSegmentInfoList.getLastSampleBefore(Cn);if(ft!=null){var hn=Cn-(ft.originalDts+ft.duration);hn<=3&&(hn=0);var pn=ft.dts+ft.duration+hn;ve=Cn-pn}else ve=0}if(Jt){var Yn=Cn-ve,ni=this._videoSegmentInfoList.getLastSegmentBefore(Cn);if(ni!=null&&ni.beginDts<Yn){var En=fe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(En){var gi=ni.beginDts,Jn=Yn-ni.beginDts;M.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(gi,", duration: ").concat(Jn)),te.unshift({unit:En,dts:gi,pts:gi}),Yt+=En.byteLength}}else Jt=!1}for(var An=[],Pn=0;Pn<te.length;Pn++){var Di=te[Pn],Hi=Di.unit,vi=Di.dts-this._dtsBase,ii=vi-ve;Pe===-1&&(Pe=ii);var _i=0;if(Pn!==te.length-1){var Qi=te[Pn+1].dts-this._dtsBase-ve;_i=Qi-ii}else if(Ut!=null){var yi=Ut.dts-this._dtsBase-ve;_i=yi-ii}else An.length>=1?_i=An[An.length-1].duration:_i=Math.floor(bt);var ri=!1,Pi=null;if(_i>bt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!w.safari){ri=!0;var Li=Math.abs(_i-bt),Oi=Math.ceil(Li/bt),Si=ii+bt;M.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
|
|
`+"dts: ".concat(ii+_i," ms, expected: ").concat(ii+Math.round(bt)," ms, ")+"delta: ".concat(Math.round(Li)," ms, generate: ").concat(Oi," frames"));var cr=fe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);cr==null&&(M.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),cr=Hi),Pi=[];for(var _r=0;_r<Oi;_r++){var rr=Math.round(Si);if(Pi.length>0){var Zi=Pi[Pi.length-1];Zi.duration=rr-Zi.dts}var Ar={dts:rr,pts:rr,cts:0,unit:cr,size:cr.byteLength,duration:0,originalDts:vi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Pi.push(Ar),Yt+=Ar.size,Si+=bt}var Nr=Pi[Pi.length-1];Nr.duration=ii+_i-Nr.dts,_i=Math.round(bt)}An.push({dts:ii,pts:ii,cts:0,unit:Di.unit,size:Di.unit.byteLength,duration:_i,originalDts:vi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),ri&&An.push.apply(An,Pi)}$e?sn=new Uint8Array(Yt):(sn=new Uint8Array(Yt),sn[0]=Yt>>>24&255,sn[1]=Yt>>>16&255,sn[2]=Yt>>>8&255,sn[3]=Yt&255,sn.set(it.types.mdat,4));for(var Ur=0;Ur<An.length;Ur++){var ar=An[Ur].unit;sn.set(ar,Et),Et+=ar.byteLength}var pi=An[An.length-1];Ge=pi.dts+pi.duration,this._audioNextDts=Ge;var ci=new re;ci.beginDts=Pe,ci.endDts=Ge,ci.beginPts=Pe,ci.endPts=Ge,ci.originalBeginDts=An[0].originalDts,ci.originalEndDts=pi.originalDts+pi.duration,ci.firstSample=new ie(An[0].dts,An[0].pts,An[0].duration,An[0].originalDts,!1),ci.lastSample=new ie(pi.dts,pi.pts,pi.duration,pi.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(ci),$.samples=An,$.sequenceNumber++;var Yi=null;$e?Yi=new Uint8Array:Yi=it.moof($,Pe),$.samples=[],$.length=0;var qi={type:"audio",data:this._mergeBoxes(Yi,sn).buffer,sampleCount:An.length,info:ci};$e&&At&&(qi.timestampOffset=Pe),this._onMediaSegment("audio",qi)}},{key:"_remuxVideo",value:function(W,Y){if(this._videoMeta==null)return;var $=W,te=$.samples,ve=void 0,Pe=-1,Ge=-1,_t=-1,bt=-1;if(!te||te.length===0)return;if(te.length===1&&!Y)return;var $e=8,At=null,Jt=8+W.length,Et=null;if(te.length>1&&(Et=te.pop(),Jt-=Et.length),this._videoStashedLastSample!=null){var sn=this._videoStashedLastSample;this._videoStashedLastSample=null,te.unshift(sn),Jt+=sn.length}Et!=null&&(this._videoStashedLastSample=Et);var Yt=te[0].dts-this._dtsBase;if(this._videoNextDts)ve=Yt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())ve=0;else{var Ut=this._videoSegmentInfoList.getLastSampleBefore(Yt);if(Ut!=null){var pt=Yt-(Ut.originalDts+Ut.duration);pt<=3&&(pt=0);var Cn=Ut.dts+Ut.duration+pt;ve=Yt-Cn}else ve=0}for(var ft=new re,hn=[],pn=0;pn<te.length;pn++){var Yn=te[pn],ni=Yn.dts-this._dtsBase,En=Yn.isKeyframe,gi=ni-ve,Jn=Yn.cts,An=gi+Jn;Pe===-1&&(Pe=gi,_t=An);var Pn=0;if(pn!==te.length-1){var Di=te[pn+1].dts-this._dtsBase-ve;Pn=Di-gi}else if(Et!=null){var Hi=Et.dts-this._dtsBase-ve;Pn=Hi-gi}else hn.length>=1?Pn=hn[hn.length-1].duration:Pn=Math.floor(this._videoMeta.refSampleDuration);if(En){var vi=new ie(gi,An,Pn,Yn.dts,!0);vi.fileposition=Yn.fileposition,ft.appendSyncPoint(vi)}hn.push({dts:gi,pts:An,cts:Jn,units:Yn.units,size:Yn.length,isKeyframe:En,duration:Pn,originalDts:ni,flags:{isLeading:0,dependsOn:En?2:1,isDependedOn:En?1:0,hasRedundancy:0,isNonSync:En?0:1}})}At=new Uint8Array(Jt),At[0]=Jt>>>24&255,At[1]=Jt>>>16&255,At[2]=Jt>>>8&255,At[3]=Jt&255,At.set(it.types.mdat,4);for(var ii=0;ii<hn.length;ii++)for(var _i=hn[ii].units;_i.length;){var Qi=_i.shift(),yi=Qi.data;At.set(yi,$e),$e+=yi.byteLength}var ri=hn[hn.length-1];if(Ge=ri.dts+ri.duration,bt=ri.pts+ri.duration,this._videoNextDts=Ge,ft.beginDts=Pe,ft.endDts=Ge,ft.beginPts=_t,ft.endPts=bt,ft.originalBeginDts=hn[0].originalDts,ft.originalEndDts=ri.originalDts+ri.duration,ft.firstSample=new ie(hn[0].dts,hn[0].pts,hn[0].duration,hn[0].originalDts,hn[0].isKeyframe),ft.lastSample=new ie(ri.dts,ri.pts,ri.duration,ri.originalDts,ri.isKeyframe),this._isLive||this._videoSegmentInfoList.append(ft),$.samples=hn,$.sequenceNumber++,this._forceFirstIDR){var Pi=hn[0].flags;Pi.dependsOn=2,Pi.isNonSync=0}var Li=it.moof($,Pe);$.samples=[],$.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Li,At).buffer,sampleCount:hn.length,info:ft})}},{key:"_mergeBoxes",value:function(W,Y){var $=new Uint8Array(W.byteLength+Y.byteLength);return $.set(W,0),$.set(Y,W.byteLength),$}}]),_e}(),he=le,Ee={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"},ye=Ee,Le=function(){function _e(ce,W){Object(J.a)(this,_e),this.TAG="TransmuxingController",this._emitter=new C.a,this._config=W,ce.segments||(ce.segments=[{duration:ce.duration,filesize:ce.filesize,url:ce.url}]),typeof ce.cors!="boolean"&&(ce.cors=!0),typeof ce.withCredentials!="boolean"&&(ce.withCredentials=!1),this._mediaDataSource=ce,this._currentSegmentIndex=0;var Y=0;this._mediaDataSource.segments.forEach(function($){$.timestampBase=Y,Y+=$.duration,$.cors=ce.cors,$.withCredentials=ce.withCredentials,W.referrerPolicy&&($.referrerPolicy=W.referrerPolicy)}),!isNaN(Y)&&this._mediaDataSource.duration!==Y&&(this._mediaDataSource.duration=Y),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return Object(z.a)(_e,[{key:"destroy",value:function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(W,Y){this._emitter.addListener(W,Y)}},{key:"off",value:function(W,Y){this._emitter.removeListener(W,Y)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(W,Y){this._currentSegmentIndex=W;var $=this._mediaDataSource.segments[W],te=this._ioctl=new se($,this._config,W);te.onError=this._onIOException.bind(this),te.onSeeked=this._onIOSeeked.bind(this),te.onComplete=this._onIOComplete.bind(this),te.onRedirect=this._onIORedirect.bind(this),te.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),Y?this._demuxer.bindDataSource(this._ioctl):te.onDataArrival=this._onInitChunkArrival.bind(this),te.open(Y)}},{key:"stop",value:function(){this._internalAbort(),this._disableStatisticsReporter()}},{key:"_internalAbort",value:function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}},{key:"pause",value:function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}},{key:"resume",value:function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}},{key:"seek",value:function(W){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;var Y=this._searchSegmentIndexContains(W);if(Y===this._currentSegmentIndex){var $=this._mediaInfo.segments[Y];if($==null)this._pendingSeekTime=W;else{var te=$.getNearestKeyframe(W);this._remuxer.seek(te.milliseconds),this._ioctl.seek(te.fileposition),this._pendingResolveSeekPoint=te.milliseconds}}else{var ve=this._mediaInfo.segments[Y];if(ve==null)this._pendingSeekTime=W,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(Y);else{var Pe=ve.getNearestKeyframe(W);this._internalAbort(),this._remuxer.seek(W),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[Y].timestampBase,this._loadSegment(Y,Pe.fileposition),this._pendingResolveSeekPoint=Pe.milliseconds,this._reportSegmentMediaInfo(Y)}}this._enableStatisticsReporter()}},{key:"_searchSegmentIndexContains",value:function(W){for(var Y=this._mediaDataSource.segments,$=Y.length-1,te=0;te<Y.length;te++)if(W<Y[te].timestampBase){$=te-1;break}return $}},{key:"_onInitChunkArrival",value:function(W,Y){var $=this,te=null,ve=0;if(Y>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,ve=this._demuxer.parseChunks(W,Y);else if((te=Fe.probe(W)).match){this._demuxer=new Fe(te,this._config),this._remuxer||(this._remuxer=new he(this._config));var Pe=this._mediaDataSource;Pe.duration!=null&&!isNaN(Pe.duration)&&(this._demuxer.overridedDuration=Pe.duration),typeof Pe.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Pe.hasAudio),typeof Pe.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Pe.hasVideo),this._demuxer.timestampBase=Pe.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),ve=this._demuxer.parseChunks(W,Y)}else te=null,M.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){$._internalAbort()}),this._emitter.emit(ye.DEMUX_ERROR,Qe.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),ve=0;return ve}},{key:"_onMediaInfo",value:function(W){var Y=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},W),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,K.prototype));var $=Object.assign({},W);Object.setPrototypeOf($,K.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=$,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var te=Y._pendingSeekTime;Y._pendingSeekTime=null,Y.seek(te)})}},{key:"_onMetaDataArrived",value:function(W){this._emitter.emit(ye.METADATA_ARRIVED,W)}},{key:"_onScriptDataArrived",value:function(W){this._emitter.emit(ye.SCRIPTDATA_ARRIVED,W)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(W){var Y=W,$=Y+1;$<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment($)):(this._remuxer.flushStashedSamples(),this._emitter.emit(ye.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(W){var Y=this._ioctl.extraData;this._mediaDataSource.segments[Y].redirectedURL=W}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(ye.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(W,Y){M.e(this.TAG,"IOException: type = ".concat(W,", code = ").concat(Y.code,", msg = ").concat(Y.msg)),this._emitter.emit(ye.IO_ERROR,W,Y),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(W,Y){M.e(this.TAG,"DemuxException: type = ".concat(W,", info = ").concat(Y)),this._emitter.emit(ye.DEMUX_ERROR,W,Y)}},{key:"_onRemuxerInitSegmentArrival",value:function(W,Y){this._emitter.emit(ye.INIT_SEGMENT,W,Y)}},{key:"_onRemuxerMediaSegmentArrival",value:function(W,Y){if(this._pendingSeekTime!=null)return;if(this._emitter.emit(ye.MEDIA_SEGMENT,W,Y),this._pendingResolveSeekPoint!=null&&W==="video"){var $=Y.info.syncPoints,te=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,w.safari&&$.length>0&&$[0].originalDts===te&&(te=$[0].pts),this._emitter.emit(ye.RECOMMEND_SEEKPOINT,te)}}},{key:"_enableStatisticsReporter",value:function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(W){var Y=this._mediaInfo.segments[W],$=Object.assign({},Y);$.duration=this._mediaInfo.duration,$.segmentCount=this._mediaInfo.segmentCount,delete $.segments,delete $.keyframesIndex,this._emitter.emit(ye.MEDIA_INFO,$)}},{key:"_reportStatisticsInfo",value:function(){var W={};W.url=this._ioctl.currentURL,W.hasRedirect=this._ioctl.hasRedirect,W.hasRedirect&&(W.redirectedURL=this._ioctl.currentRedirectedURL),W.speed=this._ioctl.currentSpeed,W.loaderType=this._ioctl.loaderType,W.currentSegmentIndex=this._currentSegmentIndex,W.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(ye.STATISTICS_INFO,W)}}]),_e}(),Ne=Le,tt=function(ce){var W="TransmuxingWorker",Y=null,$=Yt.bind(this);X.install(),ce.addEventListener("message",function(Ut){switch(Ut.data.cmd){case"init":Y=new Ne(Ut.data.param[0],Ut.data.param[1]),Y.on(ye.IO_ERROR,Jt.bind(this)),Y.on(ye.DEMUX_ERROR,Et.bind(this)),Y.on(ye.INIT_SEGMENT,te.bind(this)),Y.on(ye.MEDIA_SEGMENT,ve.bind(this)),Y.on(ye.LOADING_COMPLETE,Pe.bind(this)),Y.on(ye.RECOVERED_EARLY_EOF,Ge.bind(this)),Y.on(ye.MEDIA_INFO,_t.bind(this)),Y.on(ye.METADATA_ARRIVED,bt.bind(this)),Y.on(ye.SCRIPTDATA_ARRIVED,$e.bind(this)),Y.on(ye.STATISTICS_INFO,At.bind(this)),Y.on(ye.RECOMMEND_SEEKPOINT,sn.bind(this));break;case"destroy":Y&&(Y.destroy(),Y=null),ce.postMessage({msg:"destroyed"});break;case"start":Y.start();break;case"stop":Y.stop();break;case"seek":Y.seek(Ut.data.param);break;case"pause":Y.pause();break;case"resume":Y.resume();break;case"logging_config":{var pt=Ut.data.param;Z.applyConfig(pt),pt.enableCallback===!0?Z.addLogListener($):Z.removeLogListener($);break}}});function te(Ut,pt){var Cn={msg:ye.INIT_SEGMENT,data:{type:Ut,data:pt}};ce.postMessage(Cn,[pt.data])}function ve(Ut,pt){var Cn={msg:ye.MEDIA_SEGMENT,data:{type:Ut,data:pt}};ce.postMessage(Cn,[pt.data])}function Pe(){var Ut={msg:ye.LOADING_COMPLETE};ce.postMessage(Ut)}function Ge(){var Ut={msg:ye.RECOVERED_EARLY_EOF};ce.postMessage(Ut)}function _t(Ut){var pt={msg:ye.MEDIA_INFO,data:Ut};ce.postMessage(pt)}function bt(Ut){var pt={msg:ye.METADATA_ARRIVED,data:Ut};ce.postMessage(pt)}function $e(Ut){var pt={msg:ye.SCRIPTDATA_ARRIVED,data:Ut};ce.postMessage(pt)}function At(Ut){var pt={msg:ye.STATISTICS_INFO,data:Ut};ce.postMessage(pt)}function Jt(Ut,pt){ce.postMessage({msg:ye.IO_ERROR,data:{type:Ut,info:pt}})}function Et(Ut,pt){ce.postMessage({msg:ye.DEMUX_ERROR,data:{type:Ut,info:pt}})}function sn(Ut){ce.postMessage({msg:ye.RECOMMEND_SEEKPOINT,data:Ut})}function Yt(Ut,pt){ce.postMessage({msg:"logcat_callback",data:{type:Ut,logcat:pt}})}},gt=tt,Ct=function(){function _e(ce,W){if(Object(J.a)(this,_e),this.TAG="Transmuxer",this._emitter=new C.a,W.enableWorker&&typeof Worker!="undefined")try{var Y=I("0r65");this._worker=Y(gt),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[ce,W]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},Z.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:Z.getConfig()})}catch(te){M.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Ne(ce,W)}else this._controller=new Ne(ce,W);if(this._controller){var $=this._controller;$.on(ye.IO_ERROR,this._onIOError.bind(this)),$.on(ye.DEMUX_ERROR,this._onDemuxError.bind(this)),$.on(ye.INIT_SEGMENT,this._onInitSegment.bind(this)),$.on(ye.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),$.on(ye.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),$.on(ye.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),$.on(ye.MEDIA_INFO,this._onMediaInfo.bind(this)),$.on(ye.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),$.on(ye.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),$.on(ye.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),$.on(ye.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(z.a)(_e,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),Z.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(W,Y){this._emitter.addListener(W,Y)}},{key:"off",value:function(W,Y){this._emitter.removeListener(W,Y)}},{key:"hasWorker",value:function(){return this._worker!=null}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(W){this._worker?this._worker.postMessage({cmd:"seek",param:W}):this._controller.seek(W)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(W,Y){var $=this;Promise.resolve().then(function(){$._emitter.emit(ye.INIT_SEGMENT,W,Y)})}},{key:"_onMediaSegment",value:function(W,Y){var $=this;Promise.resolve().then(function(){$._emitter.emit(ye.MEDIA_SEGMENT,W,Y)})}},{key:"_onLoadingComplete",value:function(){var W=this;Promise.resolve().then(function(){W._emitter.emit(ye.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var W=this;Promise.resolve().then(function(){W._emitter.emit(ye.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(W){var Y=this;Promise.resolve().then(function(){Y._emitter.emit(ye.MEDIA_INFO,W)})}},{key:"_onMetaDataArrived",value:function(W){var Y=this;Promise.resolve().then(function(){Y._emitter.emit(ye.METADATA_ARRIVED,W)})}},{key:"_onScriptDataArrived",value:function(W){var Y=this;Promise.resolve().then(function(){Y._emitter.emit(ye.SCRIPTDATA_ARRIVED,W)})}},{key:"_onStatisticsInfo",value:function(W){var Y=this;Promise.resolve().then(function(){Y._emitter.emit(ye.STATISTICS_INFO,W)})}},{key:"_onIOError",value:function(W,Y){var $=this;Promise.resolve().then(function(){$._emitter.emit(ye.IO_ERROR,W,Y)})}},{key:"_onDemuxError",value:function(W,Y){var $=this;Promise.resolve().then(function(){$._emitter.emit(ye.DEMUX_ERROR,W,Y)})}},{key:"_onRecommendSeekpoint",value:function(W){var Y=this;Promise.resolve().then(function(){Y._emitter.emit(ye.RECOMMEND_SEEKPOINT,W)})}},{key:"_onLoggingConfigChanged",value:function(W){this._worker&&this._worker.postMessage({cmd:"logging_config",param:W})}},{key:"_onWorkerMessage",value:function(W){var Y=W.data,$=Y.data;if(Y.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(Y.msg){case ye.INIT_SEGMENT:case ye.MEDIA_SEGMENT:this._emitter.emit(Y.msg,$.type,$.data);break;case ye.LOADING_COMPLETE:case ye.RECOVERED_EARLY_EOF:this._emitter.emit(Y.msg);break;case ye.MEDIA_INFO:Object.setPrototypeOf($,K.prototype),this._emitter.emit(Y.msg,$);break;case ye.METADATA_ARRIVED:case ye.SCRIPTDATA_ARRIVED:case ye.STATISTICS_INFO:this._emitter.emit(Y.msg,$);break;case ye.IO_ERROR:case ye.DEMUX_ERROR:this._emitter.emit(Y.msg,$.type,$.info);break;case ye.RECOMMEND_SEEKPOINT:this._emitter.emit(Y.msg,$);break;case"logcat_callback":M.emitter.emit("log",$.type,$.logcat);break;default:break}}}]),_e}(),Ot=Ct,St={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},Ye=St,at=function(){function _e(ce){Object(J.a)(this,_e),this.TAG="MSEController",this._config=ce,this._emitter=new C.a,this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new de}return Object(z.a)(_e,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(W,Y){this._emitter.addListener(W,Y)}},{key:"off",value:function(W,Y){this._emitter.removeListener(W,Y)}},{key:"attachMediaElement",value:function(W){if(this._mediaSource)throw new c("MediaSource has been attached to an HTMLMediaElement!");var Y=this._mediaSource=new window.MediaSource;Y.addEventListener("sourceopen",this.e.onSourceOpen),Y.addEventListener("sourceended",this.e.onSourceEnded),Y.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=W,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),W.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var W=this._mediaSource;for(var Y in this._sourceBuffers){var $=this._pendingSegments[Y];$.splice(0,$.length),this._pendingSegments[Y]=null,this._pendingRemoveRanges[Y]=null,this._lastInitSegments[Y]=null;var te=this._sourceBuffers[Y];if(te){if(W.readyState!=="closed"){try{W.removeSourceBuffer(te)}catch(ve){M.e(this.TAG,ve.message)}te.removeEventListener("error",this.e.onSourceBufferError),te.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[Y]=null,this._sourceBuffers[Y]=null}}if(W.readyState==="open")try{W.endOfStream()}catch(ve){M.e(this.TAG,ve.message)}W.removeEventListener("sourceopen",this.e.onSourceOpen),W.removeEventListener("sourceended",this.e.onSourceEnded),W.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(W,Y){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(W),this._pendingSegments[W.type].push(W);return}var $=W,te="".concat($.container);$.codec&&$.codec.length>0&&(te+=";codecs=".concat($.codec));var ve=!1;if(M.v(this.TAG,"Received Initialization Segment, mimeType: "+te),this._lastInitSegments[$.type]=$,te!==this._mimeTypes[$.type]){if(this._mimeTypes[$.type])M.v(this.TAG,"Notice: ".concat($.type," mimeType changed, origin: ").concat(this._mimeTypes[$.type],", target: ").concat(te));else{ve=!0;try{var Pe=this._sourceBuffers[$.type]=this._mediaSource.addSourceBuffer(te);Pe.addEventListener("error",this.e.onSourceBufferError),Pe.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(Ge){M.e(this.TAG,Ge.message),this._emitter.emit(Ye.ERROR,{code:Ge.code,msg:Ge.message});return}}this._mimeTypes[$.type]=te}Y||this._pendingSegments[$.type].push($),ve||this._sourceBuffers[$.type]&&!this._sourceBuffers[$.type].updating&&this._doAppendSegments(),w.safari&&$.container==="audio/mpeg"&&$.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=$.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(W){var Y=W;this._pendingSegments[Y.type].push(Y),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var $=this._sourceBuffers[Y.type];$&&!$.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(W){for(var Y in this._sourceBuffers){if(!this._sourceBuffers[Y])continue;var $=this._sourceBuffers[Y];if(this._mediaSource.readyState==="open")try{$.abort()}catch(bt){M.e(this.TAG,bt.message)}this._idrList.clear();var te=this._pendingSegments[Y];if(te.splice(0,te.length),this._mediaSource.readyState==="closed")continue;for(var ve=0;ve<$.buffered.length;ve++){var Pe=$.buffered.start(ve),Ge=$.buffered.end(ve);this._pendingRemoveRanges[Y].push({start:Pe,end:Ge})}if($.updating||this._doRemoveRanges(),w.safari){var _t=this._lastInitSegments[Y];_t&&(this._pendingSegments[Y].push(_t),$.updating||this._doAppendSegments())}}}},{key:"endOfStream",value:function(){var W=this._mediaSource,Y=this._sourceBuffers;if(!W||W.readyState!=="open"){W&&W.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}Y.video&&Y.video.updating||Y.audio&&Y.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,W.endOfStream())}},{key:"getNearestKeyframe",value:function(W){return this._idrList.getLastSyncPointBeforeDts(W)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var W=this._mediaElement.currentTime;for(var Y in this._sourceBuffers){var $=this._sourceBuffers[Y];if($){var te=$.buffered;if(te.length>=1&&W-te.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var W=this._mediaElement.currentTime;for(var Y in this._sourceBuffers){var $=this._sourceBuffers[Y];if($){for(var te=$.buffered,ve=!1,Pe=0;Pe<te.length;Pe++){var Ge=te.start(Pe),_t=te.end(Pe);if(Ge<=W&&W<_t+3){if(W-Ge>=this._config.autoCleanupMaxBackwardDuration){ve=!0;var bt=W-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[Y].push({start:Ge,end:bt})}}else _t<W&&(ve=!0,this._pendingRemoveRanges[Y].push({start:Ge,end:_t}))}ve&&!$.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var W=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")return;if(W.video&&W.video.updating||W.audio&&W.audio.updating)return;var Y=this._mediaSource.duration,$=this._pendingMediaDuration;$>0&&(isNaN(Y)||$>Y)&&(M.v(this.TAG,"Update MediaSource duration from ".concat(Y," to ").concat($)),this._mediaSource.duration=$),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var W in this._pendingRemoveRanges){if(!this._sourceBuffers[W]||this._sourceBuffers[W].updating)continue;for(var Y=this._sourceBuffers[W],$=this._pendingRemoveRanges[W];$.length&&!Y.updating;){var te=$.shift();Y.remove(te.start,te.end)}}}},{key:"_doAppendSegments",value:function(){var W=this._pendingSegments;for(var Y in W){if(!this._sourceBuffers[Y]||this._sourceBuffers[Y].updating)continue;if(W[Y].length>0){var $=W[Y].shift();if($.timestampOffset){var te=this._sourceBuffers[Y].timestampOffset,ve=$.timestampOffset/1e3,Pe=Math.abs(te-ve);Pe>.1&&(M.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(te," to ").concat(ve)),this._sourceBuffers[Y].timestampOffset=ve),delete $.timestampOffset}if(!$.data||$.data.byteLength===0)continue;try{this._sourceBuffers[Y].appendBuffer($.data),this._isBufferFull=!1,Y==="video"&&$.hasOwnProperty("info")&&this._idrList.appendArray($.info.syncPoints)}catch(Ge){this._pendingSegments[Y].unshift($),Ge.code===22?(this._isBufferFull||this._emitter.emit(Ye.BUFFER_FULL),this._isBufferFull=!0):(M.e(this.TAG,Ge.message),this._emitter.emit(Ye.ERROR,{code:Ge.code,msg:Ge.message}))}}}}},{key:"_onSourceOpen",value:function(){if(M.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var W=this._pendingSourceBufferInit;W.length;){var Y=W.shift();this.appendInitSegment(Y,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(Ye.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){M.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){M.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var W=this._pendingSegments;return W.video.length>0||W.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var W=this._pendingRemoveRanges;return W.video.length>0||W.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(Ye.UPDATE_END)}},{key:"_onSourceBufferError",value:function(W){M.e(this.TAG,"SourceBuffer Error: ".concat(W))}}]),_e}(),Ve=at,be={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Ie={NETWORK_EXCEPTION:a.EXCEPTION,NETWORK_STATUS_CODE_INVALID:a.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:a.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:a.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:Qe.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Qe.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Qe.CODEC_UNSUPPORTED},ot=function(){function _e(ce,W){if(Object(J.a)(this,_e),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new C.a,this._config=De(),typeof W=="object"&&Object.assign(this._config,W),ce.type.toLowerCase()!=="flv")throw new o("FlvPlayer requires an flv MediaDataSource input!");ce.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=ce,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var Y=w.chrome&&(w.version.major<50||w.version.major===50&&w.version.build<2661);this._alwaysSeekKeyframe=!!(Y||w.msedge||w.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(z.a)(_e,[{key:"destroy",value:function(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(W,Y){var $=this;W===Be.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){$._emitter.emit(Be.MEDIA_INFO,$.mediaInfo)}):W===Be.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){$._emitter.emit(Be.STATISTICS_INFO,$.statisticsInfo)})),this._emitter.addListener(W,Y)}},{key:"off",value:function(W,Y){this._emitter.removeListener(W,Y)}},{key:"attachMediaElement",value:function(W){var Y=this;if(this._mediaElement=W,W.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),W.addEventListener("seeking",this.e.onvSeeking),W.addEventListener("canplay",this.e.onvCanPlay),W.addEventListener("stalled",this.e.onvStalled),W.addEventListener("progress",this.e.onvProgress),this._msectl=new Ve(this._config),this._msectl.on(Ye.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(Ye.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(Ye.SOURCE_OPEN,function(){Y._mseSourceOpened=!0,Y._hasPendingLoad&&(Y._hasPendingLoad=!1,Y.load())}),this._msectl.on(Ye.ERROR,function($){Y._emitter.emit(Be.ERROR,be.MEDIA_ERROR,Ie.MEDIA_MSE_ERROR,$)}),this._msectl.attachMediaElement(W),this._pendingSeekTime!=null)try{W.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch($){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var W=this;if(!this._mediaElement)throw new c("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new c("FlvPlayer.load() has been called, please call unload() first!");if(this._hasPendingLoad)return;if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new Ot(this._mediaDataSource,this._config),this._transmuxer.on(ye.INIT_SEGMENT,function(Y,$){W._msectl.appendInitSegment($)}),this._transmuxer.on(ye.MEDIA_SEGMENT,function(Y,$){if(W._msectl.appendMediaSegment($),W._config.lazyLoad&&!W._config.isLive){var te=W._mediaElement.currentTime;$.info.endDts>=(te+W._config.lazyLoadMaxDuration)*1e3&&(W._progressChecker==null&&(M.v(W.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),W._suspendTransmuxer()))}}),this._transmuxer.on(ye.LOADING_COMPLETE,function(){W._msectl.endOfStream(),W._emitter.emit(Be.LOADING_COMPLETE)}),this._transmuxer.on(ye.RECOVERED_EARLY_EOF,function(){W._emitter.emit(Be.RECOVERED_EARLY_EOF)}),this._transmuxer.on(ye.IO_ERROR,function(Y,$){W._emitter.emit(Be.ERROR,be.NETWORK_ERROR,Y,$)}),this._transmuxer.on(ye.DEMUX_ERROR,function(Y,$){W._emitter.emit(Be.ERROR,be.MEDIA_ERROR,Y,{code:-1,msg:$})}),this._transmuxer.on(ye.MEDIA_INFO,function(Y){W._mediaInfo=Y,W._emitter.emit(Be.MEDIA_INFO,Object.assign({},Y))}),this._transmuxer.on(ye.METADATA_ARRIVED,function(Y){W._emitter.emit(Be.METADATA_ARRIVED,Y)}),this._transmuxer.on(ye.SCRIPTDATA_ARRIVED,function(Y){W._emitter.emit(Be.SCRIPTDATA_ARRIVED,Y)}),this._transmuxer.on(ye.STATISTICS_INFO,function(Y){W._statisticsInfo=W._fillStatisticsInfo(Y),W._emitter.emit(Be.STATISTICS_INFO,Object.assign({},W._statisticsInfo))}),this._transmuxer.on(ye.RECOMMEND_SEEKPOINT,function(Y){W._mediaElement&&!W._config.accurateSeek&&(W._requestSetTime=!0,W._mediaElement.currentTime=Y/1e3)}),this._transmuxer.open()}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(W){this._mediaElement.volume=W}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(W){this._mediaElement.muted=W}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(W){this._mediaElement?this._internalSeek(W):this._pendingSeekTime=W}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}},{key:"_fillStatisticsInfo",value:function(W){if(W.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return W;var Y=!0,$=0,te=0;if(this._mediaElement.getVideoPlaybackQuality){var ve=this._mediaElement.getVideoPlaybackQuality();$=ve.totalVideoFrames,te=ve.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?($=this._mediaElement.webkitDecodedFrameCount,te=this._mediaElement.webkitDroppedFrameCount):Y=!1;return Y&&(W.decodedFrames=$,W.droppedFrames=te),W}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var W=this._mediaElement.buffered,Y=this._mediaElement.currentTime,$=0,te=0,ve=0;ve<W.length;ve++){var Pe=W.start(ve),Ge=W.end(ve);if(Pe<=Y&&Y<Ge){$=Pe,te=Ge;break}}te>=Y+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(M.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){M.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var W=this._mediaElement.currentTime,Y=this._mediaElement.buffered,$=!1,te=0;te<Y.length;te++){var ve=Y.start(te),Pe=Y.end(te);if(W>=ve&&W<Pe){W>=Pe-this._config.lazyLoadRecoverDuration&&($=!0);break}}$&&(window.clearInterval(this._progressChecker),this._progressChecker=null,$&&(M.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(W){for(var Y=this._mediaElement.buffered,$=0;$<Y.length;$++){var te=Y.start($),ve=Y.end($);if(W>=te&&W<ve)return!0}return!1}},{key:"_internalSeek",value:function(W){var Y=this._isTimepointBuffered(W),$=!1,te=0;if(W<1&&this._mediaElement.buffered.length>0){var ve=this._mediaElement.buffered.start(0);(ve<1&&W<ve||w.safari)&&($=!0,te=w.safari?.1:ve)}if($)this._requestSetTime=!0,this._mediaElement.currentTime=te;else if(Y){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=W;else{var Pe=this._msectl.getNearestKeyframe(Math.floor(W*1e3));this._requestSetTime=!0,Pe!=null?this._mediaElement.currentTime=Pe.dts/1e3:this._mediaElement.currentTime=W}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(W),this._transmuxer.seek(Math.floor(W*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=W)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var W=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(W)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(W),this._transmuxer.seek(Math.floor(W*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=W))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(W){var Y=this._mediaElement;if(W||!this._receivedCanPlay||Y.readyState<2){var $=Y.buffered;$.length>0&&Y.currentTime<$.start(0)&&(M.w(this.TAG,"Playback seems stuck at ".concat(Y.currentTime,", seek to ").concat($.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=$.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}},{key:"_onvLoadedMetadata",value:function(W){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(W){var Y=this._mediaElement.currentTime,$=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(Y<1&&$.length>0){var te=$.start(0);if(te<1&&Y<te||w.safari){this._requestSetTime=!0,this._mediaElement.currentTime=w.safari?.1:te;return}}if(this._isTimepointBuffered(Y)){if(this._alwaysSeekKeyframe){var ve=this._msectl.getNearestKeyframe(Math.floor(Y*1e3));ve!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=ve.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:Y,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_onvCanPlay",value:function(W){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(W){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(W){this._checkAndResumeStuckPlayback()}}]),_e}(),Xe=ot,Rt=function(){function _e(ce,W){if(Object(J.a)(this,_e),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new C.a,this._config=De(),typeof W=="object"&&Object.assign(this._config,W),ce.type.toLowerCase()==="flv")throw new o("NativePlayer does't support flv MediaDataSource input!");if(ce.hasOwnProperty("segments"))throw new o("NativePlayer(".concat(ce.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=ce,this._mediaElement=null}return Object(z.a)(_e,[{key:"destroy",value:function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(W,Y){var $=this;W===Be.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){$._emitter.emit(Be.MEDIA_INFO,$.mediaInfo)}):W===Be.STATISTICS_INFO&&(this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){$._emitter.emit(Be.STATISTICS_INFO,$.statisticsInfo)})),this._emitter.addListener(W,Y)}},{key:"off",value:function(W,Y){this._emitter.removeListener(W,Y)}},{key:"attachMediaElement",value:function(W){if(this._mediaElement=W,W.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{W.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(Y){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"load",value:function(){if(!this._mediaElement)throw new c("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(W){this._mediaElement.volume=W}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(W){this._mediaElement.muted=W}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(W){this._mediaElement?this._mediaElement.currentTime=W:this._pendingSeekTime=W}},{key:"mediaInfo",get:function(){var W=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",Y={mimeType:W+this._mediaDataSource.type};return this._mediaElement&&(Y.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(Y.width=this._mediaElement.videoWidth,Y.height=this._mediaElement.videoHeight)),Y}},{key:"statisticsInfo",get:function(){var W={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return W;var Y=!0,$=0,te=0;if(this._mediaElement.getVideoPlaybackQuality){var ve=this._mediaElement.getVideoPlaybackQuality();$=ve.totalVideoFrames,te=ve.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?($=this._mediaElement.webkitDecodedFrameCount,te=this._mediaElement.webkitDroppedFrameCount):Y=!1;return Y&&(W.decodedFrames=$,W.droppedFrames=te),W}},{key:"_onvLoadedMetadata",value:function(W){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(Be.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(Be.STATISTICS_INFO,this.statisticsInfo)}}]),_e}(),Lt=Rt;X.install();function et(_e,ce){var W=_e;if(W==null||typeof W!="object")throw new o("MediaDataSource must be an javascript object!");if(!W.hasOwnProperty("type"))throw new o("MediaDataSource must has type field to indicate video file type!");switch(W.type){case"flv":return new Xe(W,ce);default:return new Lt(W,ce)}}function dt(){return ke.supportMSEH264Playback()}function vt(){return ke.getFeatureList()}var Tt={};Tt.createPlayer=et,Tt.isSupported=dt,Tt.getFeatureList=vt,Tt.BaseLoader=i,Tt.LoaderStatus=r,Tt.LoaderErrors=a,Tt.Events=Be,Tt.ErrorTypes=be,Tt.ErrorDetails=Ie,Tt.FlvPlayer=Xe,Tt.NativePlayer=Lt,Tt.LoggingControl=Z,Object.defineProperty(Tt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var Pt=pe.a=Tt},GgEA:function(He,pe,I){},Gytx:function(He,pe){He.exports=function(J,z,P,X){var N=P?P.call(X,J,z):void 0;if(N!==void 0)return!!N;if(J===z)return!0;if(typeof J!="object"||!J||typeof z!="object"||!z)return!1;var C=Object.keys(J),B=Object.keys(z);if(C.length!==B.length)return!1;for(var M=Object.prototype.hasOwnProperty.bind(z),n=0;n<C.length;n++){var D=C[n];if(!M(D))return!1;var g=J[D],p=z[D];if(N=P?P.call(X,g,p,D):void 0,N===!1||N===void 0&&g!==p)return!1}return!0}},HmJG:function(He,pe,I){},Hw79:function(He,pe,I){He.exports={pagination:"pagination___2VQzP",info:"info___1saw2"}},I8Z2:function(He,pe,I){"use strict";I.d(pe,"a",function(){return X}),I.d(pe,"b",function(){return h}),I.d(pe,"c",function(){return o});var J=I("q1tI"),z=function(){var d=function(r,a){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var S in s)s.hasOwnProperty(S)&&(i[S]=s[S])},d(r,a)};return function(r,a){d(r,a);function i(){this.constructor=r}r.prototype=a===null?Object.create(a):(i.prototype=a.prototype,new i)}}(),P=J.createContext(null),X=function(d){z(r,d);function r(){return d!==null&&d.apply(this,arguments)||this}return r.prototype.render=function(){return J.createElement(P.Provider,{value:this.props.store},this.props.children)},r}(J.Component),N=I("Gytx"),C=I.n(N),B=I("2mql"),M=I.n(B),n=function(){var d=function(r,a){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var S in s)s.hasOwnProperty(S)&&(i[S]=s[S])},d(r,a)};return function(r,a){d(r,a);function i(){this.constructor=r}r.prototype=a===null?Object.create(a):(i.prototype=a.prototype,new i)}}(),D=function(){return D=Object.assign||function(d){for(var r,a=1,i=arguments.length;a<i;a++){r=arguments[a];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(d[s]=r[s])}return d},D.apply(this,arguments)};function g(d){return d.displayName||d.name||"Component"}var p=function(){return{}};function h(d,r){r===void 0&&(r={});var a=!!d,i=d||p;return function(S){var x=function(A){n(w,A);function w(v,b){var m=A.call(this,v,b)||this;return m.unsubscribe=null,m.handleChange=function(){if(!m.unsubscribe)return;var f=i(m.store.getState(),m.props);m.setState({subscribed:f})},m.store=m.context,m.state={subscribed:i(m.store.getState(),v),store:m.store,props:v},m}return w.getDerivedStateFromProps=function(v,b){return d&&d.length===2&&v!==b.props?{subscribed:i(b.store.getState(),v),props:v}:{props:v}},w.prototype.componentDidMount=function(){this.trySubscribe()},w.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},w.prototype.shouldComponentUpdate=function(v,b){return!C()(this.props,v)||!C()(this.state.subscribed,b.subscribed)},w.prototype.trySubscribe=function(){a&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},w.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},w.prototype.render=function(){var v=D(D(D({},this.props),this.state.subscribed),{store:this.store});return J.createElement(S,D({},v,{ref:this.props.miniStoreForwardedRef}))},w.displayName="Connect("+g(S)+")",w.contextType=P,w}(J.Component);if(r.forwardRef){var T=J.forwardRef(function(A,w){return J.createElement(x,D({},A,{miniStoreForwardedRef:w}))});return M()(T,S)}return M()(x,S)}}var c=function(){return c=Object.assign||function(d){for(var r,a=1,i=arguments.length;a<i;a++){r=arguments[a];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(d[s]=r[s])}return d},c.apply(this,arguments)};function o(d){var r=d,a=[];function i(x){r=c(c({},r),x);for(var T=0;T<a.length;T++)a[T]()}function s(){return r}function S(x){return a.push(x),function(){var A=a.indexOf(x);a.splice(A,1)}}return{setState:i,getState:s,subscribe:S}}},IBYe:function(He,pe,I){"use strict";function J(z){return null}pe.a=J},IxHN:function(He,pe,I){"use strict";var J=I("q1tI"),z=I.n(J),P=I("07cG"),X=I.n(P);pe.a=function(N){var C=N.message,B=N.className,M=N.children,n=N.style,D=n===void 0?{}:n;return z.a.createElement("div",{className:"".concat(X.a.idsRingWrapper," ").concat(B)},z.a.createElement("div",{className:X.a.ldsRing},z.a.createElement("div",null),z.a.createElement("div",null),z.a.createElement("div",null),z.a.createElement("div",null)),C?z.a.createElement("p",{style:D},C):null,M)}},J66h:function(He,pe,I){(function(J){var z,P;(function(X,N){He.exports=N(X)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof J!="undefined"?J:this,function(X){"use strict";X=X||{};var N=X.Base64,C="2.6.4",B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",M=function(_){for(var k={},F=0,L=_.length;F<L;F++)k[_.charAt(F)]=F;return k}(B),n=String.fromCharCode,D=function(_){if(_.length<2){var k=_.charCodeAt(0);return k<128?_:k<2048?n(192|k>>>6)+n(128|k&63):n(224|k>>>12&15)+n(128|k>>>6&63)+n(128|k&63)}else{var k=65536+(_.charCodeAt(0)-55296)*1024+(_.charCodeAt(1)-56320);return n(240|k>>>18&7)+n(128|k>>>12&63)+n(128|k>>>6&63)+n(128|k&63)}},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,p=function(_){return _.replace(g,D)},h=function(_){var k=[0,2,1][_.length%3],F=_.charCodeAt(0)<<16|(_.length>1?_.charCodeAt(1):0)<<8|(_.length>2?_.charCodeAt(2):0),L=[B.charAt(F>>>18),B.charAt(F>>>12&63),k>=2?"=":B.charAt(F>>>6&63),k>=1?"=":B.charAt(F&63)];return L.join("")},c=X.btoa&&typeof X.btoa=="function"?function(_){return X.btoa(_)}:function(_){if(_.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return _.replace(/[\s\S]{1,3}/g,h)},o=function(_){return c(p(String(_)))},d=function(_){return _.replace(/[+\/]/g,function(k){return k=="+"?"-":"_"}).replace(/=/g,"")},r=function(_,k){return k?d(o(_)):o(_)},a=function(_){return r(_,!0)},i;X.Uint8Array&&(i=function(_,k){for(var F="",L=0,G=_.length;L<G;L+=3){var j=_[L],R=_[L+1],V=_[L+2],ne=j<<16|R<<8|V;F+=B.charAt(ne>>>18)+B.charAt(ne>>>12&63)+(typeof R!="undefined"?B.charAt(ne>>>6&63):"=")+(typeof V!="undefined"?B.charAt(ne&63):"=")}return k?d(F):F});var s=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,S=function(_){switch(_.length){case 4:var k=(7&_.charCodeAt(0))<<18|(63&_.charCodeAt(1))<<12|(63&_.charCodeAt(2))<<6|63&_.charCodeAt(3),F=k-65536;return n((F>>>10)+55296)+n((F&1023)+56320);case 3:return n((15&_.charCodeAt(0))<<12|(63&_.charCodeAt(1))<<6|63&_.charCodeAt(2));default:return n((31&_.charCodeAt(0))<<6|63&_.charCodeAt(1))}},x=function(_){return _.replace(s,S)},T=function(_){var k=_.length,F=k%4,L=(k>0?M[_.charAt(0)]<<18:0)|(k>1?M[_.charAt(1)]<<12:0)|(k>2?M[_.charAt(2)]<<6:0)|(k>3?M[_.charAt(3)]:0),G=[n(L>>>16),n(L>>>8&255),n(L&255)];return G.length-=[0,0,2,1][F],G.join("")},A=X.atob&&typeof X.atob=="function"?function(_){return X.atob(_)}:function(_){return _.replace(/\S{1,4}/g,T)},w=function(_){return A(String(_).replace(/[^A-Za-z0-9\+\/]/g,""))},v=function(_){return x(A(_))},b=function(_){return String(_).replace(/[-_]/g,function(k){return k=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},m=function(_){return v(b(_))},f;X.Uint8Array&&(f=function(_){return Uint8Array.from(w(b(_)),function(k){return k.charCodeAt(0)})});var O=function(){var _=X.Base64;return X.Base64=N,_};if(X.Base64={VERSION:C,atob:w,btoa:c,fromBase64:m,toBase64:r,utob:p,encode:r,encodeURI:a,btou:x,decode:m,noConflict:O,fromUint8Array:i,toUint8Array:f},typeof Object.defineProperty=="function"){var E=function(_){return{value:_,enumerable:!1,writable:!0,configurable:!0}};X.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",E(function(){return m(this)})),Object.defineProperty(String.prototype,"toBase64",E(function(_){return r(this,_)})),Object.defineProperty(String.prototype,"toBase64URI",E(function(){return r(this,!0)}))}}return X.Meteor&&(Base64=X.Base64),He.exports?He.exports.Base64=X.Base64:!(z=[],P=function(){return X.Base64}.apply(pe,z),P!==void 0&&(He.exports=P)),{Base64:X.Base64}})}).call(this,I("IyRk"))},JOrW:function(He,pe,I){He.exports=I.p+"static/gf.09d89ab3.svg"},JYp7:function(He,pe,I){"use strict";I.d(pe,"a",function(){return J});var J;(function(z){function P(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}z.is=P;const X=Object.freeze([]);function N(){return X}z.empty=N;function*C(s){yield s}z.single=C;function B(s){return s||X}z.from=B;function M(s){return!s||s[Symbol.iterator]().next().done===!0}z.isEmpty=M;function n(s){return s[Symbol.iterator]().next().value}z.first=n;function D(s,S){for(const x of s)if(S(x))return!0;return!1}z.some=D;function g(s,S){for(const x of s)if(S(x))return x;return}z.find=g;function*p(s,S){for(const x of s)S(x)&&(yield x)}z.filter=p;function*h(s,S){let x=0;for(const T of s)yield S(T,x++)}z.map=h;function*c(...s){for(const S of s)for(const x of S)yield x}z.concat=c;function*o(s){for(const S of s)for(const x of S)yield x}z.concatNested=o;function d(s,S,x){let T=x;for(const A of s)T=S(T,A);return T}z.reduce=d;function*r(s,S,x=s.length){for(S<0&&(S+=s.length),x<0?x+=s.length:x>s.length&&(x=s.length);S<x;S++)yield s[S]}z.slice=r;function a(s,S=Number.POSITIVE_INFINITY){const x=[];if(S===0)return[x,s];const T=s[Symbol.iterator]();for(let A=0;A<S;A++){const w=T.next();if(w.done)return[x,z.empty()];x.push(w.value)}return[x,{[Symbol.iterator](){return T}}]}z.consume=a;function i(s,S,x=(T,A)=>T===A){const T=s[Symbol.iterator](),A=S[Symbol.iterator]();for(;;){const w=T.next(),v=A.next();if(w.done!==v.done)return!1;if(w.done)return!0;if(!x(w.value,v.value))return!1}}z.equals=i})(J||(J={}))},LdHM:function(He,pe,I){"use strict";I.d(pe,"b",function(){return s}),I.d(pe,"a",function(){return x});var J=I("1OyB"),z=I("vuIU"),P=I("Ji7U"),X=I("LK+K"),N=I("q1tI"),C=I("rePB"),B=I("Ff2n"),M=I("ODXe"),n=I("4IlW"),D=I("bX4T"),g=I("YrtM"),p=I("TSYQ"),h=I.n(p),c=I("+nKL"),o=I("8OUc"),d=function(V,ne){var se=V.prefixCls,Se=V.id,De=V.flattenOptions,Ae=V.childrenAsData,ke=V.values,je=V.searchValue,Be=V.multiple,we=V.defaultActiveFirstOption,Z=V.height,U=V.itemHeight,K=V.notFoundContent,ee=V.open,oe=V.menuItemSelectedIcon,Q=V.virtual,Ce=V.onSelect,ze=V.onToggleOpen,nt=V.onActiveValue,xe=V.onScroll,Re=V.onMouseEnter,Te="".concat(se,"-item"),Oe=Object(g.a)(function(){return De},[ee,De],function(ie,re){return re[0]&&ie[1]!==re[1]}),Ke=N.useRef(null),Qe=function(re){re.preventDefault()},st=function(re){Ke.current&&Ke.current.scrollTo({index:re})},ut=function(re){for(var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,me=Oe.length,le=0;le<me;le+=1){var he=(re+le*de+me)%me,Ee=Oe[he],ye=Ee.group,Le=Ee.data;if(!ye&&!Le.disabled)return he}return-1},xt=N.useState(function(){return ut(0)}),wt=Object(M.a)(xt,2),Fe=wt[0],Ue=wt[1],it=function(re){Ue(re);var de=Oe[re];if(!de){nt(null,-1);return}nt(de.data.value,re)};N.useEffect(function(){it(we!==!1?ut(0):-1)},[Oe.length,je]),N.useEffect(function(){var ie=setTimeout(function(){if(!Be&&ee&&ke.size===1){var re=Array.from(ke)[0],de=Oe.findIndex(function(me){var le=me.data;return le.value===re});it(de),st(de)}});return function(){return clearTimeout(ie)}},[ee]);var lt=function(re){re!==void 0&&Ce(re,{selected:!ke.has(re)}),Be||ze(!1)};if(N.useImperativeHandle(ne,function(){return{onKeyDown:function(re){var de=re.which;switch(de){case n.a.UP:case n.a.DOWN:{var me=0;if(de===n.a.UP?me=-1:de===n.a.DOWN&&(me=1),me!==0){var le=ut(Fe+me,me);st(le),it(le)}break}case n.a.ENTER:{var he=Oe[Fe];he&&!he.data.disabled?lt(he.data.value):lt(void 0),ee&&re.preventDefault();break}case n.a.ESC:ze(!1)}},onKeyUp:function(){},scrollTo:function(re){st(re)}}}),Oe.length===0)return N.createElement("div",{role:"listbox",id:"".concat(Se,"_list"),className:"".concat(Te,"-empty"),onMouseDown:Qe},K);function fe(ie){var re=Oe[ie];if(!re)return null;var de=re.data||{},me=de.value,le=de.label,he=de.children,Ee=Object(D.a)(de,!0),ye=Ae?he:le;return re?N.createElement("div",Object.assign({"aria-label":typeof ye=="string"?ye:null},Ee,{key:ie,role:"option",id:"".concat(Se,"_list_").concat(ie),"aria-selected":ke.has(me)}),me):null}return N.createElement(N.Fragment,null,N.createElement("div",{role:"listbox",id:"".concat(Se,"_list"),style:{height:0,width:0,overflow:"hidden"}},fe(Fe-1),fe(Fe),fe(Fe+1)),N.createElement(c.a,{itemKey:"key",ref:Ke,data:Oe,height:Z,itemHeight:U,fullHeight:!1,onMouseDown:Qe,onScroll:xe,virtual:Q,onMouseEnter:Re},function(ie,re){var de,me=ie.group,le=ie.groupOption,he=ie.data,Ee=he.label,ye=he.key;if(me)return N.createElement("div",{className:h()(Te,"".concat(Te,"-group"))},Ee!==void 0?Ee:ye);var Le=he.disabled,Ne=he.value,tt=he.title,gt=he.children,Ct=he.style,Ot=he.className,St=Object(B.a)(he,["disabled","value","title","children","style","className"]),Ye=ke.has(Ne),at="".concat(Te,"-option"),Ve=h()(Te,at,Ot,(de={},Object(C.a)(de,"".concat(at,"-grouped"),le),Object(C.a)(de,"".concat(at,"-active"),Fe===re&&!Le),Object(C.a)(de,"".concat(at,"-disabled"),Le),Object(C.a)(de,"".concat(at,"-selected"),Ye),de)),be=Ae?gt:Ee,Ie=!oe||typeof oe=="function"||Ye;return N.createElement("div",Object.assign({},St,{"aria-selected":Ye,className:Ve,title:tt,onMouseMove:function(){if(Fe===re||Le)return;it(re)},onClick:function(){Le||lt(Ne)},style:Ct}),N.createElement("div",{className:"".concat(at,"-content")},be||Ne),N.isValidElement(oe)||Ye,Ie&&N.createElement(o.a,{className:"".concat(Te,"-option-state"),customizeIcon:oe,customizeIconProps:{isSelected:Ye}},Ye?"\u2713":null))}))},r=N.forwardRef(d);r.displayName="OptionList";var a=r,i=function(){return null};i.isSelectOption=!0;var s=i,S=function(){return null};S.isSelectOptGroup=!0;var x=S,T=I("VTBJ"),A=I("Zm9Q");function w(R){var V=R.key,ne=R.props,se=ne.children,Se=ne.value,De=Object(B.a)(ne,["children","value"]);return Object(T.a)({key:V,value:Se!==void 0?Se:V,children:se},De)}function v(R){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(R).map(function(ne,se){if(!N.isValidElement(ne)||!ne.type)return null;var Se=ne.type.isSelectOptGroup,De=ne.key,Ae=ne.props,ke=Ae.children,je=Object(B.a)(Ae,["children"]);return V||!Se?w(ne):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(De===null?se:De,"__"),label:De},je),{},{options:v(ke)})}).filter(function(ne){return ne})}var b=I("2Qr1"),m=I("qNPg"),f=I("U8pU"),O=I("Kwbf"),E=I("WKfj");function _(R){var V=R.mode,ne=R.options,se=R.children,Se=R.backfill,De=R.allowClear,Ae=R.placeholder,ke=R.getInputElement,je=R.showSearch,Be=R.onSearch,we=R.defaultOpen,Z=R.autoFocus,U=R.labelInValue,K=R.value,ee=R.inputValue,oe=R.optionLabelProp,Q=V==="multiple"||V==="tags",Ce=je!==void 0?je:Q||V==="combobox",ze=ne||v(se);if(Object(O.a)(V!=="tags"||ze.every(function(Te){return!Te.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var nt=ze.some(function(Te){return Te.options?Te.options.some(function(Oe){return typeof("value"in Oe?Oe.value:Oe.key)=="number"}):typeof("value"in Te?Te.value:Te.key)=="number"});Object(O.a)(!nt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(O.a)(V!=="combobox"||!oe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(O.a)(V==="combobox"||!Se,"`backfill` only works with `combobox` mode."),Object(O.a)(V==="combobox"||!ke,"`getInputElement` only work with `combobox` mode."),Object(O.b)(V!=="combobox"||!ke||!De||!Ae,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Be&&!Ce&&V!=="combobox"&&V!=="tags"&&Object(O.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(O.b)(!we||Z,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),K!=null){var xe=Object(E.d)(K);Object(O.a)(!U||xe.every(function(Te){return Object(f.a)(Te)==="object"&&("key"in Te||"value"in Te)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(O.a)(!Q||Array.isArray(K),"`value` should be array when `mode` is `multiple` or `tags`")}if(se){var Re=null;Object(A.a)(se).some(function(Te){if(!N.isValidElement(Te)||!Te.type)return!1;var Oe=Te.type;if(Oe.isSelectOption)return!1;if(Oe.isSelectOptGroup){var Ke=Object(A.a)(Te.props.children).every(function(Qe){return!N.isValidElement(Qe)||!Te.type||Qe.type.isSelectOption?!0:(Re=Qe.type,!1)});return!Ke}return Re=Oe,!0}),Re&&Object(O.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Re.displayName||Re.name||Re,"`.")),Object(O.a)(ee===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var k=_,F=Object(m.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:v,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:k,fillOptionsWithMissingValue:b.a}),L=function(R){Object(P.a)(ne,R);var V=Object(X.a)(ne);function ne(){var se;return Object(J.a)(this,ne),se=V.apply(this,arguments),se.selectRef=N.createRef(),se.focus=function(){se.selectRef.current.focus()},se.blur=function(){se.selectRef.current.blur()},se}return Object(z.a)(ne,[{key:"render",value:function(){return N.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),ne}(N.Component);L.Option=s,L.OptGroup=x;var G=L,j=pe.c=G},M8RZ:function(He,pe,I){"use strict";I.d(pe,"a",function(){return n});var J=I("fWQN"),z=I("mtLc"),P=I("yKVA"),X=I("879j"),N=I("q1tI"),C=I.n(N),B=I("i8i4"),M=I.n(B),n=function(D){Object(P.a)(p,D);var g=Object(X.a)(p);function p(h){var c;Object(J.a)(this,p),c=g.call(this,h);var o=window.document;return c.node=o.createElement("div"),o.body.appendChild(c.node),c}return Object(z.a)(p,[{key:"render",value:function(){var c=this.props.children;return Object(B.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(C.a.Component)},MFOe:function(He,pe,I){(function(J){var z=C(),P=B(),X=M(),N=typeof window!="undefined"?window:J;He.exports={assign:z,create:P,trim:X,bind:n,slice:D,each:g,map:p,pluck:h,isList:c,isFunction:o,isObject:d,Global:N};function C(){return Object.assign?Object.assign:function(a,i,s,S){for(var x=1;x<arguments.length;x++)g(Object(arguments[x]),function(T,A){a[A]=T});return a}}function B(){if(Object.create)return function(i,s,S,x){var T=D(arguments,1);return z.apply(this,[Object.create(i)].concat(T))};{function r(){}return function(i,s,S,x){var T=D(arguments,1);return r.prototype=i,z.apply(this,[new r].concat(T))}}}function M(){return String.prototype.trim?function(a){return String.prototype.trim.call(a)}:function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function n(r,a){return function(){return a.apply(r,Array.prototype.slice.call(arguments,0))}}function D(r,a){return Array.prototype.slice.call(r,a||0)}function g(r,a){h(r,function(i,s){return a(i,s),!1})}function p(r,a){var i=c(r)?[]:{};return h(r,function(s,S){return i[S]=a(s,S),!1}),i}function h(r,a){if(c(r)){for(var i=0;i<r.length;i++)if(a(r[i],i))return r[i]}else for(var s in r)if(r.hasOwnProperty(s)&&a(r[s],s))return r[s]}function c(r){return r!=null&&typeof r!="function"&&typeof r.length=="number"}function o(r){return r&&{}.toString.call(r)==="[object Function]"}function d(r){return r&&{}.toString.call(r)==="[object Object]"}}).call(this,I("IyRk"))},MI8n:function(He,pe,I){"use strict";I.d(pe,"c",function(){return N}),I.d(pe,"b",function(){return n}),I.d(pe,"e",function(){return D}),I.d(pe,"a",function(){return g}),I.d(pe,"d",function(){return p}),I.d(pe,"f",function(){return h});var J=I("/cxE"),z=I("pmY6"),P=I("24hK"),X=I("5Y4S"),N;(function(c){c.None=()=>z.a.None;function o(_){return(k,F=null,L)=>{let G=!1,j;return j=_(R=>G?void 0:(j?j.dispose():G=!0,k.call(F,R)),null,L),G&&j.dispose(),j}}c.once=o;function d(_,k){return x((F,L=null,G)=>_(j=>F.call(L,k(j)),null,G))}c.map=d;function r(_,k){return x((F,L=null,G)=>_(j=>{k(j),F.call(L,j)},null,G))}c.forEach=r;function a(_,k){return x((F,L=null,G)=>_(j=>k(j)&&F.call(L,j),null,G))}c.filter=a;function i(_){return _}c.signal=i;function s(..._){return(k,F=null,L)=>Object(z.e)(..._.map(G=>G(j=>k.call(F,j),null,L)))}c.any=s;function S(_,k,F){let L=F;return d(_,G=>(L=k(L,G),L))}c.reduce=S;function x(_){let k;const F=new n({onFirstListenerAdd(){k=_(F.fire,F)},onLastListenerRemove(){k.dispose()}});return F.event}function T(_,k,F=100,L=!1,G){let j,R,V,ne=0;const se=new n({leakWarningThreshold:G,onFirstListenerAdd(){j=_(Se=>{ne++,R=k(R,Se),L&&!V&&(se.fire(R),R=void 0),clearTimeout(V),V=setTimeout(()=>{const De=R;R=void 0,V=void 0,(!L||ne>1)&&se.fire(De),ne=0},F)})},onLastListenerRemove(){j.dispose()}});return se.event}c.debounce=T;function A(_,k=(F,L)=>F===L){let F=!0,L;return a(_,G=>{const j=F||!k(G,L);return F=!1,L=G,j})}c.latch=A;function w(_,k){return[c.filter(_,k),c.filter(_,F=>!k(F))]}c.split=w;function v(_,k=!1,F=[]){let L=F.slice(),G=_(V=>{L?L.push(V):R.fire(V)});const j=()=>{L&&L.forEach(V=>R.fire(V)),L=null},R=new n({onFirstListenerAdd(){G||(G=_(V=>R.fire(V)))},onFirstListenerDidAdd(){L&&(k?setTimeout(j):j())},onLastListenerRemove(){G&&G.dispose(),G=null}});return R.event}c.buffer=v;class b{constructor(_){this.event=_}map(_){return new b(d(this.event,_))}forEach(_){return new b(r(this.event,_))}filter(_){return new b(a(this.event,_))}reduce(_,k){return new b(S(this.event,_,k))}latch(){return new b(A(this.event))}debounce(_,k=100,F=!1,L){return new b(T(this.event,_,k,F,L))}on(_,k,F){return this.event(_,k,F)}once(_,k,F){return o(this.event)(_,k,F)}}function m(_){return new b(_)}c.chain=m;function f(_,k,F=L=>L){const L=(...V)=>R.fire(F(...V)),G=()=>_.on(k,L),j=()=>_.removeListener(k,L),R=new n({onFirstListenerAdd:G,onLastListenerRemove:j});return R.event}c.fromNodeEventEmitter=f;function O(_,k,F=L=>L){const L=(...V)=>R.fire(F(...V)),G=()=>_.addEventListener(k,L),j=()=>_.removeEventListener(k,L),R=new n({onFirstListenerAdd:G,onLastListenerRemove:j});return R.event}c.fromDOMEventEmitter=O;function E(_){return new Promise(k=>o(_)(k))}c.toPromise=E})(N||(N={}));class C{constructor(c){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${c}_${C._idPool++}`}start(c){this._stopWatch=new X.a(!0),this._listenerCount=c}stop(){if(this._stopWatch){const c=this._stopWatch.elapsed();this._elapsedOverall+=c,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${c.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}C._idPool=0;let B=-1;class M{constructor(c,o=Math.random().toString(18).slice(2,5)){this.customThreshold=c,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(c){let o=B;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||c<o)return;this._stacks||(this._stacks=new Map);const d=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),r=this._stacks.get(d)||0;if(this._stacks.set(d,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let a,i=0;for(const[s,S]of this._stacks)(!a||i<S)&&(a=s,i=S);console.warn(`[${this.name}] potential listener LEAK detected, having ${c} listeners already. MOST frequent listener (${i}):`),console.warn(a)}return()=>{const a=this._stacks.get(d)||0;this._stacks.set(d,a-1)}}}class n{constructor(c){var o;this._disposed=!1,this._options=c,this._leakageMon=B>0?new M(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new C(this._options._profName):void 0}get event(){return this._event||(this._event=(c,o,d)=>{var r;this._listeners||(this._listeners=new P.a);const a=this._listeners.isEmpty();a&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(o?[c,o]:c);a&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,c,o);const s=(r=this._leakageMon)===null||r===void 0?void 0:r.check(this._listeners.size),S=Object(z.i)(()=>{if(s&&s(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const x=this._listeners&&!this._listeners.isEmpty();x||this._options.onLastListenerRemove(this)}});return d instanceof z.b?d.add(S):Array.isArray(d)&&d.push(S),S}),this._event}fire(c){var o,d;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let r of this._listeners)this._deliveryQueue.push([r,c]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[r,a]=this._deliveryQueue.shift();try{typeof r=="function"?r.call(void 0,a):r[0].call(r[1],a)}catch(i){Object(J.f)(i)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var c,o,d,r,a;this._disposed||(this._disposed=!0,(c=this._listeners)===null||c===void 0||c.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(r=(d=this._options)===null||d===void 0?void 0:d.onLastListenerRemove)===null||r===void 0||r.call(d),(a=this._leakageMon)===null||a===void 0||a.dispose())}}class D extends n{constructor(c){super(c);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=c==null?void 0:c.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const c=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(c))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(c){this._listeners&&(this._isPaused!==0?this._eventQueue.push(c):super.fire(c))}}class g extends D{constructor(c){var o;super(c);this._delay=(o=c.delay)!==null&&o!==void 0?o:100}fire(c){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(c)}}class p{constructor(){this.buffers=[]}wrapEvent(c){return(o,d,r)=>c(a=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>o.call(d,a)):o.call(d,a)},void 0,r)}bufferEvents(c){const o=[];this.buffers.push(o);const d=c();return this.buffers.pop(),o.forEach(r=>r()),d}}class h{constructor(){this.listening=!1,this.inputEvent=N.None,this.inputEventListener=z.a.None,this.emitter=new n({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(c){this.inputEvent=c,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=c(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(He,pe,I){"use strict";(function(J,z){I.d(pe,"b",function(){return d}),I.d(pe,"i",function(){return s}),I.d(pe,"f",function(){return S}),I.d(pe,"d",function(){return x}),I.d(pe,"g",function(){return T}),I.d(pe,"h",function(){return A}),I.d(pe,"c",function(){return w}),I.d(pe,"k",function(){return v}),I.d(pe,"j",function(){return b}),I.d(pe,"a",function(){return m}),I.d(pe,"e",function(){return E});var P;const X="en";let N=!1,C=!1,B=!1,M=!1,n=!1,D=!1,g=!1,p,h=X,c,o;const d=typeof self=="object"?self:typeof J=="object"?J:{};let r;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?r=d.vscode.process:typeof z!="undefined"&&(r=z);const a=typeof((P=r==null?void 0:r.versions)===null||P===void 0?void 0:P.electron)=="string"&&r.type==="renderer";if(typeof navigator=="object"&&!a)o=navigator.userAgent,N=o.indexOf("Windows")>=0,C=o.indexOf("Macintosh")>=0,g=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,B=o.indexOf("Linux")>=0,D=!0,p=navigator.language,h=p;else if(typeof r=="object"){N=r.platform==="win32",C=r.platform==="darwin",B=r.platform==="linux",M=B&&!!r.env.SNAP&&!!r.env.SNAP_REVISION,p=X,h=X;const _=r.env.VSCODE_NLS_CONFIG;if(_)try{const k=JSON.parse(_),F=k.availableLanguages["*"];p=k.locale,h=F||X,c=k._translationsConfigFile}catch(k){}n=!0}else console.error("Unable to resolve platform.");let i=0;C?i=1:N?i=3:B&&(i=2);const s=N,S=C,x=B,T=n,A=D,w=g,v=o,b=function(){if(d.setImmediate)return d.setImmediate.bind(d);if(typeof d.postMessage=="function"&&!d.importScripts){let F=[];d.addEventListener("message",G=>{if(G.data&&G.data.vscodeSetImmediateId)for(let j=0,R=F.length;j<R;j++){const V=F[j];if(V.id===G.data.vscodeSetImmediateId){F.splice(j,1),V.callback();return}}});let L=0;return G=>{const j=++L;F.push({id:j,callback:G}),d.postMessage({vscodeSetImmediateId:j},"*")}}if(typeof(r==null?void 0:r.nextTick)=="function")return r.nextTick.bind(r);const k=Promise.resolve();return F=>k.then(F)}(),m=C||g?2:N?1:3;let f=!0,O=!1;function E(){if(!O){O=!0;const _=new Uint8Array(2);_[0]=1,_[1]=2;const k=new Uint16Array(_.buffer);f=k[0]===(2<<8)+1}return f}}).call(this,I("IyRk"),I("Q2Ig"))},MVJL:function(He,pe,I){He.exports={flex_box_center:"flex_box_center___2gBaY",flex_space_between:"flex_space_between___2uD--",flex_box_vertical_center:"flex_box_vertical_center___3Bq-4",flex_box_center_end:"flex_box_center_end___2MOXm",flex_box_column:"flex_box_column___1Sq4x",discussItem:"discussItem___Mk503",wrap:"wrap___VPGVq",list:"list___2zNHf",btns:"btns___1hoB3",secondLevelDiscuss:"secondLevelDiscuss___9Ixoa",line:"line___20Ukm",thirdlyLevelDiscuss:"thirdlyLevelDiscuss___3ZS-s"}},N0LK:function(He,pe,I){"use strict";I.d(pe,"C",function(){return J}),I.d(pe,"v",function(){return P}),I.d(pe,"s",function(){return X}),I.d(pe,"t",function(){return N}),I.d(pe,"U",function(){return C}),I.d(pe,"J",function(){return B}),I.d(pe,"O",function(){return M}),I.d(pe,"p",function(){return n}),I.d(pe,"T",function(){return D}),I.d(pe,"q",function(){return g}),I.d(pe,"N",function(){return p}),I.d(pe,"M",function(){return h}),I.d(pe,"Q",function(){return c}),I.d(pe,"u",function(){return o}),I.d(pe,"x",function(){return d}),I.d(pe,"I",function(){return r}),I.d(pe,"f",function(){return a}),I.d(pe,"h",function(){return i}),I.d(pe,"g",function(){return s}),I.d(pe,"i",function(){return S}),I.d(pe,"G",function(){return x}),I.d(pe,"H",function(){return T}),I.d(pe,"r",function(){return A}),I.d(pe,"R",function(){return w}),I.d(pe,"d",function(){return v}),I.d(pe,"e",function(){return b}),I.d(pe,"E",function(){return m}),I.d(pe,"F",function(){return f}),I.d(pe,"j",function(){return O}),I.d(pe,"z",function(){return E}),I.d(pe,"K",function(){return k}),I.d(pe,"L",function(){return F}),I.d(pe,"m",function(){return G}),I.d(pe,"k",function(){return R}),I.d(pe,"A",function(){return ne}),I.d(pe,"a",function(){return se}),I.d(pe,"n",function(){return Se}),I.d(pe,"l",function(){return De}),I.d(pe,"D",function(){return Ae}),I.d(pe,"B",function(){return ke}),I.d(pe,"b",function(){return je}),I.d(pe,"S",function(){return Be}),I.d(pe,"o",function(){return we}),I.d(pe,"P",function(){return Z}),I.d(pe,"w",function(){return U}),I.d(pe,"c",function(){return K}),I.d(pe,"y",function(){return Q});function J(xe){return!xe||typeof xe!="string"?!0:xe.trim().length===0}const z=/{(\d+)}/g;function P(xe,...Re){return Re.length===0?xe:xe.replace(z,function(Te,Oe){const Ke=parseInt(Oe,10);return isNaN(Ke)||Ke<0||Ke>=Re.length?Te:Re[Ke]})}function X(xe){return xe.replace(/[<>&]/g,function(Re){switch(Re){case"<":return"<";case">":return">";case"&":return"&";default:return Re}})}function N(xe){return xe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function C(xe,Re=" "){const Te=B(xe,Re);return M(Te,Re)}function B(xe,Re){if(!xe||!Re)return xe;const Te=Re.length;if(Te===0||xe.length===0)return xe;let Oe=0;for(;xe.indexOf(Re,Oe)===Oe;)Oe=Oe+Te;return xe.substring(Oe)}function M(xe,Re){if(!xe||!Re)return xe;const Te=Re.length,Oe=xe.length;if(Te===0||Oe===0)return xe;let Ke=Oe,Qe=-1;for(;!(Qe=xe.lastIndexOf(Re,Ke-1),Qe===-1||Qe+Te!==Ke);){if(Qe===0)return"";Ke=Qe}return xe.substring(0,Ke)}function n(xe){return xe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(xe){return xe.replace(/\*/g,"")}function g(xe,Re,Te={}){if(!xe)throw new Error("Cannot create regex from empty string");Re||(xe=N(xe)),Te.wholeWord&&(/\B/.test(xe.charAt(0))||(xe="\\b"+xe),/\B/.test(xe.charAt(xe.length-1))||(xe=xe+"\\b"));let Oe="";return Te.global&&(Oe+="g"),Te.matchCase||(Oe+="i"),Te.multiline&&(Oe+="m"),Te.unicode&&(Oe+="u"),new RegExp(xe,Oe)}function p(xe){if(xe.source==="^"||xe.source==="^$"||xe.source==="$"||xe.source==="^\\s*$")return!1;const Re=xe.exec("");return!!(Re&&xe.lastIndex===0)}function h(xe){return(xe.global?"g":"")+(xe.ignoreCase?"i":"")+(xe.multiline?"m":"")+(xe.unicode?"u":"")}function c(xe){return xe.split(/\r\n|\r|\n/)}function o(xe){for(let Re=0,Te=xe.length;Re<Te;Re++){const Oe=xe.charCodeAt(Re);if(Oe!==32&&Oe!==9)return Re}return-1}function d(xe,Re=0,Te=xe.length){for(let Oe=Re;Oe<Te;Oe++){const Ke=xe.charCodeAt(Oe);if(Ke!==32&&Ke!==9)return xe.substring(Re,Oe)}return xe.substring(Re,Te)}function r(xe,Re=xe.length-1){for(let Te=Re;Te>=0;Te--){const Oe=xe.charCodeAt(Te);if(Oe!==32&&Oe!==9)return Te}return-1}function a(xe,Re){return xe<Re?-1:xe>Re?1:0}function i(xe,Re,Te=0,Oe=xe.length,Ke=0,Qe=Re.length){for(;Te<Oe&&Ke<Qe;Te++,Ke++){let xt=xe.charCodeAt(Te),wt=Re.charCodeAt(Ke);if(xt<wt)return-1;if(xt>wt)return 1}const st=Oe-Te,ut=Qe-Ke;return st<ut?-1:st>ut?1:0}function s(xe,Re){return S(xe,Re,0,xe.length,0,Re.length)}function S(xe,Re,Te=0,Oe=xe.length,Ke=0,Qe=Re.length){for(;Te<Oe&&Ke<Qe;Te++,Ke++){let xt=xe.charCodeAt(Te),wt=Re.charCodeAt(Ke);if(xt===wt)continue;if(xt>=128||wt>=128)return i(xe.toLowerCase(),Re.toLowerCase(),Te,Oe,Ke,Qe);x(xt)&&(xt-=32),x(wt)&&(wt-=32);const Fe=xt-wt;if(Fe===0)continue;return Fe}const st=Oe-Te,ut=Qe-Ke;return st<ut?-1:st>ut?1:0}function x(xe){return xe>=97&&xe<=122}function T(xe){return xe>=65&&xe<=90}function A(xe,Re){return xe.length===Re.length&&S(xe,Re)===0}function w(xe,Re){const Te=Re.length;return Re.length>xe.length?!1:S(xe,Re,0,Te)===0}function v(xe,Re){let Te,Oe=Math.min(xe.length,Re.length);for(Te=0;Te<Oe;Te++)if(xe.charCodeAt(Te)!==Re.charCodeAt(Te))return Te;return Oe}function b(xe,Re){let Te,Oe=Math.min(xe.length,Re.length);const Ke=xe.length-1,Qe=Re.length-1;for(Te=0;Te<Oe;Te++)if(xe.charCodeAt(Ke-Te)!==Re.charCodeAt(Qe-Te))return Te;return Oe}function m(xe){return 55296<=xe&&xe<=56319}function f(xe){return 56320<=xe&&xe<=57343}function O(xe,Re){return(xe-55296<<10)+(Re-56320)+65536}function E(xe,Re,Te){const Oe=xe.charCodeAt(Te);if(m(Oe)&&Te+1<Re){const Ke=xe.charCodeAt(Te+1);if(f(Ke))return O(Oe,Ke)}return Oe}function _(xe,Re){const Te=xe.charCodeAt(Re-1);if(f(Te)&&Re>1){const Oe=xe.charCodeAt(Re-2);if(m(Oe))return O(Oe,Te)}return Te}function k(xe,Re){const Te=ee.getInstance(),Oe=Re,Ke=xe.length,Qe=E(xe,Ke,Re);Re+=Qe>=65536?2:1;let st=Te.getGraphemeBreakType(Qe);for(;Re<Ke;){const ut=E(xe,Ke,Re),xt=Te.getGraphemeBreakType(ut);if(K(st,xt))break;Re+=ut>=65536?2:1,st=xt}return Re-Oe}function F(xe,Re){const Te=ee.getInstance(),Oe=Re,Ke=_(xe,Re);Re-=Ke>=65536?2:1;let Qe=Te.getGraphemeBreakType(Ke);for(;Re>0;){const st=_(xe,Re),ut=Te.getGraphemeBreakType(st);if(K(ut,Qe))break;Re-=st>=65536?2:1,Qe=ut}return Oe-Re}const L=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function G(xe){return L.test(xe)}const j=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function R(xe){return j.test(xe)}const V=/^[\t\n\r\x20-\x7E]*$/;function ne(xe){return V.test(xe)}const se=/[\u2028\u2029]/;function Se(xe){return se.test(xe)}function De(xe){for(let Re=0,Te=xe.length;Re<Te;Re++)if(Ae(xe.charCodeAt(Re)))return!0;return!1}function Ae(xe){return xe=+xe,xe>=11904&&xe<=55215||xe>=63744&&xe<=64255||xe>=65281&&xe<=65374}function ke(xe){return xe>=127462&&xe<=127487||xe===8986||xe===8987||xe===9200||xe===9203||xe>=9728&&xe<=10175||xe===11088||xe===11093||xe>=127744&&xe<=128591||xe>=128640&&xe<=128764||xe>=128992&&xe<=129003||xe>=129280&&xe<=129535||xe>=129648&&xe<=129750}const je=String.fromCharCode(65279);function Be(xe){return!!(xe&&xe.length>0&&xe.charCodeAt(0)===65279)}function we(xe,Re=!1){return xe?(Re&&(xe=xe.replace(/\\./g,"")),xe.toLowerCase()!==xe):!1}function Z(xe){const Re=90-65+1;return xe=xe%(2*Re),xe<Re?String.fromCharCode(97+xe):String.fromCharCode(65+xe-Re)}function U(xe){const Re=ee.getInstance();return Re.getGraphemeBreakType(xe)}function K(xe,Re){return xe===0?Re!==5&&Re!==7:xe===2&&Re===3?!1:xe===4||xe===2||xe===3||(Re===4||Re===2||Re===3)?!0:xe===8&&(Re===8||Re===9||Re===11||Re===12)||((xe===11||xe===9)&&(Re===9||Re===10)||((xe===12||xe===10)&&Re===10||(Re===5||Re===13||(Re===7||(xe===1||xe===13&&Re===14)))))?!1:!(xe===6&&Re===6)}class ee{constructor(){this._data=oe()}static getInstance(){return ee._INSTANCE||(ee._INSTANCE=new ee),ee._INSTANCE}getGraphemeBreakType(xe){if(xe<32)return xe===10?3:xe===13?2:4;if(xe<127)return 0;const Re=this._data,Te=Re.length/3;let Oe=1;for(;Oe<=Te;)if(xe<Re[3*Oe])Oe=2*Oe;else if(xe>Re[3*Oe+1])Oe=2*Oe+1;else return Re[3*Oe+2];return 0}}ee._INSTANCE=null;function oe(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Q(xe,Re){if(xe===0)return 0;const Te=Ce(xe,Re);if(Te!==void 0)return Te;const Oe=_(Re,xe);return xe-=ze(Oe),xe}function Ce(xe,Re){let Te=_(Re,xe);for(xe-=ze(Te);nt(Te)||Te===65039||Te===8419;){if(xe===0)return;Te=_(Re,xe),xe-=ze(Te)}if(!ke(Te))return;if(xe>=0){const Oe=_(Re,xe);Oe===8205&&(xe-=ze(Oe))}return xe}function ze(xe){return xe>=65536?2:1}function nt(xe){return 127995<=xe&&xe<=127999}},NvD2:function(He,pe,I){"use strict";I.d(pe,"a",function(){return C});var J=I("Kwbf");function z(B,M){var n=new Set;return B.forEach(function(D){M.has(D)||n.add(D)}),n}function P(B){var M=B||{},n=M.disabled,D=M.disableCheckbox,g=M.checkable;return!!(n||D)||g===!1}function X(B,M,n,D){for(var g=new Set(B),p=new Set,h=0;h<=n;h+=1){var c=M.get(h)||new Set;c.forEach(function(a){var i=a.key,s=a.node,S=a.children,x=S===void 0?[]:S;g.has(i)&&!D(s)&&x.filter(function(T){return!D(T.node)}).forEach(function(T){g.add(T.key)})})}for(var o=new Set,d=n;d>=0;d-=1){var r=M.get(d)||new Set;r.forEach(function(a){var i=a.parent,s=a.node;if(D(s)||!a.parent||o.has(a.parent.key))return;if(D(a.parent.node)){o.add(i.key);return}var S=!0,x=!1;(i.children||[]).filter(function(T){return!D(T.node)}).forEach(function(T){var A=T.key,w=g.has(A);S&&!w&&(S=!1),!x&&(w||p.has(A))&&(x=!0)}),S&&g.add(i.key),x&&p.add(i.key),o.add(i.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(z(p,g))}}function N(B,M,n,D,g){for(var p=new Set(B),h=new Set(M),c=0;c<=D;c+=1){var o=n.get(c)||new Set;o.forEach(function(i){var s=i.key,S=i.node,x=i.children,T=x===void 0?[]:x;!p.has(s)&&!h.has(s)&&!g(S)&&T.filter(function(A){return!g(A.node)}).forEach(function(A){p.delete(A.key)})})}h=new Set;for(var d=new Set,r=D;r>=0;r-=1){var a=n.get(r)||new Set;a.forEach(function(i){var s=i.parent,S=i.node;if(g(S)||!i.parent||d.has(i.parent.key))return;if(g(i.parent.node)){d.add(s.key);return}var x=!0,T=!1;(s.children||[]).filter(function(A){return!g(A.node)}).forEach(function(A){var w=A.key,v=p.has(w);x&&!v&&(x=!1),!T&&(v||h.has(w))&&(T=!0)}),x||p.delete(s.key),T&&h.add(s.key),d.add(s.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(z(h,p))}}function C(B,M,n,D){var g=[],p;D?p=D:p=P;var h=new Set(B.filter(function(r){var a=!!n[r];return a||g.push(r),a})),c=new Map,o=0;Object.keys(n).forEach(function(r){var a=n[r],i=a.level,s=c.get(i);s||(s=new Set,c.set(i,s)),s.add(a),o=Math.max(o,i)}),Object(J.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(r){return"'".concat(r,"'")}).join(", ")));var d;return M===!0?d=X(h,c,o,p):d=N(h,M.halfCheckedKeys,c,o,p),d}},OLES:function(He,pe,I){"use strict";var J=I("U8pU"),z=I("VTBJ"),P=I("Ff2n"),X=I("q1tI"),N=I("uciX"),C=I("7ixt"),B=function(h){var c=h.overlay,o=h.prefixCls,d=h.id,r=h.overlayInnerStyle;return X.createElement("div",{className:"".concat(o,"-inner"),id:d,role:"tooltip",style:r},typeof c=="function"?c():c)},M=B,n=function(h,c){var o=h.overlayClassName,d=h.trigger,r=d===void 0?["hover"]:d,a=h.mouseEnterDelay,i=a===void 0?0:a,s=h.mouseLeaveDelay,S=s===void 0?.1:s,x=h.overlayStyle,T=h.prefixCls,A=T===void 0?"rc-tooltip":T,w=h.children,v=h.onVisibleChange,b=h.afterVisibleChange,m=h.transitionName,f=h.animation,O=h.placement,E=O===void 0?"right":O,_=h.align,k=_===void 0?{}:_,F=h.destroyTooltipOnHide,L=F===void 0?!1:F,G=h.defaultVisible,j=h.getTooltipContainer,R=h.overlayInnerStyle,V=Object(P.a)(h,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ne=Object(X.useRef)(null);Object(X.useImperativeHandle)(c,function(){return ne.current});var se=Object(z.a)({},V);"visible"in h&&(se.popupVisible=h.visible);var Se=function(){var Be=h.arrowContent,we=Be===void 0?null:Be,Z=h.overlay,U=h.id;return[X.createElement("div",{className:"".concat(A,"-arrow"),key:"arrow"},we),X.createElement(M,{key:"content",prefixCls:A,id:U,overlay:Z,overlayInnerStyle:R})]},De=!1,Ae=!1;if(typeof L=="boolean")De=L;else if(L&&Object(J.a)(L)==="object"){var ke=L.keepParent;De=ke===!0,Ae=ke===!1}return X.createElement(N.a,Object.assign({popupClassName:o,prefixCls:A,popup:Se,action:r,builtinPlacements:C.a,popupPlacement:E,ref:ne,popupAlign:k,getPopupContainer:j,onPopupVisibleChange:v,afterPopupVisibleChange:b,popupTransitionName:m,popupAnimation:f,defaultPopupVisible:G,destroyPopupOnHide:De,autoDestroy:Ae,mouseLeaveDelay:S,popupStyle:x,mouseEnterDelay:i},se),w)},D=Object(X.forwardRef)(n),g=pe.a=D},OZM5:function(He,pe,I){"use strict";I.d(pe,"b",function(){return D}),I.d(pe,"a",function(){return g}),I.d(pe,"k",function(){return p}),I.d(pe,"h",function(){return h}),I.d(pe,"i",function(){return c}),I.d(pe,"g",function(){return o}),I.d(pe,"c",function(){return d}),I.d(pe,"d",function(){return r}),I.d(pe,"j",function(){return s}),I.d(pe,"e",function(){return S}),I.d(pe,"f",function(){return x});var J=I("KQm4"),z=I("U8pU"),P=I("Ff2n"),X=I("q1tI"),N=I.n(X),C=I("Kwbf"),B=I("WaYH"),M=.25,n=2;function D(T,A){var w=T.slice(),v=w.indexOf(A);return v>=0&&w.splice(v,1),w}function g(T,A){var w=T.slice();return w.indexOf(A)===-1&&w.push(A),w}function p(T){return T.split("-")}function h(T,A){return"".concat(T,"-").concat(A)}function c(T){return T&&T.type&&T.type.isTreeNode}function o(T,A){var w=[T],v=A[T];function b(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];m.forEach(function(f){var O=f.key,E=f.children;w.push(O),b(E)})}return b(v.children),w}function d(T,A){var w=T.clientY,v=A.selectHandle.getBoundingClientRect(),b=v.top,m=v.bottom,f=v.height,O=Math.max(f*M,n);return w<=b+O?-1:w>=m-O?1:0}function r(T,A){if(!T)return;var w=A.multiple;return w?T.slice():T.length?[T[0]]:T}var a=function(A){return A};function i(T,A){if(!T)return[];var w=A||{},v=w.processProps,b=v===void 0?a:v,m=Array.isArray(T)?T:[T];return m.map(function(f){var O=f.children,E=Object(P.a)(f,["children"]),_=i(O,A);return N.a.createElement(B.a,Object.assign({},b(E)),_)})}function s(T){if(!T)return null;var A;if(Array.isArray(T))A={checkedKeys:T,halfCheckedKeys:void 0};else if(Object(z.a)(T)==="object")A={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return Object(C.a)(!1,"`checkedKeys` is not an array or an object"),null;return A}function S(T,A){var w=new Set;function v(b){if(w.has(b))return;var m=A[b];if(!m)return;w.add(b);var f=m.parent,O=m.node;if(O.disabled)return;f&&v(f.key)}return(T||[]).forEach(function(b){v(b)}),Object(J.a)(w)}function x(T){var A={};return Object.keys(T).forEach(function(w){(w.startsWith("data-")||w.startsWith("aria-"))&&(A[w]=T[w])}),A}},"OkW/":function(He,pe,I){},Ot1p:function(He,pe,I){"use strict";var J=I("2qtc"),z=I("kLXV"),P=I("rAM+"),X=I("miYZ"),N=I("tsqr"),C=I("9og8"),B=I("tJVT"),M=I("jrin"),n=I("WmNS"),D=I.n(n),g=I("q1tI"),p=I.n(g),h=I("VrN/"),c=I.n(h),o=I("bdgK"),d=I("p77/"),r=I("Bd2K"),a=I("ELLl"),i=I("19Vz"),s=I("lZu9"),S=I("+NIl"),x=I("kSUc"),T=I("9Bee"),A=function(Le){var Ne=Le.value,tt=Ne===void 0?"":Ne,gt=Le.className,Ct=Le.showTextOnly,Ot=Le.showLines,St=Le.style,Ye=St===void 0?{}:St,at=Object(g.useMemo)(function(){return""},[tt]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:at}}))},w=I("0Owb"),v=I("dejd"),b=I("C+DQ"),m=I("1vsH"),f=I("m3rI"),O=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function E(Le){var Ne=Le.onActionCallback,tt=Le.title,gt=Le.icon,Ct=Le.actionName,Ot=Le.className,St=Ot===void 0?"":Ot,Ye=Le.children;function at(){Ne(Ct)}return p.a.createElement("a",{title:tt,className:St,onClick:at},p.a.createElement("i",{className:"md-iconfont ".concat(gt)}),Ye)}var _=function(Le){var Ne=Le.watch,tt=Le.showNullButton,gt=Le.onActionCallback,Ct=Le.fullScreen,Ot=Le.insertTemp,St=Le.hidetoolBar,Ye=Le.uuid,at=Le.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(m.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(m.F)("_educoder_session"),"&key=").concat(Ye,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var Ve=[].concat(O,[{title:"".concat(Ne?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ne?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!St&&Ve.map(function(be,Ie){return p.a.createElement("li",{key:Ie},be.actionName?p.a.createElement(E,Object(w.a)({},be,{onActionCallback:gt})):p.a.createElement("span",{className:"v-line"}))}),tt?p.a.createElement("li",null,p.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:gt},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ot&&p.a.createElement("li",null,p.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ot),onActionCallback:gt},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(E,{icon:"".concat(Ct?"icon-shrink":"icon-enlarge"),title:Ct?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:gt})))},k=I("M8RZ"),F=I("+L6B"),L=I("2/Rp"),G=I("y8nQ"),j=I("Vl3Y"),R=I("5NDa"),V=I("5rEg"),ne={labelCol:{span:4},wrapperCol:{span:20}},se=function(Le){var Ne=Le.callback,tt=Le.onCancel;function gt(Ct){Ne(Ct)}return p.a.createElement(j.a,Object(w.a)({},ne,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:gt}),p.a.createElement(j.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(V.a,null)),p.a.createElement(j.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(V.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(L.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(L.a,{type:"ghost",onClick:tt},"\u53D6\u6D88")))},Se=I("7ahc"),De=I("HmJG"),Ae=I("BjJ7"),ke=j.a.useForm,je={width:280,marginRight:10},Be={labelCol:{span:5},wrapperCol:{span:19}},we=function(Le){var Ne=Le.callback,tt=Le.onCancel,gt=ke(),Ct=Object(B.a)(gt,1),Ot=Ct[0];function St(Ve){Ne(Ve)}function Ye(Ve,be){if(Ve.status===-1){N.b.error(Ve.message);return}Ot.setFieldsValue({src:"/api/attachments/".concat(Ve.id),type:be.type})}function at(Ve){var be=Ve.target.files[0];U(be,Ye)}return p.a.createElement(j.a,Object(w.a)({form:Ot},Be,{className:"upload-image-panel",onFinish:St}),p.a.createElement(j.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(j.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(V.a,{style:je})),p.a.createElement(Z,{onFileChange:at}))),p.a.createElement(j.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(V.a,{style:{width:264}})),p.a.createElement(j.a.Item,{style:{textAlign:"right"}},p.a.createElement(L.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(L.a,{type:"ghost",onClick:tt},"\u53D6\u6D88")))};function Z(Le){var Ne=Le.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Ne}))}function U(Le,Ne){if(!Le)throw new String("\u6CA1\u6709\u6587\u4EF6");var tt=new FormData;tt.append("editormd-image-file",Le),tt.append("file_param_name","editormd-image-file"),tt.append("byxhr","true");var gt=new window.XMLHttpRequest;gt.withCredentials=!0,gt.addEventListener("load",function(Ct){Ne(JSON.parse(Ct.target.responseText),Le)},!1),gt.addEventListener("error",function(Ct){console.error(Ct)},!1),gt.open("POST","".concat(Ae.a,"/api/attachments.json")),gt.send(tt)}var K=I("giR+"),ee=I("fyUT"),oe=I("7Kak"),Q=I("9yH6"),Ce=Q.a.Group,ze={margin:"0 8px"},nt=function(Le){var Ne=Le.callback,tt=Le.onCancel;function gt(Ct){Ne(Ct)}return p.a.createElement(j.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:gt},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:ze},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:ze},"\u884C\u6570"),p.a.createElement(j.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(ee.a,null)),p.a.createElement("span",{style:ze},"\u5217\u6570"),p.a.createElement(j.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(ee.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:ze},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(j.a.Item,{name:"align"},p.a.createElement(Ce,null,p.a.createElement(Q.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(Q.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(Q.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(Q.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(L.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(L.a,{type:"ghost",onClick:tt},"\u53D6\u6D88")))},xe=I("ErOA"),Re=I("7Cbv"),Te="link",Oe="upload-image",Ke="code-block",Qe="add-table",st="------------",ut={default:st,left:":".concat(st),center:":".concat(st,":"),right:"".concat(st,":")},xt=I("9VGf"),wt,Fe;function Ue(){}var it=0,lt=1e4,fe="\u2581",ie=`
|
|
**\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 re(Le){return/^\d+$/.test(Le)?"".concat(Le,"px"):Le}var de=navigator.platform.toUpperCase().indexOf("MAC")>=0,me=de?"Cmd":"Ctrl",le=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],he=(wt={},Object(M.a)(wt,me+"-B","bold"),Object(M.a)(wt,me+"-I","italic"),wt),Ee=(Fe={},Object(M.a)(Fe,Te,"\u6DFB\u52A0\u94FE\u63A5"),Object(M.a)(Fe,Ke,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(M.a)(Fe,Oe,"\u6DFB\u52A0\u6587\u4EF6"),Object(M.a)(Fe,Qe,"\u6DFB\u52A0\u8868\u683C"),Fe),ye=pe.a=function(Le){var Ne=Le.defaultValue,tt=Ne===void 0?"":Ne,gt=Le.onChange,Ct=Le.width,Ot=Ct===void 0?"100%":Ct,St=Le.height,Ye=St===void 0?400:St,at=Le.miniToolbar,Ve=at===void 0?!1:at,be=Le.isFocus,Ie=be===void 0?!1:be,ot=Le.watch,Xe=Le.insertTemp,Rt=Le.mode,Lt=Rt===void 0?"markdown":Rt,et=Le.id,dt=et===void 0?"markdown-editor-id":et,vt=Le.showResizeBar,Tt=vt===void 0?!1:vt,Pt=Le.noStorage,_e=Pt===void 0?!1:Pt,ce=Le.showNullButton,W=ce===void 0?!1:ce,Y=Le.hidetoolBar,$=Y===void 0?!1:Y,te=Le.fullScreen,ve=te===void 0?!1:te,Pe=Le.onBlur,Ge=Le.onCMBeforeChange,_t=Le.onFullScreen,bt=Le.className,$e=bt===void 0?"":bt,At=Le.disablePaste,Jt=At===void 0?!1:At,Et=Le.placeholder,sn=Et===void 0?"":Et,Yt=Le.values,Ut=Yt===void 0?"":Yt,pt=Object(g.useState)(null),Cn=Object(B.a)(pt,2),ft=Cn[0],hn=Cn[1],pn=Object(g.useState)(tt),Yn=Object(B.a)(pn,2),ni=Yn[0],En=Yn[1],gi=Object(g.useState)(ot),Jn=Object(B.a)(gi,2),An=Jn[0],Pn=Jn[1],Di=Object(g.useState)(ve),Hi=Object(B.a)(Di,2),vi=Hi[0],ii=Hi[1],_i=Object(g.useState)(""),Qi=Object(B.a)(_i,2),yi=Qi[0],ri=Qi[1],Pi=Object(g.useState)(0),Li=Object(B.a)(Pi,2),Oi=Li[0],Si=Li[1],cr=Object(g.useState)(Ye),_r=Object(B.a)(cr,2),rr=_r[0],Zi=_r[1],Ar=Object(g.useState)(!1),Nr=Object(B.a)(Ar,2),Ur=Nr[0],ar=Nr[1],pi=Object(g.useRef)(Object(Re.a)()),ci=Object(g.useRef)(!1),Yi=Object(g.useRef)(),qi=Object(g.useRef)(),sr=Object(g.useRef)(),er=Object(g.useRef)(),zr=Object(g.useRef)(),ea=function(){var rn=Object(C.a)(D.a.mark(function yn(){var ln,In;return D.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(xe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:pi.current}});case 2:In=Zt.sent,In!=null&&(ln=In.attachments)!==null&&ln!==void 0&&ln.length&&(console.log("cm:",ft,qi),In.attachments.map(function(Dn){Dn.content_type.indexOf("image")>-1?ft.replaceSelection(".concat(Dn.content_type,")")):Dn.content_type.indexOf("video")>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Dn.content_type.indexOf("pdf")>-1?ft.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Dn.id,"?type=").concat(Dn.content_type,'&disposition=inline" target="_blank">').concat(Dn.name,"</a>")):ft.replaceSelection("[".concat(Dn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Dn.id,"?type=").concat(Dn.content_type,")"))}));case 4:case"end":return Zt.stop()}},yn)}));return function(){return rn.apply(this,arguments)}}();Object(g.useEffect)(function(){En(Ut),ft==null||ft.setValue(Ut)},[Ut]),Object(g.useEffect)(function(){_t==null||_t(vi)},[vi]),Object(g.useEffect)(function(){if(qi.current){var rn=c.a.fromTextArea(qi.current,{mode:Lt,lineNumbers:!Ve,lineWrapping:!0,value:tt,autoCloseTags:!0,autoCloseBrackets:!0});Ie&&rn.focus();function yn(ln,In){if(Jt){In.preventDefault();return}var Hn=In.clipboardData;if(Hn){var Zt=Hn.types.toString(),Dn=Hn.items;if(Zt==="Files"||Hn.types.indexOf("Files")>-1){if(In.preventDefault(),Lt=="stex")return;try{var bi,Fi=Dn[1];((bi=Dn[0])===null||bi===void 0?void 0:bi.kind)==="file"&&(Fi=Dn[0]);var Fn=Fi.getAsFile(),fr=Fn.name.split(".").pop();U(Fn,function(Qn){if(Qn.id){var Ze,ht,Nt;(Fn==null||((Ze=Fn.type)===null||Ze===void 0)?void 0:Ze.indexOf("image"))>-1?rn.replaceSelection(".concat(Qn.content_type,")")):(Fn==null||((ht=Fn.type)===null||ht===void 0)?void 0:ht.indexOf("video"))>-1?rn.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Qn.id,'"></video>')):(Fn==null||((Nt=Fn.type)===null||Nt===void 0)?void 0:Nt.indexOf("pdf"))>-1?rn.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Qn.id,"?type=").concat(Fn.type,'&disposition=inline" target="_blank">').concat(Fn.name,"</a>")):le.includes(fr)?rn.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Qn.id,'?type=office&disposition=inline" target="_blank">').concat(Fn.name,"</a>")):rn.replaceSelection("[".concat(Fn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Qn.id,"?type=").concat(Qn.content_type,")"))}else(Qn==null?void 0:Qn.status)===401&&(document.location.href="/user/login")})}catch(Qn){N.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return rn.on("paste",yn),rn.on("dragleave",function(ln,In){sr.current.classList.remove("mouse-hover-md")}),rn.on("dragover",function(ln,In){sr.current.classList.add("mouse-hover-md")}),rn.on("drop",function(ln,In){sr.current.classList.add("mouse-hover-md");var Hn;if(Hn=In.dataTransfer.files,Hn.length>0){In.preventDefault(),In.stopPropagation();for(var Zt=function(Fi){var Fn=Hn[Fi],fr=Fn.name.split(".").pop();U(Fn,function(Qn){if(Qn.id){var Ze,ht,Nt;(Fn==null||((Ze=Fn.type)===null||Ze===void 0)?void 0:Ze.indexOf("image"))>-1?rn.replaceSelection(".concat(Qn.content_type,")")):(Fn==null||((ht=Fn.type)===null||ht===void 0)?void 0:ht.indexOf("video"))>-1?rn.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Qn.id,'"></video>')):(Fn==null||((Nt=Fn.type)===null||Nt===void 0)?void 0:Nt.indexOf("pdf"))>-1?rn.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Qn.id,"?type=").concat(Fn.type,'&disposition=inline" target="_blank">').concat(Fn.name,"</a>")):le.includes(fr)?rn.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Qn.id,'?type=office&disposition=inline" target="_blank">').concat(Fn.name,"</a>")):rn.replaceSelection("[".concat(Fn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Qn.id,"?type=").concat(Qn.content_type,")"))}else(Qn==null?void 0:Qn.status)===401&&(document.location.href="/user/login")})},Dn=0;Dn<Hn.length;Dn++)Zt(Dn)}}),hn(rn),function(){rn.off("paste",yn)}}},[]);var tr=Object(g.useCallback)(function(){if(sr.current)try{}catch(rn){console.log(rn,"---- to set md editor body height")}},[rr,sr,vi]);Object(g.useEffect)(function(){function rn(){var ln=new o.default(function(In){var Hn=Object(P.a)(In),Zt;try{for(Hn.s();!(Zt=Hn.n()).done;){var Dn=Zt.value;(Dn.target.offsetHeight>0||Dn.target.offsetWidth>0)&&(tr(),ft.setSize("100%","100%"),ft.refresh())}}catch(bi){Hn.e(bi)}finally{Hn.f()}});return ln.observe(qi.current.parentElement),ln}if(ft){var yn=rn();return function(){yn.unobserve(qi.current.parentElement)}}},[ft,tr]),Object(g.useEffect)(function(){if(ft){for(var rn=[],yn=function(){var Dn=In[ln];Hn=Object(B.a)(Dn,2);var bi=Hn[0],Fi=Hn[1],Fn=Object(M.a)({},bi,function(){dr(Fi)});rn.push(Fn),ft.addKeyMap(Fn)},ln=0,In=Object.entries(he);ln<In.length;ln++){var Hn;yn()}return Yi.current=setInterval(function(){ci.current&&ea()},4e3),function(){clearInterval(Yi.current);var Zt=Object(P.a)(rn),Dn;try{for(Zt.s();!(Dn=Zt.n()).done;){var bi=Dn.value;ft.removeKeyMap(bi)}}catch(Fi){Zt.e(Fi)}finally{Zt.f()}}}},[ft]),Object(g.useEffect)(function(){ve!==vi&&ii(ve)},[ve]),Object(xt.a)(function(){if(!_e&&Oi>0){var rn=new Date().getTime(),yn=window.sessionStorage.getItem(dt);rn>=Oi+lt&&(!yn||yn!==ni)&&(window.sessionStorage.setItem(dt,ni),ar(!0))}},lt),Object(g.useEffect)(function(){Pn(ot)},[ft,ot]),Object(g.useEffect)(function(){ft&&(Ie&&ft.focus())},[ft,Ie]),Object(g.useEffect)(function(){if(An&&ft){var rn=ft.getScrollerElement();function yn(ln){var In=ln.target;if(zr.current){var Hn=In.scrollTop/In.scrollHeight;zr.current.scrollTop=zr.current.scrollHeight*Hn}}return rn.addEventListener("scroll",yn),function(){rn.removeEventListener("scroll",yn)}}},[ft,An]),Object(g.useEffect)(function(){if(ft&&Ge){function rn(yn,ln){Ge(yn,ln)}return ft.on("beforeChange",rn),function(){ft.off("beforeChange",rn)}}},[ft,Ge]),Object(g.useEffect)(function(){if(ft&&Pe){function rn(){Pe(ft.getValue())}return ft.on("blur",rn),function(){ft.off("blur",rn)}}},[ft,Pe]),Object(g.useEffect)(function(){if(ft){function rn(yn){var ln=yn.getValue();En(ln),Si(new Date().getTime()),yn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),gt&>(ln)}return ft.on("change",rn),function(){ft.off("change",rn)}}},[ft,gt]),Object(g.useEffect)(function(){ft&&(tt==null?(ft.setValue(""),En("")):tt!==ft.getValue()&&(ft.setValue(tt),En(tt),ft.setCursor(ft.lineCount(),0)))},[ft,tt]);var dr=Object(g.useCallback)(function(rn){var yn=ft.getCursor(),ln=ft.getSelection(),In=ln.split(`
|
|
`);switch(rn){case"bold":return ft.replaceSelection("**"+ln+"**"),ln===""&&ft.setCursor(yn.line,yn.ch+2),ft.focus();case"italic":return ft.replaceSelection("*"+ln+"*"),ln===""&&ft.setCursor(yn.line,yn.ch+1),ft.focus();case"code":return ft.replaceSelection("`"+ln+"`"),ln===""&&ft.setCursor(yn.line,yn.ch+1),ft.focus();case"inline-latex":return ft.replaceSelection("`$$"+ln+"$$`"),ln===""&&ft.setCursor(yn.line,yn.ch+3),ft.focus();case"latex":return ft.replaceSelection("```latex\n"+ln+"\n```"),ft.setCursor(yn.line+1,ln.length+1),ft.focus();case"line-break":return ft.replaceSelection(`<br/>
|
|
`),ft.focus();case"list-ul":return ln===""?ft.replaceSelection("- "+ln):ft.replaceSelection(In.map(function(Hn){return Hn===""?"":"- ".concat(Hn)}).join(`
|
|
`)),ft.focus();case"list-ol":return ln===""?ft.replaceSelection("1. "+ln):ft.replaceSelection(In.map(function(Hn,Zt){return Hn===""?"":"".concat(Zt+1,". ").concat(Hn)}).join(`
|
|
`)),ft.focus();case"add-null-ch":return ln===""&&ft.setCursor(yn.line,yn.ch+1),ft.replaceSelection(fe),ft.focus();case"inster-template-1":return ln===""&&ft.setCursor(yn.line,yn.ch),ft.replaceSelection(ie),ft.focus();case"eraser":return ft.setValue(""),ft.focus();case"trigger-watch":return Pn(!An),ft.focus();case"trigger-full-screen":return ii(!vi),ft.focus();case Te:ri(Te);return;case Ke:ri(Ke);return;case Oe:ri(Oe);return;case Qe:ri(Qe);return;default:throw new Error}},[ft,An,vi]),Lr=Object(g.useCallback)(function(rn){ri("");switch(yi){case Te:var yn=rn.title,ln=rn.link;return ft.replaceSelection("[".concat(yn,"](").concat(ln,")")),ft.focus();case Ke:var In=rn.language,Hn=rn.content;return ft.replaceSelection(["```"+In,Hn,"```"].join(`
|
|
`)),ft.focus();case Oe:var Zt=rn.src,Dn=rn.alt;return Dn?ft.replaceSelection(".concat(Zt,' "').concat(Dn,'" )')):ft.replaceSelection("")),ft.focus();case Qe:for(var bi=rn.row,Fi=rn.col,Fn=rn.align,fr=`
|
|
`,Qn=0;Qn<bi;Qn++){for(var Ze=[],ht=[],Nt=0;Nt<Fi;Nt++)Qn===1&&ht.push(ut[Fn]),Ze.push(" ");Qn===1&&(fr+="| ".concat(ht.join(" | "),` |
|
|
`)),fr+="| ".concat(Ze.join(Fi===1?"":" | "),` |
|
|
`)}return ft.replaceSelection(fr+`
|
|
`),ft.focus();default:throw new Error}},[ft,yi]),Br=Object(g.useMemo)(function(){switch(yi){case Te:return p.a.createElement(se,{callback:Lr,onCancel:Ir});case Ke:return p.a.createElement(Se.b,{callback:Lr,onCancel:Ir});case Oe:return p.a.createElement(we,{callback:Lr,onCancel:Ir});case Qe:return p.a.createElement(nt,{callback:Lr,onCancel:Ir});default:return null}},[yi]);function Ir(){ri("")}Object(g.useEffect)(function(){if(er.current){var rn=er.current,yn=!1,ln=0;function In(Dn){yn=!0,ln=Dn.pageY}function Hn(){yn=!1}function Zt(Dn){if(yn){var bi=Dn.pageY-ln;bi<0&&(bi=0),bi>300&&(bi=300);var Fi=Ye+bi+"px";Zi(Fi)}}return rn.addEventListener("mousedown",In),document.addEventListener("mousemove",Zt),document.addEventListener("mouseup",Hn),function(){rn.removeEventListener("mousedown",In),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",Hn)}}},[ft,er]),Object(g.useEffect)(function(){Zi(Ye)},[Ye]);var br=re(Ot),Vr=re(rr),hr={width:br,height:Vr},Xr=Object(g.useMemo)(function(){if(Oi){var rn=new Date(Oi),yn=rn.getHours(),ln=rn.getMinutes(),In=rn.getSeconds();return yn=yn<10?"0"+yn:yn,ln=ln<10?"0"+ln:ln,In=In<10?"0"+In:In,"".concat(yn,":").concat(ln,":").concat(In)}return 0},[Oi]);function Yr(){window.sessionStorage.removeItem(dt),ar(!1),Si(0)}function or(){ar(!1),Si(0),ft.setValue(window.sessionStorage.getItem(dt))}function Jr(rn,yn){var ln=ft.getValue();ln=ln.replace(rn,yn),En(ln),ft==null||ft.setValue(ln)}return p.a.createElement(g.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:sr},p.a.createElement("div",{className:"markdown-editor-container ".concat($e," ").concat(An?"on-preview":""," ").concat(Ve?"mini":""," ").concat(vi?"full-screen":""),style:hr},p.a.createElement(_,{insertTemp:Xe,watch:An,fullScreen:vi,showNullButton:W,onActionCallback:dr,hidetoolBar:$,uuid:pi.current,setOpenPhones:function(){ci.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:qi,placeholder:sn})),An?p.a.createElement("div",{ref:zr,className:"preview-container"},Lt==="stex"&&p.a.createElement(A,{value:ni}),Lt!=="stex"&&p.a.createElement(T.a,{edit:!0,value:ni,replaces:Jr})):null))),Tt?p.a.createElement("a",{ref:er,className:"editor-resize"}):null,p.a.createElement(k.a,null,Ee[yi]?p.a.createElement(z.a,{centered:!0,title:Ee[yi],visible:!0,onCancel:Ir,footer:null,className:"markdown-popup-form"},Br):null))}},P5Jw:function(He,pe,I){"use strict";var J=I("rHrb"),z=J.CopyToClipboard;z.CopyToClipboard=z,He.exports=z},PD8m:function(He,pe){He.exports={name:"memoryStorage",read:J,write:z,each:P,remove:X,clearAll:N};var I={};function J(C){return I[C]}function z(C,B){I[C]=B}function P(C){for(var B in I)I.hasOwnProperty(B)&&C(I[B],B)}function X(C){delete I[C]}function N(C){I={}}},RELg:function(He,pe,I){var J=I("MFOe"),z=J.Global;He.exports={name:"oldIE-userDataStorage",write:B,read:M,each:n,remove:D,clearAll:g};var P="storejs",X=z.document,N=c(),C=(z.navigator?z.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function B(o,d){if(C)return;var r=h(o);N(function(a){a.setAttribute(r,d),a.save(P)})}function M(o){if(C)return;var d=h(o),r=null;return N(function(a){r=a.getAttribute(d)}),r}function n(o){N(function(d){for(var r=d.XMLDocument.documentElement.attributes,a=r.length-1;a>=0;a--){var i=r[a];o(d.getAttribute(i.name),i.name)}})}function D(o){var d=h(o);N(function(r){r.removeAttribute(d),r.save(P)})}function g(){N(function(o){var d=o.XMLDocument.documentElement.attributes;o.load(P);for(var r=d.length-1;r>=0;r--)o.removeAttribute(d[r].name);o.save(P)})}var p=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function h(o){return o.replace(/^\d/,"___$&").replace(p,"___")}function c(){if(!X||!X.documentElement||!X.documentElement.addBehavior)return null;var o="script",d,r,a;try{r=new ActiveXObject("htmlfile"),r.open(),r.write("<"+o+">document.w=window</"+o+'><iframe src="/favicon.ico"></iframe>'),r.close(),d=r.w.frames[0].document,a=d.createElement("div")}catch(i){a=X.createElement("div"),d=X.body}return function(i){var s=[].slice.call(arguments,0);s.unshift(a),d.appendChild(a),a.addBehavior("#default#userData"),a.load(P),i.apply(this,s),d.removeChild(a);return}}},RpDr:function(He,pe,I){"use strict";I.d(pe,"a",function(){return T}),I.d(pe,"c",function(){return v});var J=I("+L6B"),z=I("2/Rp"),P=I("tJVT"),X=I("k1fw"),N=I("jrin"),C=I("5NDa"),B=I("5rEg"),M=I("q1tI"),n=I.n(M),D=I("8Skl"),g=I("y3Kf"),p=I("bdLU"),h=I("J66h"),c=I.n(h),o=I("++UQ"),d=I.n(o),r=I("IxHN"),a=I("9Bee"),i=I("1vsH"),s,S=B.a.TextArea,x={visible:!1,tabIndex:"0"},T=(s={},Object(N.a)(s,p.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(N.a)(s,p.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(N.a)(s,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(N.a)(s,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(N.a)(s,4,"\u7F16\u8BD1\u5931\u8D25"),Object(N.a)(s,5,"\u6267\u884C\u5931\u8D25"),s),A;(function(m){m[m.SET_VISIBLE=0]="SET_VISIBLE",m[m.SET_TABINDEX=1]="SET_TABINDEX"})(A||(A={}));function w(m,f){switch(f.type){case A.SET_VISIBLE:return Object(X.a)(Object(X.a)({},m),{},{visible:f.payload});case A.SET_TABINDEX:return Object(X.a)(Object(X.a)({},m),{},{tabIndex:f.payload});default:throw new Error}}function v(m){var f=m.status,O=m.error_msg,E=m.output,_=m.input,k=m.expected_output,F=m.is_file,L=m.input_file_url,G=m.output_file_url,j=m.expected_output_file_url,R=null,V={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(f){case p.a.NOMATCH:R=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!F&&n.a.createElement(a.a,{value:_,style:V}),F&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.y)(L,_)}},_)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!F&&n.a.createElement(a.a,{value:E&&h.Base64.decode(E)||"",style:V}),F&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.y)(G,E)}},E)),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!F&&n.a.createElement(a.a,{value:k&&h.Base64.decode(k)||"",style:V}),F&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.y)(j,k)}},k)));break;case p.a.EXECUTEFAILURE:R=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!F&&n.a.createElement(a.a,{value:_,style:V}),F&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.y)(L,_)}},_)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},h.Base64.decode(O)));break;case p.a.COMPILEFAILURE:R=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!F&&n.a.createElement(a.a,{value:_,style:V}),F&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.y)(L,_)}},_)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},h.Base64.decode(O)));break;case p.a.PODFAILURE:R=n.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case p.a.TIMEOUT:R=n.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return n.a.createElement(n.a.Fragment,null," ",R," ")}function b(m){var f=m.status,O=m.error_msg,E=m.execute_time,_=m.output,k=m.input,F=m.expected_output,L=m.is_file,G=m.input_file_url,j=m.output_file_url,R=m.expected_output_file_url,V=null;switch(f){case p.a.OK:V=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",E),n.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),n.a.createElement("pre",null,h.Base64.decode(_)));break;case p.a.NOMATCH:V=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u8F93\u5165\uFF1A",n.a.createElement("pre",null,k)),n.a.createElement("p",null,"\u8F93\u51FA\uFF1A",_&&h.Base64.decode(_)),n.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",F&&h.Base64.decode(F)));break;case p.a.EXECUTEFAILURE:V=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",n.a.createElement("pre",null,k)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},h.Base64.decode(O)));break;case p.a.COMPILEFAILURE:V=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",n.a.createElement("pre",null,k)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},h.Base64.decode(O)));break;case p.a.PODFAILURE:V=n.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case p.a.TIMEOUT:V=n.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return n.a.createElement(n.a.Fragment,null," ",V," ")}pe.b=function(m){var f=m.id,O=m.input,E=m.debuging,_=m.submitting,k=m.executingMessage,F=m.debugResult,L=m.onChangeInput,G=m.onDebugCode,j=m.onSubmitCode,R=Object(M.useReducer)(w,x),V=Object(P.a)(R,2),ne=V[0],se=V[1],Se=ne.visible,De=ne.tabIndex;Object(M.useEffect)(function(){se({type:A.SET_VISIBLE,payload:!1})},[f]);function Ae(we){var Z=we.target.id;se({type:A.SET_TABINDEX,payload:Z})}function ke(){se({type:A.SET_VISIBLE,payload:!Se})}var je=Object(M.useMemo)(function(){if(F){var we=F.status;return n.a.createElement(n.a.Fragment,null,b(F))}return null},[F]);function Be(){se({type:A.SET_VISIBLE,payload:!0}),se({type:A.SET_TABINDEX,payload:"1"}),G()}return n.a.createElement("div",{className:"test-case-panel"},n.a.createElement("div",{className:"test-case-panel-body ".concat(Se?"active":"")},n.a.createElement("ul",{className:"s-navs"},n.a.createElement("li",null,n.a.createElement("a",{className:De==="0"?"active":"",id:"0",onClick:Ae},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),n.a.createElement("li",null,n.a.createElement("a",{className:De==="1"?"active":"",id:"1",onClick:Ae},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),n.a.createElement("div",{className:"tab-panel-body ".concat(De==="0"?"":"hide")},n.a.createElement(S,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:O,onChange:L})),n.a.createElement("div",{className:"tab-panel-body ".concat(De==="1"?"":"hide")},E?n.a.createElement(r.a,{message:k}):F?n.a.createElement("section",{style:{height:200}}," ",je," "):n.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),n.a.createElement("a",{className:"btn-collapse ".concat(Se?"up":""),onClick:ke},Se?n.a.createElement(D.a,null):n.a.createElement(g.a,null)),n.a.createElement("footer",{className:"footer"},n.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),n.a.createElement("div",{className:"flex-container"},n.a.createElement(z.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),n.a.createElement(z.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),n.a.createElement(z.a,{className:"btn-green",type:"ghost",loading:E,onClick:Be},"\u8C03\u8BD5\u4EE3\u7801"),n.a.createElement(z.a,{type:"primary",loading:_,disabled:_,onClick:function(){se({type:A.SET_VISIBLE,payload:!1}),j()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(He,pe,I){He.exports=I.p+"static/time.a3dc82f3.svg"},"SA+Z":function(He,pe,I){var J=I("wTVA"),z=I("EbDI"),P=I("ZhPi"),X=I("wkBT");function N(C){return J(C)||z(C)||P(C)||X()}He.exports=N,He.exports.__esModule=!0,He.exports.default=He.exports},SJMd:function(He,pe){/**
|
|
* @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 I,J,z,P=!1,X,N;window.PR_SHOULD_USE_CONTINUATION=!0;var C,B;(function(){var M=window,n=["break,continue,do,else,for,if,return,while"],D=[n,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[g,"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"],h=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[g,"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"],o="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",d=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],r="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",a=[n,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],i=[n,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],s=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[p,c,h,d,r,a,i,s],x=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",A="kwd",w="com",v="typ",b="lit",m="pun",f="pln",O="tag",E="dec",_="src",k="atn",F="atv",L="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function j(Ce){for(var ze=0,nt=!1,xe=!1,Re=0,Te=Ce.length;Re<Te;++Re){var Oe=Ce[Re];if(Oe.ignoreCase)xe=!0;else if(/[a-z]/i.test(Oe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){nt=!0,xe=!1;break}}var Ke={b:8,t:9,n:10,v:11,f:12,r:13};function Qe(Fe){var Ue=Fe.charCodeAt(0);if(Ue!==92)return Ue;var it=Fe.charAt(1);return Ue=Ke[it],Ue||("0"<=it&&it<="7"?parseInt(Fe.substring(1),8):it==="u"||it==="x"?parseInt(Fe.substring(2),16):Fe.charCodeAt(1))}function st(Fe){if(Fe<32)return(Fe<16?"\\x0":"\\x")+Fe.toString(16);var Ue=String.fromCharCode(Fe);return Ue==="\\"||Ue==="-"||Ue==="]"||Ue==="^"?"\\"+Ue:Ue}function ut(Fe){var Ue=Fe.substring(1,Fe.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")),it=[],lt=Ue[0]==="^",fe=["["];lt&&fe.push("^");for(var ie=lt?1:0,re=Ue.length;ie<re;++ie){var de=Ue[ie];if(/\\[bdsw]/i.test(de))fe.push(de);else{var me=Qe(de),le;ie+2<re&&Ue[ie+1]==="-"?(le=Qe(Ue[ie+2]),ie+=2):le=me,it.push([me,le]),le<65||me>122||(le<65||me>90||it.push([Math.max(65,me)|32,Math.min(le,90)|32]),le<97||me>122||it.push([Math.max(97,me)&~32,Math.min(le,122)&~32]))}}it.sort(function(Le,Ne){return Le[0]-Ne[0]||Ne[1]-Le[1]});for(var he=[],Ee=[],ie=0;ie<it.length;++ie){var ye=it[ie];ye[0]<=Ee[1]+1?Ee[1]=Math.max(Ee[1],ye[1]):he.push(Ee=ye)}for(var ie=0;ie<he.length;++ie){var ye=he[ie];fe.push(st(ye[0])),ye[1]>ye[0]&&(ye[1]+1>ye[0]&&fe.push("-"),fe.push(st(ye[1])))}return fe.push("]"),fe.join("")}function xt(Fe){for(var Ue=Fe.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")),it=Ue.length,lt=[],fe=0,ie=0;fe<it;++fe){var re=Ue[fe];if(re==="(")++ie;else if(re.charAt(0)==="\\"){var de=+re.substring(1);de&&(de<=ie?lt[de]=-1:Ue[fe]=st(de))}}for(var fe=1;fe<lt.length;++fe)lt[fe]===-1&&(lt[fe]=++ze);for(var fe=0,ie=0;fe<it;++fe){var re=Ue[fe];if(re==="(")++ie,lt[ie]||(Ue[fe]="(?:");else if(re.charAt(0)==="\\"){var de=+re.substring(1);de&&de<=ie&&(Ue[fe]="\\"+lt[de])}}for(var fe=0;fe<it;++fe)Ue[fe]==="^"&&Ue[fe+1]!=="^"&&(Ue[fe]="");if(Fe.ignoreCase&&nt)for(var fe=0;fe<it;++fe){var re=Ue[fe],me=re.charAt(0);re.length>=2&&me==="["?Ue[fe]=ut(re):me!=="\\"&&(Ue[fe]=re.replace(/[a-zA-Z]/g,function(Ee){var ye=Ee.charCodeAt(0);return"["+String.fromCharCode(ye&~32,ye|32)+"]"}))}return Ue.join("")}for(var wt=[],Re=0,Te=Ce.length;Re<Te;++Re){var Oe=Ce[Re];if(Oe.global||Oe.multiline)throw new Error(""+Oe);wt.push("(?:"+xt(Oe)+")")}return new RegExp(wt.join("|"),xe?"gi":"g")}function R(Ce,ze){var nt=/(?:^|\s)nocode(?:\s|$)/,xe=[],Re=0,Te=[],Oe=0;function Ke(Qe){var st=Qe.nodeType;if(st==1){if(nt.test(Qe.className))return;for(var ut=Qe.firstChild;ut;ut=ut.nextSibling)Ke(ut);var xt=Qe.nodeName.toLowerCase();(xt==="br"||xt==="li")&&(xe[Oe]=`
|
|
`,Te[Oe<<1]=Re++,Te[Oe++<<1|1]=Qe)}else if(st==3||st==4){var wt=Qe.nodeValue;wt.length&&(ze?wt=wt.replace(/\r\n?/g,`
|
|
`):wt=wt.replace(/[ \t\r\n]+/g," "),xe[Oe]=wt,Te[Oe<<1]=Re,Re+=wt.length,Te[Oe++<<1|1]=Qe)}}return Ke(Ce),{sourceCode:xe.join("").replace(/\n$/,""),spans:Te}}function V(Ce,ze,nt,xe,Re){if(!nt)return;var Te={sourceNode:Ce,pre:1,langExtension:null,numberLines:null,sourceCode:nt,spans:null,basePos:ze,decorations:null};xe(Te),Re.push.apply(Re,Te.decorations)}var ne=/\S/;function se(Ce){for(var ze=void 0,nt=Ce.firstChild;nt;nt=nt.nextSibling){var xe=nt.nodeType;ze=xe===1?ze?Ce:nt:xe===3&&ne.test(nt.nodeValue)?Ce:ze}return ze===Ce?void 0:ze}function Se(Ce,ze){var nt={},xe;(function(){for(var Oe=Ce.concat(ze),Ke=[],Qe={},st=0,ut=Oe.length;st<ut;++st){var xt=Oe[st],wt=xt[3];if(wt)for(var Fe=wt.length;--Fe>=0;)nt[wt.charAt(Fe)]=xt;var Ue=xt[1],it=""+Ue;Qe.hasOwnProperty(it)||(Ke.push(Ue),Qe[it]=null)}Ke.push(/[\0-\uffff]/),xe=j(Ke)})();var Re=ze.length,Te=function(Oe){for(var Ke=Oe.sourceCode,Qe=Oe.basePos,st=Oe.sourceNode,ut=[Qe,f],xt=0,wt=Ke.match(xe)||[],Fe={},Ue=0,it=wt.length;Ue<it;++Ue){var lt=wt[Ue],fe=Fe[lt],ie=void 0,re;if(typeof fe=="string")re=!1;else{var de=nt[lt.charAt(0)];if(de)ie=lt.match(de[1]),fe=de[0];else{for(var me=0;me<Re;++me)if(de=ze[me],ie=lt.match(de[1]),ie){fe=de[0];break}ie||(fe=f)}re=fe.length>=5&&fe.substring(0,5)==="lang-",re&&!(ie&&typeof ie[1]=="string")&&(re=!1,fe=_),re||(Fe[lt]=fe)}var le=xt;if(xt+=lt.length,!re)ut.push(Qe+le,fe);else{var he=ie[1],Ee=lt.indexOf(he),ye=Ee+he.length;ie[2]&&(ye=lt.length-ie[2].length,Ee=ye-he.length);var Le=fe.substring(5);V(st,Qe+le,lt.substring(0,Ee),Te,ut),V(st,Qe+le+Ee,he,Z(Le,he),ut),V(st,Qe+le+ye,lt.substring(ye),Te,ut)}}Oe.decorations=ut};return Te}function De(Ce){var ze=[],nt=[];Ce.tripleQuotedStrings?ze.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ce.multiLineStrings?ze.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ze.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ce.verbatimStrings&&nt.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var xe=Ce.hashComments;xe&&(Ce.cStyleComments?(xe>1?ze.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ze.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),nt.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ze.push([w,/^#[^\r\n]*/,null,"#"])),Ce.cStyleComments&&(nt.push([w,/^\/\/[^\r\n]*/,null]),nt.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Re=Ce.regexLiterals;if(Re){var Te=Re>1?"":`
|
|
\r`,Oe=Te?".":"[\\S\\s]",Ke="/(?=[^/*"+Te+"])(?:[^/\\x5B\\x5C"+Te+"]|\\x5C"+Oe+"|\\x5B(?:[^\\x5C\\x5D"+Te+"]|\\x5C"+Oe+")*(?:\\x5D|$))+/";nt.push(["lang-regex",RegExp("^"+G+"("+Ke+")")])}var Qe=Ce.types;Qe&&nt.push([v,Qe]);var st=(""+Ce.keywords).replace(/^ | $/g,"");st.length&&nt.push([A,new RegExp("^(?:"+st.replace(/[\s,]+/g,"|")+")\\b"),null]),ze.push([f,/^\s+/,null,` \r
|
|
\xA0`]);var ut="^.[^\\s\\w.$@'\"`/\\\\]*";return Ce.regexLiterals&&(ut+="(?!s*/)"),nt.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[v,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[m,new RegExp(ut),null]),Se(ze,nt)}var Ae=De({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ke(Ce,ze,nt){for(var xe=/(?:^|\s)nocode(?:\s|$)/,Re=/\r\n?|\n/,Te=Ce.ownerDocument,Oe=Te.createElement("li");Ce.firstChild;)Oe.appendChild(Ce.firstChild);var Ke=[Oe];function Qe(Ue){var it=Ue.nodeType;if(it==1&&!xe.test(Ue.className))if(Ue.nodeName==="br")st(Ue),Ue.parentNode&&Ue.parentNode.removeChild(Ue);else for(var lt=Ue.firstChild;lt;lt=lt.nextSibling)Qe(lt);else if((it==3||it==4)&&nt){var fe=Ue.nodeValue,ie=fe.match(Re);if(ie){var re=fe.substring(0,ie.index);Ue.nodeValue=re;var de=fe.substring(ie.index+ie[0].length);if(de){var me=Ue.parentNode;me.insertBefore(Te.createTextNode(de),Ue.nextSibling)}st(Ue),re||Ue.parentNode.removeChild(Ue)}}}function st(Ue){for(;!Ue.nextSibling;)if(Ue=Ue.parentNode,!Ue)return;function it(ie,re){var de=re?ie.cloneNode(!1):ie,me=ie.parentNode;if(me){var le=it(me,1),he=ie.nextSibling;le.appendChild(de);for(var Ee=he;Ee;Ee=he)he=Ee.nextSibling,le.appendChild(Ee)}return de}for(var lt=it(Ue.nextSibling,0),fe;(fe=lt.parentNode)&&fe.nodeType===1;)lt=fe;Ke.push(lt)}for(var ut=0;ut<Ke.length;++ut)Qe(Ke[ut]);ze===(ze|0)&&Ke[0].setAttribute("value",ze);var xt=Te.createElement("ol");xt.className="linenums";for(var wt=Math.max(0,ze-1|0)||0,ut=0,Fe=Ke.length;ut<Fe;++ut)Oe=Ke[ut],Oe.className="L"+(ut+wt)%10,Oe.firstChild||Oe.appendChild(Te.createTextNode("\xA0")),xt.appendChild(Oe);Ce.appendChild(xt)}function je(Ce){var ze=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ze=ze&&+ze[1]<=8;var nt=/\n/g,xe=Ce.sourceCode,Re=xe.length,Te=0,Oe=Ce.spans,Ke=Oe.length,Qe=0,st=Ce.decorations,ut=st.length,xt=0;st[ut]=Re;var wt,Fe;for(Fe=wt=0;Fe<ut;)st[Fe]!==st[Fe+2]?(st[wt++]=st[Fe++],st[wt++]=st[Fe++]):Fe+=2;for(ut=wt,Fe=wt=0;Fe<ut;){for(var Ue=st[Fe],it=st[Fe+1],lt=Fe+2;lt+2<=ut&&st[lt+1]===it;)lt+=2;st[wt++]=Ue,st[wt++]=it,Fe=lt}ut=st.length=wt;var fe=Ce.sourceNode,ie="";fe&&(ie=fe.style.display,fe.style.display="none");try{for(var re=null;Qe<Ke;){var de=Oe[Qe],me=Oe[Qe+2]||Re,le=st[xt+2]||Re,lt=Math.min(me,le),he=Oe[Qe+1],Ee;if(he.nodeType!==1&&(Ee=xe.substring(Te,lt))){ze&&(Ee=Ee.replace(nt,"\r")),he.nodeValue=Ee;var ye=he.ownerDocument,Le=ye.createElement("span");Le.className=st[xt+1];var Ne=he.parentNode;Ne.replaceChild(Le,he),Le.appendChild(he),Te<me&&(Oe[Qe+1]=he=ye.createTextNode(xe.substring(lt,me)),Ne.insertBefore(he,Le.nextSibling))}Te=lt,Te>=me&&(Qe+=2),Te>=le&&(xt+=2)}}finally{fe&&(fe.style.display=ie)}}var Be={};function we(Ce,ze){for(var nt=ze.length;--nt>=0;){var xe=ze[nt];Be.hasOwnProperty(xe)?M.console&&console.warn("cannot override language handler %s",xe):Be[xe]=Ce}}function Z(Ce,ze){return Ce&&Be.hasOwnProperty(Ce)||(Ce=/^\s*</.test(ze)?"default-markup":"default-code"),Be[Ce]}we(Ae,["default-code"]),we(Se([],[[f,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[w,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[m,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),we(Se([[f,/^[\s]+/,null,` \r
|
|
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[O,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[k,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[m,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),we(Se([],[[F,/^[\s\S]+/]]),["uq.val"]),we(De({keywords:p,hashComments:!0,cStyleComments:!0,types:x}),["c","cc","cpp","cxx","cyc","m"]),we(De({keywords:"null,true,false"}),["json"]),we(De({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:x}),["cs"]),we(De({keywords:h,cStyleComments:!0}),["java"]),we(De({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),we(De({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),we(De({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),we(De({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),we(De({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),we(De({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),we(Se([],[[T,/^[\s\S]+/]]),["regex"]);function U(Ce){var ze=Ce.langExtension;try{var nt=R(Ce.sourceNode,Ce.pre),xe=nt.sourceCode;Ce.sourceCode=xe,Ce.spans=nt.spans,Ce.basePos=0,Z(ze,xe)(Ce),je(Ce)}catch(Re){M.console&&console.log(Re&&Re.stack||Re)}}function K(Ce,ze,nt){var xe=nt||!1,Re=ze||null,Te=document.createElement("div");Te.innerHTML="<pre>"+Ce+"</pre>",Te=Te.firstChild,xe&&ke(Te,xe,!0);var Oe={langExtension:Re,numberLines:xe,sourceNode:Te,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return U(Oe),Te.innerHTML}function ee(Ce,ze){var nt=ze||document.body,xe=nt.ownerDocument||document;function Re(de){return nt.getElementsByTagName(de)}for(var Te=[Re("pre"),Re("code"),Re("xmp")],Oe=[],Ke=0;Ke<Te.length;++Ke)for(var Qe=0,st=Te[Ke].length;Qe<st;++Qe)Oe.push(Te[Ke][Qe]);Te=null;var ut=Date;ut.now||(ut={now:function(){return+new Date}});var xt=0,wt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Fe=/\bprettyprint\b/,Ue=/\bprettyprinted\b/,it=/pre|xmp/i,lt=/^code$/i,fe=/^(?:pre|code|xmp)$/i,ie={};function re(){for(var de=M.PR_SHOULD_USE_CONTINUATION?ut.now()+250:Infinity;xt<Oe.length&&ut.now()<de;xt++){for(var me=Oe[xt],le=ie,he=me;he=he.previousSibling;){var Ee=he.nodeType,ye=(Ee===7||Ee===8)&&he.nodeValue;if(ye?!/^\??prettify\b/.test(ye):Ee!==3||/\S/.test(he.nodeValue))break;if(ye){le={},ye.replace(/\b(\w+)=([\w:.%+-]+)/g,function(ot,Xe,Rt){le[Xe]=Rt});break}}var Le=me.className;if((le!==ie||Fe.test(Le))&&!Ue.test(Le)){for(var Ne=!1,tt=me.parentNode;tt;tt=tt.parentNode){var gt=tt.tagName;if(fe.test(gt)&&tt.className&&Fe.test(tt.className)){Ne=!0;break}}if(!Ne){me.className+=" prettyprinted";var Ct=le.lang;if(!Ct){Ct=Le.match(wt);var Ot;!Ct&&(Ot=se(me))&<.test(Ot.tagName)&&(Ct=Ot.className.match(wt)),Ct&&(Ct=Ct[1])}var St;if(it.test(me.tagName))St=1;else{var Ye=me.currentStyle,at=xe.defaultView,Ve=Ye?Ye.whiteSpace:at&&at.getComputedStyle?at.getComputedStyle(me,null).getPropertyValue("white-space"):0;St=Ve&&Ve.substring(0,3)==="pre"}var be=le.linenums;(be=be==="true"||+be)||(be=Le.match(/\blinenums\b(?::(\d+))?/),be=be?be[1]&&be[1].length?+be[1]:!0:!1),be&&ke(me,be,St);var Ie={langExtension:Ct,sourceNode:me,numberLines:be,pre:St,sourceCode:null,basePos:null,spans:null,decorations:null};U(Ie)}}}xt<Oe.length?M.setTimeout(re,250):typeof Ce=="function"&&Ce()}re()}var oe=M.PR={createSimpleLexer:Se,registerLangHandler:we,sourceDecorator:De,PR_ATTRIB_NAME:k,PR_ATTRIB_VALUE:F,PR_COMMENT:w,PR_DECLARATION:E,PR_KEYWORD:A,PR_LITERAL:b,PR_NOCODE:L,PR_PLAIN:f,PR_PUNCTUATION:m,PR_SOURCE:_,PR_STRING:T,PR_TAG:O,PR_TYPE:v,prettyPrintOne:P?M.prettyPrintOne=K:C=K,prettyPrint:B=P?M.prettyPrint=ee:B=ee},Q=M.define;typeof Q=="function"&&Q.amd&&Q("google-code-prettify",[],function(){return oe})})()},STEk:function(He,pe,I){"use strict";I.d(pe,"a",function(){return we});/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var J=function(Z,U){return(J=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(K,ee){K.__proto__=ee}||function(K,ee){for(var oe in ee)Object.prototype.hasOwnProperty.call(ee,oe)&&(K[oe]=ee[oe])})(Z,U)};function z(Z,U){function K(){this.constructor=Z}J(Z,U),Z.prototype=U===null?Object.create(U):(K.prototype=U.prototype,new K)}function P(Z,U,K,ee){return new(K||(K=Promise))(function(oe,Q){function Ce(xe){try{nt(ee.next(xe))}catch(Re){Q(Re)}}function ze(xe){try{nt(ee.throw(xe))}catch(Re){Q(Re)}}function nt(xe){var Re;xe.done?oe(xe.value):(Re=xe.value,Re instanceof K?Re:new K(function(Te){Te(Re)})).then(Ce,ze)}nt((ee=ee.apply(Z,U||[])).next())})}function X(Z,U){var K,ee,oe,Q,Ce={label:0,sent:function(){if(1&oe[0])throw oe[1];return oe[1]},trys:[],ops:[]};return Q={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function ze(nt){return function(xe){return function(Re){if(K)throw new TypeError("Generator is already executing.");for(;Ce;)try{if(K=1,ee&&(oe=2&Re[0]?ee.return:Re[0]?ee.throw||((oe=ee.return)&&oe.call(ee),0):ee.next)&&!(oe=oe.call(ee,Re[1])).done)return oe;switch(ee=0,oe&&(Re=[2&Re[0],oe.value]),Re[0]){case 0:case 1:oe=Re;break;case 4:return Ce.label++,{value:Re[1],done:!1};case 5:Ce.label++,ee=Re[1],Re=[0];continue;case 7:Re=Ce.ops.pop(),Ce.trys.pop();continue;default:if(!(oe=Ce.trys,(oe=oe.length>0&&oe[oe.length-1])||Re[0]!==6&&Re[0]!==2)){Ce=0;continue}if(Re[0]===3&&(!oe||Re[1]>oe[0]&&Re[1]<oe[3])){Ce.label=Re[1];break}if(Re[0]===6&&Ce.label<oe[1]){Ce.label=oe[1],oe=Re;break}if(oe&&Ce.label<oe[2]){Ce.label=oe[2],Ce.ops.push(Re);break}oe[2]&&Ce.ops.pop(),Ce.trys.pop();continue}Re=U.call(Z,Ce)}catch(Te){Re=[6,Te],ee=0}finally{K=oe=0}if(5&Re[0])throw Re[1];return{value:Re[0]?Re[1]:void 0,done:!0}}([nt,xe])}}}function N(){for(var Z=0,U=0,K=arguments.length;U<K;U++)Z+=arguments[U].length;var ee=Array(Z),oe=0;for(U=0;U<K;U++)for(var Q=arguments[U],Ce=0,ze=Q.length;Ce<ze;Ce++,oe++)ee[oe]=Q[Ce];return ee}var C=function(){function Z(){}return Z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Z.setAttributes=function(U,K){for(var ee=0,oe=K;ee<oe.length;ee++){var Q=oe[ee],Ce=Q[0],ze=Q[1];U.setAttribute(Ce,ze)}},Z.createRect=function(U,K,ee){var oe=document.createElementNS("http://www.w3.org/2000/svg","rect");return oe.setAttribute("width",U.toString()),oe.setAttribute("height",K.toString()),ee&&Z.setAttributes(oe,ee),oe},Z.createLine=function(U,K,ee,oe,Q){var Ce=document.createElementNS("http://www.w3.org/2000/svg","line");return Ce.setAttribute("x1",U.toString()),Ce.setAttribute("y1",K.toString()),Ce.setAttribute("x2",ee.toString()),Ce.setAttribute("y2",oe.toString()),Q&&Z.setAttributes(Ce,Q),Ce},Z.createPolygon=function(U,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ee.setAttribute("points",U),K&&Z.setAttributes(ee,K),ee},Z.createCircle=function(U,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","circle");return ee.setAttribute("cx",(U/2).toString()),ee.setAttribute("cy",(U/2).toString()),ee.setAttribute("r",U.toString()),K&&Z.setAttributes(ee,K),ee},Z.createEllipse=function(U,K,ee){var oe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return oe.setAttribute("cx",(U/2).toString()),oe.setAttribute("cy",(K/2).toString()),oe.setAttribute("rx",(U/2).toString()),oe.setAttribute("ry",(K/2).toString()),ee&&Z.setAttributes(oe,ee),oe},Z.createGroup=function(U){var K=document.createElementNS("http://www.w3.org/2000/svg","g");return U&&Z.setAttributes(K,U),K},Z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Z.createMarker=function(U,K,ee,oe,Q,Ce,ze){var nt=document.createElementNS("http://www.w3.org/2000/svg","marker");return Z.setAttributes(nt,[["id",U],["orient",K],["markerWidth",ee.toString()],["markerHeight",oe.toString()],["refX",Q.toString()],["refY",Ce.toString()]]),nt.appendChild(ze),nt},Z.createText=function(U){var K=document.createElementNS("http://www.w3.org/2000/svg","text");return K.setAttribute("x","0"),K.setAttribute("y","0"),U&&Z.setAttributes(K,U),K},Z.createTSpan=function(U,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ee.textContent=U,K&&Z.setAttributes(ee,K),ee},Z.createImage=function(U){var K=document.createElementNS("http://www.w3.org/2000/svg","image");return U&&Z.setAttributes(K,U),K},Z.createPoint=function(U,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ee.x=U,ee.y=K,ee},Z.createPath=function(U,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","path");return ee.setAttribute("d",U),K&&Z.setAttributes(ee,K),ee},Z}(),B=function(){function Z(){}return Z.addKey=function(U){Z.key=U},Object.defineProperty(Z,"isLicensed",{get:function(){return!!Z.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Z.key)},enumerable:!1,configurable:!0}),Z}(),M=function(){function Z(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Z.prototype.rasterize=function(U,K,ee){var oe=this;return new Promise(function(Q){var Ce=ee!==void 0?ee:document.createElement("canvas");U===null&&(oe.markersOnly=!0,oe.naturalSize=!1);var ze=document.createElementNS("http://www.w3.org/2000/svg","svg");ze.setAttribute("xmlns","http://www.w3.org/2000/svg"),ze.setAttribute("width",K.width.baseVal.valueAsString),ze.setAttribute("height",K.height.baseVal.valueAsString),ze.setAttribute("viewBox","0 0 "+K.viewBox.baseVal.width.toString()+" "+K.viewBox.baseVal.height.toString()),ze.innerHTML=K.innerHTML,oe.naturalSize===!0?(ze.width.baseVal.value=U.naturalWidth,ze.height.baseVal.value=U.naturalHeight):oe.width!==void 0&&oe.height!==void 0&&(ze.width.baseVal.value=oe.width,ze.height.baseVal.value=oe.height),Ce.width=ze.width.baseVal.value,Ce.height=ze.height.baseVal.value;var nt=ze.outerHTML,xe=Ce.getContext("2d");oe.markersOnly!==!0&&xe.drawImage(U,0,0,Ce.width,Ce.height);var Re=window.URL,Te=new Image(Ce.width,Ce.height);Te.setAttribute("crossOrigin","anonymous");var Oe=new Blob([nt],{type:"image/svg+xml"}),Ke=Re.createObjectURL(Oe);Te.onload=function(){xe.drawImage(Te,0,0),Re.revokeObjectURL(Ke);var Qe=Ce.toDataURL(oe.imageType,oe.imageQuality);Q(Qe)},Te.src=Ke})},Z}(),n=function(){},D=function(){function Z(U){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+U+"_"}return Object.defineProperty(Z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Z.prototype.addClass=function(U){return this.styleSheet===void 0&&this.addStyleSheet(),U.name=""+this.classNamePrefix+U.localName,this.classes.push(U),this.styleSheet.sheet.insertRule("."+U.name+" {"+U.style+"}",this.styleSheet.sheet.cssRules.length),U},Z.prototype.addRule=function(U){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(U),this.styleSheet.sheet.insertRule(U.selector+" {"+U.style+"}",this.styleSheet.sheet.cssRules.length)},Z.prototype.addStyleSheet=function(){var U;this.styleSheet=document.createElement("style"),((U=this.styleSheetRoot)!==null&&U!==void 0?U:document.head).appendChild(this.styleSheet),this.addRule(new g("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new p("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new p("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},Z.prototype.removeStyleSheet=function(){var U;this.styleSheet&&(((U=this.styleSheetRoot)!==null&&U!==void 0?U:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Z}(),g=function(Z,U){this.selector=Z,this.style=U},p=function(Z,U){this.localName=Z,this.style=U},h=function(){function Z(U,K,ee,oe,Q){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=U,this.displayMode=K,this.markerItems=ee,this.uiStyleSettings=oe,this.styles=Q,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Z.prototype.show=function(U){var K=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=U,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<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(ee,'<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(ee,'<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(ee,'<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(ee,'<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(ee,'<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(ee,'<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(ee,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Q){var Ce=document.createElement("div");Ce.className=""+K.toolbarButtonStyleClass.name,Ce.setAttribute("data-type-name",Q.typeName),Ce.innerHTML=Q.icon,Ce.addEventListener("click",function(){K.markerToolbarButtonClicked(Ce,Q)}),K.buttons.push(Ce),K.markerButtons.push(Ce)}),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 oe=document.createElement("div");oe.className=this.toolbarBlockStyleClass.name,oe.style.whiteSpace="nowrap",oe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(oe),this.addActionButton(oe,'<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(oe,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Z.prototype.addButtonClickListener=function(U){this.buttonClickListeners.push(U)},Z.prototype.removeButtonClickListener=function(U){this.buttonClickListeners.indexOf(U)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(U),1)},Z.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Z.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var U=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var K=0;K<this.markerButtons.length;K++)K<U||K===U&&this.markerButtons.length-1===U?this.markerButtonBlock.appendChild(this.markerButtons[K]):(K===U&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[K]))}},Z.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},Z.prototype.resetButtonStyles=function(){var U=this;this.buttons.forEach(function(K){K.className=K.className.replace(U.uiStyleSettings.toolbarButtonStyleColorsClassName?U.uiStyleSettings.toolbarButtonStyleColorsClassName:U.toolbarButtonStyleColorsClass.name,"").trim(),K.className=K.className.replace(U.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?U.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:U.toolbarActiveButtonStyleColorsClass.name,"").trim(),K.className+=" "+(U.uiStyleSettings.toolbarButtonStyleColorsClassName?U.uiStyleSettings.toolbarButtonStyleColorsClassName:U.toolbarButtonStyleColorsClass.name)})},Z.prototype.addActionButton=function(U,K,ee){var oe=this,Q=document.createElement("div");switch(Q.className=""+this.toolbarButtonStyleClass.name,Q.innerHTML=K,Q.setAttribute("data-action",ee),Q.addEventListener("click",function(){oe.actionToolbarButtonClicked(Q,ee)}),ee){case"select":Q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Q.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Q.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Q.style.fill=this.uiStyleSettings.closeButtonColor}U.appendChild(Q),this.buttons.push(Q)},Z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new p("toolbar",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new p("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new p("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new p("toolbar-overflow-block",`
|
|
position: absolute;
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
z-index: 10;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new p("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var U=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new p("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*U)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*U)+`px;
|
|
padding: `+U+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new p("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},Z.prototype.markerToolbarButtonClicked=function(U,K){this.setActiveButton(U),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ee){return ee("marker",K)}),this.markerButtonOverflowBlock.style.display="none"},Z.prototype.actionToolbarButtonClicked=function(U,K){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ee){return ee("action",K)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Z.prototype.setActiveButton=function(U){this.resetButtonStyles(),U.className=U.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),U.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Z.prototype.setActiveMarkerButton=function(U){var K=this.markerButtons.find(function(ee){return ee.getAttribute("data-type-name")===U});K&&this.setActiveButton(K)},Z.prototype.setCurrentMarker=function(U){var K=this;this.currentMarker=U,this.buttons.filter(function(ee){return/delete|notes/.test(ee.getAttribute("data-action"))}).forEach(function(ee){K.currentMarker===void 0?(ee.style.fillOpacity="0.4",ee.style.pointerEvents="none"):(ee.style.fillOpacity="1",ee.style.pointerEvents="all")})},Z}(),c=function(){function Z(U,K,ee,oe){this.panels=[],this.panelButtons=[],this.markerjsContainer=U,this.displayMode=K,this.uiStyleSettings=ee,this.styles=oe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Z.prototype.addStyles=function(){var U;this.toolboxStyleClass=this.styles.addClass(new p("toolbox",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-family: sans-serif;
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new p("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var K=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new p("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new p("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new p("toolbox-panel-row",`
|
|
display: flex;
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
cursor: default;
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
box-sizing: content-box;
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new p("toolbox-panel-row_colors",`
|
|
background-color: `+((U=this.uiStyleSettings.toolboxBackgroundColor)!==null&&U!==void 0?U:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new p("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*K)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*K)+`px;
|
|
padding: `+K+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new p("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},Z.prototype.show=function(U){var K;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=U,this.uiContainer.className=this.toolboxStyleClass.name+" "+((K=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Z.prototype.setPanelButtons=function(U){var K,ee,oe=this;this.panels=U,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((K=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ee=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ee!==void 0?ee:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Q){var Ce;Q.uiStyleSettings=oe.uiStyleSettings;var ze=document.createElement("div");ze.className=oe.toolboxButtonStyleClass.name+" "+((Ce=oe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ce!==void 0?Ce:oe.toolboxButtonStyleColorsClass.name),ze.innerHTML=Q.icon,ze.title=Q.title,ze.addEventListener("click",function(){oe.panelButtonClick(Q)}),oe.panelButtons.push(ze),oe.buttonRow.appendChild(ze)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Z.prototype.panelButtonClick=function(U){var K=this,ee=-1;if(U!==this.activePanel){ee=this.panels.indexOf(U),this.panelRow.innerHTML="";var oe=U.getUi();oe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(oe),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=U}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){K.displayMode==="inline"?K.panelRow.style.display="none":K.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Q,Ce){var ze,nt;Q.className=K.toolboxButtonStyleClass.name+" "+(Ce===ee?""+((ze=K.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ze!==void 0?ze:K.toolboxActiveButtonStyleColorsClass.name):""+((nt=K.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&nt!==void 0?nt:K.toolboxButtonStyleColorsClass.name))})},Z}(),o=function(Z,U){this.title=Z,this.icon=U},d=function(Z){function U(K,ee,oe,Q){var Ce=Z.call(this,K,Q||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Ce.colors=[],Ce.addTransparent=!1,Ce.colorBoxes=[],Ce.colors=ee,Ce.currentColor=oe,Ce.setCurrentColor=Ce.setCurrentColor.bind(Ce),Ce.getColorBox=Ce.getColorBox.bind(Ce),Ce}return z(U,Z),U.prototype.getUi=function(){var K=this,ee=document.createElement("div");return ee.style.overflow="hidden",ee.style.whiteSpace="nowrap",this.colors.forEach(function(oe){var Q=K.getColorBox(oe);ee.appendChild(Q),K.colorBoxes.push(Q)}),ee},U.prototype.getColorBox=function(K){var ee=this,oe=this.uiStyleSettings.toolbarHeight/4,Q=this.uiStyleSettings.toolbarHeight-oe,Ce=document.createElement("div");Ce.style.display="inline-block",Ce.style.boxSizing="content-box",Ce.style.width=Q-2+"px",Ce.style.height=Q-2+"px",Ce.style.padding="1px",Ce.style.marginRight="2px",Ce.style.marginBottom="2px",Ce.style.borderWidth="2px",Ce.style.borderStyle="solid",Ce.style.borderRadius=(Q+2)/2+"px",Ce.style.borderColor=K===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ce.addEventListener("click",function(){ee.setCurrentColor(K,Ce)});var ze=document.createElement("div");return ze.style.display="inline-block",ze.style.width=Q-2+"px",ze.style.height=Q-2+"px",ze.style.backgroundColor=K,ze.style.borderRadius=Q/2+"px",K==="transparent"&&(ze.style.fill=this.uiStyleSettings.toolboxAccentColor,ze.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>`),Ce.appendChild(ze),Ce},U.prototype.setCurrentColor=function(K,ee){var oe=this;this.currentColor=K,this.colorBoxes.forEach(function(Q){Q.style.borderColor=Q===ee?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(K)},U}(o),r=function(){function Z(U,K,ee){this._state="new",this._isSelected=!1,this._container=U,this._overlayContainer=K,this.globalSettings=ee,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Z.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Z.prototype.ownsTarget=function(U){return!1},Object.defineProperty(Z.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Z.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Z.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Z.prototype.pointerDown=function(U,K){},Z.prototype.dblClick=function(U,K){},Z.prototype.manipulate=function(U){},Z.prototype.pointerUp=function(U){this.stateChanged()},Z.prototype.dispose=function(){},Z.prototype.addMarkerVisualToContainer=function(U){this.container.childNodes.length>0?this.container.insertBefore(U,this.container.childNodes[0]):this.container.appendChild(U)},Z.prototype.getState=function(){return{typeName:Z.typeName,state:this.state,notes:this.notes}},Z.prototype.restoreState=function(U){this._state=U.state,this.notes=U.notes},Z.prototype.scale=function(U,K){},Z.prototype.colorChanged=function(U){this.onColorChanged&&this.onColorChanged(U),this.stateChanged()},Z.prototype.fillColorChanged=function(U){this.onFillColorChanged&&this.onFillColorChanged(U),this.stateChanged()},Z.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var U=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),U.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(U)&&this.onStateChanged(this)}},Z.typeName="MarkerBase",Z}(),a=function(){function Z(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Z.prototype.findGripByVisual=function(U){return this.topLeft.ownsTarget(U)?this.topLeft:this.topCenter.ownsTarget(U)?this.topCenter:this.topRight.ownsTarget(U)?this.topRight:this.centerLeft.ownsTarget(U)?this.centerLeft:this.centerRight.ownsTarget(U)?this.centerRight:this.bottomLeft.ownsTarget(U)?this.bottomLeft:this.bottomCenter.ownsTarget(U)?this.bottomCenter:this.bottomRight.ownsTarget(U)?this.bottomRight:void 0},Z}(),i=function(){function Z(){this.GRIP_SIZE=10,this.visual=C.createGroup(),this.visual.appendChild(C.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(C.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Z.prototype.ownsTarget=function(U){return U===this.visual||U===this.visual.childNodes[0]||U===this.visual.childNodes[1]},Z}(),s=function(){function Z(){}return Z.toITransformMatrix=function(U){return{a:U.a,b:U.b,c:U.c,d:U.d,e:U.e,f:U.f}},Z.toSVGMatrix=function(U,K){return U.a=K.a,U.b=K.b,U.c=K.c,U.d=K.d,U.e=K.e,U.f=K.f,U},Z}(),S=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.left=0,Q.top=0,Q.width=0,Q.height=0,Q.defaultSize={x:50,y:20},Q.offsetX=0,Q.offsetY=0,Q.rotationAngle=0,Q.CB_DISTANCE=10,Q._suppressMarkerCreateEvent=!1,Q.container.transform.baseVal.appendItem(C.createTransform()),Q.setupControlBox(),Q}return z(U,Z),Object.defineProperty(U.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"visual",{get:function(){return this._visual},set:function(K){this._visual=K;var ee=C.createTransform();this._visual.transform.baseVal.appendItem(ee)},enumerable:!1,configurable:!0}),U.prototype.ownsTarget=function(K){return!!Z.prototype.ownsTarget.call(this,K)||!!(this.controlGrips.findGripByVisual(K)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(K))},U.prototype.pointerDown=function(K,ee){Z.prototype.pointerDown.call(this,K,ee),this.state==="new"&&(this.left=K.x,this.top=K.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var oe=this.unrotatePoint(K);if(this.manipulationStartX=oe.x,this.manipulationStartY=oe.y,this.offsetX=oe.x-this.left,this.offsetY=oe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ee),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ee)){this.activeGrip=this.rotatorGrip;var Q=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Q.x-this.width/2,this.top=Q.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ce=this.container.transform.baseVal.getItem(0);Ce.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ce,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},U.prototype.pointerUp=function(K){var ee=this.state;Z.prototype.pointerUp.call(this,K),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(K),this._state="select",ee==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},U.prototype.moveVisual=function(K){this.visual.style.transform="translate("+K.x+"px, "+K.y+"px)"},U.prototype.manipulate=function(K){var ee=this.unrotatePoint(K);this.state==="creating"?this.resize(K):this.state==="move"?(this.left=this.manipulationStartLeft+(ee.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ee.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ee):this.state==="rotate"&&this.rotate(K)},U.prototype.resize=function(K){var ee=this.manipulationStartLeft,oe=this.manipulationStartWidth,Q=this.manipulationStartTop,Ce=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ee=this.manipulationStartLeft+K.x-this.manipulationStartX,oe=this.manipulationStartWidth+this.manipulationStartLeft-ee;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:oe=this.manipulationStartWidth+K.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Q=this.manipulationStartTop+K.y-this.manipulationStartY,Ce=this.manipulationStartHeight+this.manipulationStartTop-Q;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ce=this.manipulationStartHeight+K.y-this.manipulationStartY}oe>=0?(this.left=ee,this.width=oe):(this.left=ee+oe,this.width=-oe),Ce>=0?(this.top=Q,this.height=Ce):(this.top=Q+Ce,this.height=-Ce),this.setSize()},U.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},U.prototype.rotate=function(K){if(Math.abs(K.x-this.centerX)>.1){var ee=Math.sign(K.x-this.centerX);this.rotationAngle=180*Math.atan((K.y-this.centerY)/(K.x-this.centerX))/Math.PI+90*ee,this.applyRotation()}},U.prototype.applyRotation=function(){var K=this.container.transform.baseVal.getItem(0);K.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(K,0)},U.prototype.rotatePoint=function(K){if(this.rotationAngle===0)return K;var ee=this.container.getCTM(),oe=C.createPoint(K.x,K.y);return{x:(oe=oe.matrixTransform(ee)).x,y:oe.y}},U.prototype.unrotatePoint=function(K){if(this.rotationAngle===0)return K;var ee=this.container.getCTM();ee=ee.inverse();var oe=C.createPoint(K.x,K.y);return{x:(oe=oe.matrixTransform(ee)).x,y:oe.y}},U.prototype.select=function(){Z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},U.prototype.deselect=function(){Z.prototype.deselect.call(this),this.controlBox.style.display="none"},U.prototype.setupControlBox=function(){this.controlBox=C.createGroup();var K=C.createTransform();K.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(K),this.container.appendChild(this.controlBox),this.controlRect=C.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=C.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 a,this.addControlGrips(),this.controlBox.style.display="none"},U.prototype.adjustControlBox=function(){var K=this.controlBox.transform.baseVal.getItem(0);K.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(K,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},U.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()},U.prototype.createGrip=function(){var K=new i;return K.visual.transform.baseVal.appendItem(C.createTransform()),this.controlBox.appendChild(K.visual),K},U.prototype.positionGrips=function(){var K=this.controlGrips.topLeft.GRIP_SIZE,ee=-K/2,oe=ee,Q=(this.width+this.CB_DISTANCE)/2-K/2,Ce=(this.height+this.CB_DISTANCE)/2-K/2,ze=this.height+this.CB_DISTANCE-K/2,nt=this.width+this.CB_DISTANCE-K/2;this.positionGrip(this.controlGrips.topLeft.visual,ee,oe),this.positionGrip(this.controlGrips.topCenter.visual,Q,oe),this.positionGrip(this.controlGrips.topRight.visual,nt,oe),this.positionGrip(this.controlGrips.centerLeft.visual,ee,Ce),this.positionGrip(this.controlGrips.centerRight.visual,nt,Ce),this.positionGrip(this.controlGrips.bottomLeft.visual,ee,ze),this.positionGrip(this.controlGrips.bottomCenter.visual,Q,ze),this.positionGrip(this.controlGrips.bottomRight.visual,nt,ze),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Q,oe-3*this.CB_DISTANCE)},U.prototype.positionGrip=function(K,ee,oe){var Q=K.transform.baseVal.getItem(0);Q.setTranslate(ee,oe),K.transform.baseVal.replaceItem(Q,0)},U.prototype.hideControlBox=function(){this.controlBox.style.display="none"},U.prototype.showControlBox=function(){this.controlBox.style.display=""},U.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:s.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:s.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Z.prototype.getState.call(this))},U.prototype.restoreState=function(K){Z.prototype.restoreState.call(this,K);var ee=K;this.left=ee.left,this.top=ee.top,this.width=ee.width,this.height=ee.height,this.rotationAngle=ee.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(s.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ee.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(s.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ee.containerTransformMatrix))},U.prototype.scale=function(K,ee){Z.prototype.scale.call(this,K,ee);var oe=this.rotatePoint({x:this.left,y:this.top}),Q=this.unrotatePoint({x:oe.x*K,y:oe.y*ee});this.left=Q.x,this.top=Q.y,this.width=this.width*K,this.height=this.height*ee,this.adjustControlBox()},U}(r),x=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q}return z(U,Z),U.prototype.ownsTarget=function(K){return!(!Z.prototype.ownsTarget.call(this,K)&&K!==this.visual)},U.prototype.createVisual=function(){this.visual=C.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)},U.prototype.pointerDown=function(K,ee){Z.prototype.pointerDown.call(this,K,ee),this.state==="new"&&(this.createVisual(),this.moveVisual(K),this._state="creating")},U.prototype.manipulate=function(K){Z.prototype.manipulate.call(this,K)},U.prototype.resize=function(K){Z.prototype.resize.call(this,K),this.setSize()},U.prototype.setSize=function(){Z.prototype.setSize.call(this),C.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},U.prototype.pointerUp=function(K){Z.prototype.pointerUp.call(this,K),this.setSize()},U.prototype.setStrokeColor=function(K){this.strokeColor=K,this.visual&&C.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(K),this.stateChanged()},U.prototype.setFillColor=function(K){this.fillColor=K,this.visual&&C.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},U.prototype.setStrokeWidth=function(K){this.strokeWidth=K,this.visual&&C.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},U.prototype.setStrokeDasharray=function(K){this.strokeDasharray=K,this.visual&&C.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},U.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this))},U.prototype.restoreState=function(K){var ee=K;this.fillColor=ee.fillColor,this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.opacity=ee.opacity,this.createVisual(),Z.prototype.restoreState.call(this,K),this.setSize()},U.prototype.scale=function(K,ee){Z.prototype.scale.call(this,K,ee),this.setSize()},U.title="Rectangle marker",U}(S),T=function(Z){function U(K,ee,oe,Q){var Ce=Z.call(this,K,Q||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ce.widths=[],Ce.widthBoxes=[],Ce.widths=ee,Ce.currentWidth=oe,Ce.setCurrentWidth=Ce.setCurrentWidth.bind(Ce),Ce}return z(U,Z),U.prototype.getUi=function(){var K=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",this.widths.forEach(function(oe){var Q=document.createElement("div");Q.style.display="flex",Q.style.flexGrow="2",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=oe===K.currentWidth?K.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){K.setCurrentWidth(oe,Q)}),ee.appendChild(Q);var Ce=document.createElement("div");Ce.innerText=oe.toString(),Ce.style.marginRight="5px",Q.appendChild(Ce);var ze=document.createElement("div");ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.display="flex",ze.style.alignItems="center";var nt=document.createElement("hr");nt.style.minWidth="20px",nt.style.border="0px",nt.style.borderTop=oe+"px solid "+K.uiStyleSettings.toolboxColor,nt.style.flexGrow="2",ze.appendChild(nt),Q.appendChild(ze),K.widthBoxes.push(Q)}),ee},U.prototype.setCurrentWidth=function(K,ee){var oe=this;this.currentWidth=K,this.widthBoxes.forEach(function(Q){Q.style.borderColor=Q===ee?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},U}(o),A=function(Z){function U(K,ee,oe,Q){var Ce=Z.call(this,K,Q||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Ce.styles=[],Ce.styleBoxes=[],Ce.styles=ee,Ce.currentStyle=oe,Ce.setCurrentStyle=Ce.setCurrentStyle.bind(Ce),Ce}return z(U,Z),U.prototype.getUi=function(){var K=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",this.styles.forEach(function(oe){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/K.styles.length-5+"%",Q.style.borderColor=oe===K.currentStyle?K.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){K.setCurrentStyle(oe,Q)}),ee.appendChild(Q);var Ce=document.createElement("div");Ce.style.minHeight="20px",Ce.style.flexGrow="2",Ce.style.overflow="hidden";var ze=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+K.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(oe!==""?'stroke-dasharray="'+oe+'"':"")+` />
|
|
</svg>`;Ce.innerHTML=ze,Q.appendChild(Ce),K.styleBoxes.push(Q)}),ee},U.prototype.setCurrentStyle=function(K,ee){var oe=this;this.currentStyle=K,this.styleBoxes.forEach(function(Q){Q.style.borderColor=Q===ee?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},U}(o),w=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.strokeColor=oe.defaultColor,Q.strokeWidth=oe.defaultStrokeWidth,Q.strokeDasharray=oe.defaultStrokeDasharray,Q.strokePanel=new d("Line color",oe.defaultColorSet,oe.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new T("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new A("Line style",oe.defaultStrokeDasharrays,oe.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return z(U,Z),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var K=Z.prototype.getState.call(this);return K.typeName=U.typeName,K},U.typeName="FrameMarker",U.title="Frame marker",U.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',U}(x),v=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},b=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.x1=0,Q.y1=0,Q.x2=0,Q.y2=0,Q.defaultLength=50,Q.manipulationStartX=0,Q.manipulationStartY=0,Q.manipulationStartX1=0,Q.manipulationStartY1=0,Q.manipulationStartX2=0,Q.manipulationStartY2=0,Q.setupControlBox(),Q}return z(U,Z),U.prototype.ownsTarget=function(K){return!!Z.prototype.ownsTarget.call(this,K)||!(!this.grip1.ownsTarget(K)&&!this.grip2.ownsTarget(K))},U.prototype.pointerDown=function(K,ee){Z.prototype.pointerDown.call(this,K,ee),this.manipulationStartX=K.x,this.manipulationStartY=K.y,this.state==="new"&&(this.x1=K.x,this.y1=K.y,this.x2=K.x,this.y2=K.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(ee)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ee)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},U.prototype.pointerUp=function(K){var ee=this.state;Z.prototype.pointerUp.call(this,K),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(K),this._state="select",ee==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},U.prototype.adjustVisual=function(){},U.prototype.manipulate=function(K){this.state==="creating"?this.resize(K):this.state==="move"?(this.x1=this.manipulationStartX1+K.x-this.manipulationStartX,this.y1=this.manipulationStartY1+K.y-this.manipulationStartY,this.x2=this.manipulationStartX2+K.x-this.manipulationStartX,this.y2=this.manipulationStartY2+K.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(K)},U.prototype.resize=function(K){switch(this.activeGrip){case this.grip1:this.x1=K.x,this.y1=K.y;break;case this.grip2:case void 0:this.x2=K.x,this.y2=K.y}this.adjustVisual(),this.adjustControlBox()},U.prototype.select=function(){Z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},U.prototype.deselect=function(){Z.prototype.deselect.call(this),this.controlBox.style.display="none"},U.prototype.setupControlBox=function(){this.controlBox=C.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},U.prototype.adjustControlBox=function(){this.positionGrips()},U.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},U.prototype.createGrip=function(){var K=new i;return K.visual.transform.baseVal.appendItem(C.createTransform()),this.controlBox.appendChild(K.visual),K},U.prototype.positionGrips=function(){var K=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-K/2,this.y1-K/2),this.positionGrip(this.grip2.visual,this.x2-K/2,this.y2-K/2)},U.prototype.positionGrip=function(K,ee,oe){var Q=K.transform.baseVal.getItem(0);Q.setTranslate(ee,oe),K.transform.baseVal.replaceItem(Q,0)},U.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Z.prototype.getState.call(this))},U.prototype.restoreState=function(K){Z.prototype.restoreState.call(this,K);var ee=K;this.x1=ee.x1,this.y1=ee.y1,this.x2=ee.x2,this.y2=ee.y2},U.prototype.scale=function(K,ee){Z.prototype.scale.call(this,K,ee),this.x1=this.x1*K,this.y1=this.y1*ee,this.x2=this.x2*K,this.y2=this.y2*ee,this.adjustVisual(),this.adjustControlBox()},U}(r),m=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.strokeColor=oe.defaultColor,Q.strokeWidth=oe.defaultStrokeWidth,Q.strokeDasharray=oe.defaultStrokeDasharray,Q.strokePanel=new d("Line color",oe.defaultColorSet,oe.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new T("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new A("Line style",oe.defaultStrokeDasharrays,oe.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return z(U,Z),U.prototype.ownsTarget=function(K){return!(!Z.prototype.ownsTarget.call(this,K)&&K!==this.visual&&K!==this.selectorLine&&K!==this.visibleLine)},U.prototype.createVisual=function(){this.visual=C.createGroup(),this.selectorLine=C.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=C.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)},U.prototype.pointerDown=function(K,ee){Z.prototype.pointerDown.call(this,K,ee),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},U.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()),C.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),C.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),C.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},U.prototype.setStrokeColor=function(K){this.strokeColor=K,this.adjustVisual(),this.colorChanged(K)},U.prototype.setStrokeWidth=function(K){this.strokeWidth=K,this.adjustVisual()},U.prototype.setStrokeDasharray=function(K){this.strokeDasharray=K,this.adjustVisual(),this.stateChanged()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var K=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Z.prototype.getState.call(this));return K.typeName=U.typeName,K},U.prototype.restoreState=function(K){Z.prototype.restoreState.call(this,K);var ee=K;this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.createVisual(),this.adjustVisual()},U.typeName="LineMarker",U.title="Line marker",U.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',U}(b),f=function(Z){function U(K,ee,oe,Q){var Ce=Z.call(this,K,Q||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Ce.fonts=[],Ce.fontBoxes=[],Ce.fonts=ee,Ce.currentFont=oe,Ce.setCurrentFont=Ce.setCurrentFont.bind(Ce),Ce}return z(U,Z),U.prototype.getUi=function(){var K=this,ee=document.createElement("div");return ee.style.overflow="hidden",ee.style.flexGrow="2",this.fonts.forEach(function(oe){var Q=document.createElement("div");Q.style.display="inline-block",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/K.fonts.length-5+"%",Q.style.borderColor=oe===K.currentFont?K.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){K.setCurrentFont(oe,Q)}),ee.appendChild(Q);var Ce=document.createElement("div");Ce.style.display="flex",Ce.style.minHeight="20px",Ce.style.flexGrow="2",Ce.style.fontFamily=oe,Ce.style.overflow="hidden";var ze=document.createElement("div");ze.style.whiteSpace="nowrap",ze.style.overflow="hidden",ze.style.textOverflow="ellipsis",ze.innerHTML="The quick brown fox jumps over the lazy dog",Ce.appendChild(ze),Q.appendChild(Ce),K.fontBoxes.push(Q)}),ee},U.prototype.setCurrentFont=function(K,ee){var oe=this;this.currentFont=K,this.fontBoxes.forEach(function(Q){Q.style.borderColor=Q===ee?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},U}(o),O=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.color="transparent",Q.padding=5,Q.DEFAULT_TEXT="your text here",Q.text=Q.DEFAULT_TEXT,Q.isMoved=!1,Q.color=oe.defaultColor,Q.fontFamily=oe.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setColor=Q.setColor.bind(Q),Q.setFont=Q.setFont.bind(Q),Q.renderText=Q.renderText.bind(Q),Q.sizeText=Q.sizeText.bind(Q),Q.textEditDivClicked=Q.textEditDivClicked.bind(Q),Q.showTextEditor=Q.showTextEditor.bind(Q),Q.setSize=Q.setSize.bind(Q),Q.positionTextEditor=Q.positionTextEditor.bind(Q),Q.colorPanel=new d("Color",oe.defaultColorSet,oe.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.fontFamilyPanel=new f("Font",oe.defaultFontFamilies,oe.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q}return z(U,Z),U.prototype.ownsTarget=function(K){if(Z.prototype.ownsTarget.call(this,K)||K===this.visual||K===this.textElement||K===this.bgRectangle)return!0;var ee=!1;return this.textElement.childNodes.forEach(function(oe){oe===K&&(ee=!0)}),ee},U.prototype.createVisual=function(){this.visual=C.createGroup(),this.bgRectangle=C.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=C.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(C.createTransform()),this.textElement.transform.baseVal.appendItem(C.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},U.prototype.pointerDown=function(K,ee){Z.prototype.pointerDown.call(this,K,ee),this.isMoved=!1,this.pointerDownPoint=K,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(K),this._state="creating")},U.prototype.renderText=function(){var K=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(ee){K.textElement.appendChild(C.createTSpan(ee.trim()===""?" ":ee.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},U.prototype.getTextScale=function(){var K=this.textElement.getBBox(),ee=1;if(K.width>0&&K.height>0){var oe=(1*this.width-this.width*this.padding*2/100)/K.width,Q=(1*this.height-this.height*this.padding*2/100)/K.height;ee=Math.min(oe,Q)}return ee},U.prototype.getTextPosition=function(K){var ee=this.textElement.getBBox(),oe=0,Q=0;return ee.width>0&&ee.height>0&&(oe=(this.width-ee.width*K)/2,Q=this.height/2-ee.height*K/2),{x:oe,y:Q}},U.prototype.sizeText=function(){var K=this.textElement.getBBox(),ee=this.getTextScale(),oe=this.getTextPosition(ee);oe.y-=K.y*ee,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+oe.x+"px, "+oe.y+"px) scale("+ee+", "+ee+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(oe.x,oe.y),this.textElement.transform.baseVal.getItem(1).setScale(ee,ee))},U.prototype.manipulate=function(K){Z.prototype.manipulate.call(this,K),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(K.x-this.pointerDownPoint.x)>5||Math.abs(K.y-this.pointerDownPoint.y)>5)},U.prototype.resize=function(K){Z.prototype.resize.call(this,K),this.isMoved=!0,this.setSize(),this.sizeText()},U.prototype.setSize=function(){Z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(C.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),C.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},U.prototype.pointerUp=function(K){var ee=this.state;ee==="creating"&&(this._suppressMarkerCreateEvent=!0),Z.prototype.pointerUp.call(this,K),this.setSize(),(ee==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},U.prototype.showTextEditor=function(){var K=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(ee){ee.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ee=Number.parseFloat(K.textEditor.style.fontSize);K.textEditor.clientWidth>=Number.parseInt(K.textEditor.style.maxWidth)&&ee>.9;)ee-=.1,K.textEditor.style.fontSize=Math.max(ee,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ee){ee.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ee){if(ee.clipboardData){var oe=ee.clipboardData.getData("text"),Q=window.getSelection();if(!Q.rangeCount)return!1;Q.deleteFromDocument(),Q.getRangeAt(0).insertNode(document.createTextNode(oe)),ee.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){K.textEditDivClicked(K.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},U.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var K=this.getTextScale(),ee=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),oe=this.textElement.getBBox(),Q={x:oe.width*K,y:oe.height*K};ee.x-=Q.x/2,ee.y-=Q.y/2,this.textEditor.style.top=ee.y+"px",this.textEditor.style.left=ee.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ee.x+"px",this.textEditor.style.fontSize=Math.max(16*K,12)+"px",this.textElement.style.display="none"}},U.prototype.textEditDivClicked=function(K){this.text=K.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},U.prototype.select=function(){Z.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},U.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Z.prototype.deselect.call(this)},U.prototype.dblClick=function(K,ee){Z.prototype.dblClick.call(this,K,ee),this.showTextEditor()},U.prototype.setColor=function(K){this.textElement&&C.setAttributes(this.textElement,[["fill",K]]),this.color=K,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(K)},U.prototype.setFont=function(K){this.textElement&&C.setAttributes(this.textElement,[["font-family",K]]),this.fontFamily=K,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},U.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},U.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var K=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Z.prototype.getState.call(this));return K.typeName=U.typeName,K},U.prototype.restoreState=function(K){var ee=K;this.color=ee.color,this.fontFamily=ee.fontFamily,this.padding=ee.padding,this.text=ee.text,this.createVisual(),Z.prototype.restoreState.call(this,K),this.setSize()},U.prototype.scale=function(K,ee){Z.prototype.scale.call(this,K,ee),this.setSize(),this.sizeText(),this.positionTextEditor()},U.typeName="TextMarker",U.title="Text marker",U.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>',U}(S),E=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.color="transparent",Q.lineWidth=3,Q.drawing=!1,Q.pixelRatio=1,Q.color=oe.defaultColor,Q.lineWidth=oe.defaultStrokeWidth,Q.pixelRatio=oe.freehandPixelRatio,Q.setColor=Q.setColor.bind(Q),Q.addCanvas=Q.addCanvas.bind(Q),Q.finishCreation=Q.finishCreation.bind(Q),Q.setLineWidth=Q.setLineWidth.bind(Q),Q.colorPanel=new d("Color",oe.defaultColorSet,oe.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.lineWidthPanel=new T("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),Q.lineWidthPanel.onWidthChanged=Q.setLineWidth,Q}return z(U,Z),U.prototype.ownsTarget=function(K){return!(!Z.prototype.ownsTarget.call(this,K)&&K!==this.visual&&K!==this.drawingImage)},U.prototype.createVisual=function(){this.visual=C.createGroup(),this.drawingImage=C.createImage(),this.visual.appendChild(this.drawingImage);var K=C.createTransform();this.visual.transform.baseVal.appendItem(K),this.addMarkerVisualToContainer(this.visual)},U.prototype.pointerDown=function(K,ee){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(K.x,K.y),this.drawing=!0):Z.prototype.pointerDown.call(this,K,ee)},U.prototype.manipulate=function(K){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(K.x,K.y),this.canvasContext.stroke()):Z.prototype.manipulate.call(this,K)},U.prototype.resize=function(K){Z.prototype.resize.call(this,K),C.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),C.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},U.prototype.pointerUp=function(K){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Z.prototype.pointerUp.call(this,K)},U.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)},U.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Z.prototype.select.call(this)},U.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Z.prototype.deselect.call(this)},U.prototype.finishCreation=function(){for(var K=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ee=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],oe=ee[0],Q=ee[1],Ce=ee[2],ze=ee[3],nt=!1,xe=0;xe<this.canvasElement.height;xe++)for(var Re=0;Re<this.canvasElement.width;Re++)K.data[xe*this.canvasElement.width*4+4*Re+3]>0&&(nt=!0,xe<Q&&(Q=xe),Re<oe&&(oe=Re),xe>ze&&(ze=xe),Re>Ce&&(Ce=Re));if(nt){this.left=oe/this.pixelRatio,this.top=Q/this.pixelRatio,this.width=(Ce-oe)/this.pixelRatio,this.height=(ze-Q)/this.pixelRatio;var Te=document.createElement("canvas");Te.width=Ce-oe,Te.height=ze-Q,Te.getContext("2d").putImageData(this.canvasContext.getImageData(oe,Q,Ce-oe,ze-Q),0,0),this.drawingImgUrl=Te.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},U.prototype.setDrawingImage=function(){C.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),C.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},U.prototype.setColor=function(K){this.color=K,this.colorChanged(K)},U.prototype.setLineWidth=function(K){this.lineWidth=K},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var K=Object.assign({drawingImgUrl:this.drawingImgUrl},Z.prototype.getState.call(this));return K.typeName=U.typeName,K},U.prototype.restoreState=function(K){this.createVisual(),Z.prototype.restoreState.call(this,K),this.drawingImgUrl=K.drawingImgUrl,this.setDrawingImage()},U.prototype.scale=function(K,ee){Z.prototype.scale.call(this,K,ee),this.setDrawingImage()},U.typeName="FreehandMarker",U.title="Freehand marker",U.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>',U}(S),_=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,oe||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Q.typeBoxes=[],Q.currentType=ee,Q.setCurrentType=Q.setCurrentType.bind(Q),Q}return z(U,Z),U.prototype.getUi=function(){var K=this,ee=document.createElement("div");ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2";for(var oe=function(ze){var nt="both";switch(ze){case 0:nt="both";break;case 1:nt="start";break;case 2:nt="end";break;case 3:nt="none"}var xe=document.createElement("div");if(xe.style.display="flex",xe.style.flexGrow="2",xe.style.alignItems="center",xe.style.justifyContent="space-between",xe.style.padding="5px",xe.style.borderWidth="2px",xe.style.borderStyle="solid",xe.style.borderColor=nt===Q.currentType?Q.uiStyleSettings.toolboxAccentColor:"transparent",xe.addEventListener("click",function(){K.setCurrentType(nt,xe)}),ee.appendChild(xe),nt==="both"||nt==="start"){var Re=document.createElement("div");Re.style.display="flex",Re.style.alignItems="center",Re.style.minHeight="20px",Re.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Re.style.marginLeft="5px",xe.appendChild(Re)}var Te=document.createElement("div");Te.style.display="flex",Te.style.alignItems="center",Te.style.minHeight="20px",Te.style.flexGrow="2";var Oe=document.createElement("hr");if(Oe.style.minWidth="20px",Oe.style.border="0px",Oe.style.borderTop="3px solid "+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee"),Oe.style.flexGrow="2",Te.appendChild(Oe),xe.appendChild(Te),nt==="both"||nt==="end"){var Ke=document.createElement("div");Ke.style.display="flex",Ke.style.alignItems="center",Ke.style.minHeight="20px",Ke.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Ke.style.marginRight="5px",xe.appendChild(Ke)}Q.typeBoxes.push(xe)},Q=this,Ce=0;Ce<4;Ce++)oe(Ce);return ee},U.prototype.setCurrentType=function(K,ee){var oe=this;this.currentType=K,this.typeBoxes.forEach(function(Q){Q.style.borderColor=Q===ee?oe.uiStyleSettings!==void 0?oe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},U}(o),k=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.arrowType="end",Q.arrowBaseHeight=10,Q.arrowBaseWidth=10,Q.getArrowPoints=Q.getArrowPoints.bind(Q),Q.setArrowType=Q.setArrowType.bind(Q),Q.arrowTypePanel=new _("Arrow type","end"),Q.arrowTypePanel.onArrowTypeChanged=Q.setArrowType,Q}return z(U,Z),U.prototype.ownsTarget=function(K){return!(!Z.prototype.ownsTarget.call(this,K)&&K!==this.arrow1&&K!==this.arrow2)},U.prototype.getArrowPoints=function(K,ee){var oe=this.arrowBaseWidth+2*this.strokeWidth,Q=this.arrowBaseHeight+2*this.strokeWidth;return K-oe/2+","+(ee+Q/2)+" "+K+","+(ee-Q/2)+" "+(K+oe/2)+","+(ee+Q/2)},U.prototype.createTips=function(){this.arrow1=C.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(C.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=C.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(C.createTransform()),this.visual.appendChild(this.arrow2)},U.prototype.pointerDown=function(K,ee){Z.prototype.pointerDown.call(this,K,ee),this.state==="creating"&&this.createTips()},U.prototype.adjustVisual=function(){if(Z.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",C.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),C.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var K=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ee=this.arrow1.transform.baseVal.getItem(0);ee.setRotate(K,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ee,0);var oe=this.arrow2.transform.baseVal.getItem(0);oe.setRotate(K+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(oe,0)}},U.prototype.setArrowType=function(K){this.arrowType=K,this.adjustVisual(),this.stateChanged()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var K=Object.assign({arrowType:this.arrowType},Z.prototype.getState.call(this));return K.typeName=U.typeName,K},U.prototype.restoreState=function(K){Z.prototype.restoreState.call(this,K);var ee=K;this.arrowType=ee.arrowType,this.createTips(),this.adjustVisual()},U.typeName="ArrowMarker",U.title="Arrow marker",U.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',U}(m),F=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.fillColor=oe.defaultFillColor,Q.strokeWidth=0,Q.fillPanel=new d("Color",oe.defaultColorSet,oe.defaultFillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q}return z(U,Z),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var K=Z.prototype.getState.call(this);return K.typeName=U.typeName,K},U.typeName="CoverMarker",U.title="Cover marker",U.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',U}(x),L=function(Z){function U(K,ee,oe,Q){var Ce=Z.call(this,K,Q||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Ce.opacities=[],Ce.opacityBoxes=[],Ce.opacities=ee,Ce.currentOpacity=oe,Ce.setCurrentOpacity=Ce.setCurrentOpacity.bind(Ce),Ce}return z(U,Z),U.prototype.getUi=function(){var K=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",ee.style.justifyContent="space-between",this.opacities.forEach(function(oe){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="center",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=oe===K.currentOpacity?K.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){K.setCurrentOpacity(oe,Q)}),ee.appendChild(Q);var Ce=document.createElement("div");Ce.innerText=100*oe+"%",Q.appendChild(Ce),K.opacityBoxes.push(Q)}),ee},U.prototype.setCurrentOpacity=function(K,ee){var oe=this;this.currentOpacity=K,this.opacityBoxes.forEach(function(Q){Q.style.borderColor=Q===ee?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},U}(o),G=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.setOpacity=Q.setOpacity.bind(Q),Q.fillColor=oe.defaultHighlightColor,Q.strokeWidth=0,Q.opacity=oe.defaultHighlightOpacity,Q.fillPanel=new d("Color",oe.defaultColorSet,Q.fillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q.opacityPanel=new L("Opacity",oe.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return z(U,Z),U.prototype.setOpacity=function(K){this.opacity=K,this.visual&&C.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var K=Z.prototype.getState.call(this);return K.typeName=U.typeName,K},U.typeName="HighlightMarker",U.title="Highlight marker",U.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>',U}(F),j='<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>',R=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.bgColor="transparent",Q.tipPosition={x:0,y:0},Q.tipBase1Position={x:0,y:0},Q.tipBase2Position={x:0,y:0},Q.tipMoving=!1,Q.color=oe.defaultStrokeColor,Q.bgColor=oe.defaultFillColor,Q.fontFamily=oe.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setBgColor=Q.setBgColor.bind(Q),Q.getTipPoints=Q.getTipPoints.bind(Q),Q.positionTip=Q.positionTip.bind(Q),Q.setTipPoints=Q.setTipPoints.bind(Q),Q.colorPanel=new d("Text color",oe.defaultColorSet,Q.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),Q.colorPanel.onColorChanged=Q.setColor,Q.bgColorPanel=new d("Fill color",oe.defaultColorSet,Q.bgColor,j),Q.bgColorPanel.onColorChanged=Q.setBgColor,Q.fontFamilyPanel=new f("Font",oe.defaultFontFamilies,oe.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q.tipGrip=new i,Q.tipGrip.visual.transform.baseVal.appendItem(C.createTransform()),Q.controlBox.appendChild(Q.tipGrip.visual),Q}return z(U,Z),U.prototype.ownsTarget=function(K){return Z.prototype.ownsTarget.call(this,K)||this.tipGrip.ownsTarget(K)||this.tip===K},U.prototype.createTip=function(){C.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=C.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},U.prototype.pointerDown=function(K,ee){this.state==="new"&&Z.prototype.pointerDown.call(this,K,ee),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ee)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Z.prototype.pointerDown.call(this,K,ee)},U.prototype.pointerUp=function(K){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Z.prototype.pointerUp.call(this,K);else{var ee=this.state==="creating";Z.prototype.pointerUp.call(this,K),this.setTipPoints(ee),this.positionTip()}},U.prototype.manipulate=function(K){if(this.tipMoving){var ee=this.unrotatePoint(K);this.tipPosition={x:ee.x-this.manipulationStartLeft,y:ee.y-this.manipulationStartTop},this.positionTip()}else Z.prototype.manipulate.call(this,K)},U.prototype.setBgColor=function(K){this.bgRectangle&&this.tip&&(C.setAttributes(this.bgRectangle,[["fill",K]]),C.setAttributes(this.tip,[["fill",K]])),this.bgColor=K,this.fillColorChanged(K)},U.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},U.prototype.setTipPoints=function(K){K===void 0&&(K=!1);var ee=Math.min(this.height/2,15),oe=this.height/5;K&&(this.tipPosition={x:ee+oe/2,y:this.height+20});var Q=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Q<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(oe=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:ee,y:0},this.tipBase2Position={x:ee+oe,y:0}):(this.tipBase1Position={x:0,y:ee},this.tipBase2Position={x:0,y:ee+oe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Q<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(oe=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ee-oe,y:0},this.tipBase2Position={x:this.width-ee,y:0}):(this.tipBase1Position={x:this.width,y:ee},this.tipBase2Position={x:this.width,y:ee+oe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Q<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(oe=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ee-oe,y:this.height},this.tipBase2Position={x:this.width-ee,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ee-oe},this.tipBase2Position={x:this.width,y:this.height-ee}):Q<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(oe=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:ee,y:this.height},this.tipBase2Position={x:ee+oe,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ee},this.tipBase2Position={x:0,y:this.height-ee-oe})},U.prototype.resize=function(K){Z.prototype.resize.call(this,K),this.positionTip()},U.prototype.positionTip=function(){C.setAttributes(this.tip,[["points",this.getTipPoints()]]);var K=this.tipGrip.visual.transform.baseVal.getItem(0);K.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(K,0)},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),U.prototype.select=function(){this.positionTip(),Z.prototype.select.call(this)},U.prototype.getState=function(){var K=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Z.prototype.getState.call(this));return K.typeName=U.typeName,K},U.prototype.restoreState=function(K){var ee=K;this.bgColor=ee.bgColor,this.tipPosition=ee.tipPosition,Z.prototype.restoreState.call(this,K),this.createTip(),this.setTipPoints()},U.prototype.scale=function(K,ee){Z.prototype.scale.call(this,K,ee),this.tipPosition={x:this.tipPosition.x*K,y:this.tipPosition.y*ee},this.positionTip()},U.typeName="CalloutMarker",U.title="Callout marker",U.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>',U}(O),V=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.strokeColor=oe.defaultColor,Q.strokeWidth=oe.defaultStrokeWidth,Q.strokeDasharray=oe.defaultStrokeDasharray,Q.fillColor=oe.defaultFillColor,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.setOpacity=Q.setOpacity.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q.strokePanel=new d("Line color",N(oe.defaultColorSet,["transparent"]),oe.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.fillPanel=new d("Fill color",N(oe.defaultColorSet,["transparent"]),Q.fillColor,j),Q.fillPanel.onColorChanged=Q.setFillColor,Q.strokeWidthPanel=new T("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new A("Line style",oe.defaultStrokeDasharrays,oe.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q.opacityPanel=new L("Opacity",oe.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return z(U,Z),U.prototype.ownsTarget=function(K){return!(!Z.prototype.ownsTarget.call(this,K)&&K!==this.visual)},U.prototype.createVisual=function(){this.visual=C.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)},U.prototype.pointerDown=function(K,ee){Z.prototype.pointerDown.call(this,K,ee),this.state==="new"&&(this.createVisual(),this.moveVisual(K),this._state="creating")},U.prototype.manipulate=function(K){Z.prototype.manipulate.call(this,K)},U.prototype.resize=function(K){Z.prototype.resize.call(this,K),this.setSize()},U.prototype.setSize=function(){Z.prototype.setSize.call(this),C.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},U.prototype.pointerUp=function(K){Z.prototype.pointerUp.call(this,K),this.setSize()},U.prototype.setStrokeColor=function(K){this.strokeColor=K,this.visual&&C.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(K),this.stateChanged()},U.prototype.setFillColor=function(K){this.fillColor=K,this.visual&&C.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(K),this.stateChanged()},U.prototype.setStrokeWidth=function(K){this.strokeWidth=K,this.visual&&C.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},U.prototype.setStrokeDasharray=function(K){this.strokeDasharray=K,this.visual&&C.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},U.prototype.setOpacity=function(K){this.opacity=K,this.visual&&C.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var K=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this));return K.typeName=U.typeName,K},U.prototype.restoreState=function(K){var ee=K;this.fillColor=ee.fillColor,this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.opacity=ee.opacity,this.createVisual(),Z.prototype.restoreState.call(this,K),this.setSize()},U.prototype.scale=function(K,ee){Z.prototype.scale.call(this,K,ee),this.setSize()},U.typeName="EllipseMarker",U.title="Ellipse marker",U.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>',U}(S),ne=function(Z){function U(K,ee,oe){return Z.call(this,K,ee,oe)||this}return z(U,Z),Object.defineProperty(U.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),U.prototype.ownsTarget=function(K){return!(!Z.prototype.ownsTarget.call(this,K)&&K!==this.tip1&&K!==this.tip2)},U.prototype.createTips=function(){this.tip1=C.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(C.createTransform()),this.visual.appendChild(this.tip1),this.tip2=C.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(C.createTransform()),this.visual.appendChild(this.tip2)},U.prototype.pointerDown=function(K,ee){Z.prototype.pointerDown.call(this,K,ee),this.state==="creating"&&this.createTips()},U.prototype.adjustVisual=function(){if(Z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(C.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()]]),C.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var K=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ee=this.tip1.transform.baseVal.getItem(0);ee.setRotate(K,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ee,0);var oe=this.tip2.transform.baseVal.getItem(0);oe.setRotate(K+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(oe,0)}},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var K=Z.prototype.getState.call(this);return K.typeName=U.typeName,K},U.prototype.restoreState=function(K){Z.prototype.restoreState.call(this,K),this.createTips(),this.adjustVisual()},U.typeName="MeasurementMarker",U.title="Measurement marker",U.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>',U}(m),se=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.strokePanel.colors=oe.defaultColorSet,Q.fillColor="transparent",Q}return z(U,Z),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var K=Z.prototype.getState.call(this);return K.typeName=U.typeName,K},U.typeName="EllipseFrameMarker",U.title="Ellipse frame marker",U.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>',U}(V),Se=function(){function Z(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Z.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Z.prototype.addUndoStep=function(U){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(U)||(this.undoStack.push(U),JSON.stringify(this.lastRedoStep)!==JSON.stringify(U)&&this.redoStack.splice(0,this.redoStack.length))},Z.prototype.replaceLastUndoStep=function(U){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=U)},Z.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Z.prototype.undo=function(){if(this.undoStack.length>1){var U=this.undoStack.pop();return U!==void 0&&this.redoStack.push(U),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Z.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Z}(),De=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,ee,oe)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.curveX=0,Q.curveY=0,Q.manipulationStartCurveX=0,Q.manipulationStartCurveY=0,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.positionGrips=Q.positionGrips.bind(Q),Q.addControlGrips=Q.addControlGrips.bind(Q),Q.adjustVisual=Q.adjustVisual.bind(Q),Q.setupControlBox=Q.setupControlBox.bind(Q),Q.resize=Q.resize.bind(Q),Q.strokeColor=oe.defaultColor,Q.strokeWidth=oe.defaultStrokeWidth,Q.strokeDasharray=oe.defaultStrokeDasharray,Q.strokePanel=new d("Line color",oe.defaultColorSet,oe.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new T("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new A("Line style",oe.defaultStrokeDasharrays,oe.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return z(U,Z),U.prototype.ownsTarget=function(K){return!(!Z.prototype.ownsTarget.call(this,K)&&K!==this.visual&&K!==this.selectorCurve&&K!==this.visibleCurve&&!this.curveGrip.ownsTarget(K))},U.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},U.prototype.createVisual=function(){this.visual=C.createGroup(),this.selectorCurve=C.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=C.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)},U.prototype.pointerDown=function(K,ee){Z.prototype.pointerDown.call(this,K,ee),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=K.x,this.curveY=K.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ee)&&(this.activeGrip=this.curveGrip,this._state="resize")},U.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),C.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),C.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),C.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},U.prototype.setupControlBox=function(){Z.prototype.setupControlBox.call(this),this.curveControlLine1=C.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=C.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)},U.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Z.prototype.addControlGrips.call(this)},U.prototype.positionGrips=function(){Z.prototype.positionGrips.call(this);var K=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-K/2,this.curveY-K/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},U.prototype.manipulate=function(K){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+K.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+K.y-this.manipulationStartY),Z.prototype.manipulate.call(this,K)},U.prototype.resize=function(K){this.activeGrip===this.curveGrip&&(this.curveX=K.x,this.curveY=K.y),Z.prototype.resize.call(this,K),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},U.prototype.setStrokeColor=function(K){this.strokeColor=K,this.adjustVisual(),this.colorChanged(K)},U.prototype.setStrokeWidth=function(K){this.strokeWidth=K,this.adjustVisual()},U.prototype.setStrokeDasharray=function(K){this.strokeDasharray=K,this.adjustVisual()},U.prototype.scale=function(K,ee){this.curveX=this.curveX*K,this.curveY=this.curveY*ee,Z.prototype.scale.call(this,K,ee)},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var K=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Z.prototype.getState.call(this));return K.typeName=U.typeName,K},U.prototype.restoreState=function(K){Z.prototype.restoreState.call(this,K);var ee=K;this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.curveX=ee.curveX,this.curveY=ee.curveY,this.createVisual(),this.adjustVisual()},U.typeName="CurveMarker",U.title="Curve marker",U.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>',U}(b),Ae=function(){function Z(U,K){K===void 0&&(K=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=U,this.cancelable=K}return Object.defineProperty(Z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Z.prototype.preventDefault=function(){this._defaultPrevented=!0},Z}(),ke=function(Z){function U(K,ee,oe){var Q=Z.call(this,K,!1)||this;return Q.dataUrl=ee,Q.state=oe,Q}return z(U,Z),U}(Ae),je=function(Z){function U(K,ee,oe){oe===void 0&&(oe=!1);var Q=Z.call(this,K,oe)||this;return Q.marker=ee,Q}return z(U,Z),U}(Ae),Be=function(){function Z(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return Z.prototype.addEventListener=function(U,K){this[U].push(K)},Z.prototype.removeEventListener=function(U,K){var ee=this[U].indexOf(K);ee>-1&&this[U].splice(ee,1)},Z}(),we=function(){function Z(U){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new v,this._isOpen=!1,this.undoRedoManager=new Se,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 Be,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Z.instanceCounter++,this.styles=new D(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=U,this.targetRoot=document.body,this.width=U.clientWidth,this.height=U.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(Z.prototype,"ALL_MARKER_TYPES",{get:function(){return[w,E,k,O,se,V,G,R,ne,F,m,De]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[w,E,k,O,V,G,R]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[w,E,k,O,G]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(U){var K=this;this._availableMarkerTypes.splice(0),U.forEach(function(ee){if(typeof ee=="string"){var oe=K.ALL_MARKER_TYPES.find(function(Q){return Q.typeName===ee});oe!==void 0&&K._availableMarkerTypes.push(oe)}else K._availableMarkerTypes.push(ee)})},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(U){this._zoomLevel=U,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Z.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),B.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Z.prototype.show=function(){var U=this;this.styles.styleSheetRoot===void 0&&n.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=n.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(K){return K(new Ae(U))})},Z.prototype.render=function(){return P(this,void 0,void 0,function(){var U;return X(this,function(K){switch(K.label){case 0:return this.setCurrentMarker(),(U=new M).naturalSize=this.renderAtNaturalSize,U.imageType=this.renderImageType,U.imageQuality=this.renderImageQuality,U.markersOnly=this.renderMarkersOnly,U.width=this.renderWidth,U.height=this.renderHeight,[4,U.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return K.sent(),[4,U.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,K.sent()]}})})},Z.prototype.close=function(U){var K=this;if(U===void 0&&(U=!1),this.isOpen){var ee=!1;U||this.eventListeners.beforeclose.forEach(function(oe){var Q=new Ae(K,!0);oe(Q),Q.defaultPrevented&&(ee=!0)}),ee||(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(oe){return oe(new Ae(K))}),this.detachEvents(),this._isOpen=!1)}},Z.prototype.addMarkersToToolbar=function(){for(var U,K=[],ee=0;ee<arguments.length;ee++)K[ee]=arguments[ee];(U=this._availableMarkerTypes).push.apply(U,K)},Z.prototype.addRenderEventListener=function(U){this.addEventListener("render",function(K){U(K.dataUrl,K.state)})},Z.prototype.removeRenderEventListener=function(U){},Z.prototype.addCloseEventListener=function(U){this.addEventListener("close",function(){U()})},Z.prototype.removeCloseEventListener=function(U){},Z.prototype.setupResizeObserver=function(){var U=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){U.resize(U.target.clientWidth,U.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return U.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Z.prototype.onPopupTargetResize=function(){var U=1*this.target.clientWidth/this.target.clientHeight,K=this.editorCanvas.clientWidth/U>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*U:this.editorCanvas.clientWidth,ee=K<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/U;this.resize(K,ee)},Z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Z.prototype.resize=function(U,K){this._isResizing=!0;var ee=U/this.imageWidth,oe=K/this.imageHeight;this.imageWidth=Math.round(U),this.imageHeight=Math.round(K),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(ee,oe),this._isResizing=!1},Z.prototype.scaleMarkers=function(U,K){var ee,oe=this;this._currentMarker&&this._currentMarker instanceof O?this._currentMarker.scale(U,K):(ee=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Q){Q!==oe._currentMarker&&Q.scale(U,K)}),ee!==void 0&&this.setCurrentMarker(ee)},Z.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},Z.prototype.setTopLeft=function(){var U=this.editingTarget.getBoundingClientRect(),K=this.editorCanvas.getBoundingClientRect();this.left=U.left-K.left,this.top=U.top-K.top},Z.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},Z.prototype.addDefs=function(){for(var U,K=[],ee=0;ee<arguments.length;ee++)K[ee]=arguments[ee];this.defs=C.createDefs(),this.addDefsToImage(),(U=this.defs).append.apply(U,K)},Z.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Z.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},Z.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Z.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Z.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},Z.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Z.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},Z.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var U=document.createElement("a");U.href="https://markerjs.com/",U.target="_blank",U.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>',U.title="Powered by marker.js",U.style.display="grid",U.style.alignItems="center",U.style.justifyItems="center",U.style.padding="3px",U.style.width="20px",U.style.height="20px",this.logoUI.appendChild(U),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Z.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},Z.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},Z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Z.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var U=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=U+"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 h(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new c(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Z.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Z.prototype.removeMarker=function(U){this.markerImage.removeChild(U.container),this.markers.indexOf(U)>-1&&this.markers.splice(this.markers.indexOf(U),1),U.dispose()},Z.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},Z.prototype.toolbarButtonClicked=function(U,K){if(U==="marker"&&K!==void 0)this.createNewMarker(K);else if(U==="action")switch(K){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Z.prototype.deleteSelectedMarker=function(){var U=this;if(this._currentMarker!==void 0){var K=!1;if(this.eventListeners.markerbeforedelete.forEach(function(oe){var Q=new je(U,U._currentMarker,!0);oe(Q),Q.defaultPrevented&&(K=!0)}),!K){var ee=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(oe){return oe(new je(U,ee))})}}},Z.prototype.clear=function(){var U=this,K=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ce){var ze=new je(U,void 0,!0);Ce(ze),ze.defaultPrevented&&(K=!0)}),!K)){this.setCurrentMarker();for(var ee=function(Ce){var ze=oe.markers[Ce];oe.setCurrentMarker(oe.markers[Ce]),oe._currentMarker.dispose(),oe.markerImage.removeChild(oe._currentMarker.container),oe.markers.splice(oe.markers.indexOf(oe._currentMarker),1),oe.eventListeners.markerdelete.forEach(function(nt){return nt(new je(U,ze))})},oe=this,Q=this.markers.length-1;Q>=0;Q--)ee(Q);this.addUndoStep()}},Object.defineProperty(Z.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Z.prototype.showNotesEditor=function(){var U;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=(U=this._currentMarker.notes)!==null&&U!==void 0?U:"",this.overlayContainer.appendChild(this.notesArea))},Z.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},Z.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Z.prototype.addUndoStep=function(){var U=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var K=this.getState(),ee=this.undoRedoManager.getLastUndoStep();if(!ee||ee.width===K.width&&ee.height===K.height){var oe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(K),oe<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Q){return Q(new Ae(U))})}else this.undoRedoManager.replaceLastUndoStep(K),this.eventListeners.statechange.forEach(function(Q){return Q(new Ae(U))})}},Z.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Z.prototype.undoStep=function(){var U=this,K=this.undoRedoManager.undo();K!==void 0&&(this.restoreState(K),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ee){return ee(new Ae(U))}))},Z.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Z.prototype.redoStep=function(){var U=this,K=this.undoRedoManager.redo();K!==void 0&&(this.restoreState(K),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ee){return ee(new Ae(U))}))},Z.prototype.stepZoom=function(){var U=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=U<this.zoomSteps.length-1?this.zoomSteps[U+1]:this.zoomSteps[0]},Z.prototype.panTo=function(U){this.contentDiv.scrollBy({left:this.prevPanPoint.x-U.x,top:this.prevPanPoint.y-U.y}),this.prevPanPoint=U},Z.prototype.startRenderAndClose=function(){return P(this,void 0,void 0,function(){var U,K,ee=this;return X(this,function(oe){switch(oe.label){case 0:return[4,this.render()];case 1:return U=oe.sent(),K=this.getState(),this.eventListeners.render.forEach(function(Q){return Q(new ke(ee,U,K))}),this.close(!0),[2]}})})},Z.prototype.getState=function(U){U===!0&&this.setCurrentMarker();var K={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ee){return K.markers.push(ee.getState())}),K},Z.prototype.restoreState=function(U){var K=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);U.markers.forEach(function(ee){var oe=K._availableMarkerTypes.find(function(Ce){return Ce.typeName===ee.typeName});if(oe!==void 0){var Q=K.addNewMarker(oe);Q.restoreState(ee),K.markers.push(Q)}}),U.width&&U.height&&(U.width!==this.imageWidth||U.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/U.width,this.imageHeight/U.height),this.eventListeners.restorestate.forEach(function(ee){return ee(new Ae(K))})},Z.prototype.addNewMarker=function(U){var K=C.createGroup();return this.markerImage.appendChild(K),new U(K,this.overlayContainer,this.settings)},Z.prototype.createNewMarker=function(U){var K,ee=this;(K=typeof U=="string"?this._availableMarkerTypes.find(function(oe){return oe.typeName===U}):U)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(K),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(K.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(oe){return oe(new je(ee,ee._currentMarker))}))},Z.prototype.markerCreated=function(U){var K=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(U),this.setCurrentMarker(U),U instanceof E&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(E):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ee){return ee(new je(K,K._currentMarker))})},Z.prototype.colorChanged=function(U){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=U,this.settings.defaultStrokeColor=U)},Z.prototype.fillColorChanged=function(U){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=U)},Z.prototype.markerStateChanged=function(U){var K=this;this.eventListeners.markerchange.forEach(function(ee){return ee(new je(K,U))})},Z.prototype.setCurrentMarker=function(U){var K=this;this._currentMarker!==U&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(ee){return ee(new je(K,K._currentMarker))})),this._currentMarker=U,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(ee){return ee(new je(K,K._currentMarker))}))},Z.prototype.onPointerDown=function(U){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||U.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var K=this.markers.find(function(ee){return ee.ownsTarget(U.target)});K!==void 0?(this.setCurrentMarker(K),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(U.clientX,U.clientY),U.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:U.clientX,y:U.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(U.clientX,U.clientY))},Z.prototype.onDblClick=function(U){if(this._isFocused||this.focus(),this.mode==="select"){var K=this.markers.find(function(ee){return ee.ownsTarget(U.target)});K!==void 0&&K!==this._currentMarker&&this.setCurrentMarker(K),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(U.clientX,U.clientY),U.target):this.setCurrentMarker()}},Z.prototype.onPointerMove=function(U){this.touchPoints!==1&&U.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||U.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(U.clientX,U.clientY)):this.zoomLevel>1&&this.panTo({x:U.clientX,y:U.clientY}))},Z.prototype.onPointerUp=function(U){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(U.clientX,U.clientY)),this.isDragging=!1,this.addUndoStep()},Z.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Z.prototype.onKeyUp=function(U){this._currentMarker===void 0||this.notesArea!==void 0||U.key!=="Delete"&&U.key!=="Backspace"||this.deleteSelectedMarker()},Z.prototype.clientToLocalCoordinates=function(U,K){var ee=this.markerImage.getBoundingClientRect();return{x:(U-ee.left)/this.zoomLevel,y:(K-ee.top)/this.zoomLevel}},Z.prototype.onWindowResize=function(){this.positionUI()},Z.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var U=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=U+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Z.prototype.addLicenseKey=function(U){B.addKey(U)},Z.prototype.addEventListener=function(U,K){this.eventListeners.addEventListener(U,K)},Z.prototype.removeEventListener=function(U,K){this.eventListeners.removeEventListener(U,K)},Z.prototype.renderState=function(U){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(U),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Z.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Z.prototype.focus=function(){var U=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(K){return K(new Ae(U))}))},Z.prototype.blur=function(){var U=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(K){return K(new Ae(U))}))},Z.instanceCounter=0,Z}()},T8No:function(He,pe,I){"use strict";I.d(pe,"a",function(){return B}),I.d(pe,"e",function(){return M}),I.d(pe,"c",function(){return m}),I.d(pe,"b",function(){return f}),I.d(pe,"d",function(){return O}),I.d(pe,"f",function(){return k});var J=I("MNsG"),z=I("N0LK"),P=I("Cg/j");let X=J.k||"";const N=new Map;N.set("false",!1),N.set("true",!0),N.set("isMac",J.f),N.set("isLinux",J.d),N.set("isWindows",J.i),N.set("isWeb",J.h),N.set("isMacNative",J.f&&!J.h),N.set("isEdge",X.indexOf("Edg/")>=0),N.set("isFirefox",X.indexOf("Firefox")>=0),N.set("isChrome",X.indexOf("Chrome")>=0),N.set("isSafari",X.indexOf("Safari")>=0);const C=Object.prototype.hasOwnProperty;class B{static has(L){return p.create(L)}static equals(L,G){return h.create(L,G)}static regex(L,G){return T.create(L,G)}static not(L){return r.create(L)}static and(...L){return v.create(L,null)}static or(...L){return b.create(L,null,!0)}static deserialize(L,G=!1){return L?this._deserializeOrExpression(L,G):void 0}static _deserializeOrExpression(L,G){let j=L.split("||");return b.create(j.map(R=>this._deserializeAndExpression(R,G)),null,!0)}static _deserializeAndExpression(L,G){let j=L.split("&&");return v.create(j.map(R=>this._deserializeOne(R,G)),null)}static _deserializeOne(L,G){if(L=L.trim(),L.indexOf("!=")>=0){let j=L.split("!=");return d.create(j[0].trim(),this._deserializeValue(j[1],G))}if(L.indexOf("==")>=0){let j=L.split("==");return h.create(j[0].trim(),this._deserializeValue(j[1],G))}if(L.indexOf("=~")>=0){let j=L.split("=~");return T.create(j[0].trim(),this._deserializeRegexValue(j[1],G))}if(L.indexOf(" in ")>=0){let j=L.split(" in ");return c.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(L)){const j=L.split(">=");return s.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(L)){const j=L.split(">");return i.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(L)){const j=L.split("<=");return x.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(L)){const j=L.split("<");return S.create(j[0].trim(),j[1].trim())}return/^\!\s*/.test(L)?r.create(L.substr(1).trim()):p.create(L)}static _deserializeValue(L,G){if(L=L.trim(),L==="true")return!0;if(L==="false")return!1;let j=/^'([^']*)'$/.exec(L);return j?j[1].trim():L}static _deserializeRegexValue(L,G){if(Object(z.C)(L)){if(G)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let j=L.indexOf("/"),R=L.lastIndexOf("/");if(j===R||j<0){if(G)throw new Error(`bad regexp-value '${L}', missing /-enclosure`);return console.warn(`bad regexp-value '${L}', missing /-enclosure`),null}let V=L.slice(j+1,R),ne=L[R+1]==="i"?"i":"";try{return new RegExp(V,ne)}catch(se){if(G)throw new Error(`bad regexp-value '${L}', parse error: ${se}`);return console.warn(`bad regexp-value '${L}', parse error: ${se}`),null}}}function M(L,G){const j=L?L.substituteConstants():void 0,R=G?G.substituteConstants():void 0;return!j&&!R?!0:!j||!R?!1:j.equals(R)}function n(L,G){return L.cmp(G)}class D{constructor(){this.type=0}cmp(L){return this.type-L.type}equals(L){return L.type===this.type}substituteConstants(){return this}evaluate(L){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}D.INSTANCE=new D;class g{constructor(){this.type=1}cmp(L){return this.type-L.type}equals(L){return L.type===this.type}substituteConstants(){return this}evaluate(L){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}g.INSTANCE=new g;class p{constructor(L,G){this.key=L,this.negated=G,this.type=2}static create(L,G=null){const j=N.get(L);return typeof j=="boolean"?j?g.INSTANCE:D.INSTANCE:new p(L,G)}cmp(L){return L.type!==this.type?this.type-L.type:E(this.key,L.key)}equals(L){return L.type===this.type?this.key===L.key:!1}substituteConstants(){const L=N.get(this.key);return typeof L=="boolean"?L?g.INSTANCE:D.INSTANCE:this}evaluate(L){return!!L.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this)),this.negated}}class h{constructor(L,G,j){this.key=L,this.value=G,this.negated=j,this.type=4}static create(L,G,j=null){if(typeof G=="boolean")return G?p.create(L,j):r.create(L,j);const R=N.get(L);if(typeof R=="boolean"){const V=R?"true":"false";return G===V?g.INSTANCE:D.INSTANCE}return new h(L,G,j)}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){const L=N.get(this.key);if(typeof L=="boolean"){const G=L?"true":"false";return this.value===G?g.INSTANCE:D.INSTANCE}return this}evaluate(L){return L.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class c{constructor(L,G){this.key=L,this.valueKey=G,this.type=10,this.negated=null}static create(L,G){return new c(L,G)}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.valueKey,L.key,L.valueKey)}equals(L){return L.type===this.type?this.key===L.key&&this.valueKey===L.valueKey:!1}substituteConstants(){return this}evaluate(L){const G=L.getValue(this.valueKey),j=L.getValue(this.key);return Array.isArray(G)?G.indexOf(j)>=0:typeof j=="string"&&typeof G=="object"&&G!==null?C.call(G,j):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(L){this._actual=L,this.type=11}static create(L){return new o(L)}cmp(L){return L.type!==this.type?this.type-L.type:this._actual.cmp(L._actual)}equals(L){return L.type===this.type?this._actual.equals(L._actual):!1}substituteConstants(){return this}evaluate(L){return!this._actual.evaluate(L)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class d{constructor(L,G,j){this.key=L,this.value=G,this.negated=j,this.type=5}static create(L,G,j=null){if(typeof G=="boolean")return G?r.create(L,j):p.create(L,j);const R=N.get(L);if(typeof R=="boolean"){const V=R?"true":"false";return G===V?D.INSTANCE:g.INSTANCE}return new d(L,G,j)}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){const L=N.get(this.key);if(typeof L=="boolean"){const G=L?"true":"false";return this.value===G?D.INSTANCE:g.INSTANCE}return this}evaluate(L){return L.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this.value,this)),this.negated}}class r{constructor(L,G){this.key=L,this.negated=G,this.type=3}static create(L,G=null){const j=N.get(L);return typeof j=="boolean"?j?D.INSTANCE:g.INSTANCE:new r(L,G)}cmp(L){return L.type!==this.type?this.type-L.type:E(this.key,L.key)}equals(L){return L.type===this.type?this.key===L.key:!1}substituteConstants(){const L=N.get(this.key);return typeof L=="boolean"?L?D.INSTANCE:g.INSTANCE:this}evaluate(L){return!L.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this)),this.negated}}function a(L,G){if(typeof L=="string"){const j=parseFloat(L);isNaN(j)||(L=j)}return typeof L=="string"||typeof L=="number"?G(L):D.INSTANCE}class i{constructor(L,G,j){this.key=L,this.value=G,this.negated=j,this.type=12}static create(L,G,j=null){return a(G,R=>new i(L,R,j))}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){return this}evaluate(L){return typeof this.value=="string"?!1:parseFloat(L.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=x.create(this.key,this.value,this)),this.negated}}class s{constructor(L,G,j){this.key=L,this.value=G,this.negated=j,this.type=13}static create(L,G,j=null){return a(G,R=>new s(L,R,j))}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){return this}evaluate(L){return typeof this.value=="string"?!1:parseFloat(L.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=S.create(this.key,this.value,this)),this.negated}}class S{constructor(L,G,j){this.key=L,this.value=G,this.negated=j,this.type=14}static create(L,G,j=null){return a(G,R=>new S(L,R,j))}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){return this}evaluate(L){return typeof this.value=="string"?!1:parseFloat(L.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class x{constructor(L,G,j){this.key=L,this.value=G,this.negated=j,this.type=15}static create(L,G,j=null){return a(G,R=>new x(L,R,j))}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){return this}evaluate(L){return typeof this.value=="string"?!1:parseFloat(L.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class T{constructor(L,G){this.key=L,this.regexp=G,this.type=7,this.negated=null}static create(L,G){return new T(L,G)}cmp(L){if(L.type!==this.type)return this.type-L.type;if(this.key<L.key)return-1;if(this.key>L.key)return 1;const G=this.regexp?this.regexp.source:"",j=L.regexp?L.regexp.source:"";return G<j?-1:G>j?1:0}equals(L){if(L.type===this.type){const G=this.regexp?this.regexp.source:"",j=L.regexp?L.regexp.source:"";return this.key===L.key&&G===j}return!1}substituteConstants(){return this}evaluate(L){let G=L.getValue(this.key);return this.regexp?this.regexp.test(G):!1}serialize(){const L=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${L}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this)),this.negated}}class A{constructor(L){this._actual=L,this.type=8}static create(L){return new A(L)}cmp(L){return L.type!==this.type?this.type-L.type:this._actual.cmp(L._actual)}equals(L){return L.type===this.type?this._actual.equals(L._actual):!1}substituteConstants(){return this}evaluate(L){return!this._actual.evaluate(L)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function w(L){let G=null;for(let j=0,R=L.length;j<R;j++){const V=L[j].substituteConstants();if(L[j]!==V&&G===null){G=[];for(let ne=0;ne<j;ne++)G[ne]=L[ne]}G!==null&&(G[j]=V)}return G===null?L:G}class v{constructor(L,G){this.expr=L,this.negated=G,this.type=6}static create(L,G){return v._normalizeArr(L,G)}cmp(L){if(L.type!==this.type)return this.type-L.type;if(this.expr.length<L.expr.length)return-1;if(this.expr.length>L.expr.length)return 1;for(let G=0,j=this.expr.length;G<j;G++){const R=n(this.expr[G],L.expr[G]);if(R!==0)return R}return 0}equals(L){if(L.type===this.type){if(this.expr.length!==L.expr.length)return!1;for(let G=0,j=this.expr.length;G<j;G++)if(!this.expr[G].equals(L.expr[G]))return!1;return!0}return!1}substituteConstants(){const L=w(this.expr);return L===this.expr?this:v.create(L,this.negated)}evaluate(L){for(let G=0,j=this.expr.length;G<j;G++)if(!this.expr[G].evaluate(L))return!1;return!0}static _normalizeArr(L,G){const j=[];let R=!1;for(const V of L){if(!V)continue;if(V.type===1){R=!0;continue}if(V.type===0)return D.INSTANCE;if(V.type===6){j.push(...V.expr);continue}j.push(V)}if(j.length===0&&R)return g.INSTANCE;if(j.length===0)return;if(j.length===1)return j[0];j.sort(n);for(let V=1;V<j.length;V++)j[V-1].equals(j[V])&&(j.splice(V,1),V--);if(j.length===1)return j[0];for(;j.length>1;){const V=j[j.length-1];if(V.type!==9)break;j.pop();const ne=j.pop(),se=j.length===0,Se=b.create(V.expr.map(De=>v.create([De,ne],null)),null,se);Se&&(j.push(Se),j.sort(n))}return j.length===1?j[0]:new v(j,G)}serialize(){return this.expr.map(L=>L.serialize()).join(" && ")}keys(){const L=[];for(let G of this.expr)L.push(...G.keys());return L}negate(){if(!this.negated){const L=[];for(let G of this.expr)L.push(G.negate());this.negated=b.create(L,this,!0)}return this.negated}}class b{constructor(L,G){this.expr=L,this.negated=G,this.type=9}static create(L,G,j){return b._normalizeArr(L,G,j)}cmp(L){if(L.type!==this.type)return this.type-L.type;if(this.expr.length<L.expr.length)return-1;if(this.expr.length>L.expr.length)return 1;for(let G=0,j=this.expr.length;G<j;G++){const R=n(this.expr[G],L.expr[G]);if(R!==0)return R}return 0}equals(L){if(L.type===this.type){if(this.expr.length!==L.expr.length)return!1;for(let G=0,j=this.expr.length;G<j;G++)if(!this.expr[G].equals(L.expr[G]))return!1;return!0}return!1}substituteConstants(){const L=w(this.expr);return L===this.expr?this:b.create(L,this.negated,!1)}evaluate(L){for(let G=0,j=this.expr.length;G<j;G++)if(this.expr[G].evaluate(L))return!0;return!1}static _normalizeArr(L,G,j){let R=[],V=!1;if(L){for(let ne=0,se=L.length;ne<se;ne++){const Se=L[ne];if(!Se)continue;if(Se.type===0){V=!0;continue}if(Se.type===1)return g.INSTANCE;if(Se.type===9){R=R.concat(Se.expr);continue}R.push(Se)}if(R.length===0&&V)return D.INSTANCE;R.sort(n)}if(R.length===0)return;if(R.length===1)return R[0];for(let ne=1;ne<R.length;ne++)R[ne-1].equals(R[ne])&&(R.splice(ne,1),ne--);if(R.length===1)return R[0];if(j){for(let ne=0;ne<R.length;ne++)for(let se=ne+1;se<R.length;se++)k(R[ne],R[se])&&(R.splice(se,1),se--);if(R.length===1)return R[0]}return new b(R,G)}serialize(){return this.expr.map(L=>L.serialize()).join(" || ")}keys(){const L=[];for(let G of this.expr)L.push(...G.keys());return L}negate(){if(!this.negated){let L=[];for(let G of this.expr)L.push(G.negate());for(;L.length>1;){const G=L.shift(),j=L.shift(),R=[];for(const ne of F(G))for(const se of F(j))R.push(v.create([ne,se],null));const V=L.length===0;L.unshift(b.create(R,null,V))}this.negated=L[0]}return this.negated}}class m extends p{constructor(L,G,j){super(L,null);this._defaultValue=G,typeof j=="object"?m._info.push(Object.assign(Object.assign({},j),{key:L})):j!==!0&&m._info.push({key:L,description:j,type:G!=null?typeof G:void 0})}static all(){return m._info.values()}bindTo(L){return L.createKey(this.key,this._defaultValue)}getValue(L){return L.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(L){return h.create(this.key,L)}}m._info=[];const f=Object(P.c)("contextKeyService"),O="setContext";function E(L,G){return L<G?-1:L>G?1:0}function _(L,G,j,R){return L<j?-1:L>j?1:G<R?-1:G>R?1:0}function k(L,G){if(G.type===6&&L.type!==9&&L.type!==6){for(const V of G.expr)if(L.equals(V))return!0}const j=L.negate(),R=F(j).concat(F(G));R.sort(n);for(let V=0;V<R.length;V++){const ne=R[V],se=ne.negate();for(let Se=V+1;Se<R.length;Se++){const De=R[Se];if(se.equals(De))return!0}}return!1}function F(L){return L.type===9?L.expr:[L]}},TXwP:function(He,pe,I){var J,z;(function(){var P;(function(){"use strict";var N=[,,function(n){function D(h){this.__parent=h,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var h=new D(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},D.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},D.prototype.has_match=function(h){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(h))return!0;return!1},D.prototype.set_indent=function(h,c){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(h){this.__items.push(h);var c=h.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=h.length-c:this.__character_count+=h.length},D.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function g(h,c){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),c=c||"",h.indent_level>0&&(c=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}g.prototype.get_indent_size=function(h,c){var o=this.__base_string_length;return c=c||0,h<0&&(o=0),o+=h*this.__indent_size,o+=c,o},g.prototype.get_indent_string=function(h,c){var o=this.__base_string;return c=c||0,h<0&&(h=0,o=""),c+=h*this.__indent_size,this.__ensure_cache(c),o+=this.__cache[c],o},g.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var h=this.__cache.length,c=0,o="";this.__indent_size&&h>=this.__indent_size&&(c=Math.floor(h/this.__indent_size),h-=c*this.__indent_size,o=new Array(c+1).join(this.__indent_string)),h&&(o+=new Array(h+1).join(" ")),this.__cache.push(o)};function p(h,c){this.__indent_cache=new g(h,c),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(h,c){return this.__indent_cache.get_indent_string(h,c)},p.prototype.get_indent_size=function(h,c){return this.__indent_cache.get_indent_size(h,c)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(h){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
|
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(o=o.replace(/[\n]/g,h)),o},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(h,c){return h=h||0,c=c||0,this.next_line.set_indent(h,c),this.__lines.length>1?(this.current_line.set_indent(h,c),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(h){for(var c=0;c<h.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(h){for(var c=this.__lines.length;h<c;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(h,c){for(var o=this.__lines.length-2;o>=0;){var d=this.__lines[o];if(d.is_empty())break;if(d.item(0).indexOf(h)!==0&&d.item(-1)!==c){this.__lines.splice(o+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=p},,,,function(n){function D(h,c){this.raw_options=g(h,c),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}D.prototype._get_array=function(h,c){var o=this.raw_options[h],d=c||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(d=o.concat()):typeof o=="string"&&(d=o.split(/[^a-zA-Z0-9_\/\-]+/)),d},D.prototype._get_boolean=function(h,c){var o=this.raw_options[h],d=o===void 0?!!c:!!o;return d},D.prototype._get_characters=function(h,c){var o=this.raw_options[h],d=c||"";return typeof o=="string"&&(d=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},D.prototype._get_number=function(h,c){var o=this.raw_options[h];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(o,10);return isNaN(d)&&(d=c),d},D.prototype._get_selection=function(h,c,o){var d=this._get_selection_list(h,c,o);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[h]+"'");return d[0]},D.prototype._get_selection_list=function(h,c,o){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[c[0]],!this._is_valid_selection(o,c))throw new Error("Invalid Default Value!");var d=this._get_array(h,o);if(!this._is_valid_selection(d,c))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[h]+"'");return d},D.prototype._is_valid_selection=function(h,c){return h.length&&c.length&&!h.some(function(o){return c.indexOf(o)===-1})};function g(h,c){var o={};h=p(h);var d;for(d in h)d!==c&&(o[d]=h[d]);if(c&&h[c])for(d in h[c])o[d]=h[c][d];return o}function p(h){var c={},o;for(o in h){var d=o.replace(/-/g,"_");c[d]=h[o]}return c}n.exports.Options=D,n.exports.normalizeOpts=p,n.exports.mergeOpts=g},,function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function g(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},g.prototype.peek=function(p){var h=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(h=this.__input.charAt(p)),h},g.prototype.__match=function(p,h){p.lastIndex=h;var c=p.exec(this.__input);return c&&!(D&&p.sticky)&&(c.index!==h&&(c=null)),c},g.prototype.test=function(p,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(p,h):!1},g.prototype.testChar=function(p,h){var c=this.peek(h);return p.lastIndex=0,c!==null&&p.test(c)},g.prototype.match=function(p){var h=this.__match(p,this.__position);return h?this.__position+=h[0].length:h=null,h},g.prototype.read=function(p,h,c){var o="",d;return p&&(d=this.match(p),d&&(o+=d[0])),h&&(d||!p)&&(o+=this.readUntil(h,c)),o},g.prototype.readUntil=function(p,h){var c="",o=this.__position;p.lastIndex=this.__position;var d=p.exec(this.__input);return d?(o=d.index,h&&(o+=d[0].length)):o=this.__input_length,c=this.__input.substring(this.__position,o),this.__position=o,c},g.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},g.prototype.get_regexp=function(p,h){var c=null,o="g";return h&&D&&(o="y"),typeof p=="string"&&p!==""?c=new RegExp(p,o):p&&(c=new RegExp(p.source,o)),c},g.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(p){var h=this.__position,c=this.readUntilAfter(p);return this.__position=h,c},g.prototype.lookBack=function(p){var h=this.__position-1;return h>=p.length&&this.__input.substring(h-p.length,h).toLowerCase()===p},n.exports.InputScanner=g},,,,,function(n){function D(g,p){g=typeof g=="string"?g:g.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+p,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(g);h;)p[h[1]]=h[2],h=this.__directive_pattern.exec(g);return p},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},,function(n,D,g){var p=g(16).Beautifier,h=g(17).Options;function c(o,d){var r=new p(o,d);return r.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new h}},function(n,D,g){var p=g(17).Options,h=g(2).Output,c=g(8).InputScanner,o=g(13).Directives,d=new o(/\/\*/,/\*\//),r=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,i=/\s/,s=/(?:\s|\n)+/g,S=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,x=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(A,w){this._source_text=A||"",this._options=new p(w),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}T.prototype.eatString=function(A){var w="";for(this._ch=this._input.next();this._ch;){if(w+=this._ch,this._ch==="\\")w+=this._input.next();else if(A.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return w},T.prototype.eatWhitespace=function(A){for(var w=i.test(this._input.peek()),v=0;i.test(this._input.peek());)this._ch=this._input.next(),A&&this._ch===`
|
|
`&&((v===0||v<this._options.max_preserve_newlines)&&(v++,this._output.add_new_line(!0)));return w},T.prototype.foundNestedPseudoClass=function(){for(var A=0,w=1,v=this._input.peek(w);v;){if(v==="{")return!0;if(v==="(")A+=1;else if(v===")"){if(A===0)return!1;A-=1}else if(v===";"||v==="}")return!1;w++,v=this._input.peek(w)}return!1},T.prototype.print_string=function(A){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(A)},T.prototype.preserveSingleSpace=function(A){A&&(this._output.space_before_token=!0)},T.prototype.indent=function(){this._indentLevel++},T.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A=this._source_text,w=this._options.eol;w==="auto"&&(w=`
|
|
`,A&&r.test(A||"")&&(w=A.match(r)[0])),A=A.replace(a,`
|
|
`);var v=A.match(/^[\t ]*/)[0];this._output=new h(this._options,v),this._input=new c(A),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var b=0,m=!1,f=!1,O=!1,E=!1,_=!1,k=!1,F=this._ch,L=!1,G,j,R;G=this._input.read(s),j=G!=="",R=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var V=this._input.read(S),ne=d.get_directives(V);ne&&ne.ignore==="start"&&(V+=d.readIgnored(this._input)),this.print_string(V),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(x)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(j),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var se=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);se.match(/[ :]$/)&&(se=this.eatString(": ").replace(/\s$/,""),this.print_string(se),this._output.space_before_token=!0),se=se.replace(/\s$/,""),se==="extend"?E=!0:se==="import"&&(_=!0),se in this.NESTED_AT_RULE?(this._nestedLevel+=1,se in this.CONDITIONAL_GROUP_RULE&&(O=!0)):!m&&b===0&&se.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(j),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),O?(O=!1,m=this._indentLevel>=this._nestedLevel):m=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&m&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(R==="("?this._output.space_before_token=!1:R!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),R==="{"&&this._output.trim(!0),_=!1,E=!1,f&&(this.outdent(),f=!1),this.print_string(this._ch),m=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var Se=0;Se<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Se++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Se])){L=!0;break}(m||O)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!E&&b===0?(this.print_string(":"),f||(f=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var De=R==='"'||R==="'";this.preserveSingleSpace(De||j),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")L=!1,b===0?(f&&(this.outdent(),f=!1),E=!1,_=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),b++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),b&&(b--,this.outdent()));else{var Ae=!1;this._input.lookBack("with")&&(Ae=!0),this.preserveSingleSpace(j||Ae),this.print_string(this._ch),f&&R==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),k=!0):(this.eatWhitespace(),b++,this.indent())}else if(this._ch===")")b&&(b--,this.outdent()),k&&this._input.peek()===";"&&this._options.selector_separator_newline&&(k=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!f||k)&&b===0&&!_&&!E?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&b===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&i.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(j),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),i.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var ke=R==='"'||R==="'";this.preserveSingleSpace(ke||j),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&L&&this._output.add_new_line()}var je=this._output.get_code(w);return je},n.exports.Beautifier=T},function(n,D,g){var p=g(6).Options;function h(c){p.call(this,c,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r<d.length;r++)d[r]!=="expand"?this.brace_style="collapse":this.brace_style=d[r]}h.prototype=new p,n.exports.Options=h}],C={};function B(n){var D=C[n];if(D!==void 0)return D.exports;var g=C[n]={exports:{}};return N[n](g,g.exports,B),g.exports}var M=B(15);P=M})();var X=P;!(J=[],z=function(){return{css_beautify:X}}.apply(pe,J),z!==void 0&&(He.exports=z))})()},TcMa:function(He,pe,I){He.exports={desc:"desc___qlRMF",info:"info___JEaKq","commit-info":"commit-info___3-4e0"}},UZu5:function(He,pe,I){},VEzc:function(He,pe,I){He.exports={flex_box_center:"flex_box_center___z2AYj",flex_space_between:"flex_space_between___2PZH7",flex_box_vertical_center:"flex_box_vertical_center___3Vw8I",flex_box_center_end:"flex_box_center_end___1dJQf",flex_box_column:"flex_box_column___kstqC",wrap:"wrap___wWYG3",head:"head___1xABk",title:"title___yYb50",content:"content___fzoVv",list:"list___2q90P",footer:"footer___3zT-e"}},Vhoy:function(He,pe,I){"use strict";I.d(pe,"d",function(){return X}),I.d(pe,"e",function(){return N}),I.d(pe,"c",function(){return C}),I.d(pe,"b",function(){return B}),I.d(pe,"a",function(){return M});var J=I("MI8n");class z{constructor(){this._icons=new Map,this._onDidRegister=new J.b}add(n){const D=this._icons.get(n.id);D?n.description?D.description=n.description:console.error(`Duplicate registration of codicon ${n.id}`):(this._icons.set(n.id,n),this._onDidRegister.fire(n))}get(n){return this._icons.get(n)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const P=new z,X=P;function N(n,D){return new B(n,D)}function C(n){return n?n.replace(/\$\((.*?)\)/g,(D,g)=>` ${g} `).trim():""}class B{constructor(n,D,g){this.id=n,this.definition=D,this.description=g,P.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var M;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const D=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function g(c){if(c instanceof B)return["codicon","codicon-"+c.id];const o=D.exec(c.id);if(!o)return g(B.error);let[,d,r]=o;const a=["codicon","codicon-"+d];return r&&a.push("codicon-modifier-"+r.substr(1)),a}n.asClassNameArray=g;function p(c){return g(c).join(" ")}n.asClassName=p;function h(c){return"."+g(c).join(".")}n.asCSSSelector=h})(M||(M={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(B||(B={}))},"VrN/":function(He,pe,I){(function(J,z){He.exports=z()})(this,function(){"use strict";var J=navigator.userAgent,z=navigator.platform,P=/gecko\/\d/i.test(J),X=/MSIE \d/.test(J),N=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(J),C=/Edge\/(\d+)/.exec(J),B=X||N||C,M=B&&(X?document.documentMode||6:+(C||N)[1]),n=!C&&/WebKit\//.test(J),D=n&&/Qt\/\d+\.\d+/.test(J),g=!C&&/Chrome\//.test(J),p=/Opera\//.test(J),h=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(J),o=/PhantomJS/.test(J),d=!C&&/AppleWebKit/.test(J)&&/Mobile\/\w+/.test(J),r=/Android/.test(J),a=d||r||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(J),i=d||/Mac/.test(z),s=/\bCrOS\b/.test(J),S=/win/i.test(z),x=p&&J.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(p=!1,n=!0);var T=i&&(D||p&&(x==null||x<12.11)),A=P||B&&M>=9;function w(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var v=function(e,t){var u=e.className,l=w(t).exec(u);if(l){var y=u.slice(l.index+l[0].length);e.className=u.slice(0,l.index)+(y?l[1]+y:"")}};function b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function m(e,t){return b(e).appendChild(t)}function f(e,t,u,l){var y=document.createElement(e);if(u&&(y.className=u),l&&(y.style.cssText=l),typeof t=="string")y.appendChild(document.createTextNode(t));else if(t)for(var H=0;H<t.length;++H)y.appendChild(t[H]);return y}function O(e,t,u,l){var y=f(e,t,u,l);return y.setAttribute("role","presentation"),y}var E;document.createRange?E=function(e,t,u,l){var y=document.createRange();return y.setEnd(l||e,u),y.setStart(e,t),y}:E=function(e,t,u){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(y){return l}return l.collapse(!0),l.moveEnd("character",u),l.moveStart("character",t),l};function _(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 k(){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 F(e,t){var u=e.className;w(t).test(u)||(e.className+=(u?" ":"")+t)}function L(e,t){for(var u=e.split(" "),l=0;l<u.length;l++)u[l]&&!w(u[l]).test(t)&&(t+=" "+u[l]);return t}var G=function(e){e.select()};d?G=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:B&&(G=function(e){try{e.select()}catch(t){}});function j(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function R(e,t,u){t||(t={});for(var l in e)e.hasOwnProperty(l)&&(u!==!1||!t.hasOwnProperty(l))&&(t[l]=e[l]);return t}function V(e,t,u,l,y){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var H=l||0,q=y||0;;){var ae=e.indexOf(" ",H);if(ae<0||ae>=t)return q+(t-H);q+=ae-H,q+=u-q%u,H=ae+1}}var ne=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};ne.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ne.prototype.set=function(e,t){this.f=t;var u=+new Date+e;(!this.id||u<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=u)};function se(e,t){for(var u=0;u<e.length;++u)if(e[u]==t)return u;return-1}var Se=50,De={toString:function(){return"CodeMirror.Pass"}},Ae={scroll:!1},ke={origin:"*mouse"},je={origin:"+move"};function Be(e,t,u){for(var l=0,y=0;;){var H=e.indexOf(" ",l);H==-1&&(H=e.length);var q=H-l;if(H==e.length||y+q>=t)return l+Math.min(q,t-y);if(y+=H-l,y+=u-y%u,l=H+1,y>=t)return l}}var we=[""];function Z(e){for(;we.length<=e;)we.push(U(we)+" ");return we[e]}function U(e){return e[e.length-1]}function K(e,t){for(var u=[],l=0;l<e.length;l++)u[l]=t(e[l],l);return u}function ee(e,t,u){for(var l=0,y=u(t);l<e.length&&u(e[l])<=y;)l++;e.splice(l,0,t)}function oe(){}function Q(e,t){var u;return Object.create?u=Object.create(e):(oe.prototype=e,u=new oe),t&&R(t,u),u}var Ce=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ze(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ce.test(e))}function nt(e,t){return t?t.source.indexOf("\\w")>-1&&ze(e)?!0:t.test(e):ze(e)}function xe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Re=/[\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 Te(e){return e.charCodeAt(0)>=768&&Re.test(e)}function Oe(e,t,u){for(;(u<0?t>0:t<e.length)&&Te(e.charAt(t));)t+=u;return t}function Ke(e,t,u){for(var l=t>u?-1:1;;){if(t==u)return t;var y=(t+u)/2,H=l<0?Math.ceil(y):Math.floor(y);if(H==t)return e(H)?t:u;e(H)?u=H:t=H+l}}function Qe(e,t,u,l){if(!e)return l(t,u,"ltr",0);for(var y=!1,H=0;H<e.length;++H){var q=e[H];(q.from<u&&q.to>t||t==u&&q.to==t)&&(l(Math.max(q.from,t),Math.min(q.to,u),q.level==1?"rtl":"ltr",H),y=!0)}y||l(t,u,"ltr")}var st=null;function ut(e,t,u){var l;st=null;for(var y=0;y<e.length;++y){var H=e[y];if(H.from<t&&H.to>t)return y;H.to==t&&(H.from!=H.to&&u=="before"?l=y:st=y),H.from==t&&(H.from!=H.to&&u!="before"?l=y:st=y)}return l!=null?l:st}var xt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(ge){return ge<=247?e.charAt(ge):1424<=ge&&ge<=1524?"R":1536<=ge&&ge<=1785?t.charAt(ge-1536):1774<=ge&&ge<=2220?"r":8192<=ge&&ge<=8203?"w":ge==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,y=/[stwN]/,H=/[LRr]/,q=/[Lb1n]/,ae=/[1n]/;function ue(ge,Me,We){this.level=ge,this.from=Me,this.to=We}return function(ge,Me){var We=Me=="ltr"?"L":"R";if(ge.length==0||Me=="ltr"&&!l.test(ge))return!1;for(var qe=ge.length,Je=[],yt=0;yt<qe;++yt)Je.push(u(ge.charCodeAt(yt)));for(var It=0,kt=We;It<qe;++It){var Ht=Je[It];Ht=="m"?Je[It]=kt:kt=Ht}for(var Xt=0,Kt=We;Xt<qe;++Xt){var qt=Je[Xt];qt=="1"&&Kt=="r"?Je[Xt]="n":H.test(qt)&&(Kt=qt,qt=="r"&&(Je[Xt]="R"))}for(var bn=1,dn=Je[0];bn<qe-1;++bn){var Wn=Je[bn];Wn=="+"&&dn=="1"&&Je[bn+1]=="1"?Je[bn]="1":Wn==","&&dn==Je[bn+1]&&(dn=="1"||dn=="n")&&(Je[bn]=dn),dn=Wn}for(var mi=0;mi<qe;++mi){var Vi=Je[mi];if(Vi==",")Je[mi]="N";else if(Vi=="%"){var Ci=void 0;for(Ci=mi+1;Ci<qe&&Je[Ci]=="%";++Ci);for(var Rr=mi&&Je[mi-1]=="!"||Ci<qe&&Je[Ci]=="1"?"1":"N",gr=mi;gr<Ci;++gr)Je[gr]=Rr;mi=Ci-1}}for(var Ni=0,vr=We;Ni<qe;++Ni){var Ji=Je[Ni];vr=="L"&&Ji=="1"?Je[Ni]="L":H.test(Ji)&&(vr=Ji)}for(var Wi=0;Wi<qe;++Wi)if(y.test(Je[Wi])){var Ui=void 0;for(Ui=Wi+1;Ui<qe&&y.test(Je[Ui]);++Ui);for(var Ai=(Wi?Je[Wi-1]:We)=="L",yr=(Ui<qe?Je[Ui]:We)=="L",La=Ai==yr?Ai?"L":"R":We,ua=Wi;ua<Ui;++ua)Je[ua]=La;Wi=Ui-1}for(var ir=[],$r,Xi=0;Xi<qe;)if(q.test(Je[Xi])){var Fs=Xi;for(++Xi;Xi<qe&&q.test(Je[Xi]);++Xi);ir.push(new ue(0,Fs,Xi))}else{var qr=Xi,ma=ir.length,ga=Me=="rtl"?1:0;for(++Xi;Xi<qe&&Je[Xi]!="L";++Xi);for(var ur=qr;ur<Xi;)if(ae.test(Je[ur])){qr<ur&&(ir.splice(ma,0,new ue(1,qr,ur)),ma+=ga);var Ia=ur;for(++ur;ur<Xi&&ae.test(Je[ur]);++ur);ir.splice(ma,0,new ue(2,Ia,ur)),ma+=ga,qr=ur}else++ur;qr<Xi&&ir.splice(ma,0,new ue(1,qr,Xi))}return Me=="ltr"&&(ir[0].level==1&&($r=ge.match(/^\s+/))&&(ir[0].from=$r[0].length,ir.unshift(new ue(0,0,$r[0].length))),U(ir).level==1&&($r=ge.match(/\s+$/))&&(U(ir).to-=$r[0].length,ir.push(new ue(0,qe-$r[0].length,qe)))),Me=="rtl"?ir.reverse():ir}}();function wt(e,t){var u=e.order;return u==null&&(u=e.order=xt(e.text,t)),u}var Fe=[],Ue=function(e,t,u){if(e.addEventListener)e.addEventListener(t,u,!1);else if(e.attachEvent)e.attachEvent("on"+t,u);else{var l=e._handlers||(e._handlers={});l[t]=(l[t]||Fe).concat(u)}};function it(e,t){return e._handlers&&e._handlers[t]||Fe}function lt(e,t,u){if(e.removeEventListener)e.removeEventListener(t,u,!1);else if(e.detachEvent)e.detachEvent("on"+t,u);else{var l=e._handlers,y=l&&l[t];if(y){var H=se(y,u);H>-1&&(l[t]=y.slice(0,H).concat(y.slice(H+1)))}}}function fe(e,t){var u=it(e,t);if(!u.length)return;for(var l=Array.prototype.slice.call(arguments,2),y=0;y<u.length;++y)u[y].apply(null,l)}function ie(e,t,u){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),fe(e,u||t.type,e,t),Ee(t)||t.codemirrorIgnore}function re(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var u=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<t.length;++l)se(u,t[l])==-1&&u.push(t[l])}function de(e,t){return it(e,t).length>0}function me(e){e.prototype.on=function(t,u){Ue(this,t,u)},e.prototype.off=function(t,u){lt(this,t,u)}}function le(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function he(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ee(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ye(e){le(e),he(e)}function Le(e){return e.target||e.srcElement}function Ne(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),i&&e.ctrlKey&&t==1&&(t=3),t}var tt=function(){if(B&&M<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),gt;function Ct(e){if(gt==null){var t=f("span","\u200B");m(e,f("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(gt=t.offsetWidth<=1&&t.offsetHeight>2&&!(B&&M<8))}var u=gt?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var Ot;function St(e){if(Ot!=null)return Ot;var t=m(e,document.createTextNode("A\u062EA")),u=E(t,0,1).getBoundingClientRect(),l=E(t,1,2).getBoundingClientRect();return b(e),!u||u.left==u.right?!1:Ot=l.right-u.right<3}var Ye=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,u=[],l=e.length;t<=l;){var y=e.indexOf(`
|
|
`,t);y==-1&&(y=e.length);var H=e.slice(t,e.charAt(y-1)=="\r"?y-1:y),q=H.indexOf("\r");q!=-1?(u.push(H.slice(0,q)),t+=q+1):(u.push(H),t=y+1)}return u}:function(e){return e.split(/\r\n?|\n/)},at=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(u){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ve=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),be=null;function Ie(e){if(be!=null)return be;var t=m(e,f("span","x")),u=t.getBoundingClientRect(),l=E(t,0,1).getBoundingClientRect();return be=Math.abs(u.left-l.left)>1}var ot={},Xe={};function Rt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ot[e]=t}function Lt(e,t){Xe[e]=t}function et(e){if(typeof e=="string"&&Xe.hasOwnProperty(e))e=Xe[e];else if(e&&typeof e.name=="string"&&Xe.hasOwnProperty(e.name)){var t=Xe[e.name];typeof t=="string"&&(t={name:t}),e=Q(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return et("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return et("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function dt(e,t){t=et(t);var u=ot[t.name];if(!u)return dt(e,"text/plain");var l=u(e,t);if(vt.hasOwnProperty(t.name)){var y=vt[t.name];for(var H in y){if(!y.hasOwnProperty(H))continue;l.hasOwnProperty(H)&&(l["_"+H]=l[H]),l[H]=y[H]}}if(l.name=t.name,t.helperType&&(l.helperType=t.helperType),t.modeProps)for(var q in t.modeProps)l[q]=t.modeProps[q];return l}var vt={};function Tt(e,t){var u=vt.hasOwnProperty(e)?vt[e]:vt[e]={};R(t,u)}function Pt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var u={};for(var l in t){var y=t[l];y instanceof Array&&(y=y.concat([])),u[l]=y}return u}function _e(e,t){for(var u;e.innerMode&&!(u=e.innerMode(t),!u||u.mode==e);)t=u.state,e=u.mode;return u||{mode:e,state:t}}function ce(e,t,u){return e.startState?e.startState(t,u):!0}var W=function(e,t,u){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=u};W.prototype.eol=function(){return this.pos>=this.string.length},W.prototype.sol=function(){return this.pos==this.lineStart},W.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},W.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},W.prototype.eat=function(e){var t=this.string.charAt(this.pos),u;if(typeof e=="string"?u=t==e:u=t&&(e.test?e.test(t):e(t)),u)return++this.pos,t},W.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},W.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},W.prototype.skipToEnd=function(){this.pos=this.string.length},W.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},W.prototype.backUp=function(e){this.pos-=e},W.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=V(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},W.prototype.indentation=function(){return V(this.string,null,this.tabSize)-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},W.prototype.match=function(e,t,u){if(typeof e=="string"){var l=function(q){return u?q.toLowerCase():q},y=this.string.substr(this.pos,e.length);if(l(y)==l(e))return t!==!1&&(this.pos+=e.length),!0}else{var H=this.string.slice(this.pos).match(e);return H&&H.index>0?null:(H&&t!==!1&&(this.pos+=H[0].length),H)}},W.prototype.current=function(){return this.string.slice(this.start,this.pos)},W.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},W.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},W.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Y(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var u=e;!u.lines;)for(var l=0;;++l){var y=u.children[l],H=y.chunkSize();if(t<H){u=y;break}t-=H}return u.lines[t]}function $(e,t,u){var l=[],y=t.line;return e.iter(t.line,u.line+1,function(H){var q=H.text;y==u.line&&(q=q.slice(0,u.ch)),y==t.line&&(q=q.slice(t.ch)),l.push(q),++y}),l}function te(e,t,u){var l=[];return e.iter(t,u,function(y){l.push(y.text)}),l}function ve(e,t){var u=t-e.height;if(u)for(var l=e;l;l=l.parent)l.height+=u}function Pe(e){if(e.parent==null)return null;for(var t=e.parent,u=se(t.lines,e),l=t.parent;l;t=l,l=l.parent)for(var y=0;!(l.children[y]==t);++y)u+=l.children[y].chunkSize();return u+t.first}function Ge(e,t){var u=e.first;e:do{for(var l=0;l<e.children.length;++l){var y=e.children[l],H=y.height;if(t<H){e=y;continue e}t-=H,u+=y.chunkSize()}return u}while(!e.lines);for(var q=0;q<e.lines.length;++q){var ae=e.lines[q],ue=ae.height;if(t<ue)break;t-=ue}return u+q}function _t(e,t){return t>=e.first&&t<e.first+e.size}function bt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function $e(e,t,u){if(u===void 0&&(u=null),!(this instanceof $e))return new $e(e,t,u);this.line=e,this.ch=t,this.sticky=u}function At(e,t){return e.line-t.line||e.ch-t.ch}function Jt(e,t){return e.sticky==t.sticky&&At(e,t)==0}function Et(e){return $e(e.line,e.ch)}function sn(e,t){return At(e,t)<0?t:e}function Yt(e,t){return At(e,t)<0?e:t}function Ut(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function pt(e,t){if(t.line<e.first)return $e(e.first,0);var u=e.first+e.size-1;return t.line>u?$e(u,Y(e,u).text.length):Cn(t,Y(e,t.line).text.length)}function Cn(e,t){var u=e.ch;return u==null||u>t?$e(e.line,t):u<0?$e(e.line,0):e}function ft(e,t){for(var u=[],l=0;l<t.length;l++)u[l]=pt(e,t[l]);return u}var hn=function(e,t){this.state=e,this.lookAhead=t},pn=function(e,t,u,l){this.state=t,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};pn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},pn.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}},pn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},pn.fromSaved=function(e,t,u){return t instanceof hn?new pn(e,Pt(e.mode,t.state),u,t.lookAhead):new pn(e,Pt(e.mode,t),u)},pn.prototype.save=function(e){var t=e!==!1?Pt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new hn(t,this.maxLookAhead):t};function Yn(e,t,u,l){var y=[e.state.modeGen],H={};vi(e,t.text,e.doc.mode,u,function(ge,Me){return y.push(ge,Me)},H,l);for(var q=u.state,ae=function(ge){u.baseTokens=y;var Me=e.state.overlays[ge],We=1,qe=0;u.state=!0,vi(e,t.text,Me.mode,u,function(Je,yt){for(var It=We;qe<Je;){var kt=y[We];kt>Je&&y.splice(We,1,Je,y[We+1],kt),We+=2,qe=Math.min(Je,kt)}if(!yt)return;if(Me.opaque)y.splice(It,We-It,Je,"overlay "+yt),We=It+2;else for(;It<We;It+=2){var Ht=y[It+1];y[It+1]=(Ht?Ht+" ":"")+"overlay "+yt}},H),u.state=q,u.baseTokens=null,u.baseTokenPos=1},ue=0;ue<e.state.overlays.length;++ue)ae(ue);return{styles:y,classes:H.bgClass||H.textClass?H:null}}function ni(e,t,u){if(!t.styles||t.styles[0]!=e.state.modeGen){var l=En(e,Pe(t)),y=t.text.length>e.options.maxHighlightLength&&Pt(e.doc.mode,l.state),H=Yn(e,t,l);y&&(l.state=y),t.stateAfter=l.save(!y),t.styles=H.styles,H.classes?t.styleClasses=H.classes:t.styleClasses&&(t.styleClasses=null),u===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function En(e,t,u){var l=e.doc,y=e.display;if(!l.mode.startState)return new pn(l,!0,t);var H=ii(e,t,u),q=H>l.first&&Y(l,H-1).stateAfter,ae=q?pn.fromSaved(l,q,H):new pn(l,ce(l.mode),H);return l.iter(H,t,function(ue){gi(e,ue.text,ae);var ge=ae.line;ue.stateAfter=ge==t-1||ge%5==0||ge>=y.viewFrom&&ge<y.viewTo?ae.save():null,ae.nextLine()}),u&&(l.modeFrontier=ae.line),ae}function gi(e,t,u,l){var y=e.doc.mode,H=new W(t,e.options.tabSize,u);for(H.start=H.pos=l||0,t==""&&Jn(y,u.state);!H.eol();)An(y,H,u.state),H.start=H.pos}function Jn(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var u=_e(e,t);if(u.mode.blankLine)return u.mode.blankLine(u.state)}function An(e,t,u,l){for(var y=0;y<10;y++){l&&(l[0]=_e(e,u).mode);var H=e.token(t,u);if(t.pos>t.start)return H}throw new Error("Mode "+e.name+" failed to advance stream.")}var Pn=function(e,t,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=u};function Di(e,t,u,l){var y=e.doc,H=y.mode,q;t=pt(y,t);var ae=Y(y,t.line),ue=En(e,t.line,u),ge=new W(ae.text,e.options.tabSize,ue),Me;for(l&&(Me=[]);(l||ge.pos<t.ch)&&!ge.eol();)ge.start=ge.pos,q=An(H,ge,ue.state),l&&Me.push(new Pn(ge,q,Pt(y.mode,ue.state)));return l?Me:new Pn(ge,q,ue.state)}function Hi(e,t){if(e)for(;;){var u=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!u)break;e=e.slice(0,u.index)+e.slice(u.index+u[0].length);var l=u[1]?"bgClass":"textClass";t[l]==null?t[l]=u[2]:new RegExp("(?:^|\\s)"+u[2]+"(?:$|\\s)").test(t[l])||(t[l]+=" "+u[2])}return e}function vi(e,t,u,l,y,H,q){var ae=u.flattenSpans;ae==null&&(ae=e.options.flattenSpans);var ue=0,ge=null,Me=new W(t,e.options.tabSize,l),We,qe=e.options.addModeClass&&[null];for(t==""&&Hi(Jn(u,l.state),H);!Me.eol();){if(Me.pos>e.options.maxHighlightLength?(ae=!1,q&&gi(e,t,l,Me.pos),Me.pos=t.length,We=null):We=Hi(An(u,Me,l.state,qe),H),qe){var Je=qe[0].name;Je&&(We="m-"+(We?Je+" "+We:Je))}if(!ae||ge!=We){for(;ue<Me.start;)ue=Math.min(Me.start,ue+5e3),y(ue,ge);ge=We}Me.start=Me.pos}for(;ue<Me.pos;){var yt=Math.min(Me.pos,ue+5e3);y(yt,ge),ue=yt}}function ii(e,t,u){for(var l,y,H=e.doc,q=u?-1:t-(e.doc.mode.innerMode?1e3:100),ae=t;ae>q;--ae){if(ae<=H.first)return H.first;var ue=Y(H,ae-1),ge=ue.stateAfter;if(ge&&(!u||ae+(ge instanceof hn?ge.lookAhead:0)<=H.modeFrontier))return ae;var Me=V(ue.text,null,e.options.tabSize);(y==null||l>Me)&&(y=ae-1,l=Me)}return y}function _i(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var u=e.first,l=t-1;l>u;l--){var y=Y(e,l).stateAfter;if(y&&(!(y instanceof hn)||l+y.lookAhead<t)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}var Qi=!1,yi=!1;function ri(){Qi=!0}function Pi(){yi=!0}function Li(e,t,u){this.marker=e,this.from=t,this.to=u}function Oi(e,t){if(e)for(var u=0;u<e.length;++u){var l=e[u];if(l.marker==t)return l}}function Si(e,t){for(var u,l=0;l<e.length;++l)e[l]!=t&&(u||(u=[])).push(e[l]);return u}function cr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function _r(e,t,u){var l;if(e)for(var y=0;y<e.length;++y){var H=e[y],q=H.marker,ae=H.from==null||(q.inclusiveLeft?H.from<=t:H.from<t);if(ae||H.from==t&&q.type=="bookmark"&&(!u||!H.marker.insertLeft)){var ue=H.to==null||(q.inclusiveRight?H.to>=t:H.to>t);(l||(l=[])).push(new Li(q,H.from,ue?null:H.to))}}return l}function rr(e,t,u){var l;if(e)for(var y=0;y<e.length;++y){var H=e[y],q=H.marker,ae=H.to==null||(q.inclusiveRight?H.to>=t:H.to>t);if(ae||H.from==t&&q.type=="bookmark"&&(!u||H.marker.insertLeft)){var ue=H.from==null||(q.inclusiveLeft?H.from<=t:H.from<t);(l||(l=[])).push(new Li(q,ue?null:H.from-t,H.to==null?null:H.to-t))}}return l}function Zi(e,t){if(t.full)return null;var u=_t(e,t.from.line)&&Y(e,t.from.line).markedSpans,l=_t(e,t.to.line)&&Y(e,t.to.line).markedSpans;if(!u&&!l)return null;var y=t.from.ch,H=t.to.ch,q=At(t.from,t.to)==0,ae=_r(u,y,q),ue=rr(l,H,q),ge=t.text.length==1,Me=U(t.text).length+(ge?y:0);if(ae)for(var We=0;We<ae.length;++We){var qe=ae[We];if(qe.to==null){var Je=Oi(ue,qe.marker);Je?ge&&(qe.to=Je.to==null?null:Je.to+Me):qe.to=y}}if(ue)for(var yt=0;yt<ue.length;++yt){var It=ue[yt];if(It.to!=null&&(It.to+=Me),It.from==null){var kt=Oi(ae,It.marker);kt||(It.from=Me,ge&&(ae||(ae=[])).push(It))}else It.from+=Me,ge&&(ae||(ae=[])).push(It)}ae&&(ae=Ar(ae)),ue&&ue!=ae&&(ue=Ar(ue));var Ht=[ae];if(!ge){var Xt=t.text.length-2,Kt;if(Xt>0&&ae)for(var qt=0;qt<ae.length;++qt)ae[qt].to==null&&(Kt||(Kt=[])).push(new Li(ae[qt].marker,null,null));for(var bn=0;bn<Xt;++bn)Ht.push(Kt);Ht.push(ue)}return Ht}function Ar(e){for(var t=0;t<e.length;++t){var u=e[t];u.from!=null&&u.from==u.to&&u.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Nr(e,t,u){var l=null;if(e.iter(t.line,u.line+1,function(Je){if(Je.markedSpans)for(var yt=0;yt<Je.markedSpans.length;++yt){var It=Je.markedSpans[yt].marker;It.readOnly&&(!l||se(l,It)==-1)&&(l||(l=[])).push(It)}}),!l)return null;for(var y=[{from:t,to:u}],H=0;H<l.length;++H)for(var q=l[H],ae=q.find(0),ue=0;ue<y.length;++ue){var ge=y[ue];if(At(ge.to,ae.from)<0||At(ge.from,ae.to)>0)continue;var Me=[ue,1],We=At(ge.from,ae.from),qe=At(ge.to,ae.to);(We<0||!q.inclusiveLeft&&!We)&&Me.push({from:ge.from,to:ae.from}),(qe>0||!q.inclusiveRight&&!qe)&&Me.push({from:ae.to,to:ge.to}),y.splice.apply(y,Me),ue+=Me.length-3}return y}function Ur(e){var t=e.markedSpans;if(!t)return;for(var u=0;u<t.length;++u)t[u].marker.detachLine(e);e.markedSpans=null}function ar(e,t){if(!t)return;for(var u=0;u<t.length;++u)t[u].marker.attachLine(e);e.markedSpans=t}function pi(e){return e.inclusiveLeft?-1:0}function ci(e){return e.inclusiveRight?1:0}function Yi(e,t){var u=e.lines.length-t.lines.length;if(u!=0)return u;var l=e.find(),y=t.find(),H=At(l.from,y.from)||pi(e)-pi(t);if(H)return-H;var q=At(l.to,y.to)||ci(e)-ci(t);return q||t.id-e.id}function qi(e,t){var u=yi&&e.markedSpans,l;if(u)for(var y=void 0,H=0;H<u.length;++H)y=u[H],y.marker.collapsed&&(t?y.from:y.to)==null&&(!l||Yi(l,y.marker)<0)&&(l=y.marker);return l}function sr(e){return qi(e,!0)}function er(e){return qi(e,!1)}function zr(e,t){var u=yi&&e.markedSpans,l;if(u)for(var y=0;y<u.length;++y){var H=u[y];H.marker.collapsed&&(H.from==null||H.from<t)&&(H.to==null||H.to>t)&&(!l||Yi(l,H.marker)<0)&&(l=H.marker)}return l}function ea(e,t,u,l,y){var H=Y(e,t),q=yi&&H.markedSpans;if(q)for(var ae=0;ae<q.length;++ae){var ue=q[ae];if(!ue.marker.collapsed)continue;var ge=ue.marker.find(0),Me=At(ge.from,u)||pi(ue.marker)-pi(y),We=At(ge.to,l)||ci(ue.marker)-ci(y);if(Me>=0&&We<=0||Me<=0&&We>=0)continue;if(Me<=0&&(ue.marker.inclusiveRight&&y.inclusiveLeft?At(ge.to,u)>=0:At(ge.to,u)>0)||Me>=0&&(ue.marker.inclusiveRight&&y.inclusiveLeft?At(ge.from,l)<=0:At(ge.from,l)<0))return!0}}function tr(e){for(var t;t=sr(e);)e=t.find(-1,!0).line;return e}function dr(e){for(var t;t=er(e);)e=t.find(1,!0).line;return e}function Lr(e){for(var t,u;t=er(e);)e=t.find(1,!0).line,(u||(u=[])).push(e);return u}function Br(e,t){var u=Y(e,t),l=tr(u);return u==l?t:Pe(l)}function Ir(e,t){if(t>e.lastLine())return t;var u=Y(e,t),l;if(!br(e,u))return t;for(;l=er(u);)u=l.find(1,!0).line;return Pe(u)+1}function br(e,t){var u=yi&&t.markedSpans;if(u)for(var l=void 0,y=0;y<u.length;++y){if(l=u[y],!l.marker.collapsed)continue;if(l.from==null)return!0;if(l.marker.widgetNode)continue;if(l.from==0&&l.marker.inclusiveLeft&&Vr(e,t,l))return!0}}function Vr(e,t,u){if(u.to==null){var l=u.marker.find(1,!0);return Vr(e,l.line,Oi(l.line.markedSpans,u.marker))}if(u.marker.inclusiveRight&&u.to==t.text.length)return!0;for(var y=void 0,H=0;H<t.markedSpans.length;++H)if(y=t.markedSpans[H],y.marker.collapsed&&!y.marker.widgetNode&&y.from==u.to&&(y.to==null||y.to!=u.from)&&(y.marker.inclusiveLeft||u.marker.inclusiveRight)&&Vr(e,t,y))return!0}function hr(e){e=tr(e);for(var t=0,u=e.parent,l=0;l<u.lines.length;++l){var y=u.lines[l];if(y==e)break;t+=y.height}for(var H=u.parent;H;u=H,H=u.parent)for(var q=0;q<H.children.length;++q){var ae=H.children[q];if(ae==u)break;t+=ae.height}return t}function Xr(e){if(e.height==0)return 0;for(var t=e.text.length,u,l=e;u=sr(l);){var y=u.find(0,!0);l=y.from.line,t+=y.from.ch-y.to.ch}for(l=e;u=er(l);){var H=u.find(0,!0);t-=l.text.length-H.from.ch,l=H.to.line,t+=l.text.length-H.to.ch}return t}function Yr(e){var t=e.display,u=e.doc;t.maxLine=Y(u,u.first),t.maxLineLength=Xr(t.maxLine),t.maxLineChanged=!0,u.iter(function(l){var y=Xr(l);y>t.maxLineLength&&(t.maxLineLength=y,t.maxLine=l)})}var or=function(e,t,u){this.text=e,ar(this,t),this.height=u?u(this):1};or.prototype.lineNo=function(){return Pe(this)},me(or);function Jr(e,t,u,l){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ur(e),ar(e,u);var y=l?l(e):1;y!=e.height&&ve(e,y)}function rn(e){e.parent=null,Ur(e)}var yn={},ln={};function In(e,t){if(!e||/^\s*$/.test(e))return null;var u=t.addModeClass?ln:yn;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function Hn(e,t){var u=O("span",null,null,n?"padding-right: .1px":null),l={pre:O("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var y=0;y<=(t.rest?t.rest.length:0);y++){var H=y?t.rest[y-1]:t.line,q=void 0;l.pos=0,l.addToken=Dn,St(e.display.measure)&&(q=wt(H,e.doc.direction))&&(l.addToken=Fi(l.addToken,q)),l.map=[];var ae=t!=e.display.externalMeasured&&Pe(H);fr(H,l,ni(e,H,ae)),H.styleClasses&&(H.styleClasses.bgClass&&(l.bgClass=L(H.styleClasses.bgClass,l.bgClass||"")),H.styleClasses.textClass&&(l.textClass=L(H.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Ct(e.display.measure))),y==0?(t.measure.map=l.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(l.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var ue=l.content.lastChild;(/\bcm-tab\b/.test(ue.className)||ue.querySelector&&ue.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return fe(e,"renderLine",e,t.line,l.pre),l.pre.className&&(l.textClass=L(l.pre.className,l.textClass||"")),l}function Zt(e){var t=f("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Dn(e,t,u,l,y,H,q){if(!t)return;var ae=e.splitSpaces?bi(t,e.trailingSpace):t,ue=e.cm.state.specialChars,ge=!1,Me;if(!ue.test(t))e.col+=t.length,Me=document.createTextNode(ae),e.map.push(e.pos,e.pos+t.length,Me),B&&M<9&&(ge=!0),e.pos+=t.length;else{Me=document.createDocumentFragment();for(var We=0;;){ue.lastIndex=We;var qe=ue.exec(t),Je=qe?qe.index-We:t.length-We;if(Je){var yt=document.createTextNode(ae.slice(We,We+Je));B&&M<9?Me.appendChild(f("span",[yt])):Me.appendChild(yt),e.map.push(e.pos,e.pos+Je,yt),e.col+=Je,e.pos+=Je}if(!qe)break;We+=Je+1;var It=void 0;if(qe[0]==" "){var kt=e.cm.options.tabSize,Ht=kt-e.col%kt;It=Me.appendChild(f("span",Z(Ht),"cm-tab")),It.setAttribute("role","presentation"),It.setAttribute("cm-text"," "),e.col+=Ht}else qe[0]=="\r"||qe[0]==`
|
|
`?(It=Me.appendChild(f("span",qe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),It.setAttribute("cm-text",qe[0]),e.col+=1):(It=e.cm.options.specialCharPlaceholder(qe[0]),It.setAttribute("cm-text",qe[0]),B&&M<9?Me.appendChild(f("span",[It])):Me.appendChild(It),e.col+=1);e.map.push(e.pos,e.pos+1,It),e.pos++}}if(e.trailingSpace=ae.charCodeAt(t.length-1)==32,u||l||y||ge||H||q){var Xt=u||"";l&&(Xt+=l),y&&(Xt+=y);var Kt=f("span",[Me],Xt,H);if(q)for(var qt in q)q.hasOwnProperty(qt)&&qt!="style"&&qt!="class"&&Kt.setAttribute(qt,q[qt]);return e.content.appendChild(Kt)}e.content.appendChild(Me)}function bi(e,t){if(e.length>1&&!/ /.test(e))return e;for(var u=t,l="",y=0;y<e.length;y++){var H=e.charAt(y);H==" "&&u&&(y==e.length-1||e.charCodeAt(y+1)==32)&&(H="\xA0"),l+=H,u=H==" "}return l}function Fi(e,t){return function(u,l,y,H,q,ae,ue){y=y?y+" cm-force-border":"cm-force-border";for(var ge=u.pos,Me=ge+l.length;;){for(var We=void 0,qe=0;qe<t.length&&!(We=t[qe],We.to>ge&&We.from<=ge);qe++);if(We.to>=Me)return e(u,l,y,H,q,ae,ue);e(u,l.slice(0,We.to-ge),y,H,null,ae,ue),H=null,l=l.slice(We.to-ge),ge=We.to}}}function Fn(e,t,u,l){var y=!l&&u.widgetNode;y&&e.map.push(e.pos,e.pos+t,y),!l&&e.cm.display.input.needsContentAttribute&&(y||(y=e.content.appendChild(document.createElement("span"))),y.setAttribute("cm-marker",u.id)),y&&(e.cm.display.input.setUneditable(y),e.content.appendChild(y)),e.pos+=t,e.trailingSpace=!1}function fr(e,t,u){var l=e.markedSpans,y=e.text,H=0;if(!l){for(var q=1;q<u.length;q+=2)t.addToken(t,y.slice(H,H=u[q]),In(u[q+1],t.cm.options));return}for(var ae=y.length,ue=0,ge=1,Me="",We,qe,Je=0,yt,It,kt,Ht,Xt;;){if(Je==ue){yt=It=kt=qe="",Xt=null,Ht=null,Je=Infinity;for(var Kt=[],qt=void 0,bn=0;bn<l.length;++bn){var dn=l[bn],Wn=dn.marker;if(Wn.type=="bookmark"&&dn.from==ue&&Wn.widgetNode)Kt.push(Wn);else if(dn.from<=ue&&(dn.to==null||dn.to>ue||Wn.collapsed&&dn.to==ue&&dn.from==ue)){if(dn.to!=null&&dn.to!=ue&&Je>dn.to&&(Je=dn.to,It=""),Wn.className&&(yt+=" "+Wn.className),Wn.css&&(qe=(qe?qe+";":"")+Wn.css),Wn.startStyle&&dn.from==ue&&(kt+=" "+Wn.startStyle),Wn.endStyle&&dn.to==Je&&(qt||(qt=[])).push(Wn.endStyle,dn.to),Wn.title&&((Xt||(Xt={})).title=Wn.title),Wn.attributes)for(var mi in Wn.attributes)(Xt||(Xt={}))[mi]=Wn.attributes[mi];Wn.collapsed&&(!Ht||Yi(Ht.marker,Wn)<0)&&(Ht=dn)}else dn.from>ue&&Je>dn.from&&(Je=dn.from)}if(qt)for(var Vi=0;Vi<qt.length;Vi+=2)qt[Vi+1]==Je&&(It+=" "+qt[Vi]);if(!Ht||Ht.from==ue)for(var Ci=0;Ci<Kt.length;++Ci)Fn(t,0,Kt[Ci]);if(Ht&&(Ht.from||0)==ue){if(Fn(t,(Ht.to==null?ae+1:Ht.to)-ue,Ht.marker,Ht.from==null),Ht.to==null)return;Ht.to==ue&&(Ht=!1)}}if(ue>=ae)break;for(var Rr=Math.min(ae,Je);;){if(Me){var gr=ue+Me.length;if(!Ht){var Ni=gr>Rr?Me.slice(0,Rr-ue):Me;t.addToken(t,Ni,We?We+yt:yt,kt,ue+Ni.length==Je?It:"",qe,Xt)}if(gr>=Rr){Me=Me.slice(Rr-ue),ue=Rr;break}ue=gr,kt=""}Me=y.slice(H,H=u[ge++]),We=In(u[ge++],t.cm.options)}}}function Qn(e,t,u){this.line=t,this.rest=Lr(t),this.size=this.rest?Pe(U(this.rest))-u+1:1,this.node=this.text=null,this.hidden=br(e,t)}function Ze(e,t,u){for(var l=[],y,H=t;H<u;H=y){var q=new Qn(e.doc,Y(e.doc,H),H);y=H+q.size,l.push(q)}return l}var ht=null;function Nt(e){ht?ht.ops.push(e):e.ownsGroup=ht={ops:[e],delayedCallbacks:[]}}function nn(e){var t=e.delayedCallbacks,u=0;do{for(;u<t.length;u++)t[u].call(null);for(var l=0;l<e.ops.length;l++){var y=e.ops[l];if(y.cursorActivityHandlers)for(;y.cursorActivityCalled<y.cursorActivityHandlers.length;)y.cursorActivityHandlers[y.cursorActivityCalled++].call(null,y.cm)}}while(u<t.length)}function Vt(e,t){var u=e.ownsGroup;if(!u)return;try{nn(u)}finally{ht=null,t(u)}}var Bt=null;function rt(e,t){var u=it(e,t);if(!u.length)return;var l=Array.prototype.slice.call(arguments,2),y;ht?y=ht.delayedCallbacks:Bt?y=Bt:(y=Bt=[],setTimeout(mt,0));for(var H=function(ae){y.push(function(){return u[ae].apply(null,l)})},q=0;q<u.length;++q)H(q)}function mt(){var e=Bt;Bt=null;for(var t=0;t<e.length;++t)e[t]()}function en(e,t,u,l){for(var y=0;y<t.changes.length;y++){var H=t.changes[y];H=="text"?on(e,t):H=="gutter"?On(e,t,u,l):H=="class"?Mn(e,t):H=="widget"&&mn(e,t,l)}t.changes=null}function ct(e){return e.node==e.text&&(e.node=f("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),B&&M<8&&(e.node.style.zIndex=2)),e.node}function tn(e,t){var u=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(u&&(u+=" CodeMirror-linebackground"),t.background)u?t.background.className=u:(t.background.parentNode.removeChild(t.background),t.background=null);else if(u){var l=ct(t);t.background=l.insertBefore(f("div",null,u),l.firstChild),e.display.input.setUneditable(t.background)}}function Dt(e,t){var u=e.display.externalMeasured;return u&&u.line==t.line?(e.display.externalMeasured=null,t.measure=u.measure,u.built):Hn(e,t)}function on(e,t){var u=t.text.className,l=Dt(e,t);t.text==t.node&&(t.node=l.pre),t.text.parentNode.replaceChild(l.pre,t.text),t.text=l.pre,l.bgClass!=t.bgClass||l.textClass!=t.textClass?(t.bgClass=l.bgClass,t.textClass=l.textClass,Mn(e,t)):u&&(t.text.className=u)}function Mn(e,t){tn(e,t),t.line.wrapClass?ct(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var u=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=u||""}function On(e,t,u,l){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var y=ct(t);t.gutterBackground=f("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),y.insertBefore(t.gutterBackground,t.text)}var H=t.line.gutterMarkers;if(e.options.lineNumbers||H){var q=ct(t),ae=t.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ae),q.insertBefore(ae,t.text),t.line.gutterClass&&(ae.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!H||!H["CodeMirror-linenumbers"])&&(t.lineNumber=ae.appendChild(f("div",bt(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),H)for(var ue=0;ue<e.display.gutterSpecs.length;++ue){var ge=e.display.gutterSpecs[ue].className,Me=H.hasOwnProperty(ge)&&H[ge];Me&&ae.appendChild(f("div",[Me],"CodeMirror-gutter-elt","left: "+l.gutterLeft[ge]+"px; width: "+l.gutterWidth[ge]+"px"))}}}function mn(e,t,u){t.alignable&&(t.alignable=null);for(var l=w("CodeMirror-linewidget"),y=t.node.firstChild,H=void 0;y;y=H)H=y.nextSibling,l.test(y.className)&&t.node.removeChild(y);xn(e,t,u)}function Xn(e,t,u,l){var y=Dt(e,t);return t.text=t.node=y.pre,y.bgClass&&(t.bgClass=y.bgClass),y.textClass&&(t.textClass=y.textClass),Mn(e,t),On(e,t,u,l),xn(e,t,l),t.node}function xn(e,t,u){if(Kn(e,t.line,t,u,!0),t.rest)for(var l=0;l<t.rest.length;l++)Kn(e,t.rest[l],t,u,!1)}function Kn(e,t,u,l,y){if(!t.widgets)return;for(var H=ct(u),q=0,ae=t.widgets;q<ae.length;++q){var ue=ae[q],ge=f("div",[ue.node],"CodeMirror-linewidget"+(ue.className?" "+ue.className:""));ue.handleMouseEvents||ge.setAttribute("cm-ignore-events","true"),Gn(ue,ge,u,l),e.display.input.setUneditable(ge),y&&ue.above?H.insertBefore(ge,u.gutter||u.text):H.appendChild(ge),rt(ue,"redraw")}}function Gn(e,t,u,l){if(e.noHScroll){(u.alignable||(u.alignable=[])).push(t);var y=l.wrapperWidth;t.style.left=l.fixedPos+"px",e.coverGutter||(y-=l.gutterTotalWidth,t.style.paddingLeft=l.gutterTotalWidth+"px"),t.style.width=y+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-l.gutterTotalWidth+"px"))}function di(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(document.body,e.node)){var u="position: relative;";e.coverGutter&&(u+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(u+="width: "+t.display.wrapper.clientWidth+"px;"),m(t.display.measure,f("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function Ln(e,t){for(var u=Le(t);u!=e.wrapper;u=u.parentNode)if(!u||u.nodeType==1&&u.getAttribute("cm-ignore-events")=="true"||u.parentNode==e.sizer&&u!=e.mover)return!0}function oi(e){return e.lineSpace.offsetTop}function li(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $n(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=m(e.measure,f("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,l={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function Rn(e){return Se-e.display.nativeBarWidth}function zn(e){return e.display.scroller.clientWidth-Rn(e)-e.display.barWidth}function kn(e){return e.display.scroller.clientHeight-Rn(e)-e.display.barHeight}function jt(e,t,u){var l=e.options.lineWrapping,y=l&&zn(e);if(!t.measure.heights||l&&t.measure.width!=y){var H=t.measure.heights=[];if(l){t.measure.width=y;for(var q=t.text.firstChild.getClientRects(),ae=0;ae<q.length-1;ae++){var ue=q[ae],ge=q[ae+1];Math.abs(ue.bottom-ge.bottom)>2&&H.push((ue.bottom+ge.top)/2-u.top)}}H.push(u.bottom-u.top)}}function gn(e,t,u){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var l=0;l<e.rest.length;l++)if(e.rest[l]==t)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var y=0;y<e.rest.length;y++)if(Pe(e.rest[y])>u)return{map:e.measure.maps[y],cache:e.measure.caches[y],before:!0}}function Zn(e,t){t=tr(t);var u=Pe(t),l=e.display.externalMeasured=new Qn(e.doc,t,u);l.lineN=u;var y=l.built=Hn(e,l);return l.text=y.pre,m(e.display.lineMeasure,y.pre),l}function ui(e,t,u,l){return Tn(e,Vn(e,t),u,l)}function ei(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Tr(e,t)];var u=e.display.externalMeasured;if(u&&t>=u.lineN&&t<u.lineN+u.size)return u}function Vn(e,t){var u=Pe(t),l=ei(e,u);l&&!l.text?l=null:l&&l.changes&&(en(e,l,u,Ri(e)),e.curOp.forceUpdate=!0),l||(l=Zn(e,t));var y=gn(l,t,u);return{line:t,view:l,rect:null,map:y.map,cache:y.cache,before:y.before,hasHeights:!1}}function Tn(e,t,u,l,y){t.before&&(u=-1);var H=u+(l||""),q;return t.cache.hasOwnProperty(H)?q=t.cache[H]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(jt(e,t.view,t.rect),t.hasHeights=!0),q=Wt(e,t,u,l),q.bogus||(t.cache[H]=q)),{left:q.left,right:q.right,top:y?q.rtop:q.top,bottom:y?q.rbottom:q.bottom}}var un={left:0,right:0,top:0,bottom:0};function _n(e,t,u){for(var l,y,H,q,ae,ue,ge=0;ge<e.length;ge+=3)if(ae=e[ge],ue=e[ge+1],t<ae?(y=0,H=1,q="left"):t<ue?(y=t-ae,H=y+1):(ge==e.length-3||t==ue&&e[ge+3]>t)&&(H=ue-ae,y=H-1,t>=ue&&(q="right")),y!=null){if(l=e[ge+2],ae==ue&&u==(l.insertLeft?"left":"right")&&(q=u),u=="left"&&y==0)for(;ge&&e[ge-2]==e[ge-3]&&e[ge-1].insertLeft;)l=e[(ge-=3)+2],q="left";if(u=="right"&&y==ue-ae)for(;ge<e.length-3&&e[ge+3]==e[ge+4]&&!e[ge+5].insertLeft;)l=e[(ge+=3)+2],q="right";break}return{node:l,start:y,end:H,collapse:q,coverStart:ae,coverEnd:ue}}function Ft(e,t){var u=un;if(t=="left")for(var l=0;l<e.length&&!((u=e[l]).left!=u.right);l++);else for(var y=e.length-1;y>=0&&!((u=e[y]).left!=u.right);y--);return u}function Wt(e,t,u,l){var y=_n(t.map,u,l),H=y.node,q=y.start,ae=y.end,ue=y.collapse,ge;if(H.nodeType==3){for(var Me=0;Me<4;Me++){for(;q&&Te(t.line.text.charAt(y.coverStart+q));)--q;for(;y.coverStart+ae<y.coverEnd&&Te(t.line.text.charAt(y.coverStart+ae));)++ae;if(B&&M<9&&q==0&&ae==y.coverEnd-y.coverStart?ge=H.parentNode.getBoundingClientRect():ge=Ft(E(H,q,ae).getClientRects(),l),ge.left||ge.right||q==0)break;ae=q,q=q-1,ue="right"}B&&M<11&&(ge=$t(e.display.measure,ge))}else{q>0&&(ue=l="right");var We;e.options.lineWrapping&&(We=H.getClientRects()).length>1?ge=We[l=="right"?We.length-1:0]:ge=H.getBoundingClientRect()}if(B&&M<9&&!q&&(!ge||!ge.left&&!ge.right)){var qe=H.parentNode.getClientRects()[0];qe?ge={left:qe.left,right:qe.left+jn(e.display),top:qe.top,bottom:qe.bottom}:ge=un}for(var Je=ge.top-t.rect.top,yt=ge.bottom-t.rect.top,It=(Je+yt)/2,kt=t.view.measure.heights,Ht=0;Ht<kt.length-1&&!(It<kt[Ht]);Ht++);var Xt=Ht?kt[Ht-1]:0,Kt=kt[Ht],qt={left:(ue=="right"?ge.right:ge.left)-t.rect.left,right:(ue=="left"?ge.left:ge.right)-t.rect.left,top:Xt,bottom:Kt};return!ge.left&&!ge.right&&(qt.bogus=!0),e.options.singleCursorHeightPerLine||(qt.rtop=Je,qt.rbottom=yt),qt}function $t(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ie(e))return t;var u=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*u,right:t.right*u,top:t.top*l,bottom:t.bottom*l}}function Qt(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 Mt(e){e.display.externalMeasure=null,b(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Qt(e.display.view[t])}function Gt(e){Mt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function an(){return g&&r?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ti(){return g&&r?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ei(e){var t=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(t+=di(e.widgets[u]));return t}function Ki(e,t,u,l,y){if(!y){var H=Ei(t);u.top+=H,u.bottom+=H}if(l=="line")return u;l||(l="local");var q=hr(t);if(l=="local"?q+=oi(e.display):q-=e.display.viewOffset,l=="page"||l=="window"){var ae=e.display.lineSpace.getBoundingClientRect();q+=ae.top+(l=="window"?0:ti());var ue=ae.left+(l=="window"?0:an());u.left+=ue,u.right+=ue}return u.top+=q,u.bottom+=q,u}function Mi(e,t,u){if(u=="div")return t;var l=t.left,y=t.top;if(u=="page")l-=an(),y-=ti();else if(u=="local"||!u){var H=e.display.sizer.getBoundingClientRect();l+=H.left,y+=H.top}var q=e.display.lineSpace.getBoundingClientRect();return{left:l-q.left,top:y-q.top}}function Er(e,t,u,l,y){return l||(l=Y(e.doc,t.line)),Ki(e,l,ui(e,l,t.ch,y),u)}function qn(e,t,u,l,y,H){l=l||Y(e.doc,t.line),y||(y=Vn(e,l));function q(yt,It){var kt=Tn(e,y,yt,It?"right":"left",H);return It?kt.left=kt.right:kt.right=kt.left,Ki(e,l,kt,u)}var ae=wt(l,e.doc.direction),ue=t.ch,ge=t.sticky;if(ue>=l.text.length?(ue=l.text.length,ge="before"):ue<=0&&(ue=0,ge="after"),!ae)return q(ge=="before"?ue-1:ue,ge=="before");function Me(yt,It,kt){var Ht=ae[It],Xt=Ht.level==1;return q(kt?yt-1:yt,Xt!=kt)}var We=ut(ae,ue,ge),qe=st,Je=Me(ue,We,ge=="before");return qe!=null&&(Je.other=Me(ue,qe,ge!="before")),Je}function xr(e,t){var u=0;t=pt(e.doc,t),e.options.lineWrapping||(u=jn(e.display)*t.ch);var l=Y(e.doc,t.line),y=hr(l)+oi(e.display);return{left:u,right:u,top:y,bottom:y+l.height}}function Dr(e,t,u,l,y){var H=$e(e,t,u);return H.xRel=y,l&&(H.outside=l),H}function Wr(e,t,u){var l=e.doc;if(u+=e.display.viewOffset,u<0)return Dr(l.first,0,null,-1,-1);var y=Ge(l,u),H=l.first+l.size-1;if(y>H)return Dr(l.first+l.size-1,Y(l,H).text.length,null,1,1);t<0&&(t=0);for(var q=Y(l,y);;){var ae=ta(e,q,y,t,u),ue=zr(q,ae.ch+(ae.xRel>0||ae.outside>0?1:0));if(!ue)return ae;var ge=ue.find(1);if(ge.line==y)return ge;q=Y(l,y=ge.line)}}function Pr(e,t,u,l){l-=Ei(t);var y=t.text.length,H=Ke(function(q){return Tn(e,u,q-1).bottom<=l},y,0);return y=Ke(function(q){return Tn(e,u,q).top>l},H,y),{begin:H,end:y}}function ca(e,t,u,l){u||(u=Vn(e,t));var y=Ki(e,t,Tn(e,u,l),"line").top;return Pr(e,t,u,y)}function pr(e,t,u,l){return e.bottom<=u?!1:e.top>u?!0:(l?e.left:e.right)>t}function ta(e,t,u,l,y){y-=hr(t);var H=Vn(e,t),q=Ei(t),ae=0,ue=t.text.length,ge=!0,Me=wt(t,e.doc.direction);if(Me){var We=(e.options.lineWrapping?ai:Da)(e,t,u,H,Me,l,y);ge=We.level!=1,ae=ge?We.from:We.to-1,ue=ge?We.to:We.from-1}var qe=null,Je=null,yt=Ke(function(bn){var dn=Tn(e,H,bn);return dn.top+=q,dn.bottom+=q,pr(dn,l,y,!1)?(dn.top<=y&&dn.left<=l&&(qe=bn,Je=dn),!0):!1},ae,ue),It,kt,Ht=!1;if(Je){var Xt=l-Je.left<Je.right-l,Kt=Xt==ge;yt=qe+(Kt?0:1),kt=Kt?"after":"before",It=Xt?Je.left:Je.right}else{!ge&&(yt==ue||yt==ae)&&yt++,kt=yt==0?"after":yt==t.text.length?"before":Tn(e,H,yt-(ge?1:0)).bottom+q<=y==ge?"after":"before";var qt=qn(e,$e(u,yt,kt),"line",t,H);It=qt.left,Ht=y<qt.top?-1:y>=qt.bottom?1:0}return yt=Oe(t.text,yt,1),Dr(u,yt,kt,Ht,l-It)}function Da(e,t,u,l,y,H,q){var ae=Ke(function(We){var qe=y[We],Je=qe.level!=1;return pr(qn(e,$e(u,Je?qe.to:qe.from,Je?"before":"after"),"line",t,l),H,q,!0)},0,y.length-1),ue=y[ae];if(ae>0){var ge=ue.level!=1,Me=qn(e,$e(u,ge?ue.from:ue.to,ge?"after":"before"),"line",t,l);pr(Me,H,q,!0)&&Me.top>q&&(ue=y[ae-1])}return ue}function ai(e,t,u,l,y,H,q){var ae=Pr(e,t,l,q),ue=ae.begin,ge=ae.end;/\s/.test(t.text.charAt(ge-1))&&ge--;for(var Me=null,We=null,qe=0;qe<y.length;qe++){var Je=y[qe];if(Je.from>=ge||Je.to<=ue)continue;var yt=Je.level!=1,It=Tn(e,l,yt?Math.min(ge,Je.to)-1:Math.max(ue,Je.from)).right,kt=It<H?H-It+1e9:It-H;(!Me||We>kt)&&(Me=Je,We=kt)}return Me||(Me=y[y.length-1]),Me.from<ue&&(Me={from:ue,to:Me.to,level:Me.level}),Me.to>ge&&(Me={from:Me.from,to:ge,level:Me.level}),Me}var fn;function Nn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(fn==null){fn=f("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)fn.appendChild(document.createTextNode("x")),fn.appendChild(f("br"));fn.appendChild(document.createTextNode("x"))}m(e.measure,fn);var u=fn.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),b(e.measure),u||1}function jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=f("span","xxxxxxxxxx"),u=f("pre",[t],"CodeMirror-line-like");m(e.measure,u);var l=t.getBoundingClientRect(),y=(l.right-l.left)/10;return y>2&&(e.cachedCharWidth=y),y||10}function Ri(e){for(var t=e.display,u={},l={},y=t.gutters.clientLeft,H=t.gutters.firstChild,q=0;H;H=H.nextSibling,++q){var ae=e.display.gutterSpecs[q].className;u[ae]=H.offsetLeft+H.clientLeft+y,l[ae]=H.clientWidth}return{fixedPos:Un(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:u,gutterWidth:l,wrapperWidth:t.wrapper.clientWidth}}function Un(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Sr(e){var t=Nn(e.display),u=e.options.lineWrapping,l=u&&Math.max(5,e.display.scroller.clientWidth/jn(e.display)-3);return function(y){if(br(e.doc,y))return 0;var H=0;if(y.widgets)for(var q=0;q<y.widgets.length;q++)y.widgets[q].height&&(H+=y.widgets[q].height);return u?H+(Math.ceil(y.text.length/l)||1)*t:H+t}}function Fr(e){var t=e.doc,u=Sr(e);t.iter(function(l){var y=u(l);y!=l.height&&ve(l,y)})}function ji(e,t,u,l){var y=e.display;if(!u&&Le(t).getAttribute("cm-not-content")=="true")return null;var H,q,ae=y.lineSpace.getBoundingClientRect();try{H=t.clientX-ae.left,q=t.clientY-ae.top}catch(We){return null}var ue=Wr(e,H,q),ge;if(l&&ue.xRel>0&&(ge=Y(e.doc,ue.line).text).length==ue.ch){var Me=V(ge,ge.length,e.options.tabSize)-ge.length;ue=$e(ue.line,Math.max(0,Math.round((H-$n(e.display).left)/jn(e.display))-Me))}return ue}function Tr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var u=e.display.view,l=0;l<u.length;l++)if(t-=u[l].size,t<0)return l}function Ti(e,t,u,l){t==null&&(t=e.doc.first),u==null&&(u=e.doc.first+e.doc.size),l||(l=0);var y=e.display;if(l&&u<y.viewTo&&(y.updateLineNumbers==null||y.updateLineNumbers>t)&&(y.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=y.viewTo)yi&&Br(e.doc,t)<y.viewTo&&wn(e);else if(u<=y.viewFrom)yi&&Ir(e.doc,u+l)>y.viewFrom?wn(e):(y.viewFrom+=l,y.viewTo+=l);else if(t<=y.viewFrom&&u>=y.viewTo)wn(e);else if(t<=y.viewFrom){var H=vn(e,u,u+l,1);H?(y.view=y.view.slice(H.index),y.viewFrom=H.lineN,y.viewTo+=l):wn(e)}else if(u>=y.viewTo){var q=vn(e,t,t,-1);q?(y.view=y.view.slice(0,q.index),y.viewTo=q.lineN):wn(e)}else{var ae=vn(e,t,t,-1),ue=vn(e,u,u+l,1);ae&&ue?(y.view=y.view.slice(0,ae.index).concat(Ze(e,ae.lineN,ue.lineN)).concat(y.view.slice(ue.index)),y.viewTo+=l):wn(e)}var ge=y.externalMeasured;ge&&(u<ge.lineN?ge.lineN+=l:t<ge.lineN+ge.size&&(y.externalMeasured=null))}function $i(e,t,u){e.curOp.viewChanged=!0;var l=e.display,y=e.display.externalMeasured;if(y&&t>=y.lineN&&t<y.lineN+y.size&&(l.externalMeasured=null),t<l.viewFrom||t>=l.viewTo)return;var H=l.view[Tr(e,t)];if(H.node==null)return;var q=H.changes||(H.changes=[]);se(q,u)==-1&&q.push(u)}function wn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vn(e,t,u,l){var y=Tr(e,t),H,q=e.display.view;if(!yi||u==e.doc.first+e.doc.size)return{index:y,lineN:u};for(var ae=e.display.viewFrom,ue=0;ue<y;ue++)ae+=q[ue].size;if(ae!=t){if(l>0){if(y==q.length-1)return null;H=ae+q[y].size-t,y++}else H=ae-t;t+=H,u+=H}for(;Br(e.doc,u)!=u;){if(y==(l<0?0:q.length-1))return null;u+=l*q[y-(l<0?1:0)].size,y+=l}return{index:y,lineN:u}}function Bn(e,t,u){var l=e.display,y=l.view;y.length==0||t>=l.viewTo||u<=l.viewFrom?(l.view=Ze(e,t,u),l.viewFrom=t):(l.viewFrom>t?l.view=Ze(e,t,l.viewFrom).concat(l.view):l.viewFrom<t&&(l.view=l.view.slice(Tr(e,t))),l.viewFrom=t,l.viewTo<u?l.view=l.view.concat(Ze(e,l.viewTo,u)):l.viewTo>u&&(l.view=l.view.slice(0,Tr(e,u)))),l.viewTo=u}function zt(e){for(var t=e.display.view,u=0,l=0;l<t.length;l++){var y=t[l];!y.hidden&&(!y.node||y.changes)&&++u}return u}function Sn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function hi(e,t){t===void 0&&(t=!0);for(var u=e.doc,l={},y=l.cursors=document.createDocumentFragment(),H=l.selection=document.createDocumentFragment(),q=0;q<u.sel.ranges.length;q++){if(!t&&q==u.sel.primIndex)continue;var ae=u.sel.ranges[q];if(ae.from().line>=e.display.viewTo||ae.to().line<e.display.viewFrom)continue;var ue=ae.empty();(ue||e.options.showCursorWhenSelecting)&&ki(e,ae.head,y),ue||va(e,ae,H)}return l}function ki(e,t,u){var l=qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),y=u.appendChild(f("div","\xA0","CodeMirror-cursor"));if(y.style.left=l.left+"px",y.style.top=l.top+"px",y.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",l.other){var H=u.appendChild(f("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));H.style.display="",H.style.left=l.other.left+"px",H.style.top=l.other.top+"px",H.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function wi(e,t){return e.top-t.top||e.left-t.left}function va(e,t,u){var l=e.display,y=e.doc,H=document.createDocumentFragment(),q=$n(e.display),ae=q.left,ue=Math.max(l.sizerWidth,zn(e)-l.sizer.offsetLeft)-q.right,ge=y.direction=="ltr";function Me(Kt,qt,bn,dn){qt<0&&(qt=0),qt=Math.round(qt),dn=Math.round(dn),H.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+Kt+`px;
|
|
top: `+qt+"px; width: "+(bn==null?ue-Kt:bn)+`px;
|
|
height: `+(dn-qt)+"px"))}function We(Kt,qt,bn){var dn=Y(y,Kt),Wn=dn.text.length,mi,Vi;function Ci(Ni,vr){return Er(e,$e(Kt,Ni),"div",dn,vr)}function Rr(Ni,vr,Ji){var Wi=ca(e,dn,null,Ni),Ui=vr=="ltr"==(Ji=="after")?"left":"right",Ai=Ji=="after"?Wi.begin:Wi.end-(/\s/.test(dn.text.charAt(Wi.end-1))?2:1);return Ci(Ai,Ui)[Ui]}var gr=wt(dn,y.direction);return Qe(gr,qt||0,bn==null?Wn:bn,function(Ni,vr,Ji,Wi){var Ui=Ji=="ltr",Ai=Ci(Ni,Ui?"left":"right"),yr=Ci(vr-1,Ui?"right":"left"),La=qt==null&&Ni==0,ua=bn==null&&vr==Wn,ir=Wi==0,$r=!gr||Wi==gr.length-1;if(yr.top-Ai.top<=3){var Xi=(ge?La:ua)&&ir,Fs=(ge?ua:La)&&$r,qr=Xi?ae:(Ui?Ai:yr).left,ma=Fs?ue:(Ui?yr:Ai).right;Me(qr,Ai.top,ma-qr,Ai.bottom)}else{var ga,ur,Ia,js;Ui?(ga=ge&&La&&ir?ae:Ai.left,ur=ge?ue:Rr(Ni,Ji,"before"),Ia=ge?ae:Rr(vr,Ji,"after"),js=ge&&ua&&$r?ue:yr.right):(ga=ge?Rr(Ni,Ji,"before"):ae,ur=!ge&&La&&ir?ue:Ai.right,Ia=!ge&&ua&&$r?ae:yr.left,js=ge?Rr(vr,Ji,"after"):ue),Me(ga,Ai.top,ur-ga,Ai.bottom),Ai.bottom<yr.top&&Me(ae,Ai.bottom,null,yr.top),Me(Ia,yr.top,js-Ia,yr.bottom)}(!mi||wi(Ai,mi)<0)&&(mi=Ai),wi(yr,mi)<0&&(mi=yr),(!Vi||wi(Ai,Vi)<0)&&(Vi=Ai),wi(yr,Vi)<0&&(Vi=yr)}),{start:mi,end:Vi}}var qe=t.from(),Je=t.to();if(qe.line==Je.line)We(qe.line,qe.ch,Je.ch);else{var yt=Y(y,qe.line),It=Y(y,Je.line),kt=tr(yt)==tr(It),Ht=We(qe.line,qe.ch,kt?yt.text.length+1:null).end,Xt=We(Je.line,kt?0:null,Je.ch).start;kt&&(Ht.top<Xt.top-2?(Me(Ht.right,Ht.top,null,Ht.bottom),Me(ae,Xt.top,Xt.left,Xt.bottom)):Me(Ht.right,Ht.top,Xt.left-Ht.right,Ht.bottom)),Ht.bottom<Xt.top&&Me(ae,Ht.bottom,null,Xt.top)}u.appendChild(H)}function cn(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var u=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||wr(e),t.cursorDiv.style.visibility=(u=!u)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function na(e){e.state.focused||(e.display.input.focus(),jr(e))}function ya(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,wr(e))},100)}function jr(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(fe(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),cn(e)}function wr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(fe(e,"blur",e,t),e.state.focused=!1,v(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Cr(e){for(var t=e.display,u=t.lineDiv.offsetTop,l=0;l<t.view.length;l++){var y=t.view[l],H=e.options.lineWrapping,q=void 0,ae=0;if(y.hidden)continue;if(B&&M<8){var ue=y.node.offsetTop+y.node.offsetHeight;q=ue-u,u=ue}else{var ge=y.node.getBoundingClientRect();q=ge.bottom-ge.top,!H&&y.text.firstChild&&(ae=y.text.firstChild.getBoundingClientRect().right-ge.left-1)}var Me=y.line.height-q;if((Me>.005||Me<-.005)&&(ve(y.line,q),Qr(y.line),y.rest))for(var We=0;We<y.rest.length;We++)Qr(y.rest[We]);if(ae>e.display.sizerWidth){var qe=Math.ceil(ae/jn(e.display));qe>e.display.maxLineLength&&(e.display.maxLineLength=qe,e.display.maxLine=y.line,e.display.maxLineChanged=!0)}}}function Qr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var u=e.widgets[t],l=u.node.parentNode;l&&(u.height=l.offsetHeight)}}function Hr(e,t,u){var l=u&&u.top!=null?Math.max(0,u.top):e.scroller.scrollTop;l=Math.floor(l-oi(e));var y=u&&u.bottom!=null?u.bottom:l+e.wrapper.clientHeight,H=Ge(t,l),q=Ge(t,y);if(u&&u.ensure){var ae=u.ensure.from.line,ue=u.ensure.to.line;ae<H?(H=ae,q=Ge(t,hr(Y(t,ae))+e.wrapper.clientHeight)):Math.min(ue,t.lastLine())>=q&&(H=Ge(t,hr(Y(t,ue))-e.wrapper.clientHeight),q=ue)}return{from:H,to:Math.max(q,H+1)}}function ia(e,t){if(ie(e,"scrollCursorIntoView"))return;var u=e.display,l=u.sizer.getBoundingClientRect(),y=null;if(t.top+l.top<0?y=!0:t.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(y=!1),y!=null&&!o){var H=f("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-u.viewOffset-oi(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Rn(e)+u.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(H),H.scrollIntoView(y),e.display.lineSpace.removeChild(H)}}function ms(e,t,u,l){l==null&&(l=0);var y;!e.options.lineWrapping&&t==u&&(t=t.ch?$e(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,u=t.sticky=="before"?$e(t.line,t.ch+1,"before"):t);for(var H=0;H<5;H++){var q=!1,ae=qn(e,t),ue=!u||u==t?ae:qn(e,u);y={left:Math.min(ae.left,ue.left),top:Math.min(ae.top,ue.top)-l,right:Math.max(ae.left,ue.left),bottom:Math.max(ae.bottom,ue.bottom)+l};var ge=gs(e,y),Me=e.doc.scrollTop,We=e.doc.scrollLeft;if(ge.scrollTop!=null&&(Ma(e,ge.scrollTop),Math.abs(e.doc.scrollTop-Me)>1&&(q=!0)),ge.scrollLeft!=null&&(da(e,ge.scrollLeft),Math.abs(e.doc.scrollLeft-We)>1&&(q=!0)),!q)break}return y}function Bi(e,t){var u=gs(e,t);u.scrollTop!=null&&Ma(e,u.scrollTop),u.scrollLeft!=null&&da(e,u.scrollLeft)}function gs(e,t){var u=e.display,l=Nn(e.display);t.top<0&&(t.top=0);var y=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,H=kn(e),q={};t.bottom-t.top>H&&(t.bottom=t.top+H);var ae=e.doc.height+li(u),ue=t.top<l,ge=t.bottom>ae-l;if(t.top<y)q.scrollTop=ue?0:t.top;else if(t.bottom>y+H){var Me=Math.min(t.top,(ge?ae:t.bottom)-H);Me!=y&&(q.scrollTop=Me)}var We=e.options.fixedGutter?0:u.gutters.offsetWidth,qe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-We,Je=zn(e)-u.gutters.offsetWidth,yt=t.right-t.left>Je;return yt&&(t.right=t.left+Je),t.left<10?q.scrollLeft=0:t.left<qe?q.scrollLeft=Math.max(0,t.left+We-(yt?0:10)):t.right>Je+qe-3&&(q.scrollLeft=t.right+(yt?0:10)-Je),q}function vs(e,t){if(t==null)return;qa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function _a(e){qa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pa(e,t,u){(t!=null||u!=null)&&qa(e),t!=null&&(e.curOp.scrollLeft=t),u!=null&&(e.curOp.scrollTop=u)}function Qo(e,t){qa(e),e.curOp.scrollToPos=t}function qa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var u=xr(e,t.from),l=xr(e,t.to);Bs(e,u,l,t.margin)}}function Bs(e,t,u,l){var y=gs(e,{left:Math.min(t.left,u.left),top:Math.min(t.top,u.top)-l,right:Math.max(t.right,u.right),bottom:Math.max(t.bottom,u.bottom)+l});Pa(e,y.scrollLeft,y.scrollTop)}function Ma(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||_s(e,{top:t}),Ws(e,t,!0),P&&_s(e),Ua(e,100)}function Ws(e,t,u){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!u)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function da(e,t,u,l){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(u?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!l)return;e.doc.scrollLeft=t,Vs(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ka(e){var t=e.display,u=t.gutters.offsetWidth,l=Math.round(e.doc.height+li(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?u:0,docHeight:l,scrollHeight:l+Rn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:u}}var ha=function(e,t,u){this.cm=u;var l=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),y=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=y.tabIndex=-1,e(l),e(y),Ue(l,"scroll",function(){l.clientHeight&&t(l.scrollTop,"vertical")}),Ue(y,"scroll",function(){y.clientWidth&&t(y.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,B&&M<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ha.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,u=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(u){this.vert.style.display="block",this.vert.style.bottom=t?l+"px":"0";var y=e.viewHeight-(t?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+y)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=u?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var H=e.viewWidth-e.barLeft-(u?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+H)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:u?l:0,bottom:t?l:0}},ha.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ha.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ha.prototype.zeroWidthHack=function(){var e=i&&!c?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ne,this.disableVert=new ne},ha.prototype.enableZeroWidthBar=function(e,t,u){e.style.pointerEvents="auto";function l(){var y=e.getBoundingClientRect(),H=u=="vert"?document.elementFromPoint(y.right-1,(y.top+y.bottom)/2):document.elementFromPoint((y.right+y.left)/2,y.bottom-1);H!=e?e.style.pointerEvents="none":t.set(1e3,l)}t.set(1e3,l)},ha.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Na=function(){};Na.prototype.update=function(){return{bottom:0,right:0}},Na.prototype.setScrollLeft=function(){},Na.prototype.setScrollTop=function(){},Na.prototype.clear=function(){};function ba(e,t){t||(t=ka(e));var u=e.display.barWidth,l=e.display.barHeight;Hs(e,t);for(var y=0;y<4&&u!=e.display.barWidth||l!=e.display.barHeight;y++)u!=e.display.barWidth&&e.options.lineWrapping&&Cr(e),Hs(e,ka(e)),u=e.display.barWidth,l=e.display.barHeight}function Hs(e,t){var u=e.display,l=u.scrollbars.update(t);u.sizer.style.paddingRight=(u.barWidth=l.right)+"px",u.sizer.style.paddingBottom=(u.barHeight=l.bottom)+"px",u.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(u.scrollbarFiller.style.display="block",u.scrollbarFiller.style.height=l.bottom+"px",u.scrollbarFiller.style.width=l.right+"px"):u.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(u.gutterFiller.style.display="block",u.gutterFiller.style.height=l.bottom+"px",u.gutterFiller.style.width=t.gutterWidth+"px"):u.gutterFiller.style.display=""}var Ks={native:ha,null:Na};function Gs(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&v(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ks[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ue(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,u){u=="horizontal"?da(e,t):Ma(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function fa(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:++Zo},Nt(e.curOp)}function pa(e){var t=e.curOp;t&&Vt(t,function(u){for(var l=0;l<u.ops.length;l++)u.ops[l].cm.curOp=null;qo(u)})}function qo(e){for(var t=e.ops,u=0;u<t.length;u++)el(t[u]);for(var l=0;l<t.length;l++)tl(t[l]);for(var y=0;y<t.length;y++)nl(t[y]);for(var H=0;H<t.length;H++)il(t[H]);for(var q=0;q<t.length;q++)rl(t[q])}function el(e){var t=e.cm,u=t.display;sl(t),e.updateMaxLine&&Yr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<u.viewFrom||e.scrollToPos.to.line>=u.viewTo)||u.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new es(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&ys(e.cm,e.update)}function nl(e){var t=e.cm,u=t.display;e.updatedDisplay&&Cr(t),e.barMeasure=ka(t),u.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ui(t,u.maxLine,u.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(u.scroller.clientWidth,u.sizer.offsetLeft+e.adjustWidthTo+Rn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-zn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&da(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var u=e.focus&&e.focus==k();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ba(t,e.barMeasure),e.updatedDisplay&&Es(t,e.barMeasure),e.selectionChanged&&cn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),u&&na(e.cm)}function rl(e){var t=e.cm,u=t.display,l=t.doc;if(e.updatedDisplay&&zs(t,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&Ws(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&da(t,e.scrollLeft,!0,!0),e.scrollToPos){var y=ms(t,pt(l,e.scrollToPos.from),pt(l,e.scrollToPos.to),e.scrollToPos.margin);ia(t,y)}var H=e.maybeHiddenMarkers,q=e.maybeUnhiddenMarkers;if(H)for(var ae=0;ae<H.length;++ae)H[ae].lines.length||fe(H[ae],"hide");if(q)for(var ue=0;ue<q.length;++ue)q[ue].lines.length&&fe(q[ue],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&fe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Or(e,t){if(e.curOp)return t();fa(e);try{return t()}finally{pa(e)}}function Gi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);fa(e);try{return t.apply(e,arguments)}finally{pa(e)}}}function lr(e){return function(){if(this.curOp)return e.apply(this,arguments);fa(this);try{return e.apply(this,arguments)}finally{pa(this)}}}function zi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);fa(t);try{return e.apply(this,arguments)}finally{pa(t)}}}function Ua(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,j(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var u=+new Date+e.options.workTime,l=En(e,t.highlightFrontier),y=[];t.iter(l.line,Math.min(t.first+t.size,e.display.viewTo+500),function(H){if(l.line>=e.display.viewFrom){var q=H.styles,ae=H.text.length>e.options.maxHighlightLength?Pt(t.mode,l.state):null,ue=Yn(e,H,l,!0);ae&&(l.state=ae),H.styles=ue.styles;var ge=H.styleClasses,Me=ue.classes;Me?H.styleClasses=Me:ge&&(H.styleClasses=null);for(var We=!q||q.length!=H.styles.length||ge!=Me&&(!ge||!Me||ge.bgClass!=Me.bgClass||ge.textClass!=Me.textClass),qe=0;!We&&qe<q.length;++qe)We=q[qe]!=H.styles[qe];We&&y.push(l.line),H.stateAfter=l.save(),l.nextLine()}else H.text.length<=e.options.maxHighlightLength&&gi(e,H.text,l),H.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>u)return Ua(e,e.options.workDelay),!0}),t.highlightFrontier=l.line,t.modeFrontier=Math.max(t.modeFrontier,l.line),y.length&&Or(e,function(){for(var H=0;H<y.length;H++)$i(e,y[H],"text")})}var es=function(e,t,u){var l=e.display;this.viewport=t,this.visible=Hr(l,e.doc,t),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=zn(e),this.force=u,this.dims=Ri(e),this.events=[]};es.prototype.signal=function(e,t){de(e,t)&&this.events.push(arguments)},es.prototype.finish=function(){for(var e=0;e<this.events.length;e++)fe.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Rn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Rn(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=k();if(!t||!_(e.display.lineDiv,t))return null;var u={activeElt:t};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&_(e.display.lineDiv,l.anchorNode)&&(u.anchorNode=l.anchorNode,u.anchorOffset=l.anchorOffset,u.focusNode=l.focusNode,u.focusOffset=l.focusOffset)}return u}function ll(e){if(!e||!e.activeElt||e.activeElt==k())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&_(document.body,e.anchorNode)&&_(document.body,e.focusNode)){var t=window.getSelection(),u=document.createRange();u.setEnd(e.anchorNode,e.anchorOffset),u.collapse(!1),t.removeAllRanges(),t.addRange(u),t.extend(e.focusNode,e.focusOffset)}}function ys(e,t){var u=e.display,l=e.doc;if(t.editorIsHidden)return wn(e),!1;if(!t.force&&t.visible.from>=u.viewFrom&&t.visible.to<=u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo)&&u.renderedView==u.view&&zt(e)==0)return!1;Xs(e)&&(wn(e),t.dims=Ri(e));var y=l.first+l.size,H=Math.max(t.visible.from-e.options.viewportMargin,l.first),q=Math.min(y,t.visible.to+e.options.viewportMargin);u.viewFrom<H&&H-u.viewFrom<20&&(H=Math.max(l.first,u.viewFrom)),u.viewTo>q&&u.viewTo-q<20&&(q=Math.min(y,u.viewTo)),yi&&(H=Br(e.doc,H),q=Ir(e.doc,q));var ae=H!=u.viewFrom||q!=u.viewTo||u.lastWrapHeight!=t.wrapperHeight||u.lastWrapWidth!=t.wrapperWidth;Bn(e,H,q),u.viewOffset=hr(Y(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var ue=zt(e);if(!ae&&ue==0&&!t.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var ge=ol(e);return ue>4&&(u.lineDiv.style.display="none"),ul(e,u.updateLineNumbers,t.dims),ue>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,ll(ge),b(u.cursorDiv),b(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,ae&&(u.lastWrapHeight=t.wrapperHeight,u.lastWrapWidth=t.wrapperWidth,Ua(e,400)),u.updateLineNumbers=null,!0}function zs(e,t){for(var u=t.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||t.oldDisplayWidth==zn(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+li(e.display)-kn(e),u.top)}),t.visible=Hr(e.display,e.doc,u),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else l&&(t.visible=Hr(e.display,e.doc,u));if(!ys(e,t))break;Cr(e);var y=ka(e);Sn(e),ba(e,y),Es(e,y),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function _s(e,t){var u=new es(e,t);if(ys(e,u)){Cr(e),zs(e,u);var l=ka(e);Sn(e),ba(e,l),Es(e,l),u.finish()}}function ul(e,t,u){var l=e.display,y=e.options.lineNumbers,H=l.lineDiv,q=H.firstChild;function ae(yt){var It=yt.nextSibling;return n&&i&&e.display.currentWheelTarget==yt?yt.style.display="none":yt.parentNode.removeChild(yt),It}for(var ue=l.view,ge=l.viewFrom,Me=0;Me<ue.length;Me++){var We=ue[Me];if(!We.hidden)if(!We.node||We.node.parentNode!=H){var qe=Xn(e,We,ge,u);H.insertBefore(qe,q)}else{for(;q!=We.node;)q=ae(q);var Je=y&&t!=null&&t<=ge&&We.lineNumber;We.changes&&(se(We.changes,"gutter")>-1&&(Je=!1),en(e,We,ge,u)),Je&&(b(We.lineNumber),We.lineNumber.appendChild(document.createTextNode(bt(e.options,ge)))),q=We.node.nextSibling}ge+=We.size}for(;q;)q=ae(q)}function bs(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Es(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+Rn(e)+"px"}function Vs(e){var t=e.display,u=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var l=Un(t)-t.scroller.scrollLeft+e.doc.scrollLeft,y=t.gutters.offsetWidth,H=l+"px",q=0;q<u.length;q++)if(!u[q].hidden){e.options.fixedGutter&&(u[q].gutter&&(u[q].gutter.style.left=H),u[q].gutterBackground&&(u[q].gutterBackground.style.left=H));var ae=u[q].alignable;if(ae)for(var ue=0;ue<ae.length;ue++)ae[ue].style.left=H}e.options.fixedGutter&&(t.gutters.style.left=l+y+"px")}function Xs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,u=bt(e.options,t.first+t.size-1),l=e.display;if(u.length!=l.lineNumChars){var y=l.measure.appendChild(f("div",[f("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),H=y.firstChild.offsetWidth,q=y.offsetWidth-H;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(H,l.lineGutter.offsetWidth-q)+1,l.lineNumWidth=l.lineNumInnerWidth+q,l.lineNumChars=l.lineNumInnerWidth?u.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",bs(e.display),!0}return!1}function xs(e,t){for(var u=[],l=!1,y=0;y<e.length;y++){var H=e[y],q=null;if(typeof H!="string"&&(q=H.style,H=H.className),H=="CodeMirror-linenumbers")if(t)l=!0;else continue;u.push({className:H,style:q})}return t&&!l&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function Ys(e){var t=e.gutters,u=e.gutterSpecs;b(t),e.lineGutter=null;for(var l=0;l<u.length;++l){var y=u[l],H=y.className,q=y.style,ae=t.appendChild(f("div",null,"CodeMirror-gutter "+H));q&&(ae.style.cssText=q),H=="CodeMirror-linenumbers"&&(e.lineGutter=ae,ae.style.width=(e.lineNumWidth||1)+"px")}t.style.display=u.length?"":"none",bs(e)}function Fa(e){Ys(e.display),Ti(e),Vs(e)}function cl(e,t,u,l){var y=this;this.input=u,y.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),y.scrollbarFiller.setAttribute("cm-not-content","true"),y.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),y.gutterFiller.setAttribute("cm-not-content","true"),y.lineDiv=O("div",null,"CodeMirror-code"),y.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),y.cursorDiv=f("div",null,"CodeMirror-cursors"),y.measure=f("div",null,"CodeMirror-measure"),y.lineMeasure=f("div",null,"CodeMirror-measure"),y.lineSpace=O("div",[y.measure,y.lineMeasure,y.selectionDiv,y.cursorDiv,y.lineDiv],null,"position: relative; outline: none");var H=O("div",[y.lineSpace],"CodeMirror-lines");y.mover=f("div",[H],null,"position: relative"),y.sizer=f("div",[y.mover],"CodeMirror-sizer"),y.sizerWidth=null,y.heightForcer=f("div",null,null,"position: absolute; height: "+Se+"px; width: 1px;"),y.gutters=f("div",null,"CodeMirror-gutters"),y.lineGutter=null,y.scroller=f("div",[y.sizer,y.heightForcer,y.gutters],"CodeMirror-scroll"),y.scroller.setAttribute("tabIndex","-1"),y.wrapper=f("div",[y.scrollbarFiller,y.gutterFiller,y.scroller],"CodeMirror"),B&&M<8&&(y.gutters.style.zIndex=-1,y.scroller.style.paddingRight=0),!n&&!(P&&a)&&(y.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(y.wrapper):e(y.wrapper)),y.viewFrom=y.viewTo=t.first,y.reportedViewFrom=y.reportedViewTo=t.first,y.view=[],y.renderedView=null,y.externalMeasured=null,y.viewOffset=0,y.lastWrapHeight=y.lastWrapWidth=0,y.updateLineNumbers=null,y.nativeBarWidth=y.barHeight=y.barWidth=0,y.scrollbarsClipped=!1,y.lineNumWidth=y.lineNumInnerWidth=y.lineNumChars=null,y.alignWidgets=!1,y.cachedCharWidth=y.cachedTextHeight=y.cachedPaddingH=null,y.maxLine=null,y.maxLineLength=0,y.maxLineChanged=!1,y.wheelDX=y.wheelDY=y.wheelStartX=y.wheelStartY=null,y.shift=!1,y.selForContextMenu=null,y.activeTouch=null,y.gutterSpecs=xs(l.gutters,l.lineNumbers),Ys(y),u.init(y)}var ts=0,Mr=null;B?Mr=-.53:P?Mr=15:g?Mr=-.7:h&&(Mr=-1/3);function $s(e){var t=e.wheelDeltaX,u=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),u==null&&e.detail&&e.axis==e.VERTICAL_AXIS?u=e.detail:u==null&&(u=e.wheelDelta),{x:t,y:u}}function dl(e){var t=$s(e);return t.x*=Mr,t.y*=Mr,t}function Js(e,t){var u=$s(t),l=u.x,y=u.y,H=e.display,q=H.scroller,ae=q.scrollWidth>q.clientWidth,ue=q.scrollHeight>q.clientHeight;if(!(l&&ae||y&&ue))return;if(y&&i&&n){e:for(var ge=t.target,Me=H.view;ge!=q;ge=ge.parentNode)for(var We=0;We<Me.length;We++)if(Me[We].node==ge){e.display.currentWheelTarget=ge;break e}}if(l&&!P&&!p&&Mr!=null){y&&ue&&Ma(e,Math.max(0,q.scrollTop+y*Mr)),da(e,Math.max(0,q.scrollLeft+l*Mr)),(!y||y&&ue)&&le(t),H.wheelStartX=null;return}if(y&&Mr!=null){var qe=y*Mr,Je=e.doc.scrollTop,yt=Je+H.wrapper.clientHeight;qe<0?Je=Math.max(0,Je+qe-50):yt=Math.min(e.doc.height,yt+qe+50),_s(e,{top:Je,bottom:yt})}ts<20&&(H.wheelStartX==null?(H.wheelStartX=q.scrollLeft,H.wheelStartY=q.scrollTop,H.wheelDX=l,H.wheelDY=y,setTimeout(function(){if(H.wheelStartX==null)return;var It=q.scrollLeft-H.wheelStartX,kt=q.scrollTop-H.wheelStartY,Ht=kt&&H.wheelDY&&kt/H.wheelDY||It&&H.wheelDX&&It/H.wheelDX;if(H.wheelStartX=H.wheelStartY=null,!Ht)return;Mr=(Mr*ts+Ht)/(ts+1),++ts},200)):(H.wheelDX+=l,H.wheelDY+=y))}var kr=function(e,t){this.ranges=e,this.primIndex=t};kr.prototype.primary=function(){return this.ranges[this.primIndex]},kr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var u=this.ranges[t],l=e.ranges[t];if(!Jt(u.anchor,l.anchor)||!Jt(u.head,l.head))return!1}return!0},kr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new si(Et(this.ranges[t].anchor),Et(this.ranges[t].head));return new kr(e,this.primIndex)},kr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},kr.prototype.contains=function(e,t){t||(t=e);for(var u=0;u<this.ranges.length;u++){var l=this.ranges[u];if(At(t,l.from())>=0&&At(e,l.to())<=0)return u}return-1};var si=function(e,t){this.anchor=e,this.head=t};si.prototype.from=function(){return Yt(this.anchor,this.head)},si.prototype.to=function(){return sn(this.anchor,this.head)},si.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Kr(e,t,u){var l=e&&e.options.selectionsMayTouch,y=t[u];t.sort(function(qe,Je){return At(qe.from(),Je.from())}),u=se(t,y);for(var H=1;H<t.length;H++){var q=t[H],ae=t[H-1],ue=At(ae.to(),q.from());if(l&&!q.empty()?ue>0:ue>=0){var ge=Yt(ae.from(),q.from()),Me=sn(ae.to(),q.to()),We=ae.empty()?q.from()==q.head:ae.from()==ae.head;H<=u&&--u,t.splice(--H,2,new si(We?Me:ge,We?ge:Me))}}return new kr(t,u)}function ra(e,t){return new kr([new si(e,t||e)],0)}function aa(e){return e.text?$e(e.from.line+e.text.length-1,U(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Qs(e,t){if(At(e,t.from)<0)return e;if(At(e,t.to)<=0)return aa(t);var u=e.line+t.text.length-(t.to.line-t.from.line)-1,l=e.ch;return e.line==t.to.line&&(l+=aa(t).ch-t.to.ch),$e(u,l)}function Ss(e,t){for(var u=[],l=0;l<e.sel.ranges.length;l++){var y=e.sel.ranges[l];u.push(new si(Qs(y.anchor,t),Qs(y.head,t)))}return Kr(e.cm,u,e.sel.primIndex)}function Zs(e,t,u){return e.line==t.line?$e(u.line,e.ch-t.ch+u.ch):$e(u.line+(e.line-t.line),e.ch)}function hl(e,t,u){for(var l=[],y=$e(e.first,0),H=y,q=0;q<t.length;q++){var ae=t[q],ue=Zs(ae.from,y,H),ge=Zs(aa(ae),y,H);if(y=ae.to,H=ge,u=="around"){var Me=e.sel.ranges[q],We=At(Me.head,Me.anchor)<0;l[q]=new si(We?ge:ue,We?ue:ge)}else l[q]=new si(ue,ue)}return new kr(l,e.sel.primIndex)}function Ts(e){e.doc.mode=dt(e.options,e.doc.modeOption),ja(e)}function ja(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,Ua(e,100),e.state.modeGen++,e.curOp&&Ti(e)}function qs(e,t){return t.from.ch==0&&t.to.ch==0&&U(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ws(e,t,u,l){function y(Xt){return u?u[Xt]:null}function H(Xt,Kt,qt){Jr(Xt,Kt,qt,l),rt(Xt,"change",Xt,t)}function q(Xt,Kt){for(var qt=[],bn=Xt;bn<Kt;++bn)qt.push(new or(ge[bn],y(bn),l));return qt}var ae=t.from,ue=t.to,ge=t.text,Me=Y(e,ae.line),We=Y(e,ue.line),qe=U(ge),Je=y(ge.length-1),yt=ue.line-ae.line;if(t.full)e.insert(0,q(0,ge.length)),e.remove(ge.length,e.size-ge.length);else if(qs(e,t)){var It=q(0,ge.length-1);H(We,We.text,Je),yt&&e.remove(ae.line,yt),It.length&&e.insert(ae.line,It)}else if(Me==We)if(ge.length==1)H(Me,Me.text.slice(0,ae.ch)+qe+Me.text.slice(ue.ch),Je);else{var kt=q(1,ge.length-1);kt.push(new or(qe+Me.text.slice(ue.ch),Je,l)),H(Me,Me.text.slice(0,ae.ch)+ge[0],y(0)),e.insert(ae.line+1,kt)}else if(ge.length==1)H(Me,Me.text.slice(0,ae.ch)+ge[0]+We.text.slice(ue.ch),y(0)),e.remove(ae.line+1,yt);else{H(Me,Me.text.slice(0,ae.ch)+ge[0],y(0)),H(We,qe+We.text.slice(ue.ch),Je);var Ht=q(1,ge.length-1);yt>1&&e.remove(ae.line+1,yt-1),e.insert(ae.line+1,Ht)}rt(e,"change",e,t)}function sa(e,t,u){function l(y,H,q){if(y.linked)for(var ae=0;ae<y.linked.length;++ae){var ue=y.linked[ae];if(ue.doc==H)continue;var ge=q&&ue.sharedHist;if(u&&!ge)continue;t(ue.doc,ge),l(ue.doc,y,ge)}}l(e,null,!0)}function eo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Fr(e),Ts(e),to(e),e.options.lineWrapping||Yr(e),e.options.mode=t.modeOption,Ti(e)}function to(e){(e.doc.direction=="rtl"?F:v)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Or(e,function(){to(e),Ti(e)})}function ns(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 Cs(e,t){var u={from:Et(t.from),to:aa(t),text:$(e,t.from,t.to)};return ro(e,u,t.from.line,t.to.line+1),sa(e,function(l){return ro(l,u,t.from.line,t.to.line+1)},!0),u}function no(e){for(;e.length;){var t=U(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return no(e.done),U(e.done);if(e.done.length&&!U(e.done).ranges)return U(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),U(e.done)}function io(e,t,u,l){var y=e.history;y.undone.length=0;var H=+new Date,q,ae;if((y.lastOp==l||y.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&y.lastModTime>H-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(q=pl(y,y.lastOp==l)))ae=U(q.changes),At(t.from,t.to)==0&&At(t.from,ae.to)==0?ae.to=aa(t):q.changes.push(Cs(e,t));else{var ue=U(y.done);for((!ue||!ue.ranges)&&is(e.sel,y.done),q={changes:[Cs(e,t)],generation:y.generation},y.done.push(q);y.done.length>y.undoDepth;)y.done.shift(),y.done[0].ranges||y.done.shift()}y.done.push(u),y.generation=++y.maxGeneration,y.lastModTime=y.lastSelTime=H,y.lastOp=y.lastSelOp=l,y.lastOrigin=y.lastSelOrigin=t.origin,ae||fe(e,"historyAdded")}function ml(e,t,u,l){var y=t.charAt(0);return y=="*"||y=="+"&&u.ranges.length==l.ranges.length&&u.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,u,l){var y=e.history,H=l&&l.origin;u==y.lastSelOp||H&&y.lastSelOrigin==H&&(y.lastModTime==y.lastSelTime&&y.lastOrigin==H||ml(e,H,U(y.done),t))?y.done[y.done.length-1]=t:is(t,y.done),y.lastSelTime=+new Date,y.lastSelOrigin=H,y.lastSelOp=u,l&&l.clearRedo!==!1&&no(y.undone)}function is(e,t){var u=U(t);u&&u.ranges&&u.equals(e)||t.push(e)}function ro(e,t,u,l){var y=t["spans_"+e.id],H=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,l),function(q){q.markedSpans&&((y||(y=t["spans_"+e.id]={}))[H]=q.markedSpans),++H})}function vl(e){if(!e)return null;for(var t,u=0;u<e.length;++u)e[u].marker.explicitlyCleared?t||(t=e.slice(0,u)):t&&t.push(e[u]);return t?t.length?t:null:e}function yl(e,t){var u=t["spans_"+e.id];if(!u)return null;for(var l=[],y=0;y<t.text.length;++y)l.push(vl(u[y]));return l}function ao(e,t){var u=yl(e,t),l=Zi(e,t);if(!u)return l;if(!l)return u;for(var y=0;y<u.length;++y){var H=u[y],q=l[y];if(H&&q){e:for(var ae=0;ae<q.length;++ae){for(var ue=q[ae],ge=0;ge<H.length;++ge)if(H[ge].marker==ue.marker)continue e;H.push(ue)}}else q&&(u[y]=q)}return u}function Ea(e,t,u){for(var l=[],y=0;y<e.length;++y){var H=e[y];if(H.ranges){l.push(u?kr.prototype.deepCopy.call(H):H);continue}var q=H.changes,ae=[];l.push({changes:ae});for(var ue=0;ue<q.length;++ue){var ge=q[ue],Me=void 0;if(ae.push({from:ge.from,to:ge.to,text:ge.text}),t)for(var We in ge)(Me=We.match(/^spans_(\d+)$/))&&(se(t,Number(Me[1]))>-1&&(U(ae)[We]=ge[We],delete ge[We]))}}return l}function Os(e,t,u,l){if(l){var y=e.anchor;if(u){var H=At(t,y)<0;H!=At(u,y)<0?(y=t,t=u):H!=At(t,u)<0&&(t=u)}return new si(y,t)}else return new si(u||t,t)}function rs(e,t,u,l,y){y==null&&(y=e.cm&&(e.cm.display.shift||e.extend)),nr(e,new kr([Os(e.sel.primary(),t,u,y)],0),l)}function so(e,t,u){for(var l=[],y=e.cm&&(e.cm.display.shift||e.extend),H=0;H<e.sel.ranges.length;H++)l[H]=Os(e.sel.ranges[H],t[H],null,y);var q=Kr(e.cm,l,e.sel.primIndex);nr(e,q,u)}function Rs(e,t,u,l){var y=e.sel.ranges.slice(0);y[t]=u,nr(e,Kr(e.cm,y,e.sel.primIndex),l)}function oo(e,t,u,l){nr(e,ra(t,u),l)}function _l(e,t,u){var l={ranges:t.ranges,update:function(y){this.ranges=[];for(var H=0;H<y.length;H++)this.ranges[H]=new si(pt(e,y[H].anchor),pt(e,y[H].head))},origin:u&&u.origin};return fe(e,"beforeSelectionChange",e,l),e.cm&&fe(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=t.ranges?Kr(e.cm,l.ranges,l.ranges.length-1):t}function lo(e,t,u){var l=e.history.done,y=U(l);y&&y.ranges?(l[l.length-1]=t,as(e,t,u)):nr(e,t,u)}function nr(e,t,u){as(e,t,u),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function as(e,t,u){(de(e,"beforeSelectionChange")||e.cm&&de(e.cm,"beforeSelectionChange"))&&(t=_l(e,t,u));var l=u&&u.bias||(At(t.primary().head,e.sel.primary().head)<0?-1:1);uo(e,ho(e,t,l,!0)),!(u&&u.scroll===!1)&&e.cm&&_a(e.cm)}function uo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,re(e.cm)),rt(e,"cursorActivity",e)}function co(e){uo(e,ho(e,e.sel,null,!1))}function ho(e,t,u,l){for(var y,H=0;H<t.ranges.length;H++){var q=t.ranges[H],ae=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[H],ue=ss(e,q.anchor,ae&&ae.anchor,u,l),ge=ss(e,q.head,ae&&ae.head,u,l);(y||ue!=q.anchor||ge!=q.head)&&(y||(y=t.ranges.slice(0,H)),y[H]=new si(ue,ge))}return y?Kr(e.cm,y,t.primIndex):t}function xa(e,t,u,l,y){var H=Y(e,t.line);if(H.markedSpans)for(var q=0;q<H.markedSpans.length;++q){var ae=H.markedSpans[q],ue=ae.marker,ge="selectLeft"in ue?!ue.selectLeft:ue.inclusiveLeft,Me="selectRight"in ue?!ue.selectRight:ue.inclusiveRight;if((ae.from==null||(ge?ae.from<=t.ch:ae.from<t.ch))&&(ae.to==null||(Me?ae.to>=t.ch:ae.to>t.ch))){if(y&&(fe(ue,"beforeCursorEnter"),ue.explicitlyCleared))if(H.markedSpans){--q;continue}else break;if(!ue.atomic)continue;if(u){var We=ue.find(l<0?1:-1),qe=void 0;if((l<0?Me:ge)&&(We=fo(e,We,-l,We&&We.line==t.line?H:null)),We&&We.line==t.line&&(qe=At(We,u))&&(l<0?qe<0:qe>0))return xa(e,We,t,l,y)}var Je=ue.find(l<0?-1:1);return(l<0?ge:Me)&&(Je=fo(e,Je,l,Je.line==t.line?H:null)),Je?xa(e,Je,t,l,y):null}}return t}function ss(e,t,u,l,y){var H=l||1,q=xa(e,t,u,H,y)||!y&&xa(e,t,u,H,!0)||xa(e,t,u,-H,y)||!y&&xa(e,t,u,-H,!0);return q||(e.cantEdit=!0,$e(e.first,0))}function fo(e,t,u,l){return u<0&&t.ch==0?t.line>e.first?pt(e,$e(t.line-1)):null:u>0&&t.ch==(l||Y(e,t.line)).text.length?t.line<e.first+e.size-1?$e(t.line+1,0):null:new $e(t.line,t.ch+u)}function po(e){e.setSelection($e(e.firstLine(),0),$e(e.lastLine()),Ae)}function mo(e,t,u){var l={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return l.canceled=!0}};return u&&(l.update=function(y,H,q,ae){y&&(l.from=pt(e,y)),H&&(l.to=pt(e,H)),q&&(l.text=q),ae!==void 0&&(l.origin=ae)}),fe(e,"beforeChange",e,l),e.cm&&fe(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function Sa(e,t,u){if(e.cm){if(!e.cm.curOp)return Gi(e.cm,Sa)(e,t,u);if(e.cm.state.suppressEdits)return}if((de(e,"beforeChange")||e.cm&&de(e.cm,"beforeChange"))&&(t=mo(e,t,!0),!t))return;var l=Qi&&!u&&Nr(e,t.from,t.to);if(l)for(var y=l.length-1;y>=0;--y)go(e,{from:l[y].from,to:l[y].to,text:y?[""]:t.text,origin:t.origin});else go(e,t)}function go(e,t){if(t.text.length==1&&t.text[0]==""&&At(t.from,t.to)==0)return;var u=Ss(e,t);io(e,t,u,e.cm?e.cm.curOp.id:NaN),Ba(e,t,u,Zi(e,t));var l=[];sa(e,function(y,H){!H&&se(l,y.history)==-1&&(bo(y.history,t),l.push(y.history)),Ba(y,t,null,Zi(y,t))})}function os(e,t,u){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!u)return;for(var y=e.history,H,q=e.sel,ae=t=="undo"?y.done:y.undone,ue=t=="undo"?y.undone:y.done,ge=0;ge<ae.length&&!(H=ae[ge],u?H.ranges&&!H.equals(e.sel):!H.ranges);ge++);if(ge==ae.length)return;for(y.lastOrigin=y.lastSelOrigin=null;;)if(H=ae.pop(),H.ranges){if(is(H,ue),u&&!H.equals(e.sel)){nr(e,H,{clearRedo:!1});return}q=H}else if(l){ae.push(H);return}else break;var Me=[];is(q,ue),ue.push({changes:Me,generation:y.generation}),y.generation=H.generation||++y.maxGeneration;for(var We=de(e,"beforeChange")||e.cm&&de(e.cm,"beforeChange"),qe=function(It){var kt=H.changes[It];if(kt.origin=t,We&&!mo(e,kt,!1))return ae.length=0,{};Me.push(Cs(e,kt));var Ht=It?Ss(e,kt):U(ae);Ba(e,kt,Ht,ao(e,kt)),!It&&e.cm&&e.cm.scrollIntoView({from:kt.from,to:aa(kt)});var Xt=[];sa(e,function(Kt,qt){!qt&&se(Xt,Kt.history)==-1&&(bo(Kt.history,kt),Xt.push(Kt.history)),Ba(Kt,kt,null,ao(Kt,kt))})},Je=H.changes.length-1;Je>=0;--Je){var yt=qe(Je);if(yt)return yt.v}}function vo(e,t){if(t==0)return;if(e.first+=t,e.sel=new kr(K(e.sel.ranges,function(y){return new si($e(y.anchor.line+t,y.anchor.ch),$e(y.head.line+t,y.head.ch))}),e.sel.primIndex),e.cm){Ti(e.cm,e.first,e.first-t,t);for(var u=e.cm.display,l=u.viewFrom;l<u.viewTo;l++)$i(e.cm,l,"gutter")}}function Ba(e,t,u,l){if(e.cm&&!e.cm.curOp)return Gi(e.cm,Ba)(e,t,u,l);if(t.to.line<e.first){vo(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var y=t.text.length-1-(e.first-t.from.line);vo(e,y),t={from:$e(e.first,0),to:$e(t.to.line+y,t.to.ch),text:[U(t.text)],origin:t.origin}}var H=e.lastLine();t.to.line>H&&(t={from:t.from,to:$e(H,Y(e,H).text.length),text:[t.text[0]],origin:t.origin}),t.removed=$(e,t.from,t.to),u||(u=Ss(e,t)),e.cm?bl(e.cm,t,l):ws(e,t,l),as(e,u,Ae),e.cantEdit&&ss(e,$e(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,u){var l=e.doc,y=e.display,H=t.from,q=t.to,ae=!1,ue=H.line;e.options.lineWrapping||(ue=Pe(tr(Y(l,H.line))),l.iter(ue,q.line+1,function(Je){if(Je==y.maxLine)return ae=!0,!0})),l.sel.contains(t.from,t.to)>-1&&re(e),ws(l,t,u,Sr(e)),e.options.lineWrapping||(l.iter(ue,H.line+t.text.length,function(Je){var yt=Xr(Je);yt>y.maxLineLength&&(y.maxLine=Je,y.maxLineLength=yt,y.maxLineChanged=!0,ae=!1)}),ae&&(e.curOp.updateMaxLine=!0)),_i(l,H.line),Ua(e,400);var ge=t.text.length-(q.line-H.line)-1;t.full?Ti(e):H.line==q.line&&t.text.length==1&&!qs(e.doc,t)?$i(e,H.line,"text"):Ti(e,H.line,q.line+1,ge);var Me=de(e,"changes"),We=de(e,"change");if(We||Me){var qe={from:H,to:q,text:t.text,removed:t.removed,origin:t.origin};We&&rt(e,"change",e,qe),Me&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(qe)}e.display.selForContextMenu=null}function Ta(e,t,u,l,y){var H;l||(l=u),At(l,u)<0&&(H=[l,u],u=H[0],l=H[1]),typeof t=="string"&&(t=e.splitLines(t)),Sa(e,{from:u,to:l,text:t,origin:y})}function yo(e,t,u,l){u<e.line?e.line+=l:t<e.line&&(e.line=t,e.ch=0)}function _o(e,t,u,l){for(var y=0;y<e.length;++y){var H=e[y],q=!0;if(H.ranges){H.copied||(H=e[y]=H.deepCopy(),H.copied=!0);for(var ae=0;ae<H.ranges.length;ae++)yo(H.ranges[ae].anchor,t,u,l),yo(H.ranges[ae].head,t,u,l);continue}for(var ue=0;ue<H.changes.length;++ue){var ge=H.changes[ue];if(u<ge.from.line)ge.from=$e(ge.from.line+l,ge.from.ch),ge.to=$e(ge.to.line+l,ge.to.ch);else if(t<=ge.to.line){q=!1;break}}q||(e.splice(0,y+1),y=0)}}function bo(e,t){var u=t.from.line,l=t.to.line,y=t.text.length-(l-u)-1;_o(e.done,u,l,y),_o(e.undone,u,l,y)}function Wa(e,t,u,l){var y=t,H=t;return typeof t=="number"?H=Y(e,Ut(e,t)):y=Pe(t),y==null?null:(l(H,y)&&e.cm&&$i(e.cm,y,u),H)}function Ha(e){this.lines=e,this.parent=null;for(var t=0,u=0;u<e.length;++u)e[u].parent=this,t+=e[u].height;this.height=t}Ha.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var u=e,l=e+t;u<l;++u){var y=this.lines[u];this.height-=y.height,rn(y),rt(y,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,u){this.height+=u,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var l=0;l<t.length;++l)t[l].parent=this},iterN:function(e,t,u){for(var l=e+t;e<l;++e)if(u(this.lines[e]))return!0}};function Ka(e){this.children=e;for(var t=0,u=0,l=0;l<e.length;++l){var y=e[l];t+=y.chunkSize(),u+=y.height,y.parent=this}this.size=t,this.height=u,this.parent=null}Ka.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var u=0;u<this.children.length;++u){var l=this.children[u],y=l.chunkSize();if(e<y){var H=Math.min(t,y-e),q=l.height;if(l.removeInner(e,H),this.height-=q-l.height,y==H&&(this.children.splice(u--,1),l.parent=null),(t-=H)==0)break;e=0}else e-=y}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ha))){var ae=[];this.collapse(ae),this.children=[new Ha(ae)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,u){this.size+=t.length,this.height+=u;for(var l=0;l<this.children.length;++l){var y=this.children[l],H=y.chunkSize();if(e<=H){if(y.insertInner(e,t,u),y.lines&&y.lines.length>50){for(var q=y.lines.length%25+25,ae=q;ae<y.lines.length;){var ue=new Ha(y.lines.slice(ae,ae+=25));y.height-=ue.height,this.children.splice(++l,0,ue),ue.parent=this}y.lines=y.lines.slice(0,q),this.maybeSpill()}break}e-=H}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),u=new Ka(t);if(e.parent){e.size-=u.size,e.height-=u.height;var y=se(e.parent.children,e);e.parent.children.splice(y+1,0,u)}else{var l=new Ka(e.children);l.parent=e,e.children=[l,u],e=l}u.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,u){for(var l=0;l<this.children.length;++l){var y=this.children[l],H=y.chunkSize();if(e<H){var q=Math.min(t,H-e);if(y.iterN(e,q,u))return!0;if((t-=q)==0)break;e=0}else e-=H}}};var Ga=function(e,t,u){if(u)for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);this.doc=e,this.node=t};Ga.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,u=this.line,l=Pe(u);if(l==null||!t)return;for(var y=0;y<t.length;++y)t[y]==this&&t.splice(y--,1);t.length||(u.widgets=null);var H=di(this);ve(u,Math.max(0,u.height-H)),e&&(Or(e,function(){Eo(e,u,-H),$i(e,l,"widget")}),rt(e,"lineWidgetCleared",e,this,l))},Ga.prototype.changed=function(){var e=this,t=this.height,u=this.doc.cm,l=this.line;this.height=null;var y=di(this)-t;if(!y)return;br(this.doc,l)||ve(l,l.height+y),u&&Or(u,function(){u.curOp.forceUpdate=!0,Eo(u,l,y),rt(u,"lineWidgetChanged",u,e,Pe(l))})},me(Ga);function Eo(e,t,u){hr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&vs(e,u)}function El(e,t,u,l){var y=new Ga(e,u,l),H=e.cm;return H&&y.noHScroll&&(H.display.alignWidgets=!0),Wa(e,t,"widget",function(q){var ae=q.widgets||(q.widgets=[]);if(y.insertAt==null?ae.push(y):ae.splice(Math.min(ae.length-1,Math.max(0,y.insertAt)),0,y),y.line=q,H&&!br(e,q)){var ue=hr(q)<e.scrollTop;ve(q,q.height+di(y)),ue&&vs(H,y.height),H.curOp.forceUpdate=!0}return!0}),H&&rt(H,"lineWidgetAdded",H,y,typeof t=="number"?t:Pe(t)),y}var xo=0,oa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++xo};oa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&fa(e),de(this,"clear")){var u=this.find();u&&rt(this,"clear",u.from,u.to)}for(var l=null,y=null,H=0;H<this.lines.length;++H){var q=this.lines[H],ae=Oi(q.markedSpans,this);e&&!this.collapsed?$i(e,Pe(q),"text"):e&&(ae.to!=null&&(y=Pe(q)),ae.from!=null&&(l=Pe(q))),q.markedSpans=Si(q.markedSpans,ae),ae.from==null&&this.collapsed&&!br(this.doc,q)&&e&&ve(q,Nn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ue=0;ue<this.lines.length;++ue){var ge=tr(this.lines[ue]),Me=Xr(ge);Me>e.display.maxLineLength&&(e.display.maxLine=ge,e.display.maxLineLength=Me,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&Ti(e,l,y+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&co(e.doc)),e&&rt(e,"markerCleared",e,this,l,y),t&&pa(e),this.parent&&this.parent.clear()},oa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var u,l,y=0;y<this.lines.length;++y){var H=this.lines[y],q=Oi(H.markedSpans,this);if(q.from!=null&&(u=$e(t?H:Pe(H),q.from),e==-1))return u;if(q.to!=null&&(l=$e(t?H:Pe(H),q.to),e==1))return l}return u&&{from:u,to:l}},oa.prototype.changed=function(){var e=this,t=this.find(-1,!0),u=this,l=this.doc.cm;if(!t||!l)return;Or(l,function(){var y=t.line,H=Pe(t.line),q=ei(l,H);if(q&&(Qt(q),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!br(u.doc,y)&&u.height!=null){var ae=u.height;u.height=null;var ue=di(u)-ae;ue&&ve(y,y.height+ue)}rt(l,"markerChanged",l,e)})},oa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||se(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},oa.prototype.detachLine=function(e){if(this.lines.splice(se(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},me(oa);function wa(e,t,u,l,y){if(l&&l.shared)return xl(e,t,u,l,y);if(e.cm&&!e.cm.curOp)return Gi(e.cm,wa)(e,t,u,l,y);var H=new oa(e,y),q=At(t,u);if(l&&R(l,H,!1),q>0||q==0&&H.clearWhenEmpty!==!1)return H;if(H.replacedWith&&(H.collapsed=!0,H.widgetNode=O("span",[H.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||H.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(H.widgetNode.insertLeft=!0)),H.collapsed){if(ea(e,t.line,t,u,H)||t.line!=u.line&&ea(e,u.line,t,u,H))throw new Error("Inserting collapsed marker partially overlapping an existing one");Pi()}H.addToHistory&&io(e,{from:t,to:u,origin:"markText"},e.sel,NaN);var ae=t.line,ue=e.cm,ge;if(e.iter(ae,u.line+1,function(We){ue&&H.collapsed&&!ue.options.lineWrapping&&tr(We)==ue.display.maxLine&&(ge=!0),H.collapsed&&ae!=t.line&&ve(We,0),cr(We,new Li(H,ae==t.line?t.ch:null,ae==u.line?u.ch:null)),++ae}),H.collapsed&&e.iter(t.line,u.line+1,function(We){br(e,We)&&ve(We,0)}),H.clearOnEnter&&Ue(H,"beforeCursorEnter",function(){return H.clear()}),H.readOnly&&(ri(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),H.collapsed&&(H.id=++xo,H.atomic=!0),ue){if(ge&&(ue.curOp.updateMaxLine=!0),H.collapsed)Ti(ue,t.line,u.line+1);else if(H.className||H.startStyle||H.endStyle||H.css||H.attributes||H.title)for(var Me=t.line;Me<=u.line;Me++)$i(ue,Me,"text");H.atomic&&co(ue.doc),rt(ue,"markerAdded",ue,H)}return H}var za=function(e,t){this.markers=e,this.primary=t;for(var u=0;u<e.length;++u)e[u].parent=this};za.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();rt(this,"clear")},za.prototype.find=function(e,t){return this.primary.find(e,t)},me(za);function xl(e,t,u,l,y){l=R(l),l.shared=!1;var H=[wa(e,t,u,l,y)],q=H[0],ae=l.widgetNode;return sa(e,function(ue){ae&&(l.widgetNode=ae.cloneNode(!0)),H.push(wa(ue,pt(ue,t),pt(ue,u),l,y));for(var ge=0;ge<ue.linked.length;++ge)if(ue.linked[ge].isParent)return;q=U(H)}),new za(H,q)}function So(e){return e.findMarks($e(e.first,0),e.clipPos($e(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var u=0;u<t.length;u++){var l=t[u],y=l.find(),H=e.clipPos(y.from),q=e.clipPos(y.to);if(At(H,q)){var ae=wa(e,H,q,l.primary,l.primary.type);l.markers.push(ae),ae.parent=l}}}function Tl(e){for(var t=function(l){var y=e[l],H=[y.primary.doc];sa(y.primary.doc,function(ue){return H.push(ue)});for(var q=0;q<y.markers.length;q++){var ae=y.markers[q];se(H,ae.doc)==-1&&(ae.parent=null,y.markers.splice(q--,1))}},u=0;u<e.length;u++)t(u)}var wl=0,mr=function(e,t,u,l,y){if(!(this instanceof mr))return new mr(e,t,u,l,y);u==null&&(u=0),Ka.call(this,[new Ha([new or("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var H=$e(u,0);this.sel=ra(H),this.history=new ns(null),this.id=++wl,this.modeOption=t,this.lineSep=l,this.direction=y=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ws(this,{from:H,to:H,text:e}),nr(this,ra(H),Ae)};mr.prototype=Q(Ka.prototype,{constructor:mr,iter:function(e,t,u){u?this.iterN(e-this.first,t-e,u):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var u=0,l=0;l<t.length;++l)u+=t[l].height;this.insertInner(e-this.first,t,u)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=te(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:zi(function(e){var t=$e(this.first,0),u=this.first+this.size-1;Sa(this,{from:t,to:$e(u,Y(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Pa(this.cm,0,0),nr(this,ra(t),Ae)}),replaceRange:function(e,t,u,l){t=pt(this,t),u=u?pt(this,u):t,Ta(this,e,t,u,l)},getRange:function(e,t,u){var l=$(this,pt(this,e),pt(this,t));return u===!1?l:l.join(u||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(_t(this,e))return Y(this,e)},getLineNumber:function(e){return Pe(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Y(this,e)),tr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return pt(this,e)},getCursor:function(e){var t=this.sel.primary(),u;return e==null||e=="head"?u=t.head:e=="anchor"?u=t.anchor:e=="end"||e=="to"||e===!1?u=t.to():u=t.from(),u},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:zi(function(e,t,u){oo(this,pt(this,typeof e=="number"?$e(e,t||0):e),null,u)}),setSelection:zi(function(e,t,u){oo(this,pt(this,e),pt(this,t||e),u)}),extendSelection:zi(function(e,t,u){rs(this,pt(this,e),t&&pt(this,t),u)}),extendSelections:zi(function(e,t){so(this,ft(this,e),t)}),extendSelectionsBy:zi(function(e,t){var u=K(this.sel.ranges,e);so(this,ft(this,u),t)}),setSelections:zi(function(e,t,u){if(!e.length)return;for(var l=[],y=0;y<e.length;y++)l[y]=new si(pt(this,e[y].anchor),pt(this,e[y].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),nr(this,Kr(this.cm,l,t),u)}),addSelection:zi(function(e,t,u){var l=this.sel.ranges.slice(0);l.push(new si(pt(this,e),pt(this,t||e))),nr(this,Kr(this.cm,l,l.length-1),u)}),getSelection:function(e){for(var t=this.sel.ranges,u,l=0;l<t.length;l++){var y=$(this,t[l].from(),t[l].to());u=u?u.concat(y):y}return e===!1?u:u.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],u=this.sel.ranges,l=0;l<u.length;l++){var y=$(this,u[l].from(),u[l].to());e!==!1&&(y=y.join(e||this.lineSeparator())),t[l]=y}return t},replaceSelection:function(e,t,u){for(var l=[],y=0;y<this.sel.ranges.length;y++)l[y]=e;this.replaceSelections(l,t,u||"+input")},replaceSelections:zi(function(e,t,u){for(var l=[],y=this.sel,H=0;H<y.ranges.length;H++){var q=y.ranges[H];l[H]={from:q.from(),to:q.to(),text:this.splitLines(e[H]),origin:u}}for(var ae=t&&t!="end"&&hl(this,l,t),ue=l.length-1;ue>=0;ue--)Sa(this,l[ue]);ae?lo(this,ae):this.cm&&_a(this.cm)}),undo:zi(function(){os(this,"undo")}),redo:zi(function(){os(this,"redo")}),undoSelection:zi(function(){os(this,"undo",!0)}),redoSelection:zi(function(){os(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,u=0,l=0;l<e.done.length;l++)e.done[l].ranges||++t;for(var y=0;y<e.undone.length;y++)e.undone[y].ranges||++u;return{undo:t,redo:u}},clearHistory:function(){var e=this;this.history=new ns(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:Ea(this.history.done),undone:Ea(this.history.undone)}},setHistory:function(e){var t=this.history=new ns(this.history.maxGeneration);t.done=Ea(e.done.slice(0),null,!0),t.undone=Ea(e.undone.slice(0),null,!0)},setGutterMarker:zi(function(e,t,u){return Wa(this,e,"gutter",function(l){var y=l.gutterMarkers||(l.gutterMarkers={});return y[t]=u,!u&&xe(y)&&(l.gutterMarkers=null),!0})}),clearGutter:zi(function(e){var t=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&Wa(t,u,"gutter",function(){return u.gutterMarkers[e]=null,xe(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!_t(this,e))return null;if(t=e,e=Y(this,e),!e)return null}else if(t=Pe(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:zi(function(e,t,u){return Wa(this,e,t=="gutter"?"gutter":"class",function(l){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!l[y])l[y]=u;else{if(w(u).test(l[y]))return!1;l[y]+=" "+u}return!0})}),removeLineClass:zi(function(e,t,u){return Wa(this,e,t=="gutter"?"gutter":"class",function(l){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",H=l[y];if(H)if(u==null)l[y]=null;else{var q=H.match(w(u));if(!q)return!1;var ae=q.index+q[0].length;l[y]=H.slice(0,q.index)+(!q.index||ae==H.length?"":" ")+H.slice(ae)||null}else return!1;return!0})}),addLineWidget:zi(function(e,t,u){return El(this,e,t,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,u){return wa(this,pt(this,e),pt(this,t),u,u&&u.type||"range")},setBookmark:function(e,t){var u={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=pt(this,e),wa(this,e,e,u,"bookmark")},findMarksAt:function(e){e=pt(this,e);var t=[],u=Y(this,e.line).markedSpans;if(u)for(var l=0;l<u.length;++l){var y=u[l];(y.from==null||y.from<=e.ch)&&(y.to==null||y.to>=e.ch)&&t.push(y.marker.parent||y.marker)}return t},findMarks:function(e,t,u){e=pt(this,e),t=pt(this,t);var l=[],y=e.line;return this.iter(e.line,t.line+1,function(H){var q=H.markedSpans;if(q)for(var ae=0;ae<q.length;ae++){var ue=q[ae];!(ue.to!=null&&y==e.line&&e.ch>=ue.to||ue.from==null&&y!=e.line||ue.from!=null&&y==t.line&&ue.from>=t.ch)&&(!u||u(ue.marker))&&l.push(ue.marker.parent||ue.marker)}++y}),l},getAllMarks:function(){var e=[];return this.iter(function(t){var u=t.markedSpans;if(u)for(var l=0;l<u.length;++l)u[l].from!=null&&e.push(u[l].marker)}),e},posFromIndex:function(e){var t,u=this.first,l=this.lineSeparator().length;return this.iter(function(y){var H=y.text.length+l;if(H>e)return t=e,!0;e-=H,++u}),pt(this,$e(u,t))},indexFromPos:function(e){e=pt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var u=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){t+=l.text.length+u}),t},copy:function(e){var t=new mr(te(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,u=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<u&&(u=e.to);var l=new mr(te(this,t,u),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(l,So(this)),l},unlinkDoc:function(e){if(e instanceof xi&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var u=this.linked[t];if(u.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(So(this));break}if(e.history==this.history){var l=[e.id];sa(e,function(y){return l.push(y.id)},!0),e.history=new ns(null),e.history.done=Ea(this.history.done,l),e.history.undone=Ea(this.history.undone,l)}},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):Ye(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:zi(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),mr.prototype.eachLine=mr.prototype.iter;var To=0;function Cl(e){var t=this;if(wo(t),ie(t,e)||Ln(t.display,e))return;le(e),B&&(To=+new Date);var u=ji(t,e,!0),l=e.dataTransfer.files;if(!u||t.isReadOnly())return;if(l&&l.length&&window.FileReader&&window.File)for(var y=l.length,H=Array(y),q=0,ae=function(){++q==y&&Gi(t,function(){u=pt(t.doc,u);var Je={from:u,to:u,text:t.doc.splitLines(H.filter(function(yt){return yt!=null}).join(t.doc.lineSeparator())),origin:"paste"};Sa(t.doc,Je),lo(t.doc,ra(pt(t.doc,u),pt(t.doc,aa(Je))))})()},ue=function(Je,yt){if(t.options.allowDropFileTypes&&se(t.options.allowDropFileTypes,Je.type)==-1){ae();return}var It=new FileReader;It.onerror=function(){return ae()},It.onload=function(){var kt=It.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(kt)){ae();return}H[yt]=kt,ae()},It.readAsText(Je)},ge=0;ge<l.length;ge++)ue(l[ge],ge);else{if(t.state.draggingText&&t.doc.sel.contains(u)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Me=e.dataTransfer.getData("Text");if(Me){var We;if(t.state.draggingText&&!t.state.draggingText.copy&&(We=t.listSelections()),as(t.doc,ra(u,u)),We)for(var qe=0;qe<We.length;++qe)Ta(t.doc,"",We[qe].anchor,We[qe].head,"drag");t.replaceSelection(Me,"around","paste"),t.display.input.focus()}}catch(Je){}}}function Ol(e,t){if(B&&(!e.state.draggingText||+new Date-To<100)){ye(t);return}if(ie(e,t)||Ln(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h){var u=f("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),t.dataTransfer.setDragImage(u,0,0),p&&u.parentNode.removeChild(u)}}function Rl(e,t){var u=ji(e,t);if(!u)return;var l=document.createDocumentFragment();ki(e,u,l),e.display.dragCursor||(e.display.dragCursor=f("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),m(e.display.dragCursor,l)}function wo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Co(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),u=[],l=0;l<t.length;l++){var y=t[l].CodeMirror;y&&u.push(y)}u.length&&u[0].operation(function(){for(var H=0;H<u.length;H++)e(u[H])})}var Oo=!1;function Al(){if(Oo)return;Ll(),Oo=!0}function Ll(){var e;Ue(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Co(Il)},100))}),Ue(window,"blur",function(){return Co(wr)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var la={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"},Va=0;Va<10;Va++)la[Va+48]=la[Va+96]=String(Va);for(var ls=65;ls<=90;ls++)la[ls]=String.fromCharCode(ls);for(var Xa=1;Xa<=12;Xa++)la[Xa+111]=la[Xa+63235]="F"+Xa;var Zr={};Zr.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"},Zr.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"},Zr.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"},Zr.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"]},Zr.default=i?Zr.macDefault:Zr.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var u,l,y,H,q=0;q<t.length-1;q++){var ae=t[q];if(/^(cmd|meta|m)$/i.test(ae))H=!0;else if(/^a(lt)?$/i.test(ae))u=!0;else if(/^(c|ctrl|control)$/i.test(ae))l=!0;else if(/^s(hift)?$/i.test(ae))y=!0;else throw new Error("Unrecognized modifier name: "+ae)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),H&&(e="Cmd-"+e),y&&(e="Shift-"+e),e}function Pl(e){var t={};for(var u in e)if(e.hasOwnProperty(u)){var l=e[u];if(/^(name|fallthrough|(de|at)tach)$/.test(u))continue;if(l=="..."){delete e[u];continue}for(var y=K(u.split(" "),Dl),H=0;H<y.length;H++){var q=void 0,ae=void 0;H==y.length-1?(ae=y.join(" "),q=l):(ae=y.slice(0,H+1).join(" "),q="...");var ue=t[ae];if(!ue)t[ae]=q;else if(ue!=q)throw new Error("Inconsistent bindings for "+ae)}delete e[u]}for(var ge in t)e[ge]=t[ge];return e}function Ca(e,t,u,l){t=us(t);var y=t.call?t.call(e,l):t[e];if(y===!1)return"nothing";if(y==="...")return"multi";if(y!=null&&u(y))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ca(e,t.fallthrough,u,l);for(var H=0;H<t.fallthrough.length;H++){var q=Ca(e,t.fallthrough[H],u,l);if(q)return q}}}function Ro(e){var t=typeof e=="string"?e:la[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ao(e,t,u){var l=e;return t.altKey&&l!="Alt"&&(e="Alt-"+e),(T?t.metaKey:t.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(T?t.ctrlKey:t.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!u&&t.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function Lo(e,t){if(p&&e.keyCode==34&&e.char)return!1;var u=la[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),Ao(u,e,t))}function us(e){return typeof e=="string"?Zr[e]:e}function Oa(e,t){for(var u=e.doc.sel.ranges,l=[],y=0;y<u.length;y++){for(var H=t(u[y]);l.length&&At(H.from,U(l).to)<=0;){var q=l.pop();if(At(q.from,H.from)<0){H.from=q.from;break}}l.push(H)}Or(e,function(){for(var ae=l.length-1;ae>=0;ae--)Ta(e.doc,"",l[ae].from,l[ae].to,"+delete");_a(e)})}function As(e,t,u){var l=Oe(e.text,t+u,u);return l<0||l>e.text.length?null:l}function Ls(e,t,u){var l=As(e,t.ch,u);return l==null?null:new $e(t.line,l,u<0?"after":"before")}function Is(e,t,u,l,y){if(e){t.doc.direction=="rtl"&&(y=-y);var H=wt(u,t.doc.direction);if(H){var q=y<0?U(H):H[0],ae=y<0==(q.level==1),ue=ae?"after":"before",ge;if(q.level>0||t.doc.direction=="rtl"){var Me=Vn(t,u);ge=y<0?u.text.length-1:0;var We=Tn(t,Me,ge).top;ge=Ke(function(qe){return Tn(t,Me,qe).top==We},y<0==(q.level==1)?q.from:q.to-1,ge),ue=="before"&&(ge=As(u,ge,1))}else ge=y<0?q.to:q.from;return new $e(l,ge,ue)}}return new $e(l,y<0?u.text.length:0,y<0?"before":"after")}function Ml(e,t,u,l){var y=wt(t,e.doc.direction);if(!y)return Ls(t,u,l);u.ch>=t.text.length?(u.ch=t.text.length,u.sticky="before"):u.ch<=0&&(u.ch=0,u.sticky="after");var H=ut(y,u.ch,u.sticky),q=y[H];if(e.doc.direction=="ltr"&&q.level%2==0&&(l>0?q.to>u.ch:q.from<u.ch))return Ls(t,u,l);var ae=function(Ht,Xt){return As(t,Ht instanceof $e?Ht.ch:Ht,Xt)},ue,ge=function(Ht){return e.options.lineWrapping?(ue=ue||Vn(e,t),ca(e,t,ue,Ht)):{begin:0,end:t.text.length}},Me=ge(u.sticky=="before"?ae(u,-1):u.ch);if(e.doc.direction=="rtl"||q.level==1){var We=q.level==1==l<0,qe=ae(u,We?1:-1);if(qe!=null&&(We?qe<=q.to&&qe<=Me.end:qe>=q.from&&qe>=Me.begin)){var Je=We?"before":"after";return new $e(u.line,qe,Je)}}var yt=function(Ht,Xt,Kt){for(var qt=function(mi,Vi){return Vi?new $e(u.line,ae(mi,1),"before"):new $e(u.line,mi,"after")};Ht>=0&&Ht<y.length;Ht+=Xt){var bn=y[Ht],dn=Xt>0==(bn.level!=1),Wn=dn?Kt.begin:ae(Kt.end,-1);if(bn.from<=Wn&&Wn<bn.to)return qt(Wn,dn);if(Wn=dn?bn.from:ae(bn.to,-1),Kt.begin<=Wn&&Wn<Kt.end)return qt(Wn,dn)}},It=yt(H+l,l,Me);if(It)return It;var kt=l>0?Me.end:ae(Me.begin,-1);return kt!=null&&!(l>0&&kt==t.text.length)&&(It=yt(l>0?0:y.length-1,l,ge(kt)),It)?It:null}var Ya={selectAll:po,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ae)},killLine:function(e){return Oa(e,function(t){if(t.empty()){var u=Y(e.doc,t.head.line).text.length;return t.head.ch==u&&t.head.line<e.lastLine()?{from:t.head,to:$e(t.head.line+1,0)}:{from:t.head,to:$e(t.head.line,u)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Oa(e,function(t){return{from:$e(t.from().line,0),to:pt(e.doc,$e(t.to().line+1,0))}})},delLineLeft:function(e){return Oa(e,function(t){return{from:$e(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Oa(e,function(t){var u=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return{from:l,to:t.from()}})},delWrappedLineRight:function(e){return Oa(e,function(t){var u=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div");return{from:t.from(),to:l}})},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($e(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection($e(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Io(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Do(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return kl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div")},je)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:u},"div")},je)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return l.ch<e.getLine(l.line).search(/\S/)?Do(e,t.head):l},je)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],u=e.listSelections(),l=e.options.tabSize,y=0;y<u.length;y++){var H=u[y].from(),q=V(e.getLine(H.line),H.ch,l);t.push(Z(l-q%l))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Or(e,function(){for(var t=e.listSelections(),u=[],l=0;l<t.length;l++){if(!t[l].empty())continue;var y=t[l].head,H=Y(e.doc,y.line).text;if(H){if(y.ch==H.length&&(y=new $e(y.line,y.ch-1)),y.ch>0)y=new $e(y.line,y.ch+1),e.replaceRange(H.charAt(y.ch-1)+H.charAt(y.ch-2),$e(y.line,y.ch-2),y,"+transpose");else if(y.line>e.doc.first){var q=Y(e.doc,y.line-1).text;q&&(y=new $e(y.line,1),e.replaceRange(H.charAt(0)+e.doc.lineSeparator()+q.charAt(q.length-1),$e(y.line-1,q.length-1),y,"+transpose"))}}u.push(new si(y,y))}e.setSelections(u)})},newlineAndIndent:function(e){return Or(e,function(){for(var t=e.listSelections(),u=t.length-1;u>=0;u--)e.replaceRange(e.doc.lineSeparator(),t[u].anchor,t[u].head,"+input");t=e.listSelections();for(var l=0;l<t.length;l++)e.indentLine(t[l].from().line,null,!0);_a(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Io(e,t){var u=Y(e.doc,t),l=tr(u);return l!=u&&(t=Pe(l)),Is(!0,e,l,t,1)}function kl(e,t){var u=Y(e.doc,t),l=dr(u);return l!=u&&(t=Pe(l)),Is(!0,e,u,t,-1)}function Do(e,t){var u=Io(e,t.line),l=Y(e.doc,u.line),y=wt(l,e.doc.direction);if(!y||y[0].level==0){var H=Math.max(u.ch,l.text.search(/\S/)),q=t.line==u.line&&t.ch<=H&&t.ch;return $e(u.line,q?0:H,u.sticky)}return u}function cs(e,t,u){if(typeof t=="string"&&(t=Ya[t],!t))return!1;e.display.input.ensurePolled();var l=e.display.shift,y=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u&&(e.display.shift=!1),y=t(e)!=De}finally{e.display.shift=l,e.state.suppressEdits=!1}return y}function Nl(e,t,u){for(var l=0;l<e.state.keyMaps.length;l++){var y=Ca(t,e.state.keyMaps[l],u,e);if(y)return y}return e.options.extraKeys&&Ca(t,e.options.extraKeys,u,e)||Ca(t,e.options.keyMap,u,e)}var Ul=new ne;function $a(e,t,u,l){var y=e.state.keySeq;if(y){if(Ro(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==y&&(e.state.keySeq=null,e.display.input.reset())}),Po(e,y+" "+t,u,l))return!0}return Po(e,t,u,l)}function Po(e,t,u,l){var y=Nl(e,t,l);return y=="multi"&&(e.state.keySeq=t),y=="handled"&&rt(e,"keyHandled",e,t,u),(y=="handled"||y=="multi")&&(le(u),cn(e)),!!y}function Mo(e,t){var u=Lo(t,!0);return u?t.shiftKey&&!e.state.keySeq?$a(e,"Shift-"+u,t,function(l){return cs(e,l,!0)})||$a(e,u,t,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return cs(e,l)}):$a(e,u,t,function(l){return cs(e,l)}):!1}function Fl(e,t,u){return $a(e,"'"+u+"'",t,function(l){return cs(e,l,!0)})}var Ds=null;function ko(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=k(),ie(t,e))return;B&&M<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;t.display.shift=u==16||e.shiftKey;var l=Mo(t,e);p&&(Ds=l?u:null,!l&&u==88&&!Ve&&(i?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!i&&!l&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&jl(t)}function jl(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function u(l){(l.keyCode==18||!l.altKey)&&(v(t,"CodeMirror-crosshair"),lt(document,"keyup",u),lt(document,"mouseover",u))}Ue(document,"keyup",u),Ue(document,"mouseover",u)}function No(e){e.keyCode==16&&(this.doc.sel.shift=!1),ie(this,e)}function Uo(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Ln(t.display,e)||ie(t,e)||e.ctrlKey&&!e.altKey||i&&e.metaKey)return;var u=e.keyCode,l=e.charCode;if(p&&u==Ds){Ds=null,le(e);return}if(p&&(!e.which||e.which<10)&&Mo(t,e))return;var y=String.fromCharCode(l==null?u:l);if(y=="\b")return;if(Fl(t,e,y))return;t.display.input.onKeyPress(e)}var Bl=400,Ps=function(e,t,u){this.time=e,this.pos=t,this.button=u};Ps.prototype.compare=function(e,t,u){return this.time+Bl>e&&At(t,this.pos)==0&&u==this.button};var Ja,Qa;function Wl(e,t){var u=+new Date;return Qa&&Qa.compare(u,e,t)?(Ja=Qa=null,"triple"):Ja&&Ja.compare(u,e,t)?(Qa=new Ps(u,e,t),Ja=null,"double"):(Ja=new Ps(u,e,t),Qa=null,"single")}function Fo(e){var t=this,u=t.display;if(ie(t,e)||u.activeTouch&&u.input.supportsTouch())return;if(u.input.ensurePolled(),u.shift=e.shiftKey,Ln(u,e)){n||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(Ms(t,e))return;var l=ji(t,e),y=Ne(e),H=l?Wl(l,y):"single";if(window.focus(),y==1&&t.state.selectingText&&t.state.selectingText(e),l&&Hl(t,y,l,H,e))return;y==1?l?Gl(t,l,H,e):Le(e)==u.scroller&&le(e):y==2?(l&&rs(t.doc,l),setTimeout(function(){return u.input.focus()},20)):y==3&&(A?t.display.input.onContextMenu(e):ya(t))}function Hl(e,t,u,l,y){var H="Click";return l=="double"?H="Double"+H:l=="triple"&&(H="Triple"+H),H=(t==1?"Left":t==2?"Middle":"Right")+H,$a(e,Ao(H,y),y,function(q){if(typeof q=="string"&&(q=Ya[q]),!q)return!1;var ae=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ae=q(e,u)!=De}finally{e.state.suppressEdits=!1}return ae})}function Kl(e,t,u){var l=e.getOption("configureMouse"),y=l?l(e,t,u):{};if(y.unit==null){var H=s?u.shiftKey&&u.metaKey:u.altKey;y.unit=H?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(y.extend==null||e.doc.extend)&&(y.extend=e.doc.extend||u.shiftKey),y.addNew==null&&(y.addNew=i?u.metaKey:u.ctrlKey),y.moveOnDrag==null&&(y.moveOnDrag=!(i?u.altKey:u.ctrlKey)),y}function Gl(e,t,u,l){B?setTimeout(j(na,e),0):e.curOp.focus=k();var y=Kl(e,u,l),H=e.doc.sel,q;e.options.dragDrop&&tt&&!e.isReadOnly()&&u=="single"&&(q=H.contains(t))>-1&&(At((q=H.ranges[q]).from(),t)<0||t.xRel>0)&&(At(q.to(),t)>0||t.xRel<0)?zl(e,l,t,y):Vl(e,l,t,y)}function zl(e,t,u,l){var y=e.display,H=!1,q=Gi(e,function(ge){n&&(y.scroller.draggable=!1),e.state.draggingText=!1,lt(y.wrapper.ownerDocument,"mouseup",q),lt(y.wrapper.ownerDocument,"mousemove",ae),lt(y.scroller,"dragstart",ue),lt(y.scroller,"drop",q),H||(le(ge),l.addNew||rs(e.doc,u,null,null,l.extend),n&&!h||B&&M==9?setTimeout(function(){y.wrapper.ownerDocument.body.focus({preventScroll:!0}),y.input.focus()},20):y.input.focus())}),ae=function(ge){H=H||Math.abs(t.clientX-ge.clientX)+Math.abs(t.clientY-ge.clientY)>=10},ue=function(){return H=!0};n&&(y.scroller.draggable=!0),e.state.draggingText=q,q.copy=!l.moveOnDrag,y.scroller.dragDrop&&y.scroller.dragDrop(),Ue(y.wrapper.ownerDocument,"mouseup",q),Ue(y.wrapper.ownerDocument,"mousemove",ae),Ue(y.scroller,"dragstart",ue),Ue(y.scroller,"drop",q),ya(e),setTimeout(function(){return y.input.focus()},20)}function jo(e,t,u){if(u=="char")return new si(t,t);if(u=="word")return e.findWordAt(t);if(u=="line")return new si($e(t.line,0),pt(e.doc,$e(t.line+1,0)));var l=u(e,t);return new si(l.from,l.to)}function Vl(e,t,u,l){var y=e.display,H=e.doc;le(t);var q,ae,ue=H.sel,ge=ue.ranges;if(l.addNew&&!l.extend?(ae=H.sel.contains(u),ae>-1?q=ge[ae]:q=new si(u,u)):(q=H.sel.primary(),ae=H.sel.primIndex),l.unit=="rectangle")l.addNew||(q=new si(u,u)),u=ji(e,t,!0,!0),ae=-1;else{var Me=jo(e,u,l.unit);l.extend?q=Os(q,Me.anchor,Me.head,l.extend):q=Me}l.addNew?ae==-1?(ae=ge.length,nr(H,Kr(e,ge.concat([q]),ae),{scroll:!1,origin:"*mouse"})):ge.length>1&&ge[ae].empty()&&l.unit=="char"&&!l.extend?(nr(H,Kr(e,ge.slice(0,ae).concat(ge.slice(ae+1)),0),{scroll:!1,origin:"*mouse"}),ue=H.sel):Rs(H,ae,q,ke):(ae=0,nr(H,new kr([q],0),ke),ue=H.sel);var We=u;function qe(Kt){if(At(We,Kt)==0)return;if(We=Kt,l.unit=="rectangle"){for(var qt=[],bn=e.options.tabSize,dn=V(Y(H,u.line).text,u.ch,bn),Wn=V(Y(H,Kt.line).text,Kt.ch,bn),mi=Math.min(dn,Wn),Vi=Math.max(dn,Wn),Ci=Math.min(u.line,Kt.line),Rr=Math.min(e.lastLine(),Math.max(u.line,Kt.line));Ci<=Rr;Ci++){var gr=Y(H,Ci).text,Ni=Be(gr,mi,bn);mi==Vi?qt.push(new si($e(Ci,Ni),$e(Ci,Ni))):gr.length>Ni&&qt.push(new si($e(Ci,Ni),$e(Ci,Be(gr,Vi,bn))))}qt.length||qt.push(new si(u,u)),nr(H,Kr(e,ue.ranges.slice(0,ae).concat(qt),ae),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Kt)}else{var vr=q,Ji=jo(e,Kt,l.unit),Wi=vr.anchor,Ui;At(Ji.anchor,Wi)>0?(Ui=Ji.head,Wi=Yt(vr.from(),Ji.anchor)):(Ui=Ji.anchor,Wi=sn(vr.to(),Ji.head));var Ai=ue.ranges.slice(0);Ai[ae]=Xl(e,new si(pt(H,Wi),Ui)),nr(H,Kr(e,Ai,ae),ke)}}var Je=y.wrapper.getBoundingClientRect(),yt=0;function It(Kt){var qt=++yt,bn=ji(e,Kt,!0,l.unit=="rectangle");if(!bn)return;if(At(bn,We)!=0){e.curOp.focus=k(),qe(bn);var dn=Hr(y,H);(bn.line>=dn.to||bn.line<dn.from)&&setTimeout(Gi(e,function(){yt==qt&&It(Kt)}),150)}else{var Wn=Kt.clientY<Je.top?-20:Kt.clientY>Je.bottom?20:0;Wn&&setTimeout(Gi(e,function(){if(yt!=qt)return;y.scroller.scrollTop+=Wn,It(Kt)}),50)}}function kt(Kt){e.state.selectingText=!1,yt=Infinity,Kt&&(le(Kt),y.input.focus()),lt(y.wrapper.ownerDocument,"mousemove",Ht),lt(y.wrapper.ownerDocument,"mouseup",Xt),H.history.lastSelOrigin=null}var Ht=Gi(e,function(Kt){Kt.buttons===0||!Ne(Kt)?kt(Kt):It(Kt)}),Xt=Gi(e,kt);e.state.selectingText=Xt,Ue(y.wrapper.ownerDocument,"mousemove",Ht),Ue(y.wrapper.ownerDocument,"mouseup",Xt)}function Xl(e,t){var u=t.anchor,l=t.head,y=Y(e.doc,u.line);if(At(u,l)==0&&u.sticky==l.sticky)return t;var H=wt(y);if(!H)return t;var q=ut(H,u.ch,u.sticky),ae=H[q];if(ae.from!=u.ch&&ae.to!=u.ch)return t;var ue=q+(ae.from==u.ch==(ae.level!=1)?0:1);if(ue==0||ue==H.length)return t;var ge;if(l.line!=u.line)ge=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Me=ut(H,l.ch,l.sticky),We=Me-q||(l.ch-u.ch)*(ae.level==1?-1:1);Me==ue-1||Me==ue?ge=We<0:ge=We>0}var qe=H[ue+(ge?-1:0)],Je=ge==(qe.level==1),yt=Je?qe.from:qe.to,It=Je?"after":"before";return u.ch==yt&&u.sticky==It?t:new si(new $e(u.line,yt,It),l)}function Bo(e,t,u,l){var y,H;if(t.touches)y=t.touches[0].clientX,H=t.touches[0].clientY;else try{y=t.clientX,H=t.clientY}catch(qe){return!1}if(y>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&le(t);var q=e.display,ae=q.lineDiv.getBoundingClientRect();if(H>ae.bottom||!de(e,u))return Ee(t);H-=ae.top-q.viewOffset;for(var ue=0;ue<e.display.gutterSpecs.length;++ue){var ge=q.gutters.childNodes[ue];if(ge&&ge.getBoundingClientRect().right>=y){var Me=Ge(e.doc,H),We=e.display.gutterSpecs[ue];return fe(e,u,e,Me,We.className,t),Ee(t)}}}function Ms(e,t){return Bo(e,t,"gutterClick",!0)}function Wo(e,t){if(Ln(e.display,t)||Yl(e,t))return;if(ie(e,t,"contextmenu"))return;A||e.display.input.onContextMenu(t)}function Yl(e,t){return de(e,"gutterContextMenu")?Bo(e,t,"gutterContextMenu",!1):!1}function Ho(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Gt(e)}var Ra={toString:function(){return"CodeMirror.Init"}},Ko={},ds={};function $l(e){var t=e.optionHandlers;function u(l,y,H,q){e.defaults[l]=y,H&&(t[l]=q?function(ae,ue,ge){ge!=Ra&&H(ae,ue,ge)}:H)}e.defineOption=u,e.Init=Ra,u("value","",function(l,y){return l.setValue(y)},!0),u("mode",null,function(l,y){l.doc.modeOption=y,Ts(l)},!0),u("indentUnit",2,Ts,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(l){ja(l),Gt(l),Ti(l)},!0),u("lineSeparator",null,function(l,y){if(l.doc.lineSep=y,!y)return;var H=[],q=l.doc.first;l.doc.iter(function(ue){for(var ge=0;;){var Me=ue.text.indexOf(y,ge);if(Me==-1)break;ge=Me+y.length,H.push($e(q,Me))}q++});for(var ae=H.length-1;ae>=0;ae--)Ta(l.doc,y,H[ae],$e(H[ae].line,H[ae].ch+y.length))}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,y,H){l.state.specialChars=new RegExp(y.source+(y.test(" ")?"":"| "),"g"),H!=Ra&&l.refresh()}),u("specialCharPlaceholder",Zt,function(l){return l.refresh()},!0),u("electricChars",!0),u("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),u("spellcheck",!1,function(l,y){return l.getInputField().spellcheck=y},!0),u("autocorrect",!1,function(l,y){return l.getInputField().autocorrect=y},!0),u("autocapitalize",!1,function(l,y){return l.getInputField().autocapitalize=y},!0),u("rtlMoveVisually",!S),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){Ho(l),Fa(l)},!0),u("keyMap","default",function(l,y,H){var q=us(y),ae=H!=Ra&&us(H);ae&&ae.detach&&ae.detach(l,q),q.attach&&q.attach(l,ae||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,Ql,!0),u("gutters",[],function(l,y){l.display.gutterSpecs=xs(y,l.options.lineNumbers),Fa(l)},!0),u("fixedGutter",!0,function(l,y){l.display.gutters.style.left=y?Un(l.display)+"px":"0",l.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(l){return ba(l)},!0),u("scrollbarStyle","native",function(l){Gs(l),ba(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),u("lineNumbers",!1,function(l,y){l.display.gutterSpecs=xs(l.options.gutters,y),Fa(l)},!0),u("firstLineNumber",1,Fa,!0),u("lineNumberFormatter",function(l){return l},Fa,!0),u("showCursorWhenSelecting",!1,Sn,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(l,y){y=="nocursor"&&(wr(l),l.display.input.blur()),l.display.input.readOnlyChanged(y)}),u("screenReaderLabel",null,function(l,y){y=y===""?null:y,l.display.input.screenReaderLabelChanged(y)}),u("disableInput",!1,function(l,y){y||l.display.input.reset()},!0),u("dragDrop",!0,Jl),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,Sn,!0),u("singleCursorHeightPerLine",!0,Sn,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,ja,!0),u("addModeClass",!1,ja,!0),u("pollInterval",100),u("undoDepth",200,function(l,y){return l.doc.history.undoDepth=y}),u("historyEventDelay",1250),u("viewportMargin",10,function(l){return l.refresh()},!0),u("maxHighlightLength",1e4,ja,!0),u("moveInputWithCursor",!0,function(l,y){y||l.display.input.resetPosition()}),u("tabindex",null,function(l,y){return l.display.input.getField().tabIndex=y||""}),u("autofocus",null),u("direction","ltr",function(l,y){return l.doc.setDirection(y)},!0),u("phrases",null)}function Jl(e,t,u){var l=u&&u!=Ra;if(!t!=!l){var y=e.display.dragFunctions,H=t?Ue:lt;H(e.display.scroller,"dragstart",y.start),H(e.display.scroller,"dragenter",y.enter),H(e.display.scroller,"dragover",y.over),H(e.display.scroller,"dragleave",y.leave),H(e.display.scroller,"drop",y.drop)}}function Ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(v(e.display.wrapper,"CodeMirror-wrap"),Yr(e)),Fr(e),Ti(e),Gt(e),setTimeout(function(){return ba(e)},100)}function xi(e,t){var u=this;if(!(this instanceof xi))return new xi(e,t);this.options=t=t?R(t):{},R(Ko,t,!1);var l=t.value;typeof l=="string"?l=new mr(l,t.mode,null,t.lineSeparator,t.direction):t.mode&&(l.modeOption=t.mode),this.doc=l;var y=new xi.inputStyles[t.inputStyle](this),H=this.display=new cl(e,l,y,t);H.wrapper.CodeMirror=this,Ho(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gs(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 ne,keySeq:null,specialChars:null},t.autofocus&&!a&&H.input.focus(),B&&M<11&&setTimeout(function(){return u.display.input.reset(!0)},20),Zl(this),Al(),fa(this),this.curOp.forceUpdate=!0,eo(this,l),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&jr(u)},20):wr(this);for(var q in ds)ds.hasOwnProperty(q)&&ds[q](this,t[q],Ra);Xs(this),t.finishInit&&t.finishInit(this);for(var ae=0;ae<ks.length;++ae)ks[ae](this);pa(this),n&&t.lineWrapping&&getComputedStyle(H.lineDiv).textRendering=="optimizelegibility"&&(H.lineDiv.style.textRendering="auto")}xi.defaults=Ko,xi.optionHandlers=ds;function Zl(e){var t=e.display;Ue(t.scroller,"mousedown",Gi(e,Fo)),B&&M<11?Ue(t.scroller,"dblclick",Gi(e,function(ue){if(ie(e,ue))return;var ge=ji(e,ue);if(!ge||Ms(e,ue)||Ln(e.display,ue))return;le(ue);var Me=e.findWordAt(ge);rs(e.doc,Me.anchor,Me.head)})):Ue(t.scroller,"dblclick",function(ue){return ie(e,ue)||le(ue)}),Ue(t.scroller,"contextmenu",function(ue){return Wo(e,ue)}),Ue(t.input.getField(),"contextmenu",function(ue){t.scroller.contains(ue.target)||Wo(e,ue)});var u,l={end:0};function y(){t.activeTouch&&(u=setTimeout(function(){return t.activeTouch=null},1e3),l=t.activeTouch,l.end=+new Date)}function H(ue){if(ue.touches.length!=1)return!1;var ge=ue.touches[0];return ge.radiusX<=1&&ge.radiusY<=1}function q(ue,ge){if(ge.left==null)return!0;var Me=ge.left-ue.left,We=ge.top-ue.top;return Me*Me+We*We>20*20}Ue(t.scroller,"touchstart",function(ue){if(!ie(e,ue)&&!H(ue)&&!Ms(e,ue)){t.input.ensurePolled(),clearTimeout(u);var ge=+new Date;t.activeTouch={start:ge,moved:!1,prev:ge-l.end<=300?l:null},ue.touches.length==1&&(t.activeTouch.left=ue.touches[0].pageX,t.activeTouch.top=ue.touches[0].pageY)}}),Ue(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ue(t.scroller,"touchend",function(ue){var ge=t.activeTouch;if(ge&&!Ln(t,ue)&&ge.left!=null&&!ge.moved&&new Date-ge.start<300){var Me=e.coordsChar(t.activeTouch,"page"),We;!ge.prev||q(ge,ge.prev)?We=new si(Me,Me):!ge.prev.prev||q(ge,ge.prev.prev)?We=e.findWordAt(Me):We=new si($e(Me.line,0),pt(e.doc,$e(Me.line+1,0))),e.setSelection(We.anchor,We.head),e.focus(),le(ue)}y()}),Ue(t.scroller,"touchcancel",y),Ue(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ma(e,t.scroller.scrollTop),da(e,t.scroller.scrollLeft,!0),fe(e,"scroll",e))}),Ue(t.scroller,"mousewheel",function(ue){return Js(e,ue)}),Ue(t.scroller,"DOMMouseScroll",function(ue){return Js(e,ue)}),Ue(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ue){ie(e,ue)||ye(ue)},over:function(ue){ie(e,ue)||(Rl(e,ue),ye(ue))},start:function(ue){return Ol(e,ue)},drop:Gi(e,Cl),leave:function(ue){ie(e,ue)||wo(e)}};var ae=t.input.getField();Ue(ae,"keyup",function(ue){return No.call(e,ue)}),Ue(ae,"keydown",Gi(e,ko)),Ue(ae,"keypress",Gi(e,Uo)),Ue(ae,"focus",function(ue){return jr(e,ue)}),Ue(ae,"blur",function(ue){return wr(e,ue)})}var ks=[];xi.defineInitHook=function(e){return ks.push(e)};function Za(e,t,u,l){var y=e.doc,H;u==null&&(u="add"),u=="smart"&&(y.mode.indent?H=En(e,t).state:u="prev");var q=e.options.tabSize,ae=Y(y,t),ue=V(ae.text,null,q);ae.stateAfter&&(ae.stateAfter=null);var ge=ae.text.match(/^\s*/)[0],Me;if(!l&&!/\S/.test(ae.text))Me=0,u="not";else if(u=="smart"&&(Me=y.mode.indent(H,ae.text.slice(ge.length),ae.text),Me==De||Me>150)){if(!l)return;u="prev"}u=="prev"?t>y.first?Me=V(Y(y,t-1).text,null,q):Me=0:u=="add"?Me=ue+e.options.indentUnit:u=="subtract"?Me=ue-e.options.indentUnit:typeof u=="number"&&(Me=ue+u),Me=Math.max(0,Me);var We="",qe=0;if(e.options.indentWithTabs)for(var Je=Math.floor(Me/q);Je;--Je)qe+=q,We+=" ";if(qe<Me&&(We+=Z(Me-qe)),We!=ge)return Ta(y,We,$e(t,0),$e(t,ge.length),"+input"),ae.stateAfter=null,!0;for(var yt=0;yt<y.sel.ranges.length;yt++){var It=y.sel.ranges[yt];if(It.head.line==t&&It.head.ch<ge.length){var kt=$e(t,ge.length);Rs(y,yt,new si(kt,kt));break}}}var Gr=null;function hs(e){Gr=e}function Ns(e,t,u,l,y){var H=e.doc;e.display.shift=!1,l||(l=H.sel);var q=+new Date-200,ae=y=="paste"||e.state.pasteIncoming>q,ue=Ye(t),ge=null;if(ae&&l.ranges.length>1)if(Gr&&Gr.text.join(`
|
|
`)==t){if(l.ranges.length%Gr.text.length==0){ge=[];for(var Me=0;Me<Gr.text.length;Me++)ge.push(H.splitLines(Gr.text[Me]))}}else ue.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(ge=K(ue,function(Ht){return[Ht]}));for(var We=e.curOp.updateInput,qe=l.ranges.length-1;qe>=0;qe--){var Je=l.ranges[qe],yt=Je.from(),It=Je.to();Je.empty()&&(u&&u>0?yt=$e(yt.line,yt.ch-u):e.state.overwrite&&!ae?It=$e(It.line,Math.min(Y(H,It.line).text.length,It.ch+U(ue).length)):ae&&Gr&&Gr.lineWise&&Gr.text.join(`
|
|
`)==ue.join(`
|
|
`)&&(yt=It=$e(yt.line,0)));var kt={from:yt,to:It,text:ge?ge[qe%ge.length]:ue,origin:y||(ae?"paste":e.state.cutIncoming>q?"cut":"+input")};Sa(e.doc,kt),rt(e,"inputRead",e,kt)}t&&!ae&&zo(e,t),_a(e),e.curOp.updateInput<2&&(e.curOp.updateInput=We),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Go(e,t){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Or(t,function(){return Ns(t,u,0,null,"paste")}),!0}function zo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var u=e.doc.sel,l=u.ranges.length-1;l>=0;l--){var y=u.ranges[l];if(y.head.ch>100||l&&u.ranges[l-1].head.line==y.head.line)continue;var H=e.getModeAt(y.head),q=!1;if(H.electricChars){for(var ae=0;ae<H.electricChars.length;ae++)if(t.indexOf(H.electricChars.charAt(ae))>-1){q=Za(e,y.head.line,"smart");break}}else H.electricInput&&(H.electricInput.test(Y(e.doc,y.head.line).text.slice(0,y.head.ch))&&(q=Za(e,y.head.line,"smart")));q&&rt(e,"electricInput",e,y.head.line)}}function Vo(e){for(var t=[],u=[],l=0;l<e.doc.sel.ranges.length;l++){var y=e.doc.sel.ranges[l].head.line,H={anchor:$e(y,0),head:$e(y+1,0)};u.push(H),t.push(e.getRange(H.anchor,H.head))}return{text:t,ranges:u}}function Xo(e,t,u,l){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!t)}function Yo(){var e=f("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=f("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),d&&(e.style.border="1px solid black"),Xo(e),t}function ql(e){var t=e.optionHandlers,u=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,y){var H=this.options,q=H[l];if(H[l]==y&&l!="mode")return;H[l]=y,t.hasOwnProperty(l)&&Gi(this,t[l])(this,y,q),fe(this,"optionChange",this,l)},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,y){this.state.keyMaps[y?"push":"unshift"](us(l))},removeKeyMap:function(l){for(var y=this.state.keyMaps,H=0;H<y.length;++H)if(y[H]==l||y[H].name==l)return y.splice(H,1),!0},addOverlay:lr(function(l,y){var H=l.token?l:e.getMode(this.options,l);if(H.startState)throw new Error("Overlays may not be stateful.");ee(this.state.overlays,{mode:H,modeSpec:l,opaque:y&&y.opaque,priority:y&&y.priority||0},function(q){return q.priority}),this.state.modeGen++,Ti(this)}),removeOverlay:lr(function(l){for(var y=this.state.overlays,H=0;H<y.length;++H){var q=y[H].modeSpec;if(q==l||typeof l=="string"&&q.name==l){y.splice(H,1),this.state.modeGen++,Ti(this);return}}}),indentLine:lr(function(l,y,H){typeof y!="string"&&typeof y!="number"&&(y==null?y=this.options.smartIndent?"smart":"prev":y=y?"add":"subtract"),_t(this.doc,l)&&Za(this,l,y,H)}),indentSelection:lr(function(l){for(var y=this.doc.sel.ranges,H=-1,q=0;q<y.length;q++){var ae=y[q];if(ae.empty())ae.head.line>H&&(Za(this,ae.head.line,l,!0),H=ae.head.line,q==this.doc.sel.primIndex&&_a(this));else{var ue=ae.from(),ge=ae.to(),Me=Math.max(H,ue.line);H=Math.min(this.lastLine(),ge.line-(ge.ch?0:1))+1;for(var We=Me;We<H;++We)Za(this,We,l);var qe=this.doc.sel.ranges;ue.ch==0&&y.length==qe.length&&qe[q].from().ch>0&&Rs(this.doc,q,new si(ue,qe[q].to()),Ae)}}}),getTokenAt:function(l,y){return Di(this,l,y)},getLineTokens:function(l,y){return Di(this,$e(l),y,!0)},getTokenTypeAt:function(l){l=pt(this.doc,l);var y=ni(this,Y(this.doc,l.line)),H=0,q=(y.length-1)/2,ae=l.ch,ue;if(ae==0)ue=y[2];else for(;;){var ge=H+q>>1;if((ge?y[ge*2-1]:0)>=ae)q=ge;else if(y[ge*2+1]<ae)H=ge+1;else{ue=y[ge*2+2];break}}var Me=ue?ue.indexOf("overlay "):-1;return Me<0?ue:Me==0?null:ue.slice(0,Me-1)},getModeAt:function(l){var y=this.doc.mode;return y.innerMode?e.innerMode(y,this.getTokenAt(l).state).mode:y},getHelper:function(l,y){return this.getHelpers(l,y)[0]},getHelpers:function(l,y){var H=[];if(!u.hasOwnProperty(y))return H;var q=u[y],ae=this.getModeAt(l);if(typeof ae[y]=="string")q[ae[y]]&&H.push(q[ae[y]]);else if(ae[y])for(var ue=0;ue<ae[y].length;ue++){var ge=q[ae[y][ue]];ge&&H.push(ge)}else ae.helperType&&q[ae.helperType]?H.push(q[ae.helperType]):q[ae.name]&&H.push(q[ae.name]);for(var Me=0;Me<q._global.length;Me++){var We=q._global[Me];We.pred(ae,this)&&se(H,We.val)==-1&&H.push(We.val)}return H},getStateAfter:function(l,y){var H=this.doc;return l=Ut(H,l==null?H.first+H.size-1:l),En(this,l+1,y).state},cursorCoords:function(l,y){var H,q=this.doc.sel.primary();return l==null?H=q.head:typeof l=="object"?H=pt(this.doc,l):H=l?q.from():q.to(),qn(this,H,y||"page")},charCoords:function(l,y){return Er(this,pt(this.doc,l),y||"page")},coordsChar:function(l,y){return l=Mi(this,l,y||"page"),Wr(this,l.left,l.top)},lineAtHeight:function(l,y){return l=Mi(this,{top:l,left:0},y||"page").top,Ge(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,y,H){var q=!1,ae;if(typeof l=="number"){var ue=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>ue&&(l=ue,q=!0),ae=Y(this.doc,l)}else ae=l;return Ki(this,ae,{top:0,left:0},y||"page",H||q).top+(q?this.doc.height-hr(ae):0)},defaultTextHeight:function(){return Nn(this.display)},defaultCharWidth:function(){return jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,y,H,q,ae){var ue=this.display;l=qn(this,pt(this.doc,l));var ge=l.bottom,Me=l.left;if(y.style.position="absolute",y.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(y),ue.sizer.appendChild(y),q=="over")ge=l.top;else if(q=="above"||q=="near"){var We=Math.max(ue.wrapper.clientHeight,this.doc.height),qe=Math.max(ue.sizer.clientWidth,ue.lineSpace.clientWidth);(q=="above"||l.bottom+y.offsetHeight>We)&&l.top>y.offsetHeight?ge=l.top-y.offsetHeight:l.bottom+y.offsetHeight<=We&&(ge=l.bottom),Me+y.offsetWidth>qe&&(Me=qe-y.offsetWidth)}y.style.top=ge+"px",y.style.left=y.style.right="",ae=="right"?(Me=ue.sizer.clientWidth-y.offsetWidth,y.style.right="0px"):(ae=="left"?Me=0:ae=="middle"&&(Me=(ue.sizer.clientWidth-y.offsetWidth)/2),y.style.left=Me+"px"),H&&Bi(this,{left:Me,top:ge,right:Me+y.offsetWidth,bottom:ge+y.offsetHeight})},triggerOnKeyDown:lr(ko),triggerOnKeyPress:lr(Uo),triggerOnKeyUp:No,triggerOnMouseDown:lr(Fo),execCommand:function(l){if(Ya.hasOwnProperty(l))return Ya[l].call(null,this)},triggerElectric:lr(function(l){zo(this,l)}),findPosH:function(l,y,H,q){var ae=1;y<0&&(ae=-1,y=-y);for(var ue=pt(this.doc,l),ge=0;ge<y&&!(ue=Us(this.doc,ue,ae,H,q),ue.hitSide);++ge);return ue},moveH:lr(function(l,y){var H=this;this.extendSelectionsBy(function(q){return H.display.shift||H.doc.extend||q.empty()?Us(H.doc,q.head,l,y,H.options.rtlMoveVisually):l<0?q.from():q.to()},je)}),deleteH:lr(function(l,y){var H=this.doc.sel,q=this.doc;H.somethingSelected()?q.replaceSelection("",null,"+delete"):Oa(this,function(ae){var ue=Us(q,ae.head,l,y,!1);return l<0?{from:ue,to:ae.head}:{from:ae.head,to:ue}})}),findPosV:function(l,y,H,q){var ae=1,ue=q;y<0&&(ae=-1,y=-y);for(var ge=pt(this.doc,l),Me=0;Me<y;++Me){var We=qn(this,ge,"div");if(ue==null?ue=We.left:We.left=ue,ge=$o(this,We,ae,H),ge.hitSide)break}return ge},moveV:lr(function(l,y){var H=this,q=this.doc,ae=[],ue=!this.display.shift&&!q.extend&&q.sel.somethingSelected();if(q.extendSelectionsBy(function(Me){if(ue)return l<0?Me.from():Me.to();var We=qn(H,Me.head,"div");Me.goalColumn!=null&&(We.left=Me.goalColumn),ae.push(We.left);var qe=$o(H,We,l,y);return y=="page"&&Me==q.sel.primary()&&vs(H,Er(H,qe,"div").top-We.top),qe},je),ae.length)for(var ge=0;ge<q.sel.ranges.length;ge++)q.sel.ranges[ge].goalColumn=ae[ge]}),findWordAt:function(l){var y=this.doc,H=Y(y,l.line).text,q=l.ch,ae=l.ch;if(H){var ue=this.getHelper(l,"wordChars");(l.sticky=="before"||ae==H.length)&&q?--q:++ae;for(var ge=H.charAt(q),Me=nt(ge,ue)?function(We){return nt(We,ue)}:/\s/.test(ge)?function(We){return/\s/.test(We)}:function(We){return!/\s/.test(We)&&!nt(We)};q>0&&Me(H.charAt(q-1));)--q;for(;ae<H.length&&Me(H.charAt(ae));)++ae}return new si($e(l.line,q),$e(l.line,ae))},toggleOverwrite:function(l){if(l!=null&&l==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):v(this.display.cursorDiv,"CodeMirror-overwrite"),fe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==k()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:lr(function(l,y){Pa(this,l,y)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-Rn(this)-this.display.barHeight,width:l.scrollWidth-Rn(this)-this.display.barWidth,clientHeight:kn(this),clientWidth:zn(this)}},scrollIntoView:lr(function(l,y){l==null?(l={from:this.doc.sel.primary().head,to:null},y==null&&(y=this.options.cursorScrollMargin)):typeof l=="number"?l={from:$e(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=y||0,l.from.line!=null?Qo(this,l):Bs(this,l.from,l.to,l.margin)}),setSize:lr(function(l,y){var H=this,q=function(ue){return typeof ue=="number"||/^\d+$/.test(String(ue))?ue+"px":ue};l!=null&&(this.display.wrapper.style.width=q(l)),y!=null&&(this.display.wrapper.style.height=q(y)),this.options.lineWrapping&&Mt(this);var ae=this.display.viewFrom;this.doc.iter(ae,this.display.viewTo,function(ue){if(ue.widgets){for(var ge=0;ge<ue.widgets.length;ge++)if(ue.widgets[ge].noHScroll){$i(H,ae,"widget");break}}++ae}),this.curOp.forceUpdate=!0,fe(this,"refresh",this)}),operation:function(l){return Or(this,l)},startOperation:function(){return fa(this)},endOperation:function(){return pa(this)},refresh:lr(function(){var l=this.display.cachedTextHeight;Ti(this),this.curOp.forceUpdate=!0,Gt(this),Pa(this,this.doc.scrollLeft,this.doc.scrollTop),bs(this.display),(l==null||Math.abs(l-Nn(this.display))>.5||this.options.lineWrapping)&&Fr(this),fe(this,"refresh",this)}),swapDoc:lr(function(l){var y=this.doc;return y.cm=null,this.state.selectingText&&this.state.selectingText(),eo(this,l),Gt(this),this.display.input.reset(),Pa(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,rt(this,"swapDoc",this,y),y}),phrase:function(l){var y=this.options.phrases;return y&&Object.prototype.hasOwnProperty.call(y,l)?y[l]:l},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},me(e),e.registerHelper=function(l,y,H){u.hasOwnProperty(l)||(u[l]=e[l]={_global:[]}),u[l][y]=H},e.registerGlobalHelper=function(l,y,H,q){e.registerHelper(l,y,q),u[l]._global.push({pred:H,val:q})}}function Us(e,t,u,l,y){var H=t,q=u,ae=Y(e,t.line),ue=y&&e.direction=="rtl"?-u:u;function ge(){var Xt=t.line+ue;return Xt<e.first||Xt>=e.first+e.size?!1:(t=new $e(Xt,t.ch,t.sticky),ae=Y(e,Xt))}function Me(Xt){var Kt;if(l=="codepoint"){var qt=ae.text.charCodeAt(t.ch+(l>0?0:-1));isNaN(qt)?Kt=null:Kt=new $e(t.line,Math.max(0,Math.min(ae.text.length,t.ch+u*(qt>=55296&&qt<56320?2:1))),-u)}else y?Kt=Ml(e.cm,ae,t,u):Kt=Ls(ae,t,u);if(Kt==null)if(!Xt&&ge())t=Is(y,e.cm,ae,t.line,ue);else return!1;else t=Kt;return!0}if(l=="char"||l=="codepoint")Me();else if(l=="column")Me(!0);else if(l=="word"||l=="group")for(var We=null,qe=l=="group",Je=e.cm&&e.cm.getHelper(t,"wordChars"),yt=!0;!(u<0&&!Me(!yt));yt=!1){var It=ae.text.charAt(t.ch)||`
|
|
`,kt=nt(It,Je)?"w":qe&&It==`
|
|
`?"n":!qe||/\s/.test(It)?null:"p";if(qe&&!yt&&!kt&&(kt="s"),We&&We!=kt){u<0&&(u=1,Me(),t.sticky="after");break}if(kt&&(We=kt),u>0&&!Me(!yt))break}var Ht=ss(e,t,H,q,!0);return Jt(H,Ht)&&(Ht.hitSide=!0),Ht}function $o(e,t,u,l){var y=e.doc,H=t.left,q;if(l=="page"){var ae=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ue=Math.max(ae-.5*Nn(e.display),3);q=(u>0?t.bottom:t.top)+u*ue}else l=="line"&&(q=u>0?t.bottom+3:t.top-3);for(var ge;!(ge=Wr(e,H,q),!ge.outside);){if(u<0?q<=0:q>=y.height){ge.hitSide=!0;break}q+=u*5}return ge}var fi=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ne,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};fi.prototype.init=function(e){var t=this,u=this,l=u.cm,y=u.div=e.lineDiv;Xo(y,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function H(ae){for(var ue=ae.target;ue;ue=ue.parentNode){if(ue==y)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ue.className))break}return!1}Ue(y,"paste",function(ae){if(!H(ae)||ie(l,ae)||Go(ae,l))return;M<=11&&setTimeout(Gi(l,function(){return t.updateFromDOM()}),20)}),Ue(y,"compositionstart",function(ae){t.composing={data:ae.data,done:!1}}),Ue(y,"compositionupdate",function(ae){t.composing||(t.composing={data:ae.data,done:!1})}),Ue(y,"compositionend",function(ae){t.composing&&(ae.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ue(y,"touchstart",function(){return u.forceCompositionEnd()}),Ue(y,"input",function(){t.composing||t.readFromDOMSoon()});function q(ae){if(!H(ae)||ie(l,ae))return;if(l.somethingSelected())hs({lineWise:!1,text:l.getSelections()}),ae.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var ue=Vo(l);hs({lineWise:!0,text:ue.text}),ae.type=="cut"&&l.operation(function(){l.setSelections(ue.ranges,0,Ae),l.replaceSelection("",null,"cut")})}else return;if(ae.clipboardData){ae.clipboardData.clearData();var ge=Gr.text.join(`
|
|
`);if(ae.clipboardData.setData("Text",ge),ae.clipboardData.getData("Text")==ge){ae.preventDefault();return}}var Me=Yo(),We=Me.firstChild;l.display.lineSpace.insertBefore(Me,l.display.lineSpace.firstChild),We.value=Gr.text.join(`
|
|
`);var qe=document.activeElement;G(We),setTimeout(function(){l.display.lineSpace.removeChild(Me),qe.focus(),qe==y&&u.showPrimarySelection()},50)}Ue(y,"copy",q),Ue(y,"cut",q)},fi.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},fi.prototype.prepareSelection=function(){var e=hi(this.cm,!1);return e.focus=document.activeElement==this.div,e},fi.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},fi.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},fi.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,u=t.doc.sel.primary(),l=u.from(),y=u.to();if(t.display.viewTo==t.display.viewFrom||l.line>=t.display.viewTo||y.line<t.display.viewFrom){e.removeAllRanges();return}var H=fs(t,e.anchorNode,e.anchorOffset),q=fs(t,e.focusNode,e.focusOffset);if(H&&!H.bad&&q&&!q.bad&&At(Yt(H,q),l)==0&&At(sn(H,q),y)==0)return;var ae=t.display.view,ue=l.line>=t.display.viewFrom&&Jo(t,l)||{node:ae[0].measure.map[2],offset:0},ge=y.line<t.display.viewTo&&Jo(t,y);if(!ge){var Me=ae[ae.length-1].measure,We=Me.maps?Me.maps[Me.maps.length-1]:Me.map;ge={node:We[We.length-1],offset:We[We.length-2]-We[We.length-3]}}if(!ue||!ge){e.removeAllRanges();return}var qe=e.rangeCount&&e.getRangeAt(0),Je;try{Je=E(ue.node,ue.offset,ge.offset,ge.node)}catch(yt){}Je&&(!P&&t.state.focused?(e.collapse(ue.node,ue.offset),Je.collapsed||(e.removeAllRanges(),e.addRange(Je))):(e.removeAllRanges(),e.addRange(Je)),qe&&e.anchorNode==null?e.addRange(qe):P&&this.startGracePeriod()),this.rememberSelection()},fi.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)},fi.prototype.showMultipleSelections=function(e){m(this.cm.display.cursorDiv,e.cursors),m(this.cm.display.selectionDiv,e.selection)},fi.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},fi.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},fi.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},fi.prototype.blur=function(){this.div.blur()},fi.prototype.getField=function(){return this.div},fi.prototype.supportsTouch=function(){return!0},fi.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Or(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)},fi.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},fi.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(r&&g&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var u=fs(t,e.anchorNode,e.anchorOffset),l=fs(t,e.focusNode,e.focusOffset);u&&l&&Or(t,function(){nr(t.doc,ra(u,l),Ae),(u.bad||l.bad)&&(t.curOp.selectionChanged=!0)})},fi.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,u=e.doc.sel.primary(),l=u.from(),y=u.to();if(l.ch==0&&l.line>e.firstLine()&&(l=$e(l.line-1,Y(e.doc,l.line-1).length)),y.ch==Y(e.doc,y.line).text.length&&y.line<e.lastLine()&&(y=$e(y.line+1,0)),l.line<t.viewFrom||y.line>t.viewTo-1)return!1;var H,q,ae;l.line==t.viewFrom||(H=Tr(e,l.line))==0?(q=Pe(t.view[0].line),ae=t.view[0].node):(q=Pe(t.view[H].line),ae=t.view[H-1].node.nextSibling);var ue=Tr(e,y.line),ge,Me;if(ue==t.view.length-1?(ge=t.viewTo-1,Me=t.lineDiv.lastChild):(ge=Pe(t.view[ue+1].line)-1,Me=t.view[ue+1].node.previousSibling),!ae)return!1;for(var We=e.doc.splitLines(tu(e,ae,Me,q,ge)),qe=$(e.doc,$e(q,0),$e(ge,Y(e.doc,ge).text.length));We.length>1&&qe.length>1;)if(U(We)==U(qe))We.pop(),qe.pop(),ge--;else if(We[0]==qe[0])We.shift(),qe.shift(),q++;else break;for(var Je=0,yt=0,It=We[0],kt=qe[0],Ht=Math.min(It.length,kt.length);Je<Ht&&It.charCodeAt(Je)==kt.charCodeAt(Je);)++Je;for(var Xt=U(We),Kt=U(qe),qt=Math.min(Xt.length-(We.length==1?Je:0),Kt.length-(qe.length==1?Je:0));yt<qt&&Xt.charCodeAt(Xt.length-yt-1)==Kt.charCodeAt(Kt.length-yt-1);)++yt;if(We.length==1&&qe.length==1&&q==l.line)for(;Je&&Je>l.ch&&Xt.charCodeAt(Xt.length-yt-1)==Kt.charCodeAt(Kt.length-yt-1);)Je--,yt++;We[We.length-1]=Xt.slice(0,Xt.length-yt).replace(/^\u200b+/,""),We[0]=We[0].slice(Je).replace(/\u200b+$/,"");var bn=$e(q,Je),dn=$e(ge,qe.length?U(qe).length-yt:0);if(We.length>1||We[0]||At(bn,dn))return Ta(e.doc,We,bn,dn,"+input"),!0},fi.prototype.ensurePolled=function(){this.forceCompositionEnd()},fi.prototype.reset=function(){this.forceCompositionEnd()},fi.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},fi.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)},fi.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Or(this.cm,function(){return Ti(e.cm)})},fi.prototype.setUneditable=function(e){e.contentEditable="false"},fi.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Gi(this.cm,Ns)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},fi.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},fi.prototype.onContextMenu=function(){},fi.prototype.resetPosition=function(){},fi.prototype.needsContentAttribute=!0;function Jo(e,t){var u=ei(e,t.line);if(!u||u.hidden)return null;var l=Y(e.doc,t.line),y=gn(u,l,t.line),H=wt(l,e.doc.direction),q="left";if(H){var ae=ut(H,t.ch);q=ae%2?"right":"left"}var ue=_n(y.map,t.ch,q);return ue.offset=ue.collapse=="right"?ue.end:ue.start,ue}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Aa(e,t){return t&&(e.bad=!0),e}function tu(e,t,u,l,y){var H="",q=!1,ae=e.doc.lineSeparator(),ue=!1;function ge(Je){return function(yt){return yt.id==Je}}function Me(){q&&(H+=ae,ue&&(H+=ae),q=ue=!1)}function We(Je){Je&&(Me(),H+=Je)}function qe(Je){if(Je.nodeType==1){var yt=Je.getAttribute("cm-text");if(yt){We(yt);return}var It=Je.getAttribute("cm-marker"),kt;if(It){var Ht=e.findMarks($e(l,0),$e(y+1,0),ge(+It));Ht.length&&(kt=Ht[0].find(0))&&We($(e.doc,kt.from,kt.to).join(ae));return}if(Je.getAttribute("contenteditable")=="false")return;var Xt=/^(pre|div|p|li|table|br)$/i.test(Je.nodeName);if(!/^br$/i.test(Je.nodeName)&&Je.textContent.length==0)return;Xt&&Me();for(var Kt=0;Kt<Je.childNodes.length;Kt++)qe(Je.childNodes[Kt]);/^(pre|p)$/i.test(Je.nodeName)&&(ue=!0),Xt&&(q=!0)}else Je.nodeType==3&&We(Je.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(qe(t),t==u);)t=t.nextSibling,ue=!1;return H}function fs(e,t,u){var l;if(t==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[u],!l)return Aa(e.clipPos($e(e.display.viewTo-1)),!0);t=null,u=0}else for(l=t;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var y=0;y<e.display.view.length;y++){var H=e.display.view[y];if(H.node==l)return nu(H,t,u)}}function nu(e,t,u){var l=e.text.firstChild,y=!1;if(!t||!_(l,t))return Aa($e(Pe(e.line),0),!0);if(t==l&&(y=!0,t=l.childNodes[u],u=0,!t)){var H=e.rest?U(e.rest):e.line;return Aa($e(Pe(H),H.text.length),y)}var q=t.nodeType==3?t:null,ae=t;for(!q&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(q=t.firstChild,u&&(u=q.nodeValue.length));ae.parentNode!=l;)ae=ae.parentNode;var ue=e.measure,ge=ue.maps;function Me(kt,Ht,Xt){for(var Kt=-1;Kt<(ge?ge.length:0);Kt++)for(var qt=Kt<0?ue.map:ge[Kt],bn=0;bn<qt.length;bn+=3){var dn=qt[bn+2];if(dn==kt||dn==Ht){var Wn=Pe(Kt<0?e.line:e.rest[Kt]),mi=qt[bn]+Xt;return(Xt<0||dn!=kt)&&(mi=qt[bn+(Xt?1:0)]),$e(Wn,mi)}}}var We=Me(q,ae,u);if(We)return Aa(We,y);for(var qe=ae.nextSibling,Je=q?q.nodeValue.length-u:0;qe;qe=qe.nextSibling){if(We=Me(qe,qe.firstChild,0),We)return Aa($e(We.line,We.ch-Je),y);Je+=qe.textContent.length}for(var yt=ae.previousSibling,It=u;yt;yt=yt.previousSibling){if(We=Me(yt,yt.firstChild,-1),We)return Aa($e(We.line,We.ch+It),y);It+=yt.textContent.length}}var Ii=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ne,this.hasSelection=!1,this.composing=null};Ii.prototype.init=function(e){var t=this,u=this,l=this.cm;this.createField(e);var y=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),d&&(y.style.width="0px"),Ue(y,"input",function(){B&&M>=9&&t.hasSelection&&(t.hasSelection=null),u.poll()}),Ue(y,"paste",function(q){if(ie(l,q)||Go(q,l))return;l.state.pasteIncoming=+new Date,u.fastPoll()});function H(q){if(ie(l,q))return;if(l.somethingSelected())hs({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var ae=Vo(l);hs({lineWise:!0,text:ae.text}),q.type=="cut"?l.setSelections(ae.ranges,null,Ae):(u.prevInput="",y.value=ae.text.join(`
|
|
`),G(y))}else return;q.type=="cut"&&(l.state.cutIncoming=+new Date)}Ue(y,"cut",H),Ue(y,"copy",H),Ue(e.scroller,"paste",function(q){if(Ln(e,q)||ie(l,q))return;if(!y.dispatchEvent){l.state.pasteIncoming=+new Date,u.focus();return}var ae=new Event("paste");ae.clipboardData=q.clipboardData,y.dispatchEvent(ae)}),Ue(e.lineSpace,"selectstart",function(q){Ln(e,q)||le(q)}),Ue(y,"compositionstart",function(){var q=l.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:q,range:l.markText(q,l.getCursor("to"),{className:"CodeMirror-composing"})}}),Ue(y,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Ii.prototype.createField=function(e){this.wrapper=Yo(),this.textarea=this.wrapper.firstChild},Ii.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ii.prototype.prepareSelection=function(){var e=this.cm,t=e.display,u=e.doc,l=hi(e);if(e.options.moveInputWithCursor){var y=qn(e,u.sel.primary().head,"div"),H=t.wrapper.getBoundingClientRect(),q=t.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,y.top+q.top-H.top)),l.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,y.left+q.left-H.left))}return l},Ii.prototype.showSelection=function(e){var t=this.cm,u=t.display;m(u.cursorDiv,e.cursors),m(u.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ii.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var u=t.getSelection();this.textarea.value=u,t.state.focused&&G(this.textarea),B&&M>=9&&(this.hasSelection=u)}else e||(this.prevInput=this.textarea.value="",B&&M>=9&&(this.hasSelection=null))},Ii.prototype.getField=function(){return this.textarea},Ii.prototype.supportsTouch=function(){return!1},Ii.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||k()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ii.prototype.blur=function(){this.textarea.blur()},Ii.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ii.prototype.receivedFocus=function(){this.slowPoll()},Ii.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()})},Ii.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function u(){var l=t.poll();!l&&!e?(e=!0,t.polling.set(60,u)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,u)},Ii.prototype.poll=function(){var e=this,t=this.cm,u=this.textarea,l=this.prevInput;if(this.contextMenuPending||!t.state.focused||at(u)&&!l&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var y=u.value;if(y==l&&!t.somethingSelected())return!1;if(B&&M>=9&&this.hasSelection===y||i&&/[\uf700-\uf7ff]/.test(y))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var H=y.charCodeAt(0);if(H==8203&&!l&&(l="\u200B"),H==8666)return this.reset(),this.cm.execCommand("undo")}for(var q=0,ae=Math.min(l.length,y.length);q<ae&&l.charCodeAt(q)==y.charCodeAt(q);)++q;return Or(t,function(){Ns(t,y.slice(q),l.length-q,null,e.composing?"*compose":null),y.length>1e3||y.indexOf(`
|
|
`)>-1?u.value=e.prevInput="":e.prevInput=y,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ii.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ii.prototype.onKeyPress=function(){B&&M>=9&&(this.hasSelection=null),this.fastPoll()},Ii.prototype.onContextMenu=function(e){var t=this,u=t.cm,l=u.display,y=t.textarea;t.contextMenuPending&&t.contextMenuPending();var H=ji(u,e),q=l.scroller.scrollTop;if(!H||p)return;var ae=u.options.resetSelectionOnContextMenu;ae&&u.doc.sel.contains(H)==-1&&Gi(u,nr)(u.doc,ra(H),Ae);var ue=y.style.cssText,ge=t.wrapper.style.cssText,Me=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",y.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-Me.top-5)+"px; left: "+(e.clientX-Me.left-5)+`px;
|
|
z-index: 1000; background: `+(B?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var We;n&&(We=window.scrollY),l.input.focus(),n&&window.scrollTo(null,We),l.input.reset(),u.somethingSelected()||(y.value=t.prevInput=" "),t.contextMenuPending=Je,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function qe(){if(y.selectionStart!=null){var It=u.somethingSelected(),kt="\u200B"+(It?y.value:"");y.value="\u21DA",y.value=kt,t.prevInput=It?"":"\u200B",y.selectionStart=1,y.selectionEnd=kt.length,l.selForContextMenu=u.doc.sel}}function Je(){if(t.contextMenuPending!=Je)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ge,y.style.cssText=ue,B&&M<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=q),y.selectionStart!=null){(!B||B&&M<9)&&qe();var It=0,kt=function(){l.selForContextMenu==u.doc.sel&&y.selectionStart==0&&y.selectionEnd>0&&t.prevInput=="\u200B"?Gi(u,po)(u):It++<10?l.detectingSelectAll=setTimeout(kt,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(kt,200)}}if(B&&M>=9&&qe(),A){ye(e);var yt=function(){lt(window,"mouseup",yt),setTimeout(Je,20)};Ue(window,"mouseup",yt)}else setTimeout(Je,50)},Ii.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ii.prototype.setUneditable=function(){},Ii.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?R(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var u=k();t.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=ae.getValue()}var y;if(e.form&&(Ue(e.form,"submit",l),!t.leaveSubmitMethodAlone)){var H=e.form;y=H.submit;try{var q=H.submit=function(){l(),H.submit=y,H.submit(),H.submit=q}}catch(ue){}}t.finishInit=function(ue){ue.save=l,ue.getTextArea=function(){return e},ue.toTextArea=function(){ue.toTextArea=isNaN,l(),e.parentNode.removeChild(ue.getWrapperElement()),e.style.display="",e.form&&(lt(e.form,"submit",l),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=y))}},e.style.display="none";var ae=xi(function(ue){return e.parentNode.insertBefore(ue,e.nextSibling)},t);return ae}function ru(e){e.off=lt,e.on=Ue,e.wheelEventPixels=dl,e.Doc=mr,e.splitLines=Ye,e.countColumn=V,e.findColumn=Be,e.isWordChar=ze,e.Pass=De,e.signal=fe,e.Line=or,e.changeEnd=aa,e.scrollbarModel=Ks,e.Pos=$e,e.cmpPos=At,e.modes=ot,e.mimeModes=Xe,e.resolveMode=et,e.getMode=dt,e.modeExtensions=vt,e.extendMode=Tt,e.copyState=Pt,e.startState=ce,e.innerMode=_e,e.commands=Ya,e.keyMap=Zr,e.keyName=Lo,e.isModifierKey=Ro,e.lookupKey=Ca,e.normalizeKeyMap=Pl,e.StringStream=W,e.SharedTextMarker=za,e.TextMarker=oa,e.LineWidget=Ga,e.e_preventDefault=le,e.e_stopPropagation=he,e.e_stop=ye,e.addClass=F,e.contains=_,e.rmClass=v,e.keyNames=la}$l(xi),ql(xi);var au="iter insert remove copy getEditor constructor".split(" ");for(var ps in mr.prototype)mr.prototype.hasOwnProperty(ps)&&se(au,ps)<0&&(xi.prototype[ps]=function(e){return function(){return e.apply(this.doc,arguments)}}(mr.prototype[ps]));return me(mr),xi.inputStyles={textarea:Ii,contenteditable:fi},xi.defineMode=function(e){!xi.defaults.mode&&e!="null"&&(xi.defaults.mode=e),Rt.apply(this,arguments)},xi.defineMIME=Lt,xi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),xi.defineMIME("text/plain","null"),xi.defineExtension=function(e,t){xi.prototype[e]=t},xi.defineDocExtension=function(e,t){mr.prototype[e]=t},xi.fromTextArea=iu,ru(xi),xi.version="5.58.2",xi})},W7jJ:function(He,pe,I){"use strict";I.r(pe);var J=I("0Owb"),z=I("PpiC"),P=I("OaEy"),X=I("2fM7"),N=I("T2oS"),C=I("W9HT"),B=I("miYZ"),M=I("tsqr"),n=I("2qtc"),D=I("kLXV"),g=I("9og8"),p=I("tJVT"),h=I("k1fw"),c=I("aHsQ"),o=I("sGsY"),d=I("WmNS"),r=I.n(d),a=I("q1tI"),i=I.n(a),s=I("Fvcw"),S=I("GIiI"),x=I("Ty5D"),T=I("9kvl"),A=I("55Ip"),w=I("7qur"),v=I("cDPC"),b=I("m3rI"),m=I("RCxd"),f=I("EHPI"),O=I("J66h"),E=I("uMZB"),_=I.n(E),k=I("sNtx"),F=I("RpDr"),L=I("+L6B"),G=I("2/Rp"),j=I("y8nQ"),R=I("Vl3Y"),V=I("5NDa"),ne=I("5rEg"),se=ne.a.TextArea,Se=5e3,De=function(Ze){var ht=Ze.callback,Nt=Ze.onCancel,nn=Ze.notes;function Vt(Bt){ht(Bt)}return i.a.createElement(R.a,{className:"note-form-panel",onFinish:Vt,initialValues:{notes:nn}},i.a.createElement(R.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:Se,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(Se)}]},i.a.createElement(se,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),i.a.createElement(R.a.Item,{style:{textAlign:"right"}},i.a.createElement(G.a,{type:"ghost",onClick:Nt,style:{marginRight:10}}," ","\u53D6\u6D88"," "),i.a.createElement(G.a,{type:"primary",htmlType:"submit"}," ","\u63D0\u4EA4"," ")))},Ae=I("ZsLC"),ke=I.n(Ae),je=I("DjyN"),Be=I("NUBc"),we=I("g9YV"),Z=I("wCAj"),U=I("Hw79"),K=I.n(U),ee=I("ye1Q"),oe=I("lfch"),Q=I("bdLU"),Ce=I("1vsH"),ze=I("wd/R"),nt=I.n(ze),xe=Z.a.Column,Re=function(Ze){var ht=Ze.submitResult,Nt=Ze.submitting,nn=Ze.submitRecords,Vt=Ze.page,Bt=Ze.onPageChange,rt=Ze.topicId,mt=ht||{},en=mt.status,ct=mt.id,tn=mt.input,Dt=mt.output,on=mt.expected_output,Mn=mt.is_file,On=mt.input_file_url,mn=mt.output_file_url,Xn=mt.expected_output_file_url,xn=mt.error_msg,Kn=nn||{},Gn=Kn.records,di=Kn.records_count,Ln=Object(x.i)();function oi(){Mn?navigator.clipboard.writeText(O.Base64.decode(xn)).then(function(){M.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(O.Base64.decode(Dt)).then(function(){M.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return i.a.createElement(C.a,{spinning:Nt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:i.a.createElement(ee.a,{style:{fontSize:24},spin:!0})},ct?i.a.createElement(i.a.Fragment,null,i.a.createElement("ul",{className:K.a.info},i.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",i.a.createElement("span",{className:en===Q.a.OK?"c-green":"c-red"},F.a[en])),i.a.createElement("li",{className:K.a.error},i.a.createElement("a",{onClick:oi},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",i.a.createElement(oe.a,null)," ")),i.a.createElement("li",null,i.a.createElement(A.a,{to:"/problems/".concat(rt,"/record-detail/").concat(ct,"?backId=").concat(Ln==null?void 0:Ln.save_identifier)},"\u663E\u793A\u8BE6\u60C5 >"," "))),en!==Q.a.OK?i.a.createElement(i.a.Fragment,null,i.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),i.a.createElement("pre",null,!Mn&&tn,Mn&&i.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(Ce.y)(On,tn)}},tn)),i.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),i.a.createElement("pre",null,(en===4||en===5)&&O.Base64.decode(xn),en!=4&&en!=5&&(Mn?i.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(Ce.y)(mn,Dt)}},Dt):O.Base64.decode(Dt))),i.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),i.a.createElement("pre",null,!Mn&&O.Base64.decode(on),Mn&&i.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(Ce.y)(Xn,on)}},on))):null):null,(Gn==null?void 0:Gn.length)>0?i.a.createElement(Z.a,{dataSource:Gn,rowKey:"id",pagination:!1},i.a.createElement(xe,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function($n,Rn){return i.a.createElement("span",null," ",nt()($n).format("YYYY-MM-DD HH:mm:ss"))}}),i.a.createElement(xe,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function($n,Rn){var zn;return i.a.createElement(A.a,{className:$n===0?"c-green":"c-red",to:"/problems/".concat(rt,"/record-detail/").concat(Rn.id,"?backId=").concat(Ln==null?void 0:Ln.save_identifier)},(zn=F.a[$n])===null||zn===void 0?void 0:zn.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),i.a.createElement(xe,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),i.a.createElement(xe,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),i.a.createElement(xe,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,di>15?i.a.createElement(Be.a,{className:K.a.pagination,current:Vt,pageSize:15,total:di,onChange:Bt}):null)},Te=I("BdwD"),Oe=I("DYRE"),Ke=I("zeV3"),Qe=I("+BJd"),st=I("mr32"),ut=I("TcMa"),xt=I.n(ut),wt=I("9Bee"),Fe={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},Ue=function(Ze){var ht=Ze.hack,Nt=Ze.onTriggerPraise,nn=Ze.toDiscuss,Vt=ht.language,Bt=ht.difficulty,rt=ht.time_limit,mt=ht.username,en=ht.user_path,ct=ht.user_praise,tn=ht.comments_count,Dt=ht.praises_count,on=ht.description,Mn=ht.pass_count,On=ht.submit_count,mn=Object(x.h)();console.log(ht.language,"language");var Xn=Fe[Bt];return i.a.createElement(i.a.Fragment,null,i.a.createElement("ul",{className:xt.a.info},i.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",i.a.createElement(st.a,{color:Xn.color},Xn.name)),i.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",i.a.createElement("b",null,rt,"\u79D2"))),i.a.createElement(wt.a,{value:on,className:xt.a.desc}),i.a.createElement("ul",{className:xt.a["commit-info"]},i.a.createElement("li",null,i.a.createElement(Ke.a,{size:4},i.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",i.a.createElement("b",null,Mn))),i.a.createElement("li",null,i.a.createElement(Ke.a,{size:4},i.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",i.a.createElement("b",null,On))," "),i.a.createElement("li",{style:{flex:"1 0 0"}}),i.a.createElement("li",null,i.a.createElement(Ke.a,{size:4},i.a.createElement("i",{className:"iconfont icon-huifu1",onClick:nn})," ",i.a.createElement("b",null,tn))," ")))},it=I("dhSg"),lt=I("ps8w"),fe=I.n(lt),ie=I("oBTY"),re=I("M8RZ"),de=I("OkW/"),me=I("ErOA");function le(Ze){return Object(me.c)("comments.json",Ze)}function he(Ze){return Object(me.f)("/discusses/".concat(Ze,"/plus.json"),{container_type:"Discuss",type:1})}function Ee(Ze){return Object(me.f)("comments/reply.json",Ze)}function ye(Ze){return Object(me.f)("comments.json",Ze)}function Le(Ze){return Object(me.f)("comments/".concat(Ze==null?void 0:Ze.id,"/hidden.json"),Ze)}function Ne(Ze){return Object(me.b)("comments/".concat(Ze==null?void 0:Ze.id,".json"))}var tt=I("GgEA"),gt=I("AMnG"),Ct=I("xKgJ");function Ot(Ze){var ht=Ze.author;return i.a.createElement("a",{href:"/users/".concat(ht.login),target:"_blank"},i.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(b.a.IMG_SERVER,"/images/").concat(ht.image_url),width:"50"}))}function St(Ze){var ht=Ze.data,Nt=Ze.index,nn=Ze.parentDiscussIndex,Vt=Ze.user,Bt=Ze.onSetActionType,rt=ht.author,mt=ht.can_delete,en=ht.content,ct=ht.id,tn=ht.time;function Dt(){Bt({id:ct,index:Nt,type:"delete-discuss",parentDiscussIndex:nn,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var on=Vt.admin||mt||rt.user_id===Vt.user_id;return i.a.createElement("div",{className:"discuss-item-container second-discuss "},i.a.createElement(Ot,{author:rt}),i.a.createElement("section",null,i.a.createElement("div",{className:"discuss-info"},i.a.createElement("a",{href:"/users/".concat(rt.login),target:"_blank"},rt.name),i.a.createElement("span",{className:"grey"},tn),i.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},on?i.a.createElement("a",{onClick:Dt,title:"\u5220\u9664"},i.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),i.a.createElement(wt.a,{className:"discuss-content",value:en})))}var Ye=function(Ze){var ht=Ze.user,Nt=Ze.data,nn=Ze.index,Vt=Ze.onPlusDiscuss,Bt=Ze.onSetActionType,rt=Ze.activeDiscussIndex,mt=Ze.onReplyDiscuss,en=Ze.onSetActiveDiscussIndex,ct=Nt.content,tn=Nt.children,Dt=Nt.hidden,on=Nt.id,Mn=Nt.praise_count,On=Nt.time,mn=Nt.user_praise,Xn=Nt.can_delete,xn=Nt.author;console.log(Xn&&(!tn||tn.length==0),"children22");function Kn(){en(on)}function Gn(){Vt(on,!mn,nn)}function di(){Bt({id:on,index:nn,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function Ln(){Bt({id:on,index:nn,params:{hidden:Dt?"0":"1"},type:"hidden-discuss",message:Dt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var oi=ht.admin||ht.user_id===xn.user_id;return i.a.createElement("div",{className:"discuss-item-container",key:on},i.a.createElement(Ot,{author:xn}),i.a.createElement("section",null,i.a.createElement("div",{className:"discuss-info"},i.a.createElement("a",{href:"/users/".concat(xn.login),target:"_blank"}," ",xn.name," "),i.a.createElement("span",{className:"grey"},On)),i.a.createElement(wt.a,{className:"discuss-content",value:ct}),tn&&tn.length>0?i.a.createElement("div",{className:"reply-discuss-container"},tn.map(function(li,$n){return i.a.createElement(St,{key:li.id,data:li,index:$n,user:ht,onSetActionType:Bt,parentDiscussIndex:nn})})):null,i.a.createElement("div",{className:"btn-group"},Object(Ct.w)()?i.a.createElement("a",{onClick:Ln,title:Dt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},i.a.createElement("i",{className:Dt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,Xn&&(!tn||tn.length==0)?i.a.createElement("a",{onClick:di,title:"\u5220\u9664"},i.a.createElement("i",{className:"iconfont icon-shanchu"})):null,i.a.createElement("a",{onClick:Kn,title:"\u56DE\u590D"}," ",i.a.createElement("i",{className:"iconfont icon-huifu1"})," "),i.a.createElement("a",{onClick:Gn,className:mn?"c-orange":""},i.a.createElement("i",{className:mn?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),i.a.createElement("span",null,Mn||""))),i.a.createElement(gt.a,{id:on,activeDiscussIndex:rt,onReplyDiscuss:mt})))},at=I("kaH+"),Ve=I("Wx9E"),be=I("Ot1p"),Ie=function(Ze){var ht=Ze.user_praise,Nt=Ze.praise_count,nn=Ze.praisePlus,Vt=Ze.onCreateDiscuss,Bt=Ze.discuss_count,rt=Object(a.useState)(!1),mt=Object(p.a)(rt,2),en=mt[0],ct=mt[1],tn=Object(a.useState)(""),Dt=Object(p.a)(tn,2),on=Dt[0],Mn=Dt[1];function On(Gn){Mn(Gn)}function mn(){ct(!0)}function Xn(){ct(!1)}function xn(){return Kn.apply(this,arguments)}function Kn(){return Kn=Object(g.a)(r.a.mark(function Gn(){return r.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:Vt(on),Mn(""),ct(!1);case 3:case"end":return Ln.stop()}},Gn)})),Kn.apply(this,arguments)}return i.a.createElement("div",{className:"dis-input-editor-container ".concat(en?"active":""," ")},i.a.createElement("div",{className:en?"text-area hide":"text-area"},i.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:mn}),i.a.createElement("a",{style:{alignItems:"center"}}," ",i.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Bt," "),i.a.createElement("a",{className:"c-light-black",onClick:nn,style:{alignItems:"center"},title:ht?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},i.a.createElement("i",{className:"mr3 ".concat(ht?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Nt?i.a.createElement("span",null,Nt):"")),en?i.a.createElement("div",{className:"input-mask",onClick:Xn}):null,i.a.createElement("div",{className:en?"md-container":"md-container hide"},i.a.createElement(be.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:on,height:240,onChange:On}),i.a.createElement("div",{className:"tip-container",onClick:Xn},i.a.createElement("a",{className:"btn-send",onClick:xn}," ","\u53D1\u9001"," "))))},ot={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},Xe;(function(Ze){Ze[Ze.GET_DISCUSSES=0]="GET_DISCUSSES",Ze[Ze.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",Ze[Ze.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",Ze[Ze.PLUS_DISCUSS=3]="PLUS_DISCUSS",Ze[Ze.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",Ze[Ze.SET_PAGE=5]="SET_PAGE",Ze[Ze.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(Xe||(Xe={}));function Rt(Ze,ht){switch(ht.type){case Xe.SHOW_DISCUSSES_LOADING:return Object(h.a)(Object(h.a)({},Ze),{},{loading:!0});case Xe.GET_DISCUSSES:return Object(h.a)(Object(h.a)({},Ze),ht.payload);case Xe.TOP_OR_DOWN_DISCUSS:return Object(h.a)(Object(h.a)({},Ze),ht.payload);case Xe.SET_ACTION_TYPE:return Object(h.a)(Object(h.a)({},Ze),ht.payload);case Xe.PLUS_DISCUSS:return Object(h.a)(Object(h.a)({},Ze),ht.payload);case Xe.SET_PAGE:return Object(h.a)(Object(h.a)({},Ze),{},{page:ht.payload});case Xe.ACTIVE_DISCUSS_INDEX:return Object(h.a)(Object(h.a)({},Ze),ht.payload);default:throw new Error}}var Lt=function(Ze){var ht=Ze.user,Nt=Ze.identifier,nn=Ze.hack,Vt=Ze.onTriggerPraise,Bt=Ze.setDiscussTotal,rt=Object(a.useReducer)(Rt,ot),mt=Object(p.a)(rt,2),en=mt[0],ct=mt[1],tn=en.loading,Dt=en.page,on=en.data,Mn=en.count,On=en.actionType,mn=en.activeDiscussIndex,Xn=Object(a.useCallback)(Object(g.a)(r.a.mark(function gn(){var Zn,ui,ei;return r.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:return ct({type:Xe.SHOW_DISCUSSES_LOADING}),Tn.next=3,le({container_type:"Practice",container_identifier:Nt,limit:10,page:Dt});case 3:Zn=Tn.sent,ui=Zn.comments,ei=Zn.disscuss_count,ct({type:Xe.GET_DISCUSSES,payload:{data:ui,count:ei,loading:!1}}),Bt(ei);case 7:case"end":return Tn.stop()}},gn)})),[Dt,Nt]);Object(a.useEffect)(function(){Xn()},[Nt,Dt]);function xn(gn){ct({type:Xe.SET_PAGE,page:gn})}function Kn(gn){ct({type:Xe.SET_ACTION_TYPE,payload:{actionType:gn}})}function Gn(gn){mn===gn?ct({type:Xe.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):ct({type:Xe.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:gn}})}function di(gn,Zn,ui){return Ln.apply(this,arguments)}function Ln(){return Ln=Object(g.a)(r.a.mark(function gn(Zn,ui,ei){var Vn;return r.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.prev=0,un.next=3,he(Zn);case 3:Vn=un.sent,on[ei].user_praise=ui,on[ei].praise_count=Vn.praise_count,ct({type:Xe.PLUS_DISCUSS,payload:{data:Object(ie.a)(on)}}),un.next=12;break;case 9:un.prev=9,un.t0=un.catch(0),console.log(un.t0);case 12:case"end":return un.stop()}},gn,null,[[0,9]])})),Ln.apply(this,arguments)}function oi(){return li.apply(this,arguments)}function li(){return li=Object(g.a)(r.a.mark(function gn(){var Zn,ui,ei,Vn,Tn;return r.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:if(Zn=On.id,ui=On.params,ei=On.type,Vn=On.index,Tn=On.parentDiscussIndex,!(ei==="hidden-discuss")){_n.next=7;break}return console.log(ui,"params"),_n.next=5,Le(Object(h.a)({id:Zn,container_type:"Practice",container_identifier:Nt},ui));case 5:Tn?on[Tn].children[Vn].hidden=ui.hidden==1:on[Vn].hidden=ui.hidden==1,ct({type:Xe.SET_ACTION_TYPE,payload:{actionType:null,data:Object(ie.a)(on)}});case 7:if(!(ei==="delete-discuss")){_n.next=13;break}return _n.next=10,Ne({id:Zn,container_type:"Practice",container_identifier:Nt});case 10:return ct({type:Xe.SET_ACTION_TYPE,payload:{actionType:null}}),_n.next=13,Xn();case 13:case"end":return _n.stop()}},gn)})),li.apply(this,arguments)}function $n(){ct({type:Xe.SET_ACTION_TYPE,payload:{actionType:null}})}function Rn(gn,Zn){return zn.apply(this,arguments)}function zn(){return zn=Object(g.a)(r.a.mark(function gn(Zn,ui){return r.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.prev=0,Vn.next=3,Ee({container_type:"Practice",container_identifier:Nt,comments:{content:ui,parent_id:Zn}});case 3:Xn(),Vn.next=9;break;case 6:Vn.prev=6,Vn.t0=Vn.catch(0),console.log(Vn.t0);case 9:case"end":return Vn.stop()}},gn,null,[[0,6]])})),zn.apply(this,arguments)}function kn(gn){return jt.apply(this,arguments)}function jt(){return jt=Object(g.a)(r.a.mark(function gn(Zn){return r.a.wrap(function(ei){for(;;)switch(ei.prev=ei.next){case 0:return ct({type:Xe.SHOW_DISCUSSES_LOADING}),ei.next=3,ye({comments:{content:Zn},container_type:"Practice",container_identifier:Nt});case 3:Xn();case 4:case"end":return ei.stop()}},gn)})),jt.apply(this,arguments)}return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"discuss-panel"},on.length===0?i.a.createElement(Te.a,null):on.map(function(gn,Zn){return i.a.createElement(Ye,{onReplyDiscuss:Rn,onPlusDiscuss:di,onSetActiveDiscussIndex:Gn,onSetActionType:Kn,data:gn,index:Zn,user:ht,activeDiscussIndex:mn})}),Mn>10?i.a.createElement("div",{className:"pagination-container"},i.a.createElement(Be.a,{showQuickJumper:!0,onChange:xn,current:Dt,total:Mn})):null),i.a.createElement(Ie,{user_praise:nn.user_praise,praise_count:nn.praises_count,praisePlus:Vt,discuss_count:nn.comments_count,onCreateDiscuss:kn}),i.a.createElement(re.a,null,i.a.createElement(D.a,{centered:!0,title:"\u63D0\u793A",visible:!!On,onOk:oi,onCancel:$n},i.a.createElement("p",null,On?On.message:"")),i.a.createElement(at.a,null)))},et=I("1FX+"),dt=I.n(et),vt=I("pYxM"),Tt=I.n(vt),Pt=I("sB/4"),_e=I.n(Pt),ce=I("Wtmd"),W=I.n(ce),Y=I("CNDd"),$=I.n(Y),te=I("nCk5"),ve=I.n(te),Pe=I("kovY"),Ge=I.n(Pe),_t=function(ht){var Nt=ht.style,nn=Nt===void 0?{}:Nt,Vt=ht.onClick,Bt=ht.onAssist,rt=ht.onHide,mt=ht.data,en=ht.active,ct=ht.showLine;return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:en===(mt==null?void 0:mt.id)?"".concat(Tt.a.list," ").concat(Tt.a.active):Tt.a.list,style:nn,onClick:function(){return Vt(mt)}},(mt==null?void 0:mt.video)&&i.a.createElement("div",{className:Tt.a.left},i.a.createElement("img",{src:mt==null?void 0:mt.video_cover}),i.a.createElement("div",null,i.a.createElement("img",{src:_e.a}),i.a.createElement("span",null,mt==null?void 0:mt.video_duration)),i.a.createElement("div",{className:Tt.a.mask})),i.a.createElement("div",{className:Tt.a.right},i.a.createElement("div",{className:Tt.a.name},i.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(mt==null?void 0:mt.image_url),width:30,height:30}),i.a.createElement("div",{title:mt==null?void 0:mt.name,className:Tt.a.title},mt==null?void 0:mt.name),(mt==null?void 0:mt.is_authority)&&i.a.createElement("div",{className:Tt.a.b},"\u5B98\u65B9"),(mt==null?void 0:mt.is_excellent)&&i.a.createElement("div",{className:Tt.a.a},"\u7CBE\u9009")),i.a.createElement("div",{className:Tt.a.des},i.a.createElement(wt.a,{showLines:2,showTextOnly:!0,value:(mt==null?void 0:mt.content)||"\u6682\u65E0\u5185\u5BB9"})),i.a.createElement("div",{className:Tt.a.tag},i.a.createElement("span",{className:"current",onClick:function(Dt){Dt.stopPropagation(),Bt(mt)}},i.a.createElement("img",{src:mt!=null&&mt.user_liker?$.a:W.a}),i.a.createElement("span",{style:{color:mt!=null&&mt.user_liker?"#0152d9":"#656f87"}},mt==null?void 0:mt.praises_count)),i.a.createElement("span",null,i.a.createElement("img",{src:ve.a}),i.a.createElement("span",null,mt==null?void 0:mt.discusses_count)),i.a.createElement("span",null,i.a.createElement("img",{src:Ge.a}),i.a.createElement("span",null,mt==null?void 0:mt.viewed_count)),Object(Ct.w)()&&i.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(Dt){Dt.stopPropagation(),rt(mt)}},mt!=null&&mt.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),ct&&i.a.createElement("div",{className:Tt.a.line}))},bt=_t,$e=I("5Dmo"),At=I("3S7+"),Jt=I("Z8dc"),Et=I.n(Jt),sn=I("7+5b"),Yt=I.n(sn),Ut=I("twBr"),pt=I.n(Ut),Cn=I("oE5q"),ft=I.n(Cn),hn=I("9+Du"),pn=function(ht){var Nt,nn=ht.onClose,Vt=ht.onOk,Bt=ht.identifier,rt=ht.active,mt=R.a.useForm(),en=Object(p.a)(mt,1),ct=en[0],tn=Object(a.useState)({}),Dt=Object(p.a)(tn,2),on=Dt[0],Mn=Dt[1],On=Object(a.useState)(!1),mn=Object(p.a)(On,2),Xn=mn[0],xn=mn[1],Kn=Object(a.useState)(!1),Gn=Object(p.a)(Kn,2),di=Gn[0],Ln=Gn[1],oi=Object(a.useState)([]),li=Object(p.a)(oi,2),$n=li[0],Rn=li[1],zn=Object(Ct.y)(),kn=Object(x.i)();Object(a.useEffect)(function(){rt&&jt()},[rt]);var jt=function(){var Qt=Object(g.a)(r.a.mark(function Mt(){var Gt,an,ti,Ei,Ki,Mi,Er,qn,xr,Dr,Wr,Pr;return r.a.wrap(function(pr){for(;;)switch(pr.prev=pr.next){case 0:return pr.next=2,Object(w.k)(Bt,{active:rt});case 2:Gt=pr.sent,(Gt==null?void 0:Gt.status)===0&&(Mi={name:Gt==null||((an=Gt.data)===null||an===void 0)?void 0:an.name,content:Gt==null||((ti=Gt.data)===null||ti===void 0)?void 0:ti.content},ct.setFieldsValue(Mi),Mn(Mi),Gt!=null&&(Ei=Gt.data)!==null&&Ei!==void 0&&(Ki=Ei.videos)!==null&&Ki!==void 0&&Ki[0]&&Rn([{video_id:Gt==null||((Er=Gt.data)===null||Er===void 0||((qn=Er.videos)===null||qn===void 0||((xr=qn[0])===null||xr===void 0)))?void 0:xr.video_id,name:Gt==null||((Dr=Gt.data)===null||Dr===void 0||((Wr=Dr.videos)===null||Wr===void 0||((Pr=Wr[0])===null||Pr===void 0)))?void 0:Pr.title,loaded:100}]));case 4:case"end":return pr.stop()}},Mt)}));return function(){return Qt.apply(this,arguments)}}(),gn=function(Mt,Gt){Mn(Object(h.a)({},Gt))},Zn=function(){var Qt=Object(g.a)(r.a.mark(function Mt(Gt){var an,ti,Ei,Ki,Mi;return r.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:if(ti={videos:$n,articles:Gt},Ln(!0),!rt){qn.next=9;break}return ti.active=rt,qn.next=6,Object(w.j)(Bt,ti);case 6:Ei=qn.sent,qn.next=12;break;case 9:return qn.next=11,Object(w.a)(Bt,ti);case 11:Ei=qn.sent;case 12:((an=Ei)===null||an===void 0?void 0:an.status)===0&&(console.log(rt||((Ki=Ei)===null||Ki===void 0?void 0:Ki.id),44),Vt(rt||((Mi=Ei)===null||Mi===void 0?void 0:Mi.id))),Ln(!1);case 14:case"end":return qn.stop()}},Mt)}));return function(Gt){return Qt.apply(this,arguments)}}(),ui=function(Mt){var Gt=1024,an=Mt.name.toLowerCase();return an&&an.indexOf(".avi")==-1&&an.indexOf(".flv")==-1&&an.indexOf(".f4v")==-1&&an.indexOf(".m4v")==-1&&an.indexOf(".mov")==-1&&an.indexOf(".mp4")==-1&&an.indexOf(".rmvb")==-1&&an.indexOf(".swf")==-1&&an.indexOf(".webm")==-1&&an.indexOf(".wmv")==-1?(M.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),!0):Mt.size>Gt*1024*1024?(M.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(Gt,"M")),!0):$n!=null&&$n.find(function(ti){return ti.name===Mt.name})?(M.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),!0):!1},ei=function(Mt,Gt){D.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:i.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",Gt?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){Rn([])}})},Vn={accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*",onBefore:ui,onBeginInitFile:function(Mt){xn(!0),Rn([{name:Mt.filename,loaded:0}])},onComplete:function(Mt){Rn([{name:Mt.filename,loaded:Mt.percent,video_id:Mt.id}]),xn(!1)},onError:function(){Rn([]),xn(!1)},onProgress:function(Mt){Rn([{name:Mt.filename,loaded:Mt.percent}])},chunkSize:1024*1024*2,options:{user_id:zn==null?void 0:zn.user_id}},Tn=function(){return i.a.createElement(hn.a,Vn,i.a.createElement("div",{className:Et.a.main},i.a.createElement("img",{src:Yt.a,alt:""}),i.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891")))},un=function(Mt){return i.a.createElement("div",{className:Et.a.mainLoading},i.a.createElement("div",{className:Et.a.proWarp},i.a.createElement("div",{className:Et.a.pro},i.a.createElement("div",{style:{width:Mt}})),i.a.createElement("span",null,Mt||0,"%")),i.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),i.a.createElement("div",{className:Et.a.tip},i.a.createElement(At.a,{getPopupContainer:function(an){return an.parentNode},title:i.a.createElement("div",null,i.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",i.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),i.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),i.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},i.a.createElement("img",{src:ft.a,alt:""}))))},_n=function(Mt){return i.a.createElement("div",{className:Et.a.mainSucceed},i.a.createElement("img",{src:pt.a,alt:""}),i.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),i.a.createElement("div",{className:Et.a.tip},i.a.createElement(At.a,{getPopupContainer:function(an){return an.parentNode},title:i.a.createElement("div",null,i.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",i.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),i.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),i.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},i.a.createElement("img",{src:ft.a,alt:""}))),i.a.createElement("div",{className:Et.a.del,onClick:function(){return ei(Mt.name,Mt.loaded==100)}},i.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},Ft=function(){return i.a.createElement(i.a.Fragment,null,$n==null?void 0:$n.map(function(Mt,Gt){return i.a.createElement(i.a.Fragment,{key:Gt},Mt.loaded==100?_n(Mt):un(Mt.loaded))}))},Wt=function(){D.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:nn})},$t=$n==null?void 0:$n.length;return i.a.createElement("div",{className:Et.a.listForm},i.a.createElement("header",null,rt?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),i.a.createElement("section",{className:Et.a.scroll,id:"sss"},i.a.createElement("div",{className:Et.a.formWrap}," ",i.a.createElement(R.a,{form:ct,scrollToFirstError:!0,layout:"vertical",onValuesChange:gn,onFinish:Zn},i.a.createElement(R.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{max:60,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},i.a.createElement(ne.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Nt=on.name)===null||Nt===void 0?void 0:Nt.length)||0,"/60")})),i.a.createElement(R.a.Item,{name:"content",label:"\u5185\u5BB9:"},i.a.createElement(be.a,{defaultValue:on.content||"",watch:!0})))),i.a.createElement("div",{className:Et.a.upload},$t?Ft():Tn())),i.a.createElement("div",{className:Et.a.btns},i.a.createElement(G.a,{onClick:Wt,type:"primary",ghost:!0},"\u5173\u95ED"),i.a.createElement(G.a,{loading:di,disabled:Xn,onClick:function(){return ct.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},Yn=pn,ni=I("cWXX"),En=I("/ezw"),gi=I("CaVn"),Jn=I.n(gi),An=I("s8/Y"),Pn=I.n(An),Di=I("JOrW"),Hi=I.n(Di),vi=I("gqXR"),ii=I.n(vi),_i=I("14J3"),Qi=I("BMrR"),yi=I("jCWc"),ri=I("kPKH"),Pi=I("wW8i"),Li=I.n(Pi),Oi=I("MVJL"),Si=I.n(Oi),cr=function(ht){var Nt=ht.id,nn=ht.cb,Vt=Object(a.useState)(""),Bt=Object(p.a)(Vt,2),rt=Bt[0],mt=Bt[1];return i.a.createElement("aside",{className:"mt10"},i.a.createElement(be.a,{defaultValue:rt,id:"writeForumsReviewId",onChange:function(ct){mt(ct)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),i.a.createElement(Qi.a,null,i.a.createElement(ri.a,{flex:"1"}),i.a.createElement(ri.a,null,i.a.createElement(G.a,{type:"primary",size:"large",onClick:Object(g.a)(r.a.mark(function en(){return r.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:rt===""?M.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):nn(Nt,rt);case 1:case"end":return tn.stop()}},en)}))},"\u53D1\u9001"))))},_r=function(ht){var Nt,nn=ht.data;return i.a.createElement("div",{className:Si.a.thirdlyLevelDiscuss},i.a.createElement("span",{className:"c-grey-333"},i.a.createElement("span",{className:"font 14 c-light-primary"},nn==null||((Nt=nn.author)===null||Nt===void 0)?void 0:Nt.name),"@",i.a.createElement("span",{className:"font 14 c-light-primary"},nn==null?void 0:nn.parent_name),":"),i.a.createElement(wt.a,{value:nn==null?void 0:nn.content}))},rr=function(ht){var Nt,nn,Vt,Bt,rt=ht.data,mt=ht.onReplyDiscuss,en=ht.thirdlyReply,ct=ht.setThirdlyReply,tn=Object(Ct.y)();return console.log(tn,"user"),i.a.createElement("div",{className:Si.a.list},i.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(rt==null||((Nt=rt.author)===null||Nt===void 0)?void 0:Nt.image_url)}),i.a.createElement("div",{className:Si.a.wrap},i.a.createElement("div",{className:"font14",style:{marginBottom:6}},i.a.createElement("span",{className:"c-grey-333"},rt==null||((nn=rt.author)===null||nn===void 0)?void 0:nn.name),(tn==null?void 0:tn.login)!==(rt==null||((Vt=rt.author)===null||Vt===void 0)?void 0:Vt.login)&&i.a.createElement("span",{onClick:function(){return ct(rt==null?void 0:rt.id)},className:"c-grey-999 current",style:{float:"right"}},i.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),i.a.createElement("span",null,"\u56DE\u590D"))),i.a.createElement(wt.a,{value:rt==null?void 0:rt.content}),rt==null||((Bt=rt.children)===null||Bt===void 0)?void 0:Bt.map(function(Dt){return i.a.createElement(_r,{key:Dt.id,data:Dt})}),en===(rt==null?void 0:rt.id)&&i.a.createElement("div",null,i.a.createElement(cr,{id:rt==null?void 0:rt.id,cb:mt}),i.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return ct(null)},className:"c-light-primary current"},i.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),i.a.createElement("div",{className:Si.a.line})))},Zi=function(ht){var Nt,nn,Vt,Bt,rt=ht.data,mt=ht.onReplyDiscuss,en=ht.secondReply,ct=ht.setSecondReply,tn=ht.thirdlyReply,Dt=ht.setThirdlyReply,on=ht.onPlusDiscuss,Mn=Object(a.useState)(!1),On=Object(p.a)(Mn,2),mn=On[0],Xn=On[1];return console.log(rt,"data"),i.a.createElement("div",{className:Si.a.discussItem},i.a.createElement("div",{className:Si.a.list},i.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(rt==null||((Nt=rt.author)===null||Nt===void 0)?void 0:Nt.image_url)}),i.a.createElement("div",{className:Si.a.wrap},i.a.createElement("div",{className:"font14",style:{marginBottom:6}},i.a.createElement("span",{className:"c-grey-333 mr30"},rt==null||((nn=rt.author)===null||nn===void 0)?void 0:nn.name),i.a.createElement("span",{className:"c-grey-999"},rt==null?void 0:rt.time)),i.a.createElement(wt.a,{value:rt==null?void 0:rt.content}),i.a.createElement("div",{className:Si.a.btns},i.a.createElement("div",{onClick:function(){return on(rt==null?void 0:rt.id)},className:rt!=null&&rt.user_praise?"c-light-primary":"c-grey-999"},i.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),i.a.createElement("span",null,rt==null?void 0:rt.praise_count)),i.a.createElement("div",{onClick:function(){var Kn;if((rt==null||((Kn=rt.children)===null||Kn===void 0)?void 0:Kn.length)===0)return;ct(null),Xn(!mn)},style:{color:mn?"#0152d9":"#999999"}},i.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),i.a.createElement("span",null,mn?"\u6536\u8D77\u8BC4\u8BBA":rt==null||((Vt=rt.children)===null||Vt===void 0)?void 0:Vt.length)),i.a.createElement("div",{onClick:function(){Xn(!1),ct(en===(rt==null?void 0:rt.id)?null:rt==null?void 0:rt.id)},style:{color:en===(rt==null?void 0:rt.id)?"#0152d9":"#999999"}},i.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),i.a.createElement("span",null,en===(rt==null?void 0:rt.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),en===(rt==null?void 0:rt.id)&&i.a.createElement(cr,{id:rt==null?void 0:rt.id,cb:function(Kn,Gn){mt(Kn,Gn),Xn(!0)}}),mn&&i.a.createElement("div",{className:Si.a.secondLevelDiscuss},rt==null||((Bt=rt.children)===null||Bt===void 0)?void 0:Bt.map(function(xn){return i.a.createElement(rr,{thirdlyReply:tn,setThirdlyReply:Dt,key:xn.id,data:xn,onReplyDiscuss:mt})})))))},Ar=Zi,Nr=function(ht){var Nt=ht.identifier,nn=ht.active,Vt=ht.onOk,Bt=Object(a.useState)(""),rt=Object(p.a)(Bt,2),mt=rt[0],en=rt[1],ct=Object(a.useState)(1),tn=Object(p.a)(ct,2),Dt=tn[0],on=tn[1],Mn=Object(a.useState)([]),On=Object(p.a)(Mn,2),mn=On[0],Xn=On[1],xn=Object(a.useState)(0),Kn=Object(p.a)(xn,2),Gn=Kn[0],di=Kn[1],Ln=Object(a.useState)(null),oi=Object(p.a)(Ln,2),li=oi[0],$n=oi[1],Rn=Object(a.useState)(null),zn=Object(p.a)(Rn,2),kn=zn[0],jt=zn[1];Object(a.useEffect)(function(){gn(1),on(1)},[nn]);var gn=function(){var Tn=Object(g.a)(r.a.mark(function un(_n){var Ft;return r.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,le({container_type:"QuestionSolutionArticle",container_identifier:nn,limit:5,page:_n});case 2:Ft=$t.sent,Ft!=null&&Ft.comments&&(Xn((Ft==null?void 0:Ft.comments)||[]),on(_n),di(Ft==null?void 0:Ft.disscuss_count));case 4:case"end":return $t.stop()}},un)}));return function(_n){return Tn.apply(this,arguments)}}(),Zn=function(){var Tn=Object(g.a)(r.a.mark(function un(){var _n;return r.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:if(!(mt==="")){Wt.next=3;break}return M.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Wt.abrupt("return");case 3:return Wt.next=5,ye({comments:{content:mt},container_type:"QuestionSolutionArticle",container_identifier:nn});case 5:_n=Wt.sent,_n!=null&&_n.discuss&&(en(""),gn(Dt),Vt());case 7:case"end":return Wt.stop()}},un)}));return function(){return Tn.apply(this,arguments)}}(),ui=function(){var Tn=Object(g.a)(r.a.mark(function un(_n,Ft,Wt){var $t;return r.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Mt.next=2,Ee({container_type:"QuestionSolutionArticle",container_identifier:nn,comments:{content:Ft,parent_id:_n}});case 2:$t=Mt.sent,$n(null),jt(null),gn(Dt);case 6:case"end":return Mt.stop()}},un)}));return function(_n,Ft,Wt){return Tn.apply(this,arguments)}}(),ei=function(){var Tn=Object(g.a)(r.a.mark(function un(_n){var Ft;return r.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,he(_n);case 2:Ft=$t.sent,gn(Dt);case 4:case"end":return $t.stop()}},un)}));return function(_n){return Tn.apply(this,arguments)}}(),Vn=function(un){on(un),gn(un)};return i.a.createElement("div",{className:Li.a.discuss},i.a.createElement("aside",{className:Li.a.reply,style:{borderWidth:Gn?1:0}},i.a.createElement(be.a,{defaultValue:mt,id:"writeForumsReviewId",onChange:function(un){en(un)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),i.a.createElement(Qi.a,null,i.a.createElement(ri.a,{flex:"1"}),i.a.createElement(ri.a,null,i.a.createElement(G.a,{type:"primary",size:"large",onClick:function(){return Zn()}},"\u53D1\u9001")))),mn==null?void 0:mn.map(function(Tn){return i.a.createElement(Ar,{secondReply:li,setSecondReply:$n,thirdlyReply:kn,setThirdlyReply:jt,key:Tn.id,data:Tn,onReplyDiscuss:ui,onPlusDiscuss:ei})}),i.a.createElement(Be.a,{className:Li.a.pagination,showTotal:function(un){return i.a.createElement("span",{style:{color:"#656F87"}},"\u5171",i.a.createElement("span",{className:"c-light-primary"},un),"\u6761\u6570\u636E")},current:Dt,onChange:Vn,total:Gn,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},Ur=Nr,ar=I("hgre"),pi=function(ht){var Nt,nn,Vt,Bt,rt,mt,en,ct,tn,Dt,on=ht.active,Mn=ht.identifier,On=ht.onAssist,mn=ht.onEdit,Xn=ht.onArticlesSkip,xn=ht.onClose,Kn=ht.onOk,Gn=ht.onDelete,di=ht.detailsIndex,Ln=ht.btnShowStatus,oi=Object(a.useState)(!0),li=Object(p.a)(oi,2),$n=li[0],Rn=li[1],zn=Object(a.useState)({}),kn=Object(p.a)(zn,2),jt=kn[0],gn=kn[1];Object(a.useEffect)(function(){on&&Zn()},[on,di]);var Zn=function(){var un=Object(g.a)(r.a.mark(function _n(){var Ft,Wt,$t=arguments;return r.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Ft=$t.length>0&&$t[0]!==void 0?$t[0]:!0,Ft&&Rn(!0),Mt.next=4,Object(w.d)(Mn,{active:on});case 4:Wt=Mt.sent,(Wt==null?void 0:Wt.status)===0&&gn((Wt==null?void 0:Wt.data)||{}),Rn(!1);case 7:case"end":return Mt.stop()}},_n)}));return function(){return un.apply(this,arguments)}}(),ui=function(){var un=Object(g.a)(r.a.mark(function _n(Ft){var Wt;return r.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,Object(w.g)(Mn,Object(h.a)({active:on},Ft));case 2:Wt=Qt.sent,(Wt==null?void 0:Wt.status)===0&&(Zn(!1),Kn());case 4:case"end":return Qt.stop()}},_n)}));return function(Ft){return un.apply(this,arguments)}}(),ei=function(){var un=Object(g.a)(r.a.mark(function _n(Ft){var Wt;return r.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,Object(w.c)(Mn,{active:Ft==null?void 0:Ft.id});case 2:Wt=Qt.sent,Wt.status===0&&(Zn(!1),Kn());case 4:case"end":return Qt.stop()}},_n)}));return function(Ft){return un.apply(this,arguments)}}(),Vn=function(_n){D.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:null,className:"custom-modal-divider",content:"\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u9898\u89E3\u5417?",onOk:function(){return Gn(_n)}})},Tn=function(){Zn(!1),Kn()};return i.a.createElement("div",{className:Jn.a.listDetails},i.a.createElement(En.a,{className:"pt20 pl20 pr20",loading:$n,active:!0,paragraph:{rows:5}},i.a.createElement("div",{className:Jn.a.head},i.a.createElement("div",{className:Jn.a.name},i.a.createElement("div",{title:jt==null?void 0:jt.name,className:Jn.a.title},jt==null?void 0:jt.name),(jt==null?void 0:jt.is_authority)&&i.a.createElement("div",{className:Jn.a.b},"\u5B98\u65B9"),(jt==null?void 0:jt.is_excellent)&&i.a.createElement("div",{className:Jn.a.a},"\u7CBE\u9009")),i.a.createElement("div",{className:Jn.a.tag},i.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(jt==null?void 0:jt.image_url)}),i.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},jt==null?void 0:jt.username),i.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",nt()(jt==null?void 0:jt.created_at).format("YYYY-MM-DD")),i.a.createElement("span",null,i.a.createElement("img",{src:W.a}),i.a.createElement("span",null,jt==null?void 0:jt.praises_count)),i.a.createElement("span",null,i.a.createElement("img",{src:ve.a}),i.a.createElement("span",null,jt==null?void 0:jt.discusses_count)),i.a.createElement("span",null,i.a.createElement("img",{src:Ge.a}),i.a.createElement("span",null,jt==null?void 0:jt.viewed_count)),i.a.createElement("div",{className:Jn.a.btn},(Object(Ct.w)()||(jt==null?void 0:jt.is_self))&&i.a.createElement(i.a.Fragment,null,i.a.createElement(G.a,{onClick:function(){return Vn(jt)},type:"primary",ghost:!0},"\u5220\u9664"),i.a.createElement(G.a,{onClick:function(){return mn(jt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(Ct.w)()&&i.a.createElement(G.a,{onClick:function(){return ui({is_authority:!(jt!=null&&jt.is_authority)})},type:"primary"},i.a.createElement("img",{src:Hi.a}),jt!=null&&jt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(Ct.w)()&&i.a.createElement(G.a,{onClick:function(){return ui({is_excellent:!(jt!=null&&jt.is_excellent)})},type:"primary"},i.a.createElement("img",{src:Pn.a}),jt!=null&&jt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),i.a.createElement("div",{className:Jn.a.scroll},(jt==null||((Nt=jt.videos)===null||Nt===void 0||((nn=Nt[0])===null||nn===void 0))?void 0:nn.id)&&i.a.createElement("div",{className:Jn.a.video},i.a.createElement(C.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(jt!=null&&(Vt=jt.videos)!==null&&Vt!==void 0&&(Bt=Vt[0])!==null&&Bt!==void 0&&Bt.transcoded)},i.a.createElement(ar.a,{poster:jt==null||((rt=jt.videos)===null||rt===void 0||((mt=rt[0])===null||mt===void 0))?void 0:mt.cover_url,src:(jt==null||((en=jt.videos)===null||en===void 0||((ct=en[0])===null||ct===void 0))?void 0:ct.play_url)||"",videoId:jt==null||((tn=jt.videos)===null||tn===void 0||((Dt=tn[0])===null||Dt===void 0))?void 0:Dt.id,logWatchHistory:function(){}}))),i.a.createElement(wt.a,{className:Jn.a.html,value:(jt==null?void 0:jt.content)||""}),i.a.createElement("div",{onClick:function(){return ei(jt)},className:Jn.a.g},i.a.createElement("img",{className:"mr10",src:(jt!=null&&jt.user_liker,ii.a)}),i.a.createElement("span",null,jt==null?void 0:jt.praises_count)),i.a.createElement(Ur,{onOk:Tn,active:on,identifier:Mn})),i.a.createElement("div",{className:Jn.a.btns},i.a.createElement(G.a,{onClick:function(){return xn()},type:"primary",ghost:!0},"\u5173\u95ED"),Ln[0]&&i.a.createElement(G.a,{onClick:function(_n){return Xn(_n,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),Ln[1]&&i.a.createElement(G.a,{onClick:function(_n){return Xn(_n,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},ci=pi,Yi=I("3tLw"),qi=I.n(Yi),sr=I("ek7X"),er=I("0NbB"),zr=function(ht){var Nt=ht.identifier,nn=ht.tabStatus,Vt=ht.setFilterListTotal,Bt=ht.setListStatus,rt={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},mt=Object(a.useState)(Object(h.a)({},rt)),en=Object(p.a)(mt,2),ct=en[0],tn=en[1],Dt=Object(a.useState)(!1),on=Object(p.a)(Dt,2),Mn=on[0],On=on[1],mn=Object(a.useState)(0),Xn=Object(p.a)(mn,2),xn=Xn[0],Kn=Xn[1],Gn=Object(a.useState)(1),di=Object(p.a)(Gn,2),Ln=di[0],oi=di[1],li=Object(a.useState)(null),$n=Object(p.a)(li,2),Rn=$n[0],zn=$n[1],kn=Object(a.useState)([]),jt=Object(p.a)(kn,2),gn=jt[0],Zn=jt[1],ui=Object(a.useState)([!0,!0]),ei=Object(p.a)(ui,2),Vn=ei[0],Tn=ei[1],un=Object(a.useState)(0),_n=Object(p.a)(un,2),Ft=_n[0],Wt=_n[1],$t=Object(a.useRef)(null);Object(a.useEffect)(function(){qn()},[nn]),Object(a.useEffect)(function(){Qt()},[Rn]),Object(a.useEffect)(function(){Gt(Object(h.a)({},rt)),qn()},[Nt]),Object(a.useEffect)(function(){return window.addEventListener("resize",Mt),Bt(Ft),function(){window.removeEventListener("resize",Mt)}},[Ft]);var Qt=function(){var ai=Object(g.a)(r.a.mark(function fn(){var Nn,jn;return r.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:if(Rn){Un.next=3;break}return Tn([!0,!0]),Un.abrupt("return");case 3:Nn=[!0,!0],jn=gn==null?void 0:gn.findIndex(function(Sr){return Sr.id===Rn}),jn===0&&ct.page===1&&(Nn[0]=!1),(ct.page-1)*ct.limit+(jn+1)===ct.total&&(Nn[1]=!1),Tn(Nn);case 8:case"end":return Un.stop()}},fn)}));return function(){return ai.apply(this,arguments)}}(),Mt=function(){if(Ft){var fn,Nn=window.innerWidth-((fn=$t.current)===null||fn===void 0?void 0:fn.clientWidth);Kn(Nn)}},Gt=function(){var ai=Object(g.a)(r.a.mark(function fn(Nn){var jn,Ri,Un,Sr;return r.a.wrap(function(ji){for(;;)switch(ji.prev=ji.next){case 0:return On(!0),ji.next=3,Object(w.f)(Nt,Nn);case 3:return jn=ji.sent,(jn==null?void 0:jn.status)===0&&(Zn((jn==null||((Ri=jn.data)===null||Ri===void 0)?void 0:Ri.articles)||[]),tn(Object(h.a)(Object(h.a)({},Nn),{},{total:jn==null||((Un=jn.data)===null||Un===void 0)?void 0:Un.articles_count})),Vt(jn==null||((Sr=jn.data)===null||Sr===void 0)?void 0:Sr.articles_count)),On(!1),ji.abrupt("return",jn);case 7:case"end":return ji.stop()}},fn)}));return function(Nn){return ai.apply(this,arguments)}}(),an=function(){(ct==null?void 0:ct.sort_direction)===null?ct.sort_direction="asc":(ct==null?void 0:ct.sort_direction)==="asc"?ct.sort_direction="desc":(ct==null?void 0:ct.sort_direction)==="desc"&&(ct.sort_direction=null),ct.page=1,qn(),tn(Object(h.a)({},ct)),Gt(ct)},ti=function(){ct.page=1,ct.search=ct==null?void 0:ct.save_search,qn(),tn(Object(h.a)({},ct)),Gt(ct)},Ei=function(){var fn,Nn=document.getElementsByClassName("btn-resize");Nn[0].style.visibility="hidden";var jn=window.innerWidth-((fn=$t.current)===null||fn===void 0?void 0:fn.clientWidth);Kn(jn)},Ki=function(){Ei(),Wt(1)},Mi=function(fn){Ei(),zn(fn==null?void 0:fn.id),Wt(3)},Er=function(fn){Ei(),zn(fn==null?void 0:fn.id),Wt(2)},qn=function(){var fn=document.getElementsByClassName("btn-resize");fn[0].style.visibility="visible",Kn(0),Wt(0),zn(null)},xr=function(fn){Wt(3),zn(fn),ct.page=1,tn(Object(h.a)({},ct)),Gt(ct)},Dr=function(fn){Wt(3),zn(fn),tn(Object(h.a)({},ct)),Gt(ct)},Wr=function(fn){tn(Object(h.a)({},ct)),Gt(ct)},Pr=function(){var ai=Object(g.a)(r.a.mark(function fn(Nn){var jn;return r.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:return Un.next=2,Object(w.c)(Nt,{active:Nn==null?void 0:Nn.id});case 2:jn=Un.sent,jn.status===0&&(Gt(ct),oi(Ln+1));case 4:case"end":return Un.stop()}},fn)}));return function(Nn){return ai.apply(this,arguments)}}(),ca=function(){var ai=Object(g.a)(r.a.mark(function fn(Nn){var jn;return r.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:return Un.next=2,Object(w.e)(Nt,{active:Nn==null?void 0:Nn.id});case 2:jn=Un.sent,jn.status===0&&(Gt(ct),oi(Ln+1));case 4:case"end":return Un.stop()}},fn)}));return function(Nn){return ai.apply(this,arguments)}}(),pr=function(){var ai=Object(g.a)(r.a.mark(function fn(Nn){var jn;return r.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:return Un.next=2,Object(w.i)(Nt,{active:Nn==null?void 0:Nn.id});case 2:jn=Un.sent,jn.status===0&&(qn(),Gt(ct));case 4:case"end":return Un.stop()}},fn)}));return function(Nn){return ai.apply(this,arguments)}}(),ta=function(fn){ct.page=fn,tn(Object(h.a)({},ct)),Gt(ct)},Da=function(){var ai=Object(g.a)(r.a.mark(function fn(Nn,jn){var Ri,Un,Sr,Fr,ji,Tr,Ti,$i,wn,vn,Bn;return r.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:if(Ri=gn==null?void 0:gn.findIndex(function(hi){return hi.id===Rn}),console.log(Ri,jn,22),!(jn==="prev")){Sn.next=21;break}if(!(Ri===void 0)){Sn.next=6;break}return M.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Sn.abrupt("return");case 6:if(!(Ri===0)){Sn.next=19;break}if(!(ct.page===1)){Sn.next=10;break}return M.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Sn.abrupt("return");case 10:if(!(ct.page!==1)){Sn.next=17;break}return ct.page=ct.page-1,tn(Object(h.a)({},ct)),Sn.next=15,Gt(ct);case 15:Un=Sn.sent,(Un==null?void 0:Un.status)===0&&(Tr=Un==null||((Sr=Un.data)===null||Sr===void 0)?void 0:Sr.articles[(Un==null||((Fr=Un.data)===null||Fr===void 0||((ji=Fr.articles)===null||ji===void 0))?void 0:ji.length)-1],zn(Tr==null?void 0:Tr.id),console.log(Nn.target,555));case 17:Sn.next=21;break;case 19:Ti=gn[Ri-1],zn(Ti==null?void 0:Ti.id);case 21:if(!(jn==="next")){Sn.next=39;break}if(!(Ri===void 0)){Sn.next=25;break}return M.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Sn.abrupt("return");case 25:if(!((ct.page-1)*ct.limit+(Ri+1)===ct.total)){Sn.next=28;break}return M.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Sn.abrupt("return");case 28:if(!(Ri+1===ct.limit)){Sn.next=37;break}return ct.page=ct.page+1,tn(Object(h.a)({},ct)),Sn.next=33,Gt(ct);case 33:$i=Sn.sent,($i==null?void 0:$i.status)===0&&(vn=$i==null||((wn=$i.data)===null||wn===void 0)?void 0:wn.articles[0],zn(vn==null?void 0:vn.id)),Sn.next=39;break;case 37:Bn=gn[Ri+1],zn(Bn==null?void 0:Bn.id);case 39:case"end":return Sn.stop()}},fn)}));return function(Nn,jn){return ai.apply(this,arguments)}}();return i.a.createElement("div",{className:dt.a.wrap,ref:$t},i.a.createElement("div",{className:dt.a.head},i.a.createElement("div",{className:dt.a.sort,onClick:an},i.a.createElement("span",null,"\u6700\u65B0"),i.a.createElement("aside",null,i.a.createElement(sr.a,{style:{color:(ct==null?void 0:ct.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),i.a.createElement(er.a,{style:{color:(ct==null?void 0:ct.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),i.a.createElement(ne.a.Search,{value:ct.save_search,className:dt.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(fn){ct.save_search=fn.target.value,tn(Object(h.a)({},ct))},onSearch:ti}),i.a.createElement("div",{onClick:Ki,className:dt.a.btn},i.a.createElement("img",{src:qi.a}),"\u5199\u9898\u89E3")),i.a.createElement("div",{className:dt.a.listWarp},i.a.createElement(C.a,{spinning:Mn,className:"mt20"},gn==null?void 0:gn.map(function(ai,fn){var Nn=!0;return fn+1===gn.length&&fn!==0&&(Nn=!1),i.a.createElement(bt,{active:Rn,key:ai.id,data:ai,showLine:Nn,onClick:Mi,onAssist:Pr,onHide:ca})}),(gn==null?void 0:gn.length)===0&&i.a.createElement(Te.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),i.a.createElement(Be.a,{className:dt.a.pagination,showTotal:function(fn){return i.a.createElement("span",{style:{color:"#656F87"}},"\u5171",i.a.createElement("span",{className:"c-light-primary"},fn),"\u6761\u6570\u636E")},total:ct.total,showSizeChanger:!1,current:ct==null?void 0:ct.page,onChange:ta,hideOnSinglePage:!0,showQuickJumper:!0}),Ft>0&&i.a.createElement("div",{className:dt.a.fixedRight,style:{width:xn}},Ft===1&&i.a.createElement(Yn,{identifier:Nt,onClose:qn,onOk:xr}),Ft===2&&i.a.createElement(Yn,{active:Rn,identifier:Nt,onClose:qn,onOk:Dr}),Ft===3&&i.a.createElement(ci,{btnShowStatus:Vn,onArticlesSkip:Da,detailsIndex:Ln,active:Rn,identifier:Nt,onClose:qn,onOk:Wr,onEdit:Er,onAssist:Pr,onDelete:pr})))},ea=zr,tr=I("VEzc"),dr=I.n(tr),Lr=function(ht){var Nt,nn=ht.visible,Vt=ht.onVisible,Bt=ht.value,rt=ht.onChange,mt=ht.setIndex,en={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},ct=Object(a.useState)(en),tn=Object(p.a)(ct,2),Dt=tn[0],on=tn[1],Mn=Object(a.useState)([]),On=Object(p.a)(Mn,2),mn=On[0],Xn=On[1],xn=Object(a.useState)([]),Kn=Object(p.a)(xn,2),Gn=Kn[0],di=Kn[1],Ln=Object(a.useState)(!1),oi=Object(p.a)(Ln,2),li=oi[0],$n=oi[1],Rn=Object(a.useRef)([]),zn=Object(a.useRef)(null),kn=Object(x.i)();Object(a.useEffect)(function(){return kn!=null&&kn.id&&(zn.current=setInterval(function(){jt(30)},3e4)),function(){clearInterval(zn.current)}},[]);var jt=function(){var Ft=Object(g.a)(r.a.mark(function Wt($t){var Qt;return r.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Gt.next=2,Object(w.r)(kn==null?void 0:kn.id,{practice_time:$t});case 2:Qt=Gt.sent;case 3:case"end":return Gt.stop()}},Wt)}));return function($t){return Ft.apply(this,arguments)}}();Object(a.useEffect)(function(){Tn(Dt),ei()},[]),Object(a.useEffect)(function(){return window.addEventListener("click",Zn),function(){window.removeEventListener("click",Zn)}},[kn==null?void 0:kn.save_identifier,nn]),Object(a.useEffect)(function(){var Ft=Rn.current.findIndex(function(Gt){return Gt.identifier===(kn==null?void 0:kn.save_identifier)}),Wt=Rn.current[Ft-1],$t=Rn.current[Ft+1],Qt=document.getElementById("oj-prev"),Mt=document.getElementById("oj-next");Wt?Qt.style.display="block":Qt.style.display="none",$t?Mt.style.display="block":Mt.style.display="none"},[kn==null?void 0:kn.save_identifier,Rn.current]);var gn=function(Wt,$t){if(Wt.id===$t)return Wt;for(var Qt=0,Mt=Wt;Mt=Mt.parentNode;Qt++){if(Mt.id===$t)return Mt;if(Mt==document.documentElement)return!1}},Zn=function(){var Ft=Object(g.a)(r.a.mark(function Wt($t){var Qt,Mt,Gt;return r.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:if(!gn($t.target,"oj-drawer")&&nn&&Vt(!1),Qt=Rn.current.findIndex(function(Ei){return Ei.identifier===(kn==null?void 0:kn.save_identifier)}),Mt=Rn.current[Qt-1],Gt=Rn.current[Qt+1],!($t.target.id==="oj-prev")){ti.next=14;break}if(!(!Mt||Qt===-1)){ti.next=8;break}return M.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),ti.abrupt("return");case 8:return $t.target.style.pointerEvents="none",$t.target.style.cursor="not-allowed",ti.next=12,un(Mt==null?void 0:Mt.identifier);case 12:mt("0"),setTimeout(function(){$t.target.style.pointerEvents="auto",$t.target.style.cursor="pointer"},400);case 14:if(!($t.target.id==="oj-next"||$t.target.id==="oj-modal-next")){ti.next=24;break}if(!(!Gt||Qt===-1)){ti.next=18;break}return M.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),ti.abrupt("return");case 18:return $t.target.style.pointerEvents="none",$t.target.style.cursor="not-allowed",ti.next=22,un(Gt==null?void 0:Gt.identifier);case 22:mt("0"),setTimeout(function(){$t.target.style.pointerEvents="auto",$t.target.style.cursor="pointer"},400);case 24:case"end":return ti.stop()}},Wt)}));return function($t){return Ft.apply(this,arguments)}}();Object(a.useEffect)(function(){rt(kn==null?void 0:kn.save_identifier);var Ft=Gn.findIndex(function(Wt){return Wt.some(function($t){return $t.identifier===(kn==null?void 0:kn.save_identifier)})});Ft===-1?on(Object(h.a)(Object(h.a)({},Dt),{},{page:1})):on(Object(h.a)(Object(h.a)({},Dt),{},{page:Ft+1}))},[kn==null?void 0:kn.save_identifier,Gn]);var ui=function(Wt){Dt.page=1,Dt.tag_discipline_id=Wt,on(Object(h.a)({},Dt)),Tn(Dt)},ei=function(){var Ft=Object(g.a)(r.a.mark(function Wt(){var $t;return r.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Mt.next=2,Object(me.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:$t=Mt.sent,Xn($t.tag_disciplines||[]);case 4:case"end":return Mt.stop()}},Wt)}));return function(){return Ft.apply(this,arguments)}}(),Vn=function(Wt){Dt.page=1,Dt.difficulty=typeof Wt=="number"?Wt:null,on(Object(h.a)({},Dt)),Tn(Dt)},Tn=function(){var Ft=Object(g.a)(r.a.mark(function Wt($t){var Qt,Mt,Gt,an,ti,Ei;return r.a.wrap(function(Mi){for(;;)switch(Mi.prev=Mi.next){case 0:return $n(!0),Mi.next=3,Object(w.p)($t);case 3:if(Qt=Mi.sent,Qt!=null&&Qt.practices_list){for(Gt=Qt==null||((Mt=Qt.practices_list)===null||Mt===void 0)?void 0:Mt.length,an=[],ti=0;ti<Gt;ti+=Dt==null?void 0:Dt.per_page)an.push(Qt==null||((Ei=Qt.practices_list)===null||Ei===void 0)?void 0:Ei.slice(ti,ti+(Dt==null?void 0:Dt.per_page)));on(Object(h.a)(Object(h.a)({},Dt),{},{total:Qt==null?void 0:Qt.practices_count})),Rn.current=(Qt==null?void 0:Qt.practices_list)||[],di(an)}$n(!1);case 6:case"end":return Mi.stop()}},Wt)}));return function($t){return Ft.apply(this,arguments)}}(),un=function(){var Ft=Object(g.a)(r.a.mark(function Wt($t,Qt){var Mt;return r.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,Object(me.a)("/api/practices/".concat($t,"/start"),{method:"get"});case 2:Mt=an.sent,(Mt==null?void 0:Mt.status)===0&&T.d.push("/problems/".concat(Mt==null?void 0:Mt.identifier,"/oj/").concat($t));case 4:case"end":return an.stop()}},Wt)}));return function($t,Qt){return Ft.apply(this,arguments)}}(),_n=function(Wt){Dt.page=Wt,on(Object(h.a)({},Dt))};return i.a.createElement("div",{className:dr.a.wrap,id:"oj-drawer",style:{left:nn?0:-700}},i.a.createElement("div",{className:dr.a.head},i.a.createElement("div",{className:dr.a.title},"\u9898\u76EE\u5217\u8868"),i.a.createElement(ne.a.Search,{value:Dt==null?void 0:Dt.save_search,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22",style:{width:178,marginLeft:"auto",marginRight:10},onChange:function(Wt){Dt.save_search=Wt.target.value,on(Object(h.a)({},Dt))},onSearch:function(){Dt.page=1,Dt.search=Dt.save_search,on(Object(h.a)({},Dt)),Tn(Dt)}}),i.a.createElement(X.a,{value:Dt==null?void 0:Dt.tag_discipline_id,style:{width:210},mode:"multiple",placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,showArrow:!0,getPopupContainer:function(Wt){return Wt.parentNode},maxTagTextLength:2,maxTagCount:2,onChange:ui},mn.map(function(Ft){return i.a.createElement(X.a.Option,{key:Ft.id,value:Ft.id},Ft.name)})),i.a.createElement(X.a,{style:{width:70,marginLeft:10},allowClear:!0,placeholder:"\u96BE\u5EA6",getPopupContainer:function(Wt){return Wt.parentNode},value:Dt==null?void 0:Dt.difficulty,onChange:Vn},i.a.createElement(X.a.Option,{value:1},"\u7B80\u5355"),i.a.createElement(X.a.Option,{value:2},"\u9002\u4E2D"),i.a.createElement(X.a.Option,{value:3},"\u56F0\u96BE"))),i.a.createElement("div",{className:dr.a.content},i.a.createElement(C.a,{spinning:li},Gn==null||((Nt=Gn[Dt.page-1])===null||Nt===void 0)?void 0:Nt.map(function(Ft){return i.a.createElement("div",{key:Ft.identifier,className:dr.a.list,onClick:function($t){return un(Ft.identifier,$t)}},i.a.createElement("i",{style:{visibility:Bt===Ft.identifier?"visible":"hidden"},className:"iconfont icon-wancheng1 c-green-29b"}),i.a.createElement("span",{style:{fontWeight:Bt===Ft.identifier?"bold":400,color:Bt===Ft.identifier?"#ffffff":"#bac4cd"},title:Ft==null?void 0:Ft.name},Ft.name),(Ft==null?void 0:Ft.difficulty)===1&&i.a.createElement("b",{style:{color:"#2FA34F"}},"\u7B80\u5355"),(Ft==null?void 0:Ft.difficulty)===2&&i.a.createElement("b",{style:{color:"#0152d9"}},"\u9002\u4E2D"),(Ft==null?void 0:Ft.difficulty)===3&&i.a.createElement("b",{style:{color:"#FA6400"}},"\u56F0\u96BE"))}))),i.a.createElement("div",{className:dr.a.footer},i.a.createElement(Be.a,{showTotal:function(Wt){return i.a.createElement("span",{style:{color:"#656F87"}},"\u5171",i.a.createElement("span",{className:"c-light-primary"},Wt),"\u6761\u6570\u636E")},total:Dt.total,pageSize:Dt==null?void 0:Dt.per_page,current:Dt==null?void 0:Dt.page,showSizeChanger:!1,onChange:_n,showQuickJumper:!0,hideOnSinglePage:!0})))},Br=Lr,Ir=function(Ze){var ht,Nt=Ze.hack,nn=Ze.onTriggerPraise,Vt=Ze.topicId,Bt=Ze.page,rt=Ze.onPageChange,mt=Ze.user,en=Ze.submitRecords,ct=Ze.submitting,tn=Ze.submitResult,Dt=Object(x.h)(),on=Object(a.useState)((Dt==null||((ht=Dt.query)===null||ht===void 0)?void 0:ht.tab)||"0"),Mn=Object(p.a)(on,2),On=Mn[0],mn=Mn[1],Xn=Object(a.useState)(0),xn=Object(p.a)(Xn,2),Kn=xn[0],Gn=xn[1],di=Object(a.useState)(0),Ln=Object(p.a)(di,2),oi=Ln[0],li=Ln[1],$n=Object(a.useState)(0),Rn=Object(p.a)($n,2),zn=Rn[0],kn=Rn[1],jt=Object(a.useState)(),gn=Object(p.a)(jt,2),Zn=gn[0],ui=gn[1],ei=Object(a.useState)(!1),Vn=Object(p.a)(ei,2),Tn=Vn[0],un=Vn[1];function _n(Wt){var $t=Wt.target.id;if(On==="3"&&$t!==On&&(oi===1||oi===2)){D.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:function(){mn($t)}});return}mn($t)}Object(a.useEffect)(function(){var Wt=it.a.subscribe("to-commit-info",function(){mn("1")});return Wt},[]);function Ft(){mn("2")}return i.a.createElement("div",{className:ke.a["left-panel"]},i.a.createElement("ul",{className:"".concat(ke.a["s-navs"]," ").concat(ke.a["bg-white"]," ").concat(ke.a.b1)},i.a.createElement("li",{className:"mr40 current"},i.a.createElement("img",{onClick:function(){return un(!0)},src:fe.a})),i.a.createElement("li",{className:ke.a["oj-mr"]},i.a.createElement("a",{className:On==="0"?ke.a.active:"",id:"0",onClick:_n},"\u4EFB\u52A1\u63CF\u8FF0")),i.a.createElement("li",{className:ke.a["oj-mr"]},i.a.createElement("a",{className:On==="3"?ke.a.active:"",id:"3",onClick:_n},"\u9898\u89E3",zn?"(".concat(zn,")"):"")),i.a.createElement("li",{className:ke.a["oj-mr"]},i.a.createElement("a",{className:On==="2"?ke.a.active:"",id:"2",onClick:_n},"\u8BC4\u8BBA",Kn?"(".concat(Kn,")"):"")),i.a.createElement("li",null,i.a.createElement("a",{className:On==="1"?ke.a.active:"",id:"1",onClick:_n},"\u63D0\u4EA4\u8BB0\u5F55"))),i.a.createElement("div",{className:"".concat(ke.a["tab-panel-body"]," ").concat(On==="0"?"":"hide"),style:{padding:"0 0 0 16px"}},i.a.createElement(Ue,{hack:Nt,onTriggerPraise:nn,toDiscuss:Ft})),i.a.createElement("div",{className:"".concat(ke.a["tab-panel-body"]," ").concat(On==="1"?"":"hide")},en!=null&&en.records_count?i.a.createElement(Re,{page:Bt,onPageChange:rt,topicId:Vt,submitting:ct,submitRecords:en,submitResult:tn}):i.a.createElement(Te.a,null)),i.a.createElement("div",{className:"".concat(ke.a["tab-panel-body"]," ").concat(On==="2"?"":"hide"),style:{padding:0}},i.a.createElement(Lt,{setDiscussTotal:Gn,user:mt,identifier:Nt.identifier,hack:Nt,onTriggerPraise:nn})),i.a.createElement("div",{className:"".concat(ke.a["tab-panel-body"]," ").concat(On==="3"?"":"hide"),style:{padding:0}},i.a.createElement(ea,{setListStatus:li,setFilterListTotal:kn,tabStatus:On,identifier:Nt.identifier})),i.a.createElement(Br,{visible:Tn,setIndex:mn,onVisible:function($t){return un($t)},value:Zn,onChange:function($t){return ui($t)}}))},br=I("+aKw"),Vr=I("oFv4"),hr=I.n(Vr),Xr=I("S/kP"),Yr=I.n(Xr),or=I("t/PP"),Jr=I.n(or),rn=I("LvDl"),yn=I.n(rn),ln=I("P5Jw"),In=o.a.Countdown,Hn={Java:"java",C:"c",Python:"py","C++":"c"},Zt;(function(Ze){Ze[Ze.SET_LOADING=0]="SET_LOADING",Ze[Ze.GET_DATA=1]="GET_DATA",Ze[Ze.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",Ze[Ze.SET_DATA=3]="SET_DATA",Ze[Ze.SET_DEBUGING=4]="SET_DEBUGING",Ze[Ze.SET_SUBMITING=5]="SET_SUBMITING",Ze[Ze.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",Ze[Ze.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",Ze[Ze.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",Ze[Ze.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",Ze[Ze.SET_PAGE=10]="SET_PAGE",Ze[Ze.GET_LANGUAGE=11]="GET_LANGUAGE",Ze[Ze.GET_DRAWER=12]="GET_DRAWER"})(Zt||(Zt={}));function Dn(){return new Date().getTime()}var bi={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:"",languageValue:"",languageList:[],drawerData:[]};function Fi(Ze,ht){switch(ht.type){case Zt.GET_DATA:return Object(h.a)(Object(h.a)({},Ze),ht.payload);case Zt.SET_DATA:return Object(h.a)(Object(h.a)({},Ze),{},{data:ht.payload});case Zt.SET_LOADING:return Object(h.a)(Object(h.a)({},Ze),{},{loading:ht.payload});case Zt.GET_LANGUAGE:return Object(h.a)(Object(h.a)({},Ze),{},{languageList:ht.payload});case Zt.GET_DRAWER:return Object(h.a)(Object(h.a)({},Ze),{},{drawerData:ht.payload});case Zt.SET_SHOW_NOTE:return Object(h.a)(Object(h.a)({},Ze),{},{showNote:ht.payload});case Zt.SET_DEBUGING:return Object(h.a)(Object(h.a)({},Ze),{},{debuging:ht.payload});case Zt.SET_SUBMITING:return Object(h.a)(Object(h.a)({},Ze),{},{submitting:ht.payload});case Zt.GET_SUBMIT_RECORDS:return Object(h.a)(Object(h.a)({},Ze),{},{submitRecords:ht.payload});case Zt.SET_PAGE:return Object(h.a)(Object(h.a)({},Ze),{},{submitRecordPage:ht.payload});case Zt.SET_EXECUTE_MESSAGE:return Object(h.a)(Object(h.a)({},Ze),{},{executingMessage:ht.payload});case Zt.SET_EXECUTE_RESULT:return Object(h.a)(Object(h.a)({},Ze),ht.payload);case Zt.SET_SUBMIT_RESULT:return Object(h.a)(Object(h.a)({},Ze),ht.payload);default:throw new Error}}var Fn=pe.default=function(Ze){var ht,Nt,nn=Ze.children,Vt=Object(a.useReducer)(Fi,bi),Bt=Object(p.a)(Vt,2),rt=Bt[0],mt=Bt[1],en=Object(x.i)(),ct=en.id,tn=Object(x.g)(),Dt=Object(x.h)(),on=rt.languageValue,Mn=rt.languageList,On=rt.loading,mn=rt.data,Xn=rt.debugResult,xn=rt.submitResult,Kn=rt.submitRecords,Gn=rt.submitRecordPage,di=rt.showNote,Ln=rt.debuging,oi=rt.submitting,li=rt.executingMessage,$n=Object(a.useState)("#FFF"),Rn=Object(p.a)($n,2),zn=Rn[0],kn=Rn[1],jt=Object(a.useState)(null),gn=Object(p.a)(jt,2),Zn=gn[0],ui=gn[1],ei=Object(a.useState)({}),Vn=Object(p.a)(ei,2),Tn=Vn[0],un=Vn[1],_n=Object(a.useState)(!1),Ft=Object(p.a)(_n,2),Wt=Ft[0],$t=Ft[1],Qt=Object(a.useRef)(null),Mt=Object(a.useRef)(null),Gt=mn==null?void 0:mn.user,an=mn==null?void 0:mn.hack;Object(a.useEffect)(function(){return Object(T.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),Object(T.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){Object(T.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),Object(T.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}},[]),Object(a.useEffect)(function(){setTimeout(function(){document.title="\u5728\u7EBF\u5237\u9898"},400)}),Object(a.useEffect)(function(){if(Wt){var wn,vn=document.getElementById("oj-next"),Bn=document.getElementById("oj-modal-next");(vn==null||((wn=vn.style)===null||wn===void 0)?void 0:wn.display)==="none"?Bn.style.display="none":Bn.style.display="block"}},[Wt]),Object(a.useEffect)(function(){function wn(){return vn.apply(this,arguments)}function vn(){return vn=Object(g.a)(r.a.mark(function Bn(){var zt,Sn,hi,ki,wi;return r.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return cn.next=2,Object(w.m)(ct);case 2:zt=cn.sent,zt.status===401?document.location.href="/user/login":(zt.hack=zt.practice,zt.hack.code=O.Base64.decode(zt==null||((Sn=zt.hack)===null||Sn===void 0)?void 0:Sn.code),wi="".concat(Gt==null?void 0:Gt.login,"-language"),localStorage.getItem(wi)&&(zt.hack.language=localStorage.getItem(wi)),Mt.current=yn.a.cloneDeep(zt),Mt.current.language=zt==null||((hi=zt.hack)===null||hi===void 0)?void 0:hi.language,mt({type:Zt.GET_DATA,payload:{loading:!1,data:zt}}),mt({type:Zt.SET_SUBMIT_RESULT,payload:{languageValue:zt==null||((ki=zt.hack)===null||ki===void 0)?void 0:ki.language}}));case 4:case"end":return cn.stop()}},Bn)})),vn.apply(this,arguments)}ct&&wn()},[ct]),Object(a.useEffect)(function(){mt({type:Zt.SET_SUBMIT_RESULT,payload:{debugResult:void 0}}),Mi(),$t(!1)},[ct]),Object(a.useEffect)(function(){clearTimeout(Qt.current)},[ct]),Object(a.useEffect)(function(){Ei()},[ct,Gn]);var ti=function(){window.parent.postMessage("backExercise","*")};function Ei(){return Ki.apply(this,arguments)}function Ki(){return Ki=Object(g.a)(r.a.mark(function wn(){var vn;return r.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.prev=0,zt.next=3,Object(w.o)(ct,{limit:15,page:Gn});case 3:vn=zt.sent,mt({type:Zt.GET_SUBMIT_RECORDS,payload:vn}),zt.next=10;break;case 7:zt.prev=7,zt.t0=zt.catch(0),console.log(zt.t0);case 10:case"end":return zt.stop()}},wn,null,[[0,7]])})),Ki.apply(this,arguments)}function Mi(){return Er.apply(this,arguments)}function Er(){return Er=Object(g.a)(r.a.mark(function wn(){var vn;return r.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.prev=0,zt.next=3,Object(w.w)(ct);case 3:vn=zt.sent,mt({type:Zt.GET_LANGUAGE,payload:vn==null?void 0:vn.data}),zt.next=10;break;case 7:zt.prev=7,zt.t0=zt.catch(0),console.log(zt.t0);case 10:case"end":return zt.stop()}},wn,null,[[0,7]])})),Er.apply(this,arguments)}function qn(wn){mt({type:Zt.SET_PAGE,payload:wn})}function xr(wn){return Dr.apply(this,arguments)}function Dr(){return Dr=Object(g.a)(r.a.mark(function wn(vn){var Bn,zt,Sn,hi,ki,wi;return r.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return ki=((Bn=window)===null||Bn===void 0||((zt=Bn.location)===null||zt===void 0||((Sn=zt.pathname)===null||Sn===void 0||((hi=Sn.split("/"))===null||hi===void 0)))?void 0:hi[2])||ct,cn.next=3,Object(w.v)(ki,vn||{code:O.Base64.encode(an.code),language:on});case 3:return wi=cn.sent,cn.abrupt("return",wi);case 5:case"end":return cn.stop()}},wn)})),Dr.apply(this,arguments)}function Wr(){return Pr.apply(this,arguments)}function Pr(){return Pr=Object(g.a)(r.a.mark(function wn(){var vn,Bn,zt,Sn,hi,ki,wi;return r.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:if(!oi){cn.next=2;break}return cn.abrupt("return");case 2:return mt({type:Zt.SET_SUBMITING,payload:!0}),cn.prev=3,it.a.publish("to-commit-info"),cn.next=7,xr();case 7:if(vn=cn.sent,!(vn.status===0)){cn.next=21;break}return wi=function(){return wi=Object(g.a)(r.a.mark(function ya(){var jr,wr,Cr,Qr,Hr,ia;return r.a.wrap(function(Bi){for(;;)switch(Bi.prev=Bi.next){case 0:return Bi.next=2,Object(w.l)(ct,"submit");case 2:if(jr=Bi.sent,wr=jr.status,Cr=jr.data,Qr=Dn(),Hr=Qr-hi>(Sn+3)*1e3,wr!==0&&!Hr&&setTimeout(ki,1e3),!Hr){Bi.next=12;break}return D.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),mt({type:Zt.SET_SUBMITING,payload:!1}),Bi.abrupt("return");case 12:if(!(wr===0)){Bi.next=19;break}return Cr.status===2&&D.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Bi.next=16,Object(w.o)(ct,{limit:15,page:Gn});case 16:ia=Bi.sent,mt({type:Zt.SET_SUBMIT_RESULT,payload:Object(h.a)(Object(h.a)({},rt),{},{submitResult:Cr,submitting:!1,submitRecords:ia})}),(Cr==null?void 0:Cr.status)===0&&$t(!0);case 19:case"end":return Bi.stop()}},ya)})),wi.apply(this,arguments)},ki=function(){return wi.apply(this,arguments)},Bn={},cn.next=14,Object(w.s)(ct,Bn);case 14:if(zt=cn.sent,!(zt.status===-1)){cn.next=18;break}return window.parent.location.href="/classrooms/".concat(Dt.query.coursesId,"/exercise/").concat(Dt.query.exercisesId,"/detail"),cn.abrupt("return");case 18:Sn=an.time_limit,hi=Dn(),ki();case 21:cn.next=26;break;case 23:cn.prev=23,cn.t0=cn.catch(3),mt({type:Zt.SET_SUBMITING,payload:!1});case 26:case"end":return cn.stop()}},wn,null,[[3,23]])})),Pr.apply(this,arguments)}function ca(){return pr.apply(this,arguments)}function pr(){return pr=Object(g.a)(r.a.mark(function wn(){var vn,Bn,zt,Sn,hi,ki,wi;return r.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return rt.debuging=!0,mt({type:Zt.SET_DEBUGING,payload:!0}),cn.prev=2,cn.next=5,xr();case 5:if(vn=cn.sent,!(vn.status===0)){cn.next=21;break}return wi=function(){return wi=Object(g.a)(r.a.mark(function ya(){var jr,wr,Cr,Qr,Hr,ia;return r.a.wrap(function(Bi){for(;;)switch(Bi.prev=Bi.next){case 0:return Bi.next=2,Object(w.l)(ct,"debug");case 2:if(jr=Bi.sent,wr=jr.status,Cr=jr.message,Qr=jr.data,Hr=Dn(),ia=Hr-hi>(Bn+3)*1e3,wr!==0&&!ia&&(mt({type:Zt.SET_EXECUTE_MESSAGE,payload:Cr}),setTimeout(ki,1e3)),!ia){Bi.next=13;break}return D.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),mt({type:Zt.SET_DEBUGING,payload:!1}),Bi.abrupt("return");case 13:wr===0&&(mt({type:Zt.SET_DEBUGING,payload:!1}),Qr.status===2&&D.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),mt({type:Zt.SET_EXECUTE_RESULT,payload:Object(h.a)(Object(h.a)({},rt),{},{debugResult:Qr,debuging:!1})}));case 14:case"end":return Bi.stop()}},ya)})),wi.apply(this,arguments)},ki=function(){return wi.apply(this,arguments)},Bn=an.time_limit,zt={input:encodeURIComponent(mn.test_case.input)},cn.next=13,Object(w.h)(ct,zt);case 13:if(Sn=cn.sent,!(Sn.status===-1)){cn.next=17;break}return window.parent.location.href="/classrooms/".concat(Dt.query.coursesId,"/exercise/").concat(Dt.query.exercisesId,"/detail"),cn.abrupt("return");case 17:hi=Dn(),ki(),cn.next=22;break;case 21:mt({type:Zt.SET_DEBUGING,payload:!1});case 22:cn.next=27;break;case 24:cn.prev=24,cn.t0=cn.catch(2),console.log(cn.t0);case 27:return cn.prev=27,cn.finish(27);case 29:case"end":return cn.stop()}},wn,null,[[2,24,27,29]])})),pr.apply(this,arguments)}function ta(wn){var vn;clearTimeout(Qt.current),Qt.current=setTimeout(function(){var Bn;xr({code:O.Base64.encode(wn),language:Mt==null||((Bn=Mt.current)===null||Bn===void 0)?void 0:Bn.language})},2e3),mt({type:Zt.SET_DATA,payload:Object(h.a)(Object(h.a)({},Mt==null?void 0:Mt.current),{},{hack:Object(h.a)(Object(h.a)({},Mt==null||((vn=Mt.current)===null||vn===void 0)?void 0:vn.hack),{},{code:wn})})})}function Da(wn){var vn=wn.target.value;mt({type:Zt.SET_DATA,payload:Object(h.a)(Object(h.a)({},mn),{},{test_case:{input:vn}})})}var ai=function(){var wn=Object(g.a)(r.a.mark(function vn(Bn){var zt,Sn,hi,ki,wi;return r.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return mt({type:Zt.SET_LOADING,payload:!0}),cn.next=3,xr();case 3:if(zt=cn.sent,!(zt.status===0)){cn.next=14;break}return mt({type:Zt.SET_SUBMIT_RESULT,payload:{languageValue:Bn}}),Mt.current.language=Bn,Sn="".concat(Gt==null?void 0:Gt.login,"-language"),localStorage.setItem(Sn,Bn),cn.next=11,Object(w.w)(ct);case 11:hi=cn.sent,hi.status===0&&(wi=hi==null||((ki=hi.data)===null||ki===void 0)?void 0:ki.find(function(na){return na.language===Bn}),ta(O.Base64.decode(wi.code))),setTimeout(function(){mt({type:Zt.SET_LOADING,payload:!1})},300);case 14:case"end":return cn.stop()}},vn)}));return function(Bn){return wn.apply(this,arguments)}}();function fn(){return Nn.apply(this,arguments)}function Nn(){return Nn=Object(g.a)(r.a.mark(function wn(){var vn;return r.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.prev=0,zt.next=3,Object(w.q)(ct,{language:on});case 3:vn=zt.sent,vn.status===401?tn.replace("/login",{from:Dt.pathname}):(ta(O.Base64.decode(vn.code)),Mi()),zt.next=10;break;case 7:zt.prev=7,zt.t0=zt.catch(0),console.log(zt.t0);case 10:case"end":return zt.stop()}},wn,null,[[0,7]])})),Nn.apply(this,arguments)}function jn(){D.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:i.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",i.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(g.a)(r.a.mark(function vn(){var Bn;return r.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Object(w.t)(ct,{language:on});case 2:Bn=Sn.sent,Bn.status===401?tn.replace("/login",{from:Dt.pathname}):ta(O.Base64.decode(Bn.code));case 4:case"end":return Sn.stop()}},vn)}))()}})}function Ri(){mt({type:Zt.SET_SHOW_NOTE,payload:!0})}function Un(){mt({type:Zt.SET_SHOW_NOTE,payload:!1})}function Sr(wn){return Fr.apply(this,arguments)}function Fr(){return Fr=Object(g.a)(r.a.mark(function wn(vn){return r.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(w.b)(ct,vn);case 2:mt({type:Zt.GET_DATA,payload:{showNote:!1,data:Object(h.a)(Object(h.a)({},mn),{},{hack:Object(h.a)(Object(h.a)({},an),{},{notes:vn.notes})})}});case 3:case"end":return zt.stop()}},wn)})),Fr.apply(this,arguments)}var ji={input:mn==null||((ht=mn.test_case)===null||ht===void 0)?void 0:ht.input,language:an==null?void 0:an.language,code:an==null?void 0:an.code,title:"main."+Hn[an==null?void 0:an.language],modify_code:an==null?void 0:an.modify_code,notes:an==null?void 0:an.notes,debugResult:Xn,debuging:Ln,submitting:oi,executingMessage:li,id:ct,languageValue:on,languageList:Mn,onChangeLanguage:ai,onCancelNote:Un,onAddNote:Sr,showNote:di,onShowNote:Ri,onSubmitCode:Wr,onChangeCode:ta,onChangeInput:Da,onDebugCode:ca,onResetCode:fn,onSyncCode:jn,onUpdateCode:xr};function Tr(){return Ti.apply(this,arguments)}function Ti(){return Ti=Object(g.a)(r.a.mark(function wn(){var vn,Bn,zt;return r.a.wrap(function(hi){for(;;)switch(hi.prev=hi.next){case 0:return hi.next=2,Object(w.u)(an.id,{container_type:"Hack",type:1});case 2:vn=hi.sent,Bn=vn.praise_count,zt=Object(h.a)(Object(h.a)({},mn),{},{hack:Object(h.a)(Object(h.a)({},an),{},{praises_count:Bn,user_praise:!an.user_praise})}),mt({type:Zt.SET_DATA,payload:zt});case 6:case"end":return hi.stop()}},wn)})),Ti.apply(this,arguments)}var $i={topicId:ct,submitResult:xn,submitRecords:Kn,submitting:oi,page:Gn,onPageChange:qn,hack:an,user:mn==null?void 0:mn.user,onTriggerPraise:Tr};return console.log(mn,Mt==null?void 0:Mt.current,"data--------"),i.a.createElement(i.a.Fragment,null,i.a.createElement(C.a,{className:"oj-custom-large-spin",size:"large",spinning:On},mn?i.a.createElement("div",{className:"oj-custom-warp"},i.a.createElement("header",{className:_.a.header,style:{minWidth:1200}},i.a.createElement("div",null,i.a.createElement("img",{src:"".concat(b.a.IMG_SERVER,"/images/").concat(Gt.image_url),alt:"user",width:30}),i.a.createElement("span",null,Gt.name)),i.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},i.a.createElement("div",null,an.name),i.a.createElement(br.a,{onChange:function(vn){},className:"font12 c-grey-999"})),i.a.createElement(ln.CopyToClipboard,{text:"".concat((Nt=window.location)===null||Nt===void 0?void 0:Nt.origin,"/problems/").concat(an.identifier,"/share"),onCopy:function(){return M.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},i.a.createElement("span",{className:_.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",i.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),an.edit_privilege?i.a.createElement(A.a,{className:_.a.btn_back,to:"/problems/".concat(an.identifier,"/ojedit"),style:{marginRight:10}}," ",i.a.createElement(s.a,null)," \u7F16\u8F91"):null,i.a.createElement(A.a,{className:_.a.btn_back,onClick:function(){},to:"/problems"}," ",i.a.createElement(S.a,null),"\u9000\u51FA")),i.a.createElement(v.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:i.a.createElement(Ir,$i),rightChild:i.a.createElement(Qn,ji)})):null),i.a.createElement(D.a,{centered:!0,closable:!1,width:680,footer:null,visible:Wt,className:"oj-modal"},i.a.createElement("section",{className:"oj-modal-content"},i.a.createElement("div",{className:"oj-modal-head"},i.a.createElement("img",{src:hr.a,alt:""}),i.a.createElement("i",{onClick:function(){return $t(!1)},className:"iconfont icon-guanbi1"})),i.a.createElement("aside",null,i.a.createElement("img",{className:"mr30",src:Jr.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",i.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},xn==null?void 0:xn.execute_time,"s"),"\u4F18\u4E8E",i.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(xn==null?void 0:xn.time_better_than)||100,"%"),"\u7684\u7528\u6237"),i.a.createElement("aside",{className:"mb50"},i.a.createElement("img",{src:Yr.a,className:"mr30"}),i.a.createElement("span",{className:"oj-modal-tt"},i.a.createElement("span",null,i.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),i.a.createElement("span",{className:"c-light-primary"},xn==null?void 0:xn.execute_memory,"mb")),i.a.createElement("span",null,i.a.createElement("span",null))),"\u4F18\u4E8E",i.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(xn==null?void 0:xn.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),i.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function fr(Ze){var ht=Ze.languageValue,Nt=Ze.languageList,nn=Ze.onChangeLanguage,Vt=Ze.title,Bt=Ze.modify_code,rt=Ze.onSyncCode,mt=Ze.onShowCodeSetting,en=Ze.onResetCode,ct=Object(x.h)(),tn=function(){D.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:i.a.createElement(m.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:en})};return i.a.createElement("div",{className:"action-bar"},i.a.createElement(X.a,{className:"oj-select",value:ht,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:nn},Nt==null?void 0:Nt.map(function(Dt){return i.a.createElement(X.a.Option,{key:Dt.language,value:Dt.language},Dt.language)})),i.a.createElement("span",null),i.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:tn},i.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),i.a.createElement("a",{onClick:mt},i.a.createElement("i",{className:"iconfont icon-shezhi"})))}function Qn(Ze){var ht=Ze.id,Nt=Ze.input,nn=Ze.showNote,Vt=Ze.onShowNote,Bt=Ze.notes,rt=Ze.onCancelNote,mt=Ze.onAddNote,en=Ze.debugResult,ct=Ze.language,tn=Ze.debuging,Dt=Ze.submitting,on=Ze.executingMessage,Mn=Ze.code,On=Ze.onSubmitCode,mn=Ze.onDebugCode,Xn=Ze.onChangeCode,xn=Ze.onChangeInput,Kn=Ze.onUpdateCode,Gn=Object(z.a)(Ze,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function di(oi){return i.a.createElement(fr,Object(J.a)({},Gn,{onShowCodeSetting:oi}))}var Ln={id:ht,input:Nt,debugResult:en,debuging:tn,submitting:Dt,executingMessage:on,onDebugCode:mn,onChangeCode:Xn,onSubmitCode:On,onChangeInput:xn};return i.a.createElement("div",{className:"right-panel"},i.a.createElement(f.a,{language:ct,value:Mn,onChange:Xn,ActionBarRender:di}),i.a.createElement("div",{className:"note-form-area ".concat(nn?"active":"")},i.a.createElement(De,{onCancel:rt,notes:Bt,callback:mt})),i.a.createElement(F.b,Ln))}},WaYH:function(He,pe,I){"use strict";var J=I("rePB"),z=I("Ff2n"),P=I("VTBJ"),X=I("1OyB"),N=I("vuIU"),C=I("JX7q"),B=I("Ji7U"),M=I("LK+K"),n=I("q1tI"),D=I("TSYQ"),g=I.n(D),p=I("sboe"),h=I("OZM5"),c=function(A){var w=A.prefixCls,v=A.level,b=A.isStart,m=A.isEnd;if(!v)return null;for(var f="".concat(w,"-indent-unit"),O=[],E=0;E<v;E+=1){var _;O.push(n.createElement("span",{key:E,className:g()(f,(_={},Object(J.a)(_,"".concat(f,"-start"),b[E+1]),Object(J.a)(_,"".concat(f,"-end"),m[E+1]),Object(J.a)(_,"".concat(f,"-end-first-level"),!E&&m[0]),_))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(w,"-indent")},O)},o=c,d=I("815F"),r="open",a="close",i="---",s=function(T){Object(B.a)(w,T);var A=Object(M.a)(w);function w(){var v;return Object(X.a)(this,w),v=A.apply(this,arguments),v.state={dragNodeHighlight:!1},v.onSelectorClick=function(b){var m=v.props.context.onNodeClick;m(b,Object(d.b)(v.props)),v.isSelectable()?v.onSelect(b):v.onCheck(b)},v.onSelectorDoubleClick=function(b){var m=v.props.context.onNodeDoubleClick;m(b,Object(d.b)(v.props))},v.onSelect=function(b){if(v.isDisabled())return;var m=v.props.context.onNodeSelect;b.preventDefault(),m(b,Object(d.b)(v.props))},v.onCheck=function(b){if(v.isDisabled())return;var m=v.props,f=m.disableCheckbox,O=m.checked,E=v.props.context.onNodeCheck;if(!v.isCheckable()||f)return;b.preventDefault();var _=!O;E(b,Object(d.b)(v.props),_)},v.onMouseEnter=function(b){var m=v.props.context.onNodeMouseEnter;m(b,Object(d.b)(v.props))},v.onMouseLeave=function(b){var m=v.props.context.onNodeMouseLeave;m(b,Object(d.b)(v.props))},v.onContextMenu=function(b){var m=v.props.context.onNodeContextMenu;m(b,Object(d.b)(v.props))},v.onDragStart=function(b){var m=v.props.context.onNodeDragStart;b.stopPropagation(),v.setState({dragNodeHighlight:!0}),m(b,Object(C.a)(v));try{b.dataTransfer.setData("text/plain","")}catch(f){}},v.onDragEnter=function(b){var m=v.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),m(b,Object(C.a)(v))},v.onDragOver=function(b){var m=v.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),m(b,Object(C.a)(v))},v.onDragLeave=function(b){var m=v.props.context.onNodeDragLeave;b.stopPropagation(),m(b,Object(C.a)(v))},v.onDragEnd=function(b){var m=v.props.context.onNodeDragEnd;b.stopPropagation(),v.setState({dragNodeHighlight:!1}),m(b,Object(C.a)(v))},v.onDrop=function(b){var m=v.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),v.setState({dragNodeHighlight:!1}),m(b,Object(C.a)(v))},v.onExpand=function(b){var m=v.props.context.onNodeExpand;m(b,Object(d.b)(v.props))},v.setSelectHandle=function(b){v.selectHandle=b},v.getNodeState=function(){var b=v.props.expanded;return v.isLeaf()?null:b?r:a},v.hasChildren=function(){var b=v.props.eventKey,m=v.props.context.keyEntities,f=m[b]||{},O=f.children;return!!(O||[]).length},v.isLeaf=function(){var b=v.props,m=b.isLeaf,f=b.loaded,O=v.props.context.loadData,E=v.hasChildren();return m===!1?!1:m||!O&&!E||O&&f&&!E},v.isDisabled=function(){var b=v.props.disabled,m=v.props.context.disabled;return!!(m||b)},v.isCheckable=function(){var b=v.props.checkable,m=v.props.context.checkable;return!m||b===!1?!1:m},v.syncLoadData=function(b){var m=b.expanded,f=b.loading,O=b.loaded,E=v.props.context,_=E.loadData,k=E.onNodeLoad;if(f)return;_&&m&&!v.isLeaf()&&(!v.hasChildren()&&!O&&k(Object(d.b)(v.props)))},v.renderSwitcher=function(){var b=v.props,m=b.expanded,f=b.switcherIcon,O=v.props.context,E=O.prefixCls,_=O.switcherIcon,k=f||_;if(v.isLeaf())return n.createElement("span",{className:g()("".concat(E,"-switcher"),"".concat(E,"-switcher-noop"))},typeof k=="function"?k(Object(P.a)(Object(P.a)({},v.props),{},{isLeaf:!0})):k);var F=g()("".concat(E,"-switcher"),"".concat(E,"-switcher_").concat(m?r:a));return n.createElement("span",{onClick:v.onExpand,className:F},typeof k=="function"?k(Object(P.a)(Object(P.a)({},v.props),{},{isLeaf:!1})):k)},v.renderCheckbox=function(){var b=v.props,m=b.checked,f=b.halfChecked,O=b.disableCheckbox,E=v.props.context.prefixCls,_=v.isDisabled(),k=v.isCheckable();if(!k)return null;var F=typeof k!="boolean"?k:null;return n.createElement("span",{className:g()("".concat(E,"-checkbox"),m&&"".concat(E,"-checkbox-checked"),!m&&f&&"".concat(E,"-checkbox-indeterminate"),(_||O)&&"".concat(E,"-checkbox-disabled")),onClick:v.onCheck},F)},v.renderIcon=function(){var b=v.props.loading,m=v.props.context.prefixCls;return n.createElement("span",{className:g()("".concat(m,"-iconEle"),"".concat(m,"-icon__").concat(v.getNodeState()||"docu"),b&&"".concat(m,"-icon_loading"))})},v.renderSelector=function(){var b=v.state.dragNodeHighlight,m=v.props,f=m.title,O=m.selected,E=m.icon,_=m.loading,k=m.data,F=v.props.context,L=F.prefixCls,G=F.showIcon,j=F.icon,R=F.draggable,V=F.loadData,ne=F.titleRender,se=v.isDisabled(),Se="".concat(L,"-node-content-wrapper"),De;if(G){var Ae=E||j;De=Ae?n.createElement("span",{className:g()("".concat(L,"-iconEle"),"".concat(L,"-icon__customize"))},typeof Ae=="function"?Ae(v.props):Ae):v.renderIcon()}else V&&_&&(De=v.renderIcon());var ke;typeof f=="function"?ke=f(k):ne?ke=ne(k):ke=f;var je=n.createElement("span",{className:"".concat(L,"-title")},ke);return n.createElement("span",{ref:v.setSelectHandle,title:typeof f=="string"?f:"",className:g()("".concat(Se),"".concat(Se,"-").concat(v.getNodeState()||"normal"),!se&&(O||b)&&"".concat(L,"-node-selected"),!se&&R&&"draggable"),draggable:!se&&R||void 0,"aria-grabbed":!se&&R||void 0,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,onContextMenu:v.onContextMenu,onClick:v.onSelectorClick,onDoubleClick:v.onSelectorDoubleClick,onDragStart:R?v.onDragStart:void 0},De,je)},v}return Object(N.a)(w,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var b=this.props.selectable,m=this.props.context.selectable;return typeof b=="boolean"?b:m}},{key:"render",value:function(){var b,m=this.props,f=m.eventKey,O=m.className,E=m.style,_=m.dragOver,k=m.dragOverGapTop,F=m.dragOverGapBottom,L=m.isLeaf,G=m.isStart,j=m.isEnd,R=m.expanded,V=m.selected,ne=m.checked,se=m.halfChecked,Se=m.loading,De=m.domRef,Ae=m.active,ke=m.onMouseMove,je=Object(z.a)(m,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Be=this.props.context,we=Be.prefixCls,Z=Be.filterTreeNode,U=Be.draggable,K=Be.keyEntities,ee=this.isDisabled(),oe=Object(h.f)(je),Q=K[f]||{},Ce=Q.level,ze=j[j.length-1];return n.createElement("div",Object.assign({ref:De,className:g()(O,"".concat(we,"-treenode"),(b={},Object(J.a)(b,"".concat(we,"-treenode-disabled"),ee),Object(J.a)(b,"".concat(we,"-treenode-switcher-").concat(R?"open":"close"),!L),Object(J.a)(b,"".concat(we,"-treenode-checkbox-checked"),ne),Object(J.a)(b,"".concat(we,"-treenode-checkbox-indeterminate"),se),Object(J.a)(b,"".concat(we,"-treenode-selected"),V),Object(J.a)(b,"".concat(we,"-treenode-loading"),Se),Object(J.a)(b,"".concat(we,"-treenode-active"),Ae),Object(J.a)(b,"".concat(we,"-treenode-leaf-last"),ze),Object(J.a)(b,"drag-over",!ee&&_),Object(J.a)(b,"drag-over-gap-top",!ee&&k),Object(J.a)(b,"drag-over-gap-bottom",!ee&&F),Object(J.a)(b,"filter-node",Z&&Z(Object(d.b)(this.props))),b)),style:E,onDragEnter:U?this.onDragEnter:void 0,onDragOver:U?this.onDragOver:void 0,onDragLeave:U?this.onDragLeave:void 0,onDrop:U?this.onDrop:void 0,onDragEnd:U?this.onDragEnd:void 0,onMouseMove:ke},oe),n.createElement(o,{prefixCls:we,level:Ce,isStart:G,isEnd:j}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),w}(n.Component),S=function(A){return n.createElement(p.a.Consumer,null,function(w){return n.createElement(s,Object.assign({},A,{context:w}))})};S.displayName="TreeNode",S.defaultProps={title:i},S.isTreeNode=1;var x=pe.a=S},Wtmd:function(He,pe,I){He.exports=I.p+"static/c.03ba6fd6.svg"},Wx9E:function(He,pe,I){},XIdC:function(He,pe,I){"use strict";var J=I("rePB"),z=I("ODXe"),P=I("Ff2n"),X=I("q1tI"),N=I.n(X),C=I("TSYQ"),B=I.n(C),M=I("6cGi"),n=I("4IlW"),D=X.forwardRef(function(g,p){var h,c=g.prefixCls,o=c===void 0?"rc-switch":c,d=g.className,r=g.checked,a=g.defaultChecked,i=g.disabled,s=g.loadingIcon,S=g.checkedChildren,x=g.unCheckedChildren,T=g.onClick,A=g.onChange,w=g.onKeyDown,v=Object(P.a)(g,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),b=Object(M.a)(!1,{value:r,defaultValue:a}),m=Object(z.a)(b,2),f=m[0],O=m[1];function E(L,G){var j=f;return i||(j=L,O(j),A==null||A(j,G)),j}function _(L){L.which===n.a.LEFT?E(!1,L):L.which===n.a.RIGHT&&E(!0,L),w==null||w(L)}function k(L){var G=E(!f,L);T==null||T(G,L)}var F=B()(o,d,(h={},Object(J.a)(h,"".concat(o,"-checked"),f),Object(J.a)(h,"".concat(o,"-disabled"),i),h));return X.createElement("button",Object.assign({},v,{type:"button",role:"switch","aria-checked":f,disabled:i,className:F,ref:p,onKeyDown:_,onClick:k}),s,X.createElement("span",{className:"".concat(o,"-inner")},f?S:x))});D.displayName="Switch",pe.a=D},Y1PL:function(He,pe,I){"use strict";I.r(pe),I.d(pe,"ResizableTextArea",function(){return se});var J=I("wx14"),z=I("1OyB"),P=I("vuIU"),X=I("Ji7U"),N=I("LK+K"),C=I("q1tI"),B=I("VTBJ"),M=I("rePB"),n=I("Zm9Q"),D=I("Kwbf"),g=I("c+Xe"),p=I("m+aA"),h=I("bdgK"),c=new Map;function o(Ae){Ae.forEach(function(ke){var je,Be=ke.target;(je=c.get(Be))===null||je===void 0||je.forEach(function(we){return we(Be)})})}var d=new h.default(o),r=null,a=null;function i(Ae,ke){c.has(Ae)||(c.set(Ae,new Set),d.observe(Ae)),c.get(Ae).add(ke)}function s(Ae,ke){c.has(Ae)&&(c.get(Ae).delete(ke),c.get(Ae).size||(d.unobserve(Ae),c.delete(Ae)))}var S=function(Ae){Object(X.a)(je,Ae);var ke=Object(N.a)(je);function je(){return Object(z.a)(this,je),ke.apply(this,arguments)}return Object(P.a)(je,[{key:"render",value:function(){return this.props.children}}]),je}(C.Component),x=C.createContext(null);function T(Ae){var ke=Ae.children,je=Ae.onBatchResize,Be=C.useRef(0),we=C.useRef([]),Z=C.useContext(x),U=C.useCallback(function(K,ee,oe){Be.current+=1;var Q=Be.current;we.current.push({size:K,element:ee,data:oe}),Promise.resolve().then(function(){Q===Be.current&&(je==null||je(we.current),we.current=[])}),Z==null||Z(K,ee,oe)},[je,Z]);return C.createElement(x.Provider,{value:U},ke)}function A(Ae){var ke=Ae.children,je=Ae.disabled,Be=C.useRef(null),we=C.useRef(null),Z=C.useContext(x),U=C.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),K=C.isValidElement(ke)&&Object(g.c)(ke),ee=K?ke.ref:null,oe=C.useMemo(function(){return Object(g.a)(ee,Be)},[ee,Be]),Q=C.useRef(Ae);Q.current=Ae;var Ce=C.useCallback(function(ze){var nt=Q.current,xe=nt.onResize,Re=nt.data,Te=ze.getBoundingClientRect(),Oe=Te.width,Ke=Te.height,Qe=ze.offsetWidth,st=ze.offsetHeight,ut=Math.floor(Oe),xt=Math.floor(Ke);if(U.current.width!==ut||U.current.height!==xt||U.current.offsetWidth!==Qe||U.current.offsetHeight!==st){var wt={width:ut,height:xt,offsetWidth:Qe,offsetHeight:st};U.current=wt;var Fe=Qe===Math.round(Oe)?Oe:Qe,Ue=st===Math.round(Ke)?Ke:st,it=Object(B.a)(Object(B.a)({},wt),{},{offsetWidth:Fe,offsetHeight:Ue});Z==null||Z(it,ze,Re),xe&&Promise.resolve().then(function(){xe(it,ze)})}},[]);return C.useEffect(function(){var ze=Object(p.a)(Be.current)||Object(p.a)(we.current);return ze&&!je&&i(ze,Ce),function(){return s(ze,Ce)}},[Be.current,je]),C.createElement(S,{ref:we},K?C.cloneElement(ke,{ref:oe}):ke)}var w="rc-observer-key";function v(Ae){var ke=Ae.children,je=Object(n.a)(ke);return je.map(function(Be,we){var Z=(Be==null?void 0:Be.key)||"".concat(w,"-").concat(we);return C.createElement(A,Object(J.a)({},Ae,{key:Z}),Be)})}v.Collection=T;var b=v,m=I("bT9E"),f=I("TSYQ"),O=I.n(f),E=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,_=["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"],k={},F;function L(Ae){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,je=Ae.getAttribute("id")||Ae.getAttribute("data-reactid")||Ae.getAttribute("name");if(ke&&k[je])return k[je];var Be=window.getComputedStyle(Ae),we=Be.getPropertyValue("box-sizing")||Be.getPropertyValue("-moz-box-sizing")||Be.getPropertyValue("-webkit-box-sizing"),Z=parseFloat(Be.getPropertyValue("padding-bottom"))+parseFloat(Be.getPropertyValue("padding-top")),U=parseFloat(Be.getPropertyValue("border-bottom-width"))+parseFloat(Be.getPropertyValue("border-top-width")),K=_.map(function(oe){return"".concat(oe,":").concat(Be.getPropertyValue(oe))}).join(";"),ee={sizingStyle:K,paddingSize:Z,borderSize:U,boxSizing:we};return ke&&je&&(k[je]=ee),ee}function G(Ae){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Be=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),Ae.getAttribute("wrap")?F.setAttribute("wrap",Ae.getAttribute("wrap")):F.removeAttribute("wrap");var we=L(Ae,ke),Z=we.paddingSize,U=we.borderSize,K=we.boxSizing,ee=we.sizingStyle;F.setAttribute("style","".concat(ee,";").concat(E)),F.value=Ae.value||Ae.placeholder||"";var oe=Number.MIN_SAFE_INTEGER,Q=Number.MAX_SAFE_INTEGER,Ce=F.scrollHeight,ze;if(K==="border-box"?Ce+=U:K==="content-box"&&(Ce-=Z),je!==null||Be!==null){F.value=" ";var nt=F.scrollHeight-Z;je!==null&&(oe=nt*je,K==="border-box"&&(oe=oe+Z+U),Ce=Math.max(oe,Ce)),Be!==null&&(Q=nt*Be,K==="border-box"&&(Q=Q+Z+U),ze=Ce>Q?"":"hidden",Ce=Math.min(Q,Ce))}return{height:Ce,minHeight:oe,maxHeight:Q,overflowY:ze,resize:"none"}}var j=I("Gytx"),R=I.n(j),V;(function(Ae){Ae[Ae.NONE=0]="NONE",Ae[Ae.RESIZING=1]="RESIZING",Ae[Ae.RESIZED=2]="RESIZED"})(V||(V={}));var ne=function(Ae){Object(X.a)(je,Ae);var ke=Object(N.a)(je);function je(Be){var we;return Object(z.a)(this,je),we=ke.call(this,Be),we.nextFrameActionId=void 0,we.resizeFrameId=void 0,we.textArea=void 0,we.saveTextArea=function(Z){we.textArea=Z},we.handleResize=function(Z){var U=we.state.resizeStatus,K=we.props,ee=K.autoSize,oe=K.onResize;if(U!==V.NONE)return;typeof oe=="function"&&oe(Z),ee&&we.resizeOnNextFrame()},we.resizeOnNextFrame=function(){cancelAnimationFrame(we.nextFrameActionId),we.nextFrameActionId=requestAnimationFrame(we.resizeTextarea)},we.resizeTextarea=function(){var Z=we.props.autoSize;if(!Z||!we.textArea)return;var U=Z.minRows,K=Z.maxRows,ee=G(we.textArea,!1,U,K);we.setState({textareaStyles:ee,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(we.resizeFrameId),we.resizeFrameId=requestAnimationFrame(function(){we.setState({resizeStatus:V.RESIZED},function(){we.resizeFrameId=requestAnimationFrame(function(){we.setState({resizeStatus:V.NONE}),we.fixFirefoxAutoScroll()})})})})},we.renderTextArea=function(){var Z=we.props,U=Z.prefixCls,K=U===void 0?"rc-textarea":U,ee=Z.autoSize,oe=Z.onResize,Q=Z.className,Ce=Z.disabled,ze=we.state,nt=ze.textareaStyles,xe=ze.resizeStatus,Re=Object(m.a)(we.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Te=O()(K,Q,Object(M.a)({},"".concat(K,"-disabled"),Ce));"value"in Re&&(Re.value=Re.value||"");var Oe=Object(B.a)(Object(B.a)(Object(B.a)({},we.props.style),nt),xe===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return C.createElement(b,{onResize:we.handleResize,disabled:!(ee||oe)},C.createElement("textarea",Object(J.a)({},Re,{className:Te,style:Oe,ref:we.saveTextArea})))},we.state={textareaStyles:{},resizeStatus:V.NONE},we}return Object(P.a)(je,[{key:"componentDidUpdate",value:function(we){(we.value!==this.props.value||!R()(we.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var we=this.textArea.selectionStart,Z=this.textArea.selectionEnd;this.textArea.setSelectionRange(we,Z)}}catch(U){}}},{key:"render",value:function(){return this.renderTextArea()}}]),je}(C.Component),se=ne,Se=function(Ae){Object(X.a)(je,Ae);var ke=Object(N.a)(je);function je(Be){var we;Object(z.a)(this,je),we=ke.call(this,Be),we.resizableTextArea=void 0,we.focus=function(){we.resizableTextArea.textArea.focus()},we.saveTextArea=function(U){we.resizableTextArea=U},we.handleChange=function(U){var K=we.props.onChange;we.setValue(U.target.value,function(){we.resizableTextArea.resizeTextarea()}),K&&K(U)},we.handleKeyDown=function(U){var K=we.props,ee=K.onPressEnter,oe=K.onKeyDown;U.keyCode===13&&ee&&ee(U),oe&&oe(U)};var Z=typeof Be.value=="undefined"||Be.value===null?Be.defaultValue:Be.value;return we.state={value:Z},we}return Object(P.a)(je,[{key:"setValue",value:function(we,Z){"value"in this.props||this.setState({value:we},Z)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return C.createElement(se,Object(J.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(we){return"value"in we?{value:we.value}:null}}]),je}(C.Component),De=pe.default=Se},Z8dc:function(He,pe,I){He.exports={flex_box_center:"flex_box_center___3U5jH",flex_space_between:"flex_space_between___10tgP",flex_box_vertical_center:"flex_box_vertical_center___1e5pu",flex_box_center_end:"flex_box_center_end___WDBuM",flex_box_column:"flex_box_column___3TSEG",listForm:"listForm___264Pu",scroll:"scroll___CK9uS",formWrap:"formWrap___2n6e2",btns:"btns___2wuct",main:"main___1WFqr",mainLoading:"mainLoading___1kJWi",tip:"tip___10JaH",proWarp:"proWarp___TMP84",pro:"pro___1CLLm",mainSucceed:"mainSucceed___3NYgf",del:"del___34rdE"}},ZD9Y:function(He,pe,I){"use strict";var J=I("BoS7"),z=I("Sdc0"),P=I("OaEy"),X=I("2fM7"),N=I("q1tI"),C=I.n(N),B=I("lOMy"),M=I.n(B),n=X.a.Option;pe.a=function(D){var g=D.onFontSizeChange,p=D.cmFontSize,h=D.cmCodeMode,c=D.onCodeModeChange,o=D.onTabToSpace,d=D.className,r=d===void 0?"":d,a=D.tabToSpace,i=D.children;return C.a.createElement("div",{className:"tpi-code-setting ".concat(r)},C.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),C.a.createElement("section",null,C.a.createElement("div",{className:"file-item"},C.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),C.a.createElement(X.a,{bordered:!1,size:"small",value:h,onChange:c},C.a.createElement(n,{value:"vs"},"\u767D\u8272\u80CC\u666F"),C.a.createElement(n,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),C.a.createElement("div",{className:"file-item"},C.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),C.a.createElement(X.a,{bordered:!1,size:"small",value:p,onChange:g},C.a.createElement(n,{value:12},"12px"),C.a.createElement(n,{value:14},"14px"),C.a.createElement(n,{value:16},"16px"),C.a.createElement(n,{value:18},"18px"),C.a.createElement(n,{value:20},"20px"),C.a.createElement(n,{value:22},"22px"))),C.a.createElement("div",{className:"file-item"},C.a.createElement("b",null,"Tab\u8F6C\u6362"),C.a.createElement(z.a,{checked:a,onChange:o}))),C.a.createElement("h3",null,"\u5FEB\u6377\u952E"),C.a.createElement("section",null,C.a.createElement("div",{className:"file-item"},C.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),C.a.createElement("span",null,"Ctrl + S")),C.a.createElement("div",{className:"file-item"},C.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),C.a.createElement("span",null,"F1 / Alt + F1")),C.a.createElement("div",{className:"file-item"},C.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),C.a.createElement("span",null,"Ctrl + ]/[")),C.a.createElement("div",{className:"file-item"},C.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),C.a.createElement("span",null,"Ctrl + Shift + \\")),C.a.createElement("div",{className:"file-item"},C.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),C.a.createElement("span",null,"Home")),C.a.createElement("div",{className:"file-item"},C.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),C.a.createElement("span",null,"End"))),i)}},ZW9T:function(He,pe,I){"use strict";I.d(pe,"a",function(){return j});var J=I("k1fw"),z=I("oBTY"),P=I("miYZ"),X=I("tsqr"),N=I("rAM+"),C=I("tJVT"),B=I("PpiC"),M=I("q1tI"),n=I.n(M),D=I("bdgK"),g=I("9og8"),p=I("WmNS"),h=I.n(p),c={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},o={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},d={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},r={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},a=I("5VLF"),i=I.n(a),s={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},S=function(V,ne){return ne.map(function(se){return{label:se,kind:V.languages.CompletionItemKind.Keyword,insertText:se}})},x=function(V){return Object.keys(s.tables).map(function(ne){return{label:ne,kind:V.languages.CompletionItemKind.Variable,insertText:ne}})},T=function(V,ne){var se=s.tables[V];return se?se.map(function(Se){return{label:Se,kind:ne.languages.CompletionItemKind.Field,insertText:Se}}):[]};function A(R,V,ne,se,Se){var De=V.getWordUntilPosition(ne),Ae={startLineNumber:ne.lineNumber,endLineNumber:ne.lineNumber,startColumn:De.startColumn,endColumn:De.endColumn},ke=se.map(function(je){return{label:je,kind:R.languages.CompletionItemKind.Keyword,insertText:je,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}});return Se.map(function(je){ke.push(Object(J.a)(Object(J.a)({},je),{},{range:Ae}))}),ke}var w=function(R){s.languages.map(function(Se){return R.languages.registerDocumentFormattingEditProvider(Se,{provideDocumentFormattingEdits:function(Ae,ke,je){return Object(g.a)(h.a.mark(function Be(){var we;return h.a.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return we=i()(Ae.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),U.abrupt("return",[{range:Ae.getFullModelRange(),text:we}]);case 2:case"end":return U.stop()}},Be)}))()}}),Se});var V=d.quickKey.map(function(Se){return{label:Se.label,kind:R.languages.CompletionItemKind.Method,insertText:Se.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ne=r.quickKey.map(function(Se){return{label:Se.label,kind:R.languages.CompletionItemKind.Method,insertText:Se.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),se=o.quickKey.map(function(Se){return{label:Se.label,kind:R.languages.CompletionItemKind.Method,insertText:Se.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}});R.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(De,Ae){var ke=De.getWordUntilPosition(Ae),je={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:ke.startColumn,endColumn:ke.endColumn},Be=De.getLineContent(Ae.lineNumber).substring(ke.startColumn-2,ke.endColumn);return{suggestions:[].concat(Object(z.a)(d.keywords.map(function(we){return{label:we,kind:R.languages.CompletionItemKind.Function,documentation:we,insertText:we,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}})),Object(z.a)(d.quickKey.map(function(we){return{label:we.label,kind:R.languages.CompletionItemKind.Function,documentation:we.content,insertText:Be.startsWith("#")?we.content.replace(/#/,""):we.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}})))}}}),R.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(De,Ae){var ke=De.getWordUntilPosition(Ae),je={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:ke.startColumn,endColumn:ke.endColumn};return{suggestions:Object(z.a)(c.keywords.map(function(Be){return{label:Be,kind:R.languages.CompletionItemKind.Function,documentation:Be,insertText:Be,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}}))}}}),R.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(De,Ae){var ke=De.getWordUntilPosition(Ae),je={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:ke.startColumn,endColumn:ke.endColumn},Be=De.getLineContent(Ae.lineNumber).substring(ke.startColumn-2,ke.endColumn);return{suggestions:[].concat(Object(z.a)(o.keywords.map(function(we){return{label:we,kind:R.languages.CompletionItemKind.Function,documentation:we,insertText:we,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}})),Object(z.a)(o.quickKey.map(function(we){return{label:we.label,kind:R.languages.CompletionItemKind.Function,documentation:we.content,insertText:Be.startsWith("#")?we.content.replace(/#/,""):we.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}})))}}}),R.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(De,Ae){var ke=De.getWordUntilPosition(Ae),je={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:ke.startColumn,endColumn:ke.endColumn},Be=De.getLineContent(Ae.lineNumber).substring(ke.startColumn-2,ke.endColumn);return{suggestions:[].concat(Object(z.a)(r.keywords.map(function(we){return{label:we,kind:R.languages.CompletionItemKind.Function,documentation:we,insertText:we,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}})),Object(z.a)(r.quickKey.map(function(we){return{label:we.label,kind:R.languages.CompletionItemKind.Function,documentation:we.content,insertText:Be.startsWith("#")?we.content.replace(/#/,""):we.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}})))}}})},v="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",b=I("fjLI"),m=I("LvDl"),f=I("+ua5");function O(R){return/^\d+$/.test(R)?"".concat(R,"px"):R}function E(){}var _=!1,k={"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 F(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],V=R;if(Array.isArray(R)){for(var ne=0;ne<R.length;ne++){var se=k[R[ne]];if(se)return se}return V[0]}return k[V]||V}var L=null,G=pe.b=function(R){var V=R.width,ne=V===void 0?"100%":V,se=R.height,Se=se===void 0?"100%":se,De=R.value,Ae=R.language,ke=Ae===void 0?"javascript":Ae,je=R.style,Be=je===void 0?{}:je,we=R.options,Z=we===void 0?{}:we,U=R.overrideServices,K=U===void 0?{}:U,ee=R.theme,oe=ee===void 0?"vs-dark":ee,Q=R.onEditBlur,Ce=R.onSave,ze=R.autoHeight,nt=ze===void 0?!1:ze,xe=R.forbidCopy,Re=xe===void 0?!1:xe,Te=R.onChange,Oe=Te===void 0?E:Te,Ke=R.editorDidMount,Qe=Ke===void 0?E:Ke,st=R.onFocus,ut=st===void 0?E:st,xt=R.filename,wt=xt===void 0?"educoder.txt":xt,Fe=R.errorLine,Ue=R.errorContent,it=Ue===void 0?"":Ue,lt=Object(B.a)(R,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),fe=Object(M.useRef)(),ie=Object(M.useRef)({}),re=Object(M.useRef)(),de=Object(M.useRef)(),me=Object(M.useRef)(!1),le=Object(M.useRef)(),he=Object(M.useState)(!1),Ee=Object(C.a)(he,2),ye=Ee[0],Le=Ee[1];function Ne(){var vt;return fe.current&&(vt=new D.default(function(Tt){var Pt=Object(N.a)(Tt),_e;try{for(Pt.s();!(_e=Pt.n()).done;){var ce=_e.value;(ce.target.offsetHeight>0||ce.target.offsetWidth>0)&&ie.current.instance.layout()}}catch(W){Pt.e(W)}finally{Pt.f()}}),vt.observe(fe.current)),vt}function tt(){X.b.warn(decodeURIComponent(v))}var gt=function(){var Tt=ie.current.instance;if(De!=null&&Tt&&ye){var Pt=Tt.getModel();Pt&&De!==Pt.getValue()&&(_=!0,Pt.setValue(De),Tt.layout(),_=!1)}};Object(M.useEffect)(function(){de.current&&clearTimeout(de.current),de.current=setTimeout(function(){gt()},500)},[De,ye,ie.current]),Object(M.useEffect)(function(){if(Fe&&ie.current&&ie.current.instance){var vt=ie.current.instance;vt.changeViewZones(function(Pt){var _e=document.createElement("div");_e.style.padding="10px 20px",_e.style.width="calc(100% - 20px)",_e.className="my-error-line-wrp",_e.innerHTML=it,Pt.addZone({afterLineNumber:Fe||11,heightInLines:3,domNode:_e})});var Tt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};vt.addOverlayWidget(Tt),vt.revealPositionInCenter({lineNumber:20,column:1})}},[Fe,ie.current,ye]);function Ct(){var vt=ie.current.instance;if(vt){var Tt=vt.getSelection(),Pt=ie.current.pastePos||{},_e=new L.Range(Pt.startLineNumber||Tt.endLineNumber,Pt.startColumn||Tt.endColumn,Pt.endLineNumber||Tt.endLineNumber,Pt.endColumn||Tt.endColumn);setTimeout(function(){vt.executeEdits("",[{range:_e,text:""}])},300)}}function Ot(vt){(window.navigator.platform.match("Mac")?vt.metaKey:vt.ctrlKey)&&vt.keyCode==83&&(vt.preventDefault(),Ce())}var St=function(){if(nt&&ie.current.instance){var Tt=ie.current.instance.getContentHeight();et(Tt<Se?Se:Tt)}else et(Se)};function Ye(vt){var Tt=document.createEvent("MouseEvents");Tt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),vt.dispatchEvent(Tt)}function at(vt,Tt){var Pt=window.URL||window.webkitURL||window,_e=new Blob([Tt]),ce=document.createElementNS("http://www.w3.org/1999/xhtml","a");ce.href=Pt.createObjectURL(_e),ce.download=vt,Ye(ce)}Object(M.useEffect)(function(){St()},[St]),Object(M.useEffect)(function(){fe.current&&!ye&&Promise.all([I.e(18),I.e(29)]).then(I.t.bind(null,"M/lh",7)).then(function(vt){try{L=vt,ie.current.instance=L.editor.create(fe.current,{value:De,language:F(ke),theme:oe,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},K);var Tt=ie.current.instance,Pt=b.d._menuItems,_e=Object(z.a)(Pt).find(function(te){return te[0]._debugName=="EditorContext"}),ce=_e[1],W=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Y=function(ve,Pe){var Ge=ve._first;do{var _t,bt,$e=Pe.includes((_t=Ge.element)===null||_t===void 0||((bt=_t.command)===null||bt===void 0)?void 0:bt.id);$e&&ve._remove(Ge)}while(Ge=Ge.next)};if(Qe(Tt,L),setTimeout(function(){St(),ie.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){at(wt||"educoder.txt",Tt.getValue())}}),Tt.getDomNode().addEventListener("input",function(){re.current.autoFormat&&Tt.getAction("editor.action.formatDocument").run()})},500),ie.current.subscription=Tt.onDidChangeModelContent(function(te){me.current?clearTimeout(le.current):(St(),Oe(Tt.getValue(),te)),le.current=setTimeout(function(){me.current=!1},500)}),window.Monaco||w(L,F(ke)),Re&&(Y(ce,W),fe.current.classList.add("noCopyPaste"),Tt.onKeyDown(function(te){var ve=te.keyCode,Pe=te.ctrlKey,Ge=te.metaKey;(ve===33||ve===52)&&(Ge||Pe)&&(tt(),te.preventDefault())})),window.Monaco=L,Q&&Tt.onDidBlurEditorWidget(function(){Q(Tt.getValue())}),ut&&Tt.onDidFocusEditorText(function(){ut(Tt.getValue())}),Re){Tt.addCommand(L.KeyMod.CtrlCmd|L.KeyCode.KEY_V,function(){return tt(),null}),Tt.onDidPaste(function(te){ie.current.pastePos=te});try{window.addEventListener("paste",Ct)}catch(te){}}var $=Ne();return Le(!0),function(){var te=ie.current.instance;te.dispose();var ve=te.getModel();ve&&ve.dispose(),ie.current.subscription&&ie.current.subscription.dispose(),Re&&window.removeEventListener("paste",Ct),$.unobserve(fe.current)}}catch(te){}})},[]),Object(M.useEffect)(function(){var vt=ie.current.instance;if(vt&&ye)return document.addEventListener("keydown",Ot,!1),function(){document.removeEventListener("keydown",Ot)}},[Ce,ye]),Object(M.useEffect)(function(){var vt=ie.current.instance;if(vt&&ye){var Tt=F(ke);L.editor.setModelLanguage(vt.getModel(),Tt),console.log("language:",ke,vt.getModel(),Tt)}},[ke,ye]),Object(M.useEffect)(function(){var vt=ie.current.instance;vt&&ye&&L.editor.setTheme(oe)},[oe,ye]),Object(M.useEffect)(function(){var vt=ie.current.instance;re.current=Z,vt&&ye&&(vt.updateOptions(Object(J.a)({},Z)),setTimeout(function(){vt.getModel().updateOptions(Object(J.a)({},Z))},200))},[JSON.stringify(Z),ye]),Object(M.useEffect)(function(){var vt=ie.current.instance;vt&&ye&&vt.layout()},[ne,Se,ye]);var Ve=Object(M.useState)(O(ne)),be=Object(C.a)(Ve,2),Ie=be[0],ot=be[1],Xe=Object(M.useState)(O(Se)),Rt=Object(C.a)(Xe,2),Lt=Rt[0],et=Rt[1],dt=Object(J.a)(Object(J.a)({},Be),{},{width:Ie,height:Lt});return n.a.createElement("div",{className:"my-monaco-editor",ref:fe,style:dt})};function j(R){var V=R.width,ne=V===void 0?"100%":V,se=R.height,Se=se===void 0?"100%":se,De=R.original,Ae=R.modified,ke=R.language,je=R.options,Be=je===void 0?{}:je,we=Object(M.useRef)(),Z=Object(M.useState)(null),U=Object(C.a)(Z,2),K=U[0],ee=U[1];function oe(nt){var xe;return we.current&&(xe=new D.default(function(Re){var Te=Object(N.a)(Re),Oe;try{for(Te.s();!(Oe=Te.n()).done;){var Ke=Oe.value;(Ke.target.offsetHeight>0||Ke.target.offsetWidth>0)&&nt.layout()}}catch(Qe){Te.e(Qe)}finally{Te.f()}}),xe.observe(we.current)),xe}Object(M.useEffect)(function(){we.current&&Promise.all([I.e(18),I.e(29)]).then(I.t.bind(null,"M/lh",7)).then(function(nt){L=nt;var xe=L.editor.createDiffEditor(we.current,Object(J.a)(Object(J.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Be),{},{wordWrap:!0}));ee(xe);var Re=oe(xe);return function(){xe.dispose();var Te=xe.getModel();Te&&Te.dispose(),Re.unobserve(we.current)}})},[]),Object(M.useEffect)(function(){K&&K.setModel({original:L.editor.createModel(De,ke),modified:L.editor.createModel(Ae,ke)})},[De,Ae,ke,K]);var Q=O(ne),Ce=O(Se),ze={width:Q,height:Ce};return n.a.createElement("div",{className:"my-diff-editor",ref:we,style:ze})}},ZsLC:function(He,pe,I){He.exports={"left-panel":"left-panel___FTwwW","tab-panel-body":"tab-panel-body___2YSOx",b1:"b1___3qx3o","oj-mr":"oj-mr___1GA9N","oj-width-input":"oj-width-input___3GkyP","s-navs":"s-navs___1fGGf","bg-white":"bg-white___1ZAy0",active:"active___39N6D"}},bCnd:function(He,pe,I){"use strict";I.d(pe,"b",function(){return X}),I.d(pe,"a",function(){return N});var J=I("je13"),z=I.n(J),P=!1;function X(C,B){var M=z.a.get("__ec");M||(M={}),M[C]=B,z.a.set("__ec",M)}function N(C,B){var M=z.a.get("__ec");return M?M[C]===void 0?B:M[C]:B}},bT9E:function(He,pe,I){"use strict";I.d(pe,"a",function(){return z});var J=I("VTBJ");function z(P,X){var N=Object(J.a)({},P);return Array.isArray(X)&&X.forEach(function(C){delete N[C]}),N}},bdLU:function(He,pe,I){"use strict";I.d(pe,"a",function(){return J});var J;(function(z){z[z.NOMATCH=-1]="NOMATCH",z[z.OK=0]="OK",z[z.TIMEOUT=2]="TIMEOUT",z[z.PODFAILURE=3]="PODFAILURE",z[z.COMPILEFAILURE=4]="COMPILEFAILURE",z[z.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(J||(J={}))},biw7:function(He,pe,I){"use strict";var J=I("q1tI"),z=I.n(J),P=J.createContext(null);pe.a=P},c5Ni:function(He,pe,I){},cDPC:function(He,pe,I){"use strict";var J=I("tJVT"),z=I("q1tI"),P=I.n(z),X=I("i3hx"),N=I.n(X);pe.a=function(C){var B=C.defaultX,M=B===void 0?"40%":B,n=C.leftChild,D=C.rightChild,g=C.className,p=C.hideResize,h=p===void 0?!1:p,c=Object(z.useState)(M),o=Object(J.a)(c,2),d=o[0],r=o[1],a=Object(z.useRef)();function i(){a.current=!0}Object(z.useEffect)(function(){function x(A){a.current&&r(A.pageX)}function T(){a.current=!1}return window.addEventListener("mousemove",x),window.addEventListener("mouseup",T),function(){window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",T)}},[]);var s=typeof d=="number"&&d!==.01?"".concat(d,"px"):M,S="calc(100% - ".concat(h?"0px":"4px"," - ").concat(s,")");return P.a.createElement("div",{className:"split-panel-container ".concat(g)},P.a.createElement("section",{style:{width:s,display:d===.01?"none":""}},n),P.a.createElement("section",{className:"resize-x-bar",onMouseDown:i},P.a.createElement("a",{className:"btn-resize"},P.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},P.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"})))),P.a.createElement("section",{style:{width:S}},D))}},dejd:function(He,pe,I){},dmUQ:function(He,pe,I){"use strict";var J=I("Ff2n"),z=I("rePB"),P=I("1OyB"),X=I("vuIU"),N=I("Ji7U"),C=I("md7G"),B=I("foSv"),M=I("q1tI"),n=I.n(M),D=I("TSYQ"),g=I.n(D),p=I("4IlW");function h(m,f){var O=Object.keys(m);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(m);f&&(E=E.filter(function(_){return Object.getOwnPropertyDescriptor(m,_).enumerable})),O.push.apply(O,E)}return O}function c(m){for(var f=1;f<arguments.length;f++){var O=arguments[f]!=null?arguments[f]:{};f%2?h(Object(O),!0).forEach(function(E){Object(z.a)(m,E,O[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(O)):h(Object(O)).forEach(function(E){Object.defineProperty(m,E,Object.getOwnPropertyDescriptor(O,E))})}return m}function o(m){var f=d();return function(){var E=Object(B.a)(m),_;if(f){var k=Object(B.a)(this).constructor;_=Reflect.construct(E,arguments,k)}else _=E.apply(this,arguments);return Object(C.a)(this,_)}}function d(){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(m){return!1}}function r(){}function a(m){m.preventDefault()}var i=function(f){return f.replace(/[^\w.-]+/g,"")},s=200,S=600,x=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(f){return f!=null},A=function(f,O){return O===f||typeof O=="number"&&typeof f=="number"&&isNaN(O)&&isNaN(f)},w=function(m){Object(N.a)(O,m);var f=o(O);function O(E){var _;Object(P.a)(this,O),_=f.call(this,E),_.onKeyDown=function(L){var G=_.props,j=G.onKeyDown,R=G.onPressEnter;if(L.keyCode===p.a.UP){var V=_.getRatio(L);_.up(L,V,null),_.stop()}else if(L.keyCode===p.a.DOWN){var ne=_.getRatio(L);_.down(L,ne,null),_.stop()}else L.keyCode===p.a.ENTER&&R&&R(L);if(_.recordCursorPosition(),_.lastKeyCode=L.keyCode,j){for(var se=arguments.length,Se=new Array(se>1?se-1:0),De=1;De<se;De++)Se[De-1]=arguments[De];j.apply(void 0,[L].concat(Se))}},_.onKeyUp=function(L){var G=_.props.onKeyUp;if(_.stop(),_.recordCursorPosition(),G){for(var j=arguments.length,R=new Array(j>1?j-1:0),V=1;V<j;V++)R[V-1]=arguments[V];G.apply(void 0,[L].concat(R))}},_.onChange=function(L){var G=_.props.onChange;_.state.focused&&(_.inputting=!0),_.rawInput=_.props.parser(_.getValueFromEvent(L)),_.setState({inputValue:_.rawInput}),G(_.toNumber(_.rawInput))},_.onMouseUp=function(){var L=_.props.onMouseUp;_.recordCursorPosition(),L&&L.apply(void 0,arguments)},_.onFocus=function(){var L;_.setState({focused:!0}),(L=_.props).onFocus.apply(L,arguments)},_.onBlur=function(){var L=_.props.onBlur;_.inputting=!1,_.setState({focused:!1});var G=_.getCurrentValidValue(_.state.inputValue),j=_.setValue(G,r);if(L){var R=_.input.value,V=_.getInputDisplayValue({focus:!1,value:j});_.input.value=V&&Number(V),L.apply(void 0,arguments),_.input.value=R}},_.getRatio=function(L){var G=1;return L.metaKey||L.ctrlKey?G=.1:L.shiftKey&&(G=10),G},_.getFullNum=function(L){return isNaN(L)?L:/e/i.test(String(L))?Number(L).toFixed(18).replace(/\.?0+$/,""):L},_.getPrecision=function(L){if(T(_.props.precision))return _.props.precision;var G=String(L);if(G.indexOf("e-")>=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var j=0;return G.indexOf(".")>=0&&(j=G.length-G.indexOf(".")-1),j},_.getInputDisplayValue=function(L){var G=L||_.state,j=G.focused,R=G.inputValue,V=G.value,ne;j?ne=R:ne=_.toPrecisionAsStep(V),ne==null&&(ne="");var se=_.formatWrapper(ne);return T(_.props.decimalSeparator)&&(se=se.toString().replace(".",_.props.decimalSeparator)),se},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(L){}},_.restoreByAfter=function(L){if(L===void 0)return!1;var G=_.input.value,j=G.lastIndexOf(L);if(j===-1)return!1;var R=_.cursorBefore.length;return _.lastKeyCode===p.a.DELETE&&_.cursorBefore.charAt(R-1)===L[0]?(_.fixCaret(R,R),!0):j+L.length===G.length?(_.fixCaret(j,j),!0):!1},_.partRestoreByAfter=function(L){return L===void 0?!1:Array.prototype.some.call(L,function(G,j){var R=L.substring(j);return _.restoreByAfter(R)})},_.isNotCompleteNumber=function(L){return isNaN(L)||L===""||L===null||L&&L.toString().indexOf(".")===L.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(L,G,j){_.pressingUpOrDown=!0,_.step("down",L,G,j)},_.up=function(L,G,j){_.pressingUpOrDown=!0,_.step("up",L,G,j)},_.saveInput=function(L){_.input=L};var k=E.value;k===void 0&&(k=E.defaultValue),_.state={focused:E.autoFocus};var F=_.getValidValue(_.toNumber(k));return _.state=c(c({},_.state),{},{inputValue:_.toPrecisionAsStep(F),value:F}),_}return Object(X.a)(O,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var k=this.props,F=k.value,L=k.onChange,G=k.max,j=k.min,R=this.state.focused;if(_){if(!A(_.value,F)||!A(_.max,G)||!A(_.min,j)){var V=R?F:this.getValidValue(F),ne;this.pressingUpOrDown?ne=V:this.inputting?ne=this.rawInput:ne=this.toPrecisionAsStep(V),this.setState({value:V,inputValue:ne})}var se="value"in this.props?F:this.state.value;"max"in this.props&&_.max!==G&&typeof se=="number"&&se>G&&L&&L(G),"min"in this.props&&_.min!==j&&typeof se=="number"&&se<j&&L&&L(j)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Se=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?Se=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(Se=this.cursorStart):Se=this.input.value.length,this.fixCaret(Se,Se)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(De){}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(_){var k=_;return k===""?k="":this.isNotCompleteNumber(parseFloat(k))?k=this.state.value:k=this.getValidValue(k),this.toNumber(k)}},{key:"getValueFromEvent",value:function(_){var k=_.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(k=k.replace(this.props.decimalSeparator,".")),k}},{key:"getValidValue",value:function(_){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,L=parseFloat(_);return isNaN(L)?_:(L<k&&(L=k),L>F&&(L=F),L)}},{key:"setValue",value:function(_,k){var F=this.props.precision,L=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),G=this.state.value,j=G===void 0?null:G,R=this.state.inputValue,V=R===void 0?null:R,ne=typeof L=="number"?L.toFixed(F):"".concat(L),se=L!==j||ne!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},k)):this.setState({value:L,inputValue:this.toPrecisionAsStep(_)},k),se&&this.props.onChange(L),L}},{key:"getMaxPrecision",value:function(_){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,L=F.precision,G=F.step;if(T(L))return L;var j=this.getPrecision(k),R=this.getPrecision(G),V=this.getPrecision(_);return _?Math.max(V,j+R):j+R}},{key:"getPrecisionFactor",value:function(_){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(_,k);return Math.pow(10,F)}},{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(_){return this.props.formatter?this.props.formatter(_):_}},{key:"toPrecisionAsStep",value:function(_){if(this.isNotCompleteNumber(_)||_==="")return _;var k=Math.abs(this.getMaxPrecision(_));return isNaN(k)?_.toString():Number(_).toFixed(k)}},{key:"toNumber",value:function(_){var k=this.props.precision,F=this.state.focused,L=_&&_.length>16&&F;return this.isNotCompleteNumber(_)||L?_:T(k)?Math.round(_*Math.pow(10,k))/Math.pow(10,k):Number(_)}},{key:"upStep",value:function(_,k){var F=this.props.step,L=this.getPrecisionFactor(_,k),G=Math.abs(this.getMaxPrecision(_,k)),j=((L*_+L*F*k)/L).toFixed(G);return this.toNumber(j)}},{key:"downStep",value:function(_,k){var F=this.props.step,L=this.getPrecisionFactor(_,k),G=Math.abs(this.getMaxPrecision(_,k)),j=((L*_-L*F*k)/L).toFixed(G);return this.toNumber(j)}},{key:"step",value:function(_,k){var F=this,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),k&&(k.persist(),k.preventDefault());var j=this.props;if(j.disabled)return;var R=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(R))return;var V=this["".concat(_,"Step")](R,L),ne=V>j.max||V<j.min;if(V>j.max?V=j.max:V<j.min&&(V=j.min),this.setValue(V,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),ne)return;this.autoStepTimer=setTimeout(function(){F[_](k,L,!0)},G?s:S)}},{key:"fixCaret",value:function(_,k){if(_===void 0||k===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,L=this.input.selectionEnd;(_!==F||k!==L)&&this.input.setSelectionRange(_,k)}catch(G){}}},{key:"render",value:function(){var _,k=this.props,F=k.prefixCls,L=k.disabled,G=k.readOnly,j=k.useTouch,R=k.autoComplete,V=k.upHandler,ne=k.downHandler,se=k.className,Se=k.max,De=k.min,Ae=k.style,ke=k.title,je=k.onMouseEnter,Be=k.onMouseLeave,we=k.onMouseOver,Z=k.onMouseOut,U=k.required,K=k.onClick,ee=k.tabIndex,oe=k.type,Q=k.placeholder,Ce=k.id,ze=k.inputMode,nt=k.pattern,xe=k.step,Re=k.maxLength,Te=k.autoFocus,Oe=k.name,Ke=k.onPaste,Qe=k.onInput,st=Object(J.a)(k,["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"]),ut=this.state,xt=ut.value,wt=ut.focused,Fe=g()(F,(_={},Object(z.a)(_,se,!!se),Object(z.a)(_,"".concat(F,"-disabled"),L),Object(z.a)(_,"".concat(F,"-focused"),wt),_)),Ue={};Object.keys(st).forEach(function(ye){(ye.substr(0,5)==="data-"||ye.substr(0,5)==="aria-"||ye==="role")&&(Ue[ye]=st[ye])});var it=!G&&!L,lt=this.getInputDisplayValue(null),fe=(xt||xt===0)&&(isNaN(xt)||Number(xt)>=Se),ie=(xt||xt===0)&&(isNaN(xt)||Number(xt)<=De),re=fe||L||G,de=ie||L||G,me=g()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(z.a)({},"".concat(F,"-handler-up-disabled"),re)),le=g()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(z.a)({},"".concat(F,"-handler-down-disabled"),de)),he=j?{onTouchStart:re?r:this.up,onTouchEnd:this.stop}:{onMouseDown:re?r:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Ee=j?{onTouchStart:de?r:this.down,onTouchEnd:this.stop}:{onMouseDown:de?r:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Fe,style:Ae,title:ke,onMouseEnter:je,onMouseLeave:Be,onMouseOver:we,onMouseOut:Z,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(F,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Increase Value","aria-disabled":re,className:me}),V||n.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:a})),n.a.createElement("span",Object.assign({unselectable:"on"},Ee,{role:"button","aria-label":"Decrease Value","aria-disabled":de,className:le}),ne||n.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:a}))),n.a.createElement("div",{className:"".concat(F,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":De,"aria-valuemax":Se,"aria-valuenow":xt,required:U,type:oe,placeholder:Q,onPaste:Ke,onClick:K,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:ee,autoComplete:R,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:it?this.onKeyDown:r,onKeyUp:it?this.onKeyUp:r,autoFocus:Te,maxLength:Re,readOnly:G,disabled:L,max:Se,min:De,step:xe,name:Oe,title:ke,id:Ce,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(lt),pattern:nt,inputMode:ze,onInput:Qe},Ue))))}}]),O}(n.a.Component);w.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:r,onKeyDown:r,onPressEnter:r,onFocus:r,onBlur:r,parser:i,required:!1,autoComplete:"off"};var v=w,b=pe.a=v},fcSX:function(He,pe,I){"use strict";var J=I("Ff2n"),z=I("1OyB"),P=I("vuIU"),X=I("Ji7U"),N=I("md7G"),C=I("foSv"),B=I("1W/9"),M=I("q1tI"),n=I("rePB"),D=I("JX7q"),g=I("TSYQ"),p=I.n(g),h=I("qx4F"),c=I("4IlW");function o(L){return Array.isArray(L)?L:[L]}var d={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},r=Object.keys(d).filter(function(L){if(typeof document=="undefined")return!1;var G=document.getElementsByTagName("html")[0];return L in(G?G.style:{})})[0],a=d[r];function i(L,G,j,R){L.addEventListener?L.addEventListener(G,j,R):L.attachEvent&&L.attachEvent("on".concat(G),j)}function s(L,G,j,R){L.removeEventListener?L.removeEventListener(G,j,R):L.attachEvent&&L.detachEvent("on".concat(G),j)}function S(L,G){var j=typeof L=="function"?L(G):L;return Array.isArray(j)?j.length===2?j:[j[0],j[1]]:[j]}var x=function(G){return!isNaN(parseFloat(G))&&isFinite(G)},T=!(typeof window!="undefined"&&window.document&&window.document.createElement),A=function L(G,j,R,V){if(!j||j===document||j instanceof Document)return!1;if(j===G.parentNode)return!0;var ne=Math.max(Math.abs(R),Math.abs(V))===Math.abs(V),se=Math.max(Math.abs(R),Math.abs(V))===Math.abs(R),Se=j.scrollHeight-j.clientHeight,De=j.scrollWidth-j.clientWidth,Ae=document.defaultView.getComputedStyle(j),ke=Ae.overflowY==="auto"||Ae.overflowY==="scroll",je=Ae.overflowX==="auto"||Ae.overflowX==="scroll",Be=Se&&ke,we=De&&je;return ne&&(!Be||Be&&(j.scrollTop>=Se&&V<0||j.scrollTop<=0&&V>0))||se&&(!we||we&&(j.scrollLeft>=De&&R<0||j.scrollLeft<=0&&R>0))?L(G,j.parentNode,R,V):!1};function w(L){var G=v();return function(){var R=Object(C.a)(L),V;if(G){var ne=Object(C.a)(this).constructor;V=Reflect.construct(R,arguments,ne)}else V=R.apply(this,arguments);return Object(N.a)(this,V)}}function v(){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(L){return!1}}var b={},m=function(L){Object(X.a)(j,L);var G=w(j);function j(R){var V;return Object(z.a)(this,j),V=G.call(this,R),V.domFocus=function(){V.dom&&V.dom.focus()},V.removeStartHandler=function(ne){if(ne.touches.length>1)return;V.startPos={x:ne.touches[0].clientX,y:ne.touches[0].clientY}},V.removeMoveHandler=function(ne){if(ne.changedTouches.length>1)return;var se=ne.currentTarget,Se=ne.changedTouches[0].clientX-V.startPos.x,De=ne.changedTouches[0].clientY-V.startPos.y;(se===V.maskDom||se===V.handlerDom||se===V.contentDom&&A(se,ne.target,Se,De))&&ne.cancelable&&ne.preventDefault()},V.transitionEnd=function(ne){var se=ne.target;s(se,a,V.transitionEnd),se.style.transition=""},V.onKeyDown=function(ne){if(ne.keyCode===c.a.ESC){var se=V.props.onClose;ne.stopPropagation(),se&&se(ne)}},V.onWrapperTransitionEnd=function(ne){var se=V.props,Se=se.open,De=se.afterVisibleChange;ne.target===V.contentWrapper&&ne.propertyName.match(/transform$/)&&(V.dom.style.transition="",!Se&&V.getCurrentDrawerSome()&&(document.body.style.overflowX="",V.maskDom&&(V.maskDom.style.left="",V.maskDom.style.width="")),De&&De(!!Se))},V.openLevelTransition=function(){var ne=V.props,se=ne.open,Se=ne.width,De=ne.height,Ae=V.getHorizontalBoolAndPlacementName(),ke=Ae.isHorizontal,je=Ae.placementName,Be=V.contentDom?V.contentDom.getBoundingClientRect()[ke?"width":"height"]:0,we=(ke?Se:De)||Be;V.setLevelAndScrolling(se,je,we)},V.setLevelTransform=function(ne,se,Se,De){var Ae=V.props,ke=Ae.placement,je=Ae.levelMove,Be=Ae.duration,we=Ae.ease,Z=Ae.showMask;V.levelDom.forEach(function(U){U.style.transition="transform ".concat(Be," ").concat(we),i(U,a,V.transitionEnd);var K=ne?Se:0;if(je){var ee=S(je,{target:U,open:ne});K=ne?ee[0]:ee[1]||0}var oe=typeof K=="number"?"".concat(K,"px"):K,Q=ke==="left"||ke==="top"?oe:"-".concat(oe);Q=Z&&ke==="right"&&De?"calc(".concat(Q," + ").concat(De,"px)"):Q,U.style.transform=K?"".concat(se,"(").concat(Q,")"):""})},V.setLevelAndScrolling=function(ne,se,Se){var De=V.props.onChange;if(!T){var Ae=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(h.a)(!0):0;V.setLevelTransform(ne,se,Se,Ae),V.toggleScrollingToDrawerAndBody(Ae)}De&&De(ne)},V.toggleScrollingToDrawerAndBody=function(ne){var se=V.props,Se=se.getOpenCount,De=se.getContainer,Ae=se.showMask,ke=se.open,je=De&&De(),Be=Se&&Se();if(je&&je.parentNode===document.body&&Ae){var we=["touchstart"],Z=[document.body,V.maskDom,V.handlerDom,V.contentDom];ke&&document.body.style.overflow!=="hidden"?(ne&&V.addScrollingEffect(ne),Be===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",Z.forEach(function(U,K){if(!U)return;i(U,we[K]||"touchmove",K?V.removeMoveHandler:V.removeStartHandler,V.passive)})):V.getCurrentDrawerSome()&&(Be||(document.body.style.overflow=""),document.body.style.touchAction="",ne&&V.remScrollingEffect(ne),Z.forEach(function(U,K){if(!U)return;s(U,we[K]||"touchmove",K?V.removeMoveHandler:V.removeStartHandler,V.passive)}))}},V.addScrollingEffect=function(ne){var se=V.props,Se=se.placement,De=se.duration,Ae=se.ease,ke=se.getOpenCount,je=se.switchScrollingEffect,Be=ke&&ke();Be===1&&je();var we="width ".concat(De," ").concat(Ae),Z="transform ".concat(De," ").concat(Ae);V.dom.style.transition="none";switch(Se){case"right":V.dom.style.transform="translateX(-".concat(ne,"px)");break;case"top":case"bottom":V.dom.style.width="calc(100% - ".concat(ne,"px)"),V.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(V.timeout),V.timeout=setTimeout(function(){V.dom&&(V.dom.style.transition="".concat(Z,",").concat(we),V.dom.style.width="",V.dom.style.transform="")})},V.remScrollingEffect=function(ne){var se=V.props,Se=se.placement,De=se.duration,Ae=se.ease,ke=se.getOpenCount,je=se.switchScrollingEffect,Be=ke&&ke();Be||je(!0),r&&(document.body.style.overflowX="hidden"),V.dom.style.transition="none";var we,Z="width ".concat(De," ").concat(Ae),U="transform ".concat(De," ").concat(Ae);switch(Se){case"left":{V.dom.style.width="100%",Z="width 0s ".concat(Ae," ").concat(De);break}case"right":{V.dom.style.transform="translateX(".concat(ne,"px)"),V.dom.style.width="100%",Z="width 0s ".concat(Ae," ").concat(De),V.maskDom&&(V.maskDom.style.left="-".concat(ne,"px"),V.maskDom.style.width="calc(100% + ".concat(ne,"px)"));break}case"top":case"bottom":{V.dom.style.width="calc(100% + ".concat(ne,"px)"),V.dom.style.height="100%",V.dom.style.transform="translateZ(0)",we="height 0s ".concat(Ae," ").concat(De);break}default:break}clearTimeout(V.timeout),V.timeout=setTimeout(function(){V.dom&&(V.dom.style.transition="".concat(U,",").concat(we?"".concat(we,","):"").concat(Z),V.dom.style.transform="",V.dom.style.width="",V.dom.style.height="")})},V.getCurrentDrawerSome=function(){return!Object.keys(b).some(function(ne){return b[ne]})},V.getLevelDom=function(ne){var se=ne.level,Se=ne.getContainer;if(T)return;var De=Se&&Se(),Ae=De?De.parentNode:null;if(V.levelDom=[],se==="all"){var ke=Ae?Array.prototype.slice.call(Ae.children):[];ke.forEach(function(je){je.nodeName!=="SCRIPT"&&je.nodeName!=="STYLE"&&je.nodeName!=="LINK"&&je!==De&&V.levelDom.push(je)})}else se&&o(se).forEach(function(je){document.querySelectorAll(je).forEach(function(Be){V.levelDom.push(Be)})})},V.getHorizontalBoolAndPlacementName=function(){var ne=V.props.placement,se=ne==="left"||ne==="right",Se="translate".concat(se?"X":"Y");return{isHorizontal:se,placementName:Se}},V.state={_self:Object(D.a)(V)},V}return Object(P.a)(j,[{key:"componentDidMount",value:function(){var V=this;if(!T){var ne=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return ne=!0,null}}))}catch(ke){}this.passive=ne?{passive:!1}:!1}var se=this.props,Se=se.open,De=se.getContainer,Ae=De&&De();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),Se&&(Ae&&Ae.parentNode===document.body&&(b[this.drawerId]=Se),this.openLevelTransition(),this.forceUpdate(function(){V.domFocus()}))}},{key:"componentDidUpdate",value:function(V){var ne=this.props,se=ne.open,Se=ne.getContainer,De=Se&&Se();se!==V.open&&(se&&this.domFocus(),De&&De.parentNode===document.body&&(b[this.drawerId]=!!se),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var V=this.props,ne=V.getOpenCount,se=V.open,Se=V.switchScrollingEffect,De=typeof ne=="function"&&ne();delete b[this.drawerId],se&&(this.setLevelTransform(!1),document.body.style.touchAction=""),De||(document.body.style.overflow="",Se(!0))}},{key:"render",value:function(){var V,ne=this,se=this.props,Se=se.className,De=se.children,Ae=se.style,ke=se.width,je=se.height,Be=se.defaultOpen,we=se.open,Z=se.prefixCls,U=se.placement,K=se.level,ee=se.levelMove,oe=se.ease,Q=se.duration,Ce=se.getContainer,ze=se.handler,nt=se.onChange,xe=se.afterVisibleChange,Re=se.showMask,Te=se.maskClosable,Oe=se.maskStyle,Ke=se.onClose,Qe=se.onHandleClick,st=se.keyboard,ut=se.getOpenCount,xt=se.switchScrollingEffect,wt=Object(J.a)(se,["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"]),Fe=this.dom?we:!1,Ue=p()(Z,(V={},Object(n.a)(V,"".concat(Z,"-").concat(U),!0),Object(n.a)(V,"".concat(Z,"-open"),Fe),Object(n.a)(V,Se||"",!!Se),Object(n.a)(V,"no-mask",!Re),V)),it=this.getHorizontalBoolAndPlacementName(),lt=it.placementName,fe=U==="left"||U==="top"?"-100%":"100%",ie=Fe?"":"".concat(lt,"(").concat(fe,")"),re=ze&&M.cloneElement(ze,{onClick:function(me){ze.props.onClick&&ze.props.onClick(),Qe&&Qe(me)},ref:function(me){ne.handlerDom=me}});return M.createElement("div",Object.assign({},wt,{tabIndex:-1,className:Ue,style:Ae,ref:function(me){ne.dom=me},onKeyDown:Fe&&st?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Re&&M.createElement("div",{className:"".concat(Z,"-mask"),onClick:Te?Ke:void 0,style:Oe,ref:function(me){ne.maskDom=me}}),M.createElement("div",{className:"".concat(Z,"-content-wrapper"),style:{transform:ie,msTransform:ie,width:x(ke)?"".concat(ke,"px"):ke,height:x(je)?"".concat(je,"px"):je},ref:function(me){ne.contentWrapper=me}},M.createElement("div",{className:"".concat(Z,"-content"),ref:function(me){ne.contentDom=me},onTouchStart:Fe&&Re?this.removeStartHandler:void 0,onTouchMove:Fe&&Re?this.removeMoveHandler:void 0},De),re))}}],[{key:"getDerivedStateFromProps",value:function(V,ne){var se=ne.prevProps,Se=ne._self,De={prevProps:V};if(se!==void 0){var Ae=V.placement,ke=V.level;Ae!==se.placement&&(Se.contentDom=null),ke!==se.level&&Se.getLevelDom(V)}return De}}]),j}(M.Component);m.defaultProps={switchScrollingEffect:function(){}};var f=m;function O(L){var G=E();return function(){var R=Object(C.a)(L),V;if(G){var ne=Object(C.a)(this).constructor;V=Reflect.construct(R,arguments,ne)}else V=R.apply(this,arguments);return Object(N.a)(this,V)}}function E(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(L){return!1}}var _=function(L){Object(X.a)(j,L);var G=O(j);function j(R){var V;Object(z.a)(this,j),V=G.call(this,R),V.onHandleClick=function(se){var Se=V.props,De=Se.onHandleClick,Ae=Se.open;if(De&&De(se),typeof Ae=="undefined"){var ke=V.state.open;V.setState({open:!ke})}},V.onClose=function(se){var Se=V.props,De=Se.onClose,Ae=Se.open;De&&De(se),typeof Ae=="undefined"&&V.setState({open:!1})};var ne=typeof R.open!="undefined"?R.open:!!R.defaultOpen;return V.state={open:ne},"onMaskClick"in R&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),V}return Object(P.a)(j,[{key:"render",value:function(){var V=this,ne=this.props,se=ne.defaultOpen,Se=ne.getContainer,De=ne.wrapperClassName,Ae=ne.forceRender,ke=ne.handler,je=Object(J.a)(ne,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Be=this.state.open;if(!Se)return M.createElement("div",{className:De,ref:function(U){V.dom=U}},M.createElement(f,Object.assign({},je,{open:Be,handler:ke,getContainer:function(){return V.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var we=!!ke||Ae;return M.createElement(B.a,{visible:Be,forceRender:we,getContainer:Se,wrapperClassName:De},function(Z){var U=Z.visible,K=Z.afterClose,ee=Object(J.a)(Z,["visible","afterClose"]);return M.createElement(f,Object.assign({},je,ee,{open:U!==void 0?U:Be,afterVisibleChange:K!==void 0?K:je.afterVisibleChange,handler:ke,onClose:V.onClose,onHandleClick:V.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(V,ne){var se=ne.prevProps,Se={prevProps:V};return typeof se!="undefined"&&V.open!==se.open&&(Se.open=V.open),Se}}]),j}(M.Component);_.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:M.createElement("div",{className:"drawer-handle"},M.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var k=_,F=pe.a=k},fcyK:function(He,pe,I){},fjLI:function(He,pe,I){"use strict";I.d(pe,"f",function(){return h}),I.d(pe,"b",function(){return c}),I.d(pe,"a",function(){return o}),I.d(pe,"d",function(){return d}),I.d(pe,"e",function(){return r}),I.d(pe,"c",function(){return a});var J=I("8HAY"),z=I("Vhoy"),P=I("MI8n"),X=I("JYp7"),N=I("pmY6"),C=I("24hK"),B=I("nnTU"),M=I("T8No"),n=I("Cg/j"),D=I("t9D7"),g=function(i,s,S,x){var T=arguments.length,A=T<3?s:x===null?x=Object.getOwnPropertyDescriptor(s,S):x,w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(i,s,S,x);else for(var v=i.length-1;v>=0;v--)(w=i[v])&&(A=(T<3?w(A):T>3?w(s,S,A):w(s,S))||A);return T>3&&A&&Object.defineProperty(s,S,A),A},p=function(i,s){return function(S,x){s(S,x,i)}};function h(i){return i.command!==void 0}class c{constructor(i){this.id=c._idPool++,this._debugName=i}}c._idPool=0,c.CommandPalette=new c("CommandPalette"),c.EditorContext=new c("EditorContext"),c.SimpleEditorContext=new c("SimpleEditorContext"),c.EditorContextCopy=new c("EditorContextCopy"),c.EditorContextPeek=new c("EditorContextPeek"),c.MenubarEditMenu=new c("MenubarEditMenu"),c.MenubarCopy=new c("MenubarCopy"),c.MenubarGoMenu=new c("MenubarGoMenu"),c.MenubarSelectionMenu=new c("MenubarSelectionMenu"),c.InlineCompletionsActions=new c("InlineCompletionsActions");const o=Object(n.c)("menuService"),d=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===c.CommandPalette}}addCommand(i){return this.addCommands(X.a.single(i))}addCommands(i){for(const s of i)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(N.i)(()=>{let s=!1;for(const S of i)s=this._commands.delete(S.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((s,S)=>i.set(S,s)),i}appendMenuItem(i,s){return this.appendMenuItems(X.a.single({id:i,item:s}))}appendMenuItems(i){const s=new Set,S=new C.a;for(const{id:x,item:T}of i){let A=this._menuItems.get(x);A||(A=new C.a,this._menuItems.set(x,A)),S.push(A.push(T)),s.add(x)}return this._onDidChangeMenu.fire(s),Object(N.i)(()=>{if(S.size>0){for(let x of S)x();this._onDidChangeMenu.fire(s),S.clear()}})}getMenuItems(i){let s;return this._menuItems.has(i)?s=[...this._menuItems.get(i)]:s=[],i===c.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(i){const s=new Set;for(const S of i)h(S)&&(s.add(S.command.id),S.alt&&s.add(S.alt.id));this._commands.forEach((S,x)=>{s.has(x)||i.push({command:S})})}};class r extends J.e{constructor(i,s,S,x){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=s,this._contextKeyService=S,this._options=x}get actions(){const i=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),S=s.getActions(this._options);s.dispose();for(const[,x]of S)x.length>0&&(i.push(...x),i.push(new J.d));return i.length&&i.pop(),i}}let a=class i{constructor(s,S,x,T,A){var w,v;if(this._commandService=A,this.id=s.id,this.label=(x==null?void 0:x.renderShortTitle)&&s.shortTitle?typeof s.shortTitle=="string"?s.shortTitle:s.shortTitle.value:typeof s.title=="string"?s.title:s.title.value,this.tooltip=(v=typeof s.tooltip=="string"?s.tooltip:(w=s.tooltip)===null||w===void 0?void 0:w.value)!==null&&v!==void 0?v:"",this.enabled=!s.precondition||T.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const b=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=T.contextMatchesRules(b.condition),this.checked&&b.tooltip&&(this.tooltip=typeof b.tooltip=="string"?b.tooltip:b.tooltip.value),b.title&&(this.label=typeof b.title=="string"?b.title:b.title.value)}this.item=s,this.alt=S?new i(S,void 0,x,T,A):void 0,this._options=x,D.d.isThemeIcon(s.icon)&&(this.class=z.a.asClassName(s.icon))}dispose(){}run(...s){var S,x;let T=[];return((S=this._options)===null||S===void 0?void 0:S.arg)&&(T=[...T,this._options.arg]),((x=this._options)===null||x===void 0?void 0:x.shouldForwardArgs)&&(T=[...T,...s]),this._commandService.executeCommand(this.id,...T)}};a=g([p(3,M.b),p(4,B.b)],a)},fyJ8:function(He,pe,I){"use strict";var J=I("rePB"),z=I("VTBJ"),P=I("Ff2n"),X=I("U8pU"),N=I("q1tI"),C=I.n(N),B=I("TSYQ"),M=I.n(B),n=I("c+Xe"),D=I("sR1s");function g(d){return d&&Object(X.a)(d)==="object"&&!Array.isArray(d)&&!N.isValidElement(d)}function p(d){return typeof d=="string"?!0:Object(n.c)(d)}function h(d,r){var a,i=d.prefixCls,s=d.className,S=d.record,x=d.index,T=d.dataIndex,A=d.render,w=d.children,v=d.component,b=v===void 0?"td":v,m=d.colSpan,f=d.rowSpan,O=d.fixLeft,E=d.fixRight,_=d.firstFixLeft,k=d.lastFixLeft,F=d.firstFixRight,L=d.lastFixRight,G=d.appendNode,j=d.additionalProps,R=j===void 0?{}:j,V=d.ellipsis,ne=d.align,se=d.rowType,Se=d.isSticky,De="".concat(i,"-cell"),Ae,ke;if(w)ke=w;else{var je=Object(D.b)(S,T);if(ke=je,A){var Be=A(je,S,x);g(Be)?(ke=Be.children,Ae=Be.props):ke=Be}}Object(X.a)(ke)==="object"&&!Array.isArray(ke)&&!N.isValidElement(ke)&&(ke=null),V&&(k||F)&&(ke=N.createElement("span",{className:"".concat(De,"-content")},ke));var we=Ae||{},Z=we.colSpan,U=we.rowSpan,K=we.style,ee=we.className,oe=Object(P.a)(we,["colSpan","rowSpan","style","className"]),Q=Z!==void 0?Z:m,Ce=U!==void 0?U:f;if(Q===0||Ce===0)return null;var ze={},nt=typeof O=="number",xe=typeof E=="number";nt&&(ze.position="sticky",ze.left=O),xe&&(ze.position="sticky",ze.right=E);var Re={};ne&&(Re.textAlign=ne);var Te,Oe=V===!0?{showTitle:!0}:V;Oe&&(Oe.showTitle||se==="header")&&(typeof ke=="string"||typeof ke=="number"?Te=ke.toString():N.isValidElement(ke)&&typeof ke.props.children=="string"&&(Te=ke.props.children));var Ke=Object(z.a)(Object(z.a)(Object(z.a)({title:Te},oe),R),{},{colSpan:Q&&Q!==1?Q:null,rowSpan:Ce&&Ce!==1?Ce:null,className:M()(De,s,(a={},Object(J.a)(a,"".concat(De,"-fix-left"),nt),Object(J.a)(a,"".concat(De,"-fix-left-first"),_),Object(J.a)(a,"".concat(De,"-fix-left-last"),k),Object(J.a)(a,"".concat(De,"-fix-right"),xe),Object(J.a)(a,"".concat(De,"-fix-right-first"),F),Object(J.a)(a,"".concat(De,"-fix-right-last"),L),Object(J.a)(a,"".concat(De,"-ellipsis"),V),Object(J.a)(a,"".concat(De,"-with-append"),G),Object(J.a)(a,"".concat(De,"-fix-sticky"),(nt||xe)&&Se),a),R.className,ee),style:Object(z.a)(Object(z.a)(Object(z.a)(Object(z.a)({},R.style),Re),ze),K),ref:p(b)?r:null});return N.createElement(b,Object.assign({},Ke),G,ke)}var c=N.forwardRef(h);c.displayName="Cell";var o=N.memo(c,function(d,r){return r.shouldCellUpdate?!r.shouldCellUpdate(r.record,d.record):!1});pe.a=o},gRFJ:function(He,pe,I){He.exports=[I("rdUC"),I("ynwM"),I("RELg"),I("DlR+"),I("CrYA"),I("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(He){return He<10?"0"+He:He}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(He){return rx_escapable.lastIndex=0,rx_escapable.test(He)?'"'+He.replace(rx_escapable,function(pe){var I=meta[pe];return typeof I=="string"?I:"\\u"+("0000"+pe.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+He+'"'}function str(He,pe){var I,J,z,P,X=gap,N,C=pe[He];C&&typeof C=="object"&&typeof C.toJSON=="function"&&(C=C.toJSON(He)),typeof rep=="function"&&(C=rep.call(pe,He,C));switch(typeof C){case"string":return quote(C);case"number":return isFinite(C)?String(C):"null";case"boolean":case"null":return String(C);case"object":if(!C)return"null";if(gap+=indent,N=[],Object.prototype.toString.apply(C)==="[object Array]"){for(P=C.length,I=0;I<P;I+=1)N[I]=str(I,C)||"null";return z=N.length===0?"[]":gap?`[
|
|
`+gap+N.join(`,
|
|
`+gap)+`
|
|
`+X+"]":"["+N.join(",")+"]",gap=X,z}if(rep&&typeof rep=="object")for(P=rep.length,I=0;I<P;I+=1)typeof rep[I]=="string"&&(J=rep[I],z=str(J,C),z&&N.push(quote(J)+(gap?": ":":")+z));else for(J in C)Object.prototype.hasOwnProperty.call(C,J)&&(z=str(J,C),z&&N.push(quote(J)+(gap?": ":":")+z));return z=N.length===0?"{}":gap?`{
|
|
`+gap+N.join(`,
|
|
`+gap)+`
|
|
`+X+"}":"{"+N.join(",")+"}",gap=X,z}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(He,pe,I){var J;if(gap="",indent="",typeof I=="number")for(J=0;J<I;J+=1)indent+=" ";else typeof I=="string"&&(indent=I);if(rep=pe,pe&&typeof pe!="function"&&(typeof pe!="object"||typeof pe.length!="number"))throw new Error("JSON.stringify");return str("",{"":He})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(He,pe){var I,J,z=He[pe];if(z&&typeof z=="object")for(I in z)Object.prototype.hasOwnProperty.call(z,I)&&(J=walk(z,I),J!==void 0?z[I]=J:delete z[I]);return reviver.call(He,pe,z)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(He){return"\\u"+("0000"+He.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")})}()},gqXR:function(He,pe,I){He.exports=I.p+"static/g.a5bcde87.svg"},hW8S:function(He,pe,I){"use strict";I.d(pe,"a",function(){return X}),I.d(pe,"c",function(){return N}),I.d(pe,"b",function(){return C});var J=I("VTBJ"),z=I("Ff2n"),P=I("Kwbf"),X="RC_TABLE_INTERNAL_COL_DEFINE";function N(B){var M=B.expandable,n=Object(z.a)(B,["expandable"]);return"expandable"in B?Object(J.a)(Object(J.a)({},n),M):n}function C(B){return Object.keys(B).reduce(function(M,n){return(n.substr(0,5)==="data-"||n.substr(0,5)==="aria-")&&(M[n]=B[n]),M},{})}},hgre:function(He,pe,I){"use strict";var J=I("miYZ"),z=I("tsqr"),P=I("9og8"),X=I("WmNS"),N=I.n(X),C=I("q1tI"),B=I.n(C),M=I("GUcZ"),n=I("ulZh"),D=I.n(n),g=I("xKgJ"),p=I("P5Jw"),h=I.n(p),c=I("bntm"),o=I("4xil"),d=I.n(o);function r(S){if(isNaN(S))return{minutes:"00",seconds:"00"};var x=new Date(S*1e3).toISOString().substr(11,8);return{hour:x.substr(0,2),minutes:x.substr(3,2),seconds:x.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function a(S,x){return S-x}function i(S){S.sort(a);for(var x=0,T=0;T<S.length-1;T++){var A=Math.abs(S[T+1]-S[T]);A<21&&(x+=A)}return x}var s=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;pe.a=Object(C.forwardRef)(function(S,x){var T,A=S.src,w=S.toLog,v=S.videoId,b=S.logWatchHistory,m=S.courseId,f=m===void 0?null:m,O=S.startTime,E=S.handlePause,_=E===void 0?function(){}:E,k=S.handlePlay,F=k===void 0?function(){}:k,L=S.handlePlayEnded,G=L===void 0?function(){}:L,j=S.videoSpeed,R=j===void 0?1:j,V=A==null||((T=A.split("."))===null||T===void 0)?void 0:T.pop(),ne=V==="flv",se=Object(C.useRef)(),Se=Object(C.useRef)(),De=Object(C.useRef)(),Ae=Object(C.useRef)(),ke=Object(C.useRef)(),je=Object(C.useRef)(),Be=Object(C.useRef)(),we=Object(C.useRef)(),Z=Object(C.useRef)(),U=Object(C.useRef)(),K=Object(C.useRef)(),ee=Object(C.useRef)(),oe=Object(C.useRef)(),Q=Object(C.useRef)(),Ce=navigator.userAgent.toLowerCase().match(s),ze=Ce?Ce[0]:"pc",nt=Object(C.useRef)(!1),xe=Object(g.y)(),Re=0,Te=0,Oe=0,Ke=null,Qe=!1,st=20,ut=1,xt=!1,wt=!1,Fe=[];Object(C.useImperativeHandle)(x,function(){return{getLastUpdatedTime:function(){return se.current.currentTime},getDuration:function(){return se.current.duration}}});var Ue=Object(C.useCallback)(function(re){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,me={point:se.current.currentTime};Ke?(me.log_id=Ke,me.watch_duration=i(Fe),me.total_duration=Te):(f?(me.video_id=parseInt(v,10),me.course_id=f):me.video_id=v,me.duration=Re,me.device=ze),de&&(me.ed="1");function le(){return he.apply(this,arguments)}function he(){return he=Object(P.a)(N.a.mark(function Ee(){var ye;return N.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:return xt=!0,Ne.next=3,b(me);case 3:ye=Ne.sent,Ke=ye,xt=!1,re&&re();case 7:case"end":return Ne.stop()}},Ee)})),he.apply(this,arguments)}le()},[v,f]);Object(C.useEffect)(function(){z.b.destroy();var re=null;return M.a.isSupported&&ne&&A&&(A==null?void 0:A.indexOf(".m3u8"))<0?(re=M.a.createPlayer({type:"flv",volume:.8,cors:!0,url:A,muted:!1}),se.current&&(re.attachMediaElement(se.current),re.load())):se.current.setAttribute("src",A),lt(),function(){re&&(re.unload(),re.pause(),re.destroy(),re=null)}},[se,ne,A]);function it(){se.current.paused?(Ae.current.style.display="none",ke.current.style.display="block"):(Ae.current.style.display="block",ke.current.style.display="none")}function lt(){K.current.style.display="none",oe.current.style.display="none",ee.current.style.display="none",se.current.muted||se.current.volume===0?K.current.style.display="block":se.current.volume>0&&se.current.volume<=.5?oe.current.style.display="block":ee.current.style.display="block"}Object(C.useEffect)(function(){var re=document.getElementById("play"),de=document.querySelectorAll(".playback-icons use");function me(){F(),O&&!nt.current&&(se.current.currentTime=O),nt.current=!0,Fe.push(se.current.currentTime),Qe||(Qe=!0,w&&Ue())}function le(){return he.apply(this,arguments)}function he(){return he=Object(P.a)(N.a.mark(function Ve(){return N.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:it(),Fe.push(se.current.currentTime),w&&Ue(function(){Ke=null,Oe=0,Qe=!1,xt=!1,wt=!1,Fe=[],Te=0,ut=1},!0);case 3:case"end":return Ie.stop()}},Ve)})),he.apply(this,arguments)}function Ee(){je.current.value=Math.round(se.current.currentTime),Be.current.value=Math.round(se.current.currentTime)}function ye(){var Ve=r(Math.round(se.current.currentTime));Z.current.innerText="".concat(Ve.hour>0?Ve.hour+":":"").concat(Ve.minutes,":").concat(Ve.seconds),Z.current.setAttribute("datetime","".concat(Ve.hour>0?" "+Ve.hour+" ":"").concat(Ve.minutes,"m ").concat(Ve.seconds,"s"))}function Le(){var Ve=Math.round(se.current.duration);je.current.setAttribute("max",Ve),Be.current.setAttribute("max",Ve);var be=r(Ve);we.current.innerText="".concat(be.hour>0?be.hour+":":"").concat(be.minutes,":").concat(be.seconds),we.current.setAttribute("datetime","".concat(be.hour>0?" "+be.hour+" ":"").concat(be.minutes,"m ").concat(be.seconds,"s"))}function Ne(){var Ve=Math.round(se.current.duration);je.current.setAttribute("max",Ve),Be.current.setAttribute("max",Ve);var be=r(Ve);we.current.innerText="".concat(be.hour>0?be.hour+":":"").concat(be.minutes,":").concat(be.seconds),we.current.setAttribute("datetime","".concat(be.hour>0?" "+be.hour+" ":"").concat(be.minutes,"m ").concat(be.seconds,"s")),Ee(),ye();var Ie=Se.current.getBoundingClientRect(),ot=Ie.width,Xe=Ie.height,Rt=Ie.x,Lt=Ie.y;if(Rt<0||Lt<0||!ot)return;if(!wt){var et=se.current.currentTime,dt=et-Oe;Math.abs(dt)<10?(Te+=Math.abs(dt),Oe=et,xt||Te-ut*st>=0&&(ut++,Fe.push(Oe),w&&Ue())):(Oe=et,w&&Ue())}}function tt(){wt=!0}function gt(){se.current.playing&&Fe.push(se.current.currentTime,Oe),Oe=se.current.currentTime,wt=!1}function Ct(){Re=se.current.duration,Re<=20&&(st=Re/3),se.current.addEventListener("play",me)}function Ot(Ve){Ve.preventDefault(),Object(c.a)()?(se.current.style.width="100%",se.current.style.height="100%"):se.current.style.cssText=""}function St(){_()}function Ye(Ve){var be=Ve.target.dataset.seek?Ve.target.dataset.seek:Ve.target.value;se.current.currentTime=be,Be.current.value=be,je.current.value=be}function at(Ve){var be=Math.round(Ve.offsetX/Ve.target.clientWidth*parseInt(Ve.target.getAttribute("max"),10));je.current.setAttribute("data-seek",be);var Ie=r(be);U.current.textContent="".concat(Ie.hour>0?Ie.hour+":":"").concat(Ie.minutes,":").concat(Ie.seconds);var ot=se.current.getBoundingClientRect();U.current.style.left="".concat(Ve.pageX-ot.left,"px")}return De.current.addEventListener(Object(c.c)(),Ot),se.current.addEventListener("canplay",Ct),se.current.addEventListener("ended",le),se.current.addEventListener("seeking",tt),se.current.addEventListener("seeked",gt),se.current.addEventListener("loadedmetadata",Le),je.current.addEventListener("mousemove",at),je.current.addEventListener("input",Ye),se.current.addEventListener("timeupdate",Ne),se.current.addEventListener("pause",St),se.current.addEventListener("volumechange",lt),function(){se.current.removeEventListener("canplay",Ct),se.current.removeEventListener("play",me),se.current.removeEventListener("ended",le),se.current.removeEventListener("seeking",tt),se.current.removeEventListener("seeked",gt),je.current.removeEventListener("mousemove",at),je.current.removeEventListener("input",Ye),se.current.removeEventListener("timeupdate",Ne),se.current.removeEventListener("pause",St),se.current.removeEventListener("loadedmetadata",Le),se.current.removeEventListener("volumechange",lt),se.current.playing&&(Fe.push(Oe,se.current.currentTime),w&&Ue())}},[se,A]),Object(C.useEffect)(function(){if(se.current.onended=function(){G(se)},se.current.oncontextmenu=function(){return!1},(A==null?void 0:A.indexOf(".m3u8"))>-1){if(se.current.canPlayType("application/vnd.apple.mpegurl"))se.current.src=A;else if(D.a.isSupported()){var re=new D.a;re.loadSource(A),re.attachMedia(se.current)}}},[A]),Object(C.useEffect)(function(){se.current.playbackRate=R},[R]);var fe=function(){se.current.paused||se.current.ended?se.current.play():se.current.pause(),it()};function ie(){se.current.muted=!se.current.muted,se.current.muted?(Q.current.setAttribute("data-volume",volume.value),Q.current.value=0):Q.current.value=Q.current.dataset.volume}return B.a.createElement("div",{style:{position:"relative"},ref:De},B.a.createElement("div",{ref:Se,className:"".concat(d.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(d.a.animate__loop)},xe?xe.login:" "),B.a.createElement("div",{className:d.a.container},B.a.createElement("div",{className:d.a["video-container"],id:"video-container"},B.a.createElement("div",{className:d.a["playback-animation"],id:"playback-animation"},B.a.createElement("svg",{className:d.a["playback-icons"]},B.a.createElement("use",{className:"hidden",href:"#play-icon"}),B.a.createElement("use",{href:"#pause"}))),B.a.createElement("video",{className:d.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:se,autoPlay:!1}),B.a.createElement("div",{className:"".concat(d.a["video-controls"]," "),id:"video-controls"},B.a.createElement("div",{className:d.a["bottom-controls"]},B.a.createElement("div",{className:d.a["left-controls"]},B.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:fe},B.a.createElement("svg",{className:d.a["playback-icons"]},B.a.createElement("use",{ref:ke,href:"#play-icon"}),B.a.createElement("use",{ref:Ae,style:{display:"none"},href:"#pause"}))),B.a.createElement("div",{className:d.a.time},B.a.createElement("time",{id:"time-elapsed",ref:Z},"00:00"),B.a.createElement("span",null," / "),B.a.createElement("time",{id:"duration",ref:we},"00:00"))),B.a.createElement("div",{className:d.a["right-controls"]},B.a.createElement(p.CopyToClipboard,{text:A,onCopy:function(){return z.b.success("\u590D\u5236\u6210\u529F")}},B.a.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},B.a.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),B.a.createElement("div",{className:d.a["volume-controls"]},B.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:d.a["volume-button"],id:"volume-button",onClick:ie},B.a.createElement("i",{ref:K,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),B.a.createElement("i",{ref:oe,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),B.a.createElement("i",{ref:ee,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),B.a.createElement("input",{className:d.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Q,style:{display:"none"},onClick:lt})),B.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:d.a["fullscreen-button"],onClick:function(){Object(c.a)()?Object(c.b)():Object(c.d)(De.current)}},B.a.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),B.a.createElement("div",{className:d.a["video-progress"]},B.a.createElement("progress",{ref:Be,value:"0",min:"0"}),B.a.createElement("input",{className:d.a.seek,ref:je,value:"0",min:"0",type:"range",step:"1"}),B.a.createElement("div",{className:d.a["seek-tooltip"],ref:U,id:"seek-tooltip"},"00:00"))))),B.a.createElement("svg",{style:{display:"none"}},B.a.createElement("defs",null,B.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),B.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),B.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),B.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),B.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),B.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),B.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),B.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},i3hx:function(He,pe,I){},ic2d:function(He,pe,I){"use strict";I.d(pe,"a",function(){return X});var J=I("FWmy"),z=I("746U");class P{constructor(){this.data=new Map}add(N,C){J.a(z.l(N)),J.a(z.k(C)),J.a(!this.data.has(N),"There is already an extension with this id"),this.data.set(N,C)}as(N){return this.data.get(N)||null}}const X=new P},je13:function(He,pe,I){var J=I("5nXd"),z=I("gRFJ"),P=[I("uQRt")];He.exports=J.createStore(z,P)},kSUc:function(He,pe,I){},"kaH+":function(He,pe,I){"use strict";var J=I("+L6B"),z=I("2/Rp"),P=I("tJVT"),X=I("q1tI"),N=I.n(X),C=I("UZu5"),B=I.n(C),M=I("dhSg"),n=I("rLCj"),D=I("dF/Y"),g=I("4i/N");pe.a=function(){var p=Object(X.useState)(""),h=Object(P.a)(p,2),c=h[0],o=h[1],d=Object(X.useState)(0),r=Object(P.a)(d,2),a=r[0],i=r[1],s=Object(X.useRef)("");Object(X.useEffect)(function(){var b=M.a.subscribe("preview-image",function(m){o(m),document.body.style.overflow="hidden"});return b},[]),Object(X.useEffect)(function(){return document.addEventListener("keydown",S),function(){document.removeEventListener("keydown",S)}},[]),Object(X.useEffect)(function(){s.current=c},[c]);function S(b){b.keyCode==27&&s.current&&x()}function x(){document.body.style.overflow="auto",o("")}function T(){i(a+90)}var A=Object(X.useRef)(),w=Object(X.useRef)(),v=function(m){(m.nativeEvent.target===A.current||m.nativeEvent.target===w.current)&&x()};return N.a.createElement(X.Fragment,null,c?N.a.createElement("div",{className:"image-preview-container",ref:A,onClick:v},N.a.createElement("div",{className:"button-group"},N.a.createElement(z.a,{onClick:T},"\u65CB\u8F6C",N.a.createElement(n.a,null)),N.a.createElement(z.a,{href:c},"\u4E0B\u8F7D",N.a.createElement(D.a,null)),N.a.createElement(z.a,{onClick:x},"\u5173\u95ED",N.a.createElement(g.a,null))),N.a.createElement("div",{className:"preview-wrp-group",ref:w},N.a.createElement("img",{className:"image-preview",src:c,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(a,"deg)")}}))):null)}},kovY:function(He,pe,I){He.exports=I.p+"static/e.eabfa286.svg"},lOMy:function(He,pe,I){},lZu9:function(He,pe,I){(function(J){J(I("VrN/"),I("1eCo"),I("8EBN"))})(function(J){"use strict";J.defineMode("markdown",function(z,P){var X=J.getMode(z,"text/html"),N=X.name=="null";function C(j){if(J.findModeByName){var R=J.findModeByName(j);R&&(j=R.mime||R.mimes[0])}var V=J.getMode(z,j);return V.name=="null"?null:V}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var B={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var M in B)B.hasOwnProperty(M)&&P.tokenTypeOverrides[M]&&(B[M]=P.tokenTypeOverrides[M]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,p=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,d=/^\s*\[[^\]]+?\]:.*$/,r=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,a=" ";function i(j,R,V){return R.f=R.inline=V,V(j,R)}function s(j,R,V){return R.f=R.block=V,V(j,R)}function S(j){return!j||!/\S/.test(j.string)}function x(j){if(j.linkTitle=!1,j.linkHref=!1,j.linkText=!1,j.em=!1,j.strong=!1,j.strikethrough=!1,j.quote=0,j.indentedCode=!1,j.f==A){var R=N;if(!R){var V=J.innerMode(X,j.htmlState);R=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}R&&(j.f=m,j.block=T,j.htmlState=null)}return j.trailingSpace=0,j.trailingSpaceNewLine=!1,j.prevLine=j.thisLine,j.thisLine={stream:null},null}function T(j,R){var V=j.column()===R.indentation,ne=S(R.prevLine.stream),se=R.indentedCode,Se=R.prevLine.hr,De=R.list!==!1,Ae=(R.listStack[R.listStack.length-1]||0)+3;R.indentedCode=!1;var ke=R.indentation;if(R.indentationDiff===null&&(R.indentationDiff=R.indentation,De)){for(R.list=null;ke<R.listStack[R.listStack.length-1];)R.listStack.pop(),R.listStack.length?R.indentation=R.listStack[R.listStack.length-1]:R.list=!1;R.list!==!1&&(R.indentationDiff=ke-R.listStack[R.listStack.length-1])}var je=!ne&&!Se&&!R.prevLine.header&&(!De||!se)&&!R.prevLine.fencedCodeEnd,Be=(R.list===!1||Se||ne)&&R.indentation<=Ae&&j.match(n),we=null;if(R.indentationDiff>=4&&(se||R.prevLine.fencedCodeEnd||R.prevLine.header||ne))return j.skipToEnd(),R.indentedCode=!0,B.code;if(j.eatSpace())return null;if(V&&R.indentation<=Ae&&(we=j.match(p))&&we[1].length<=6)return R.quote=0,R.header=we[1].length,R.thisLine.header=!0,P.highlightFormatting&&(R.formatting="header"),R.f=R.inline,v(R);if(R.indentation<=Ae&&j.eat(">"))return R.quote=V?1:R.quote+1,P.highlightFormatting&&(R.formatting="quote"),j.eatSpace(),v(R);if(!Be&&!R.setext&&V&&R.indentation<=Ae&&(we=j.match(D))){var Z=we[1]?"ol":"ul";return R.indentation=ke+j.current().length,R.list=!0,R.quote=0,R.listStack.push(R.indentation),R.em=!1,R.strong=!1,R.code=!1,R.strikethrough=!1,P.taskLists&&j.match(g,!1)&&(R.taskList=!0),R.f=R.inline,P.highlightFormatting&&(R.formatting=["list","list-"+Z]),v(R)}else{if(V&&R.indentation<=Ae&&(we=j.match(o,!0)))return R.quote=0,R.fencedEndRE=new RegExp(we[1]+"+ *$"),R.localMode=P.fencedCodeBlockHighlighting&&C(we[2]||P.fencedCodeBlockDefaultMode),R.localMode&&(R.localState=J.startState(R.localMode)),R.f=R.block=w,P.highlightFormatting&&(R.formatting="code-block"),R.code=-1,v(R);if(R.setext||(!je||!De)&&!R.quote&&R.list===!1&&!R.code&&!Be&&!d.test(j.string)&&(we=j.lookAhead(1))&&(we=we.match(h)))return R.setext?(R.header=R.setext,R.setext=0,j.skipToEnd(),P.highlightFormatting&&(R.formatting="header")):(R.header=we[0].charAt(0)=="="?1:2,R.setext=R.header),R.thisLine.header=!0,R.f=R.inline,v(R);if(Be)return j.skipToEnd(),R.hr=!0,R.thisLine.hr=!0,B.hr;if(j.peek()==="[")return i(j,R,k)}return i(j,R,R.inline)}function A(j,R){var V=X.token(j,R.htmlState);if(!N){var ne=J.innerMode(X,R.htmlState);(ne.mode.name=="xml"&&ne.state.tagStart===null&&!ne.state.context&&ne.state.tokenize.isInText||R.md_inside&&j.current().indexOf(">")>-1)&&(R.f=m,R.block=T,R.htmlState=null)}return V}function w(j,R){var V=R.listStack[R.listStack.length-1]||0,ne=R.indentation<V,se=V+3;if(R.fencedEndRE&&R.indentation<=se&&(ne||j.match(R.fencedEndRE))){P.highlightFormatting&&(R.formatting="code-block");var Se;return ne||(Se=v(R)),R.localMode=R.localState=null,R.block=T,R.f=m,R.fencedEndRE=null,R.code=0,R.thisLine.fencedCodeEnd=!0,ne?s(j,R,R.block):Se}else return R.localMode?R.localMode.token(j,R.localState):(j.skipToEnd(),B.code)}function v(j){var R=[];if(j.formatting){R.push(B.formatting),typeof j.formatting=="string"&&(j.formatting=[j.formatting]);for(var V=0;V<j.formatting.length;V++)R.push(B.formatting+"-"+j.formatting[V]),j.formatting[V]==="header"&&R.push(B.formatting+"-"+j.formatting[V]+"-"+j.header),j.formatting[V]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=j.quote?R.push(B.formatting+"-"+j.formatting[V]+"-"+j.quote):R.push("error"))}if(j.taskOpen)return R.push("meta"),R.length?R.join(" "):null;if(j.taskClosed)return R.push("property"),R.length?R.join(" "):null;if(j.linkHref?R.push(B.linkHref,"url"):(j.strong&&R.push(B.strong),j.em&&R.push(B.em),j.strikethrough&&R.push(B.strikethrough),j.emoji&&R.push(B.emoji),j.linkText&&R.push(B.linkText),j.code&&R.push(B.code),j.image&&R.push(B.image),j.imageAltText&&R.push(B.imageAltText,"link"),j.imageMarker&&R.push(B.imageMarker)),j.header&&R.push(B.header,B.header+"-"+j.header),j.quote&&(R.push(B.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=j.quote?R.push(B.quote+"-"+j.quote):R.push(B.quote+"-"+P.maxBlockquoteDepth)),j.list!==!1){var ne=(j.listStack.length-1)%3;ne?ne===1?R.push(B.list2):R.push(B.list3):R.push(B.list1)}return j.trailingSpaceNewLine?R.push("trailing-space-new-line"):j.trailingSpace&&R.push("trailing-space-"+(j.trailingSpace%2?"a":"b")),R.length?R.join(" "):null}function b(j,R){return j.match(c,!0)?v(R):void 0}function m(j,R){var V=R.text(j,R);if(typeof V!="undefined")return V;if(R.list)return R.list=null,v(R);if(R.taskList){var ne=j.match(g,!0)[1]===" ";return ne?R.taskOpen=!0:R.taskClosed=!0,P.highlightFormatting&&(R.formatting="task"),R.taskList=!1,v(R)}if(R.taskOpen=!1,R.taskClosed=!1,R.header&&j.match(/^#+$/,!0))return P.highlightFormatting&&(R.formatting="header"),v(R);var se=j.next();if(R.linkTitle){R.linkTitle=!1;var Se=se;se==="("&&(Se=")"),Se=(Se+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var De="^\\s*(?:[^"+Se+"\\\\]+|\\\\\\\\|\\\\.)"+Se;if(j.match(new RegExp(De),!0))return B.linkHref}if(se==="`"){var Ae=R.formatting;P.highlightFormatting&&(R.formatting="code"),j.eatWhile("`");var ke=j.current().length;if(R.code==0&&(!R.quote||ke==1))return R.code=ke,v(R);if(ke==R.code){var je=v(R);return R.code=0,je}else return R.formatting=Ae,v(R)}else if(R.code)return v(R);if(se==="\\"&&(j.next(),P.highlightFormatting)){var Be=v(R),we=B.formatting+"-escape";return Be?Be+" "+we:we}if(se==="!"&&j.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return R.imageMarker=!0,R.image=!0,P.highlightFormatting&&(R.formatting="image"),v(R);if(se==="["&&R.imageMarker&&j.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return R.imageMarker=!1,R.imageAltText=!0,P.highlightFormatting&&(R.formatting="image"),v(R);if(se==="]"&&R.imageAltText){P.highlightFormatting&&(R.formatting="image");var Be=v(R);return R.imageAltText=!1,R.image=!1,R.inline=R.f=O,Be}if(se==="["&&!R.image)return R.linkText&&j.match(/^.*?\]/)||(R.linkText=!0,P.highlightFormatting&&(R.formatting="link")),v(R);if(se==="]"&&R.linkText){P.highlightFormatting&&(R.formatting="link");var Be=v(R);return R.linkText=!1,R.inline=R.f=j.match(/\(.*?\)| ?\[.*?\]/,!1)?O:m,Be}if(se==="<"&&j.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){R.f=R.inline=f,P.highlightFormatting&&(R.formatting="link");var Be=v(R);return Be?Be+=" ":Be="",Be+B.linkInline}if(se==="<"&&j.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){R.f=R.inline=f,P.highlightFormatting&&(R.formatting="link");var Be=v(R);return Be?Be+=" ":Be="",Be+B.linkEmail}if(P.xml&&se==="<"&&j.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Z=j.string.indexOf(">",j.pos);if(Z!=-1){var U=j.string.substring(j.start,Z);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(U)&&(R.md_inside=!0)}return j.backUp(1),R.htmlState=J.startState(X),s(j,R,A)}if(P.xml&&se==="<"&&j.match(/^\/\w*?>/))return R.md_inside=!1,"tag";if(se==="*"||se==="_"){for(var K=1,ee=j.pos==1?" ":j.string.charAt(j.pos-2);K<3&&j.eat(se);)K++;var oe=j.peek()||" ",Q=!/\s/.test(oe)&&(!r.test(oe)||/\s/.test(ee)||r.test(ee)),Ce=!/\s/.test(ee)&&(!r.test(ee)||/\s/.test(oe)||r.test(oe)),ze=null,nt=null;if(K%2&&(!R.em&&Q&&(se==="*"||!Ce||r.test(ee))?ze=!0:R.em==se&&Ce&&(se==="*"||!Q||r.test(oe))&&(ze=!1)),K>1&&(!R.strong&&Q&&(se==="*"||!Ce||r.test(ee))?nt=!0:R.strong==se&&Ce&&(se==="*"||!Q||r.test(oe))&&(nt=!1)),nt!=null||ze!=null){P.highlightFormatting&&(R.formatting=ze==null?"strong":nt==null?"em":"strong em"),ze===!0&&(R.em=se),nt===!0&&(R.strong=se);var je=v(R);return ze===!1&&(R.em=!1),nt===!1&&(R.strong=!1),je}}else if(se===" "&&(j.eat("*")||j.eat("_"))){if(j.peek()===" ")return v(R);j.backUp(1)}if(P.strikethrough){if(se==="~"&&j.eatWhile(se)){if(R.strikethrough){P.highlightFormatting&&(R.formatting="strikethrough");var je=v(R);return R.strikethrough=!1,je}else if(j.match(/^[^\s]/,!1))return R.strikethrough=!0,P.highlightFormatting&&(R.formatting="strikethrough"),v(R)}else if(se===" "&&j.match(/^~~/,!0)){if(j.peek()===" ")return v(R);j.backUp(2)}}if(P.emoji&&se===":"&&j.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){R.emoji=!0,P.highlightFormatting&&(R.formatting="emoji");var xe=v(R);return R.emoji=!1,xe}return se===" "&&(j.match(/^ +$/,!1)?R.trailingSpace++:R.trailingSpace&&(R.trailingSpaceNewLine=!0)),v(R)}function f(j,R){var V=j.next();if(V===">"){R.f=R.inline=m,P.highlightFormatting&&(R.formatting="link");var ne=v(R);return ne?ne+=" ":ne="",ne+B.linkInline}return j.match(/^[^>]+/,!0),B.linkInline}function O(j,R){if(j.eatSpace())return null;var V=j.next();return V==="("||V==="["?(R.f=R.inline=_(V==="("?")":"]"),P.highlightFormatting&&(R.formatting="link-string"),R.linkHref=!0,v(R)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(j){return function(R,V){var ne=R.next();if(ne===j){V.f=V.inline=m,P.highlightFormatting&&(V.formatting="link-string");var se=v(V);return V.linkHref=!1,se}return R.match(E[j]),V.linkHref=!0,v(V)}}function k(j,R){return j.match(/^([^\]\\]|\\.)*\]:/,!1)?(R.f=F,j.next(),P.highlightFormatting&&(R.formatting="link"),R.linkText=!0,v(R)):i(j,R,m)}function F(j,R){if(j.match(/^\]:/,!0)){R.f=R.inline=L,P.highlightFormatting&&(R.formatting="link");var V=v(R);return R.linkText=!1,V}return j.match(/^([^\]\\]|\\.)+/,!0),B.linkText}function L(j,R){return j.eatSpace()?null:(j.match(/^[^\s]+/,!0),j.peek()===void 0?R.linkTitle=!0:j.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),R.f=R.inline=m,B.linkHref+" url")}var G={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:m,text:b,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(j){return{f:j.f,prevLine:j.prevLine,thisLine:j.thisLine,block:j.block,htmlState:j.htmlState&&J.copyState(X,j.htmlState),indentation:j.indentation,localMode:j.localMode,localState:j.localMode?J.copyState(j.localMode,j.localState):null,inline:j.inline,text:j.text,formatting:!1,linkText:j.linkText,linkTitle:j.linkTitle,linkHref:j.linkHref,code:j.code,em:j.em,strong:j.strong,strikethrough:j.strikethrough,emoji:j.emoji,header:j.header,setext:j.setext,hr:j.hr,taskList:j.taskList,list:j.list,listStack:j.listStack.slice(0),quote:j.quote,indentedCode:j.indentedCode,trailingSpace:j.trailingSpace,trailingSpaceNewLine:j.trailingSpaceNewLine,md_inside:j.md_inside,fencedEndRE:j.fencedEndRE}},token:function(j,R){if(R.formatting=!1,j!=R.thisLine.stream){if(R.header=0,R.hr=!1,j.match(/^\s*$/,!0))return x(R),null;if(R.prevLine=R.thisLine,R.thisLine={stream:j},R.taskList=!1,R.trailingSpace=0,R.trailingSpaceNewLine=!1,!R.localState&&(R.f=R.block,R.f!=A)){var V=j.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(R.indentation=V,R.indentationDiff=null,V>0)return null}}return R.f(j,R)},innerMode:function(j){return j.block==A?{state:j.htmlState,mode:X}:j.localState?{state:j.localState,mode:j.localMode}:{state:j,mode:G}},indent:function(j,R,V){return j.block==A&&X.indent?X.indent(j.htmlState,R,V):j.localState&&j.localMode.indent?j.localMode.indent(j.localState,R,V):J.Pass},blankLine:x,getType:v,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),J.defineMIME("text/markdown","markdown"),J.defineMIME("text/x-markdown","markdown")})},n6Qo:function(He,pe,I){"use strict";I.d(pe,"a",function(){return M});var J=I("q1tI"),z=I("biw7"),P=I("fyJ8");function X(n){var D=n.className,g=n.index,p=n.children,h=n.colSpan,c=n.rowSpan,o=J.useContext(z.a),d=o.prefixCls,r=o.fixedInfoList,a=r[g];return J.createElement(P.a,Object.assign({className:D,index:g,component:"td",prefixCls:d,record:null,dataIndex:null,render:function(){return{children:p,props:{colSpan:h,rowSpan:c}}}},a))}function N(n){return J.createElement("tr",Object.assign({},n))}function C(n){var D=n.children,g=J.useContext(z.a),p=g.prefixCls;return J.createElement("tfoot",{className:"".concat(p,"-summary")},D)}var B=pe.b=C,M={Cell:X,Row:N}},nCk5:function(He,pe,I){He.exports=I.p+"static/d.53bf6ae3.svg"},nEHx:function(He,pe,I){"use strict";I.d(pe,"a",function(){return J});var J;(function(z){z.DARK="dark",z.LIGHT="light",z.HIGH_CONTRAST="hc"})(J||(J={}))},nWbc:function(He,pe,I){},nnTU:function(He,pe,I){"use strict";I.d(pe,"b",function(){return B}),I.d(pe,"a",function(){return M});var J=I("MI8n"),z=I("JYp7"),P=I("pmY6"),X=I("24hK"),N=I("746U"),C=I("Cg/j");const B=Object(C.c)("commandService"),M=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new J.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,D){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!D)throw new Error("invalid command");return this.registerCommand({id:n,handler:D})}if(n.description){const o=[];for(let r of n.description.args)o.push(r.constraint);const d=n.handler;n.handler=function(r,...a){return Object(N.o)(a,o),d(r,...a)}}const{id:g}=n;let p=this._commands.get(g);p||(p=new X.a,this._commands.set(g,p));let h=p.unshift(n),c=Object(P.i)(()=>{h();const o=this._commands.get(g);(o==null?void 0:o.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),c}registerCommandAlias(n,D){return M.registerCommand(n,(g,...p)=>g.get(B).executeCommand(D,...p))}getCommand(n){const D=this._commands.get(n);return!D||D.isEmpty()?void 0:z.a.first(D)}getCommands(){const n=new Map;for(const D of this._commands.keys()){const g=this.getCommand(D);g&&n.set(D,g)}return n}};M.registerCommand("noop",()=>{})},oE5q:function(He,pe,I){He.exports=I.p+"static/t.0b94c5c3.svg"},oFv4:function(He,pe,I){He.exports=I.p+"static/internal.da228387.png"},osHv:function(He,pe,I){(function(J){J(I("VrN/"))})(function(J){"use strict";var z=J.Pos;function P(r,a){return r.line-a.line||r.ch-a.ch}var X="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",N=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",C=new RegExp("<(/?)(["+X+"]["+N+"]*)","g");function B(r,a,i,s){this.line=a,this.ch=i,this.cm=r,this.text=r.getLine(a),this.min=s?Math.max(s.from,r.firstLine()):r.firstLine(),this.max=s?Math.min(s.to-1,r.lastLine()):r.lastLine()}function M(r,a){var i=r.cm.getTokenTypeAt(z(r.line,a));return i&&/\btag\b/.test(i)}function n(r){return r.line>=r.max?void 0:(r.ch=0,r.text=r.cm.getLine(++r.line),!0)}function D(r){return r.line<=r.min?void 0:(r.text=r.cm.getLine(--r.line),r.ch=r.text.length,!0)}function g(r){for(;;){var a=r.text.indexOf(">",r.ch);if(a==-1){if(n(r))continue;return}if(!M(r,a+1)){r.ch=a+1;continue}var i=r.text.lastIndexOf("/",a),s=i>-1&&!/\S/.test(r.text.slice(i+1,a));return r.ch=a+1,s?"selfClose":"regular"}}function p(r){for(;;){var a=r.ch?r.text.lastIndexOf("<",r.ch-1):-1;if(a==-1){if(D(r))continue;return}if(!M(r,a+1)){r.ch=a;continue}C.lastIndex=a,r.ch=a;var i=C.exec(r.text);if(i&&i.index==a)return i}}function h(r){for(;;){C.lastIndex=r.ch;var a=C.exec(r.text);if(!a){if(n(r))continue;return}if(!M(r,a.index+1)){r.ch=a.index+1;continue}return r.ch=a.index+a[0].length,a}}function c(r){for(;;){var a=r.ch?r.text.lastIndexOf(">",r.ch-1):-1;if(a==-1){if(D(r))continue;return}if(!M(r,a+1)){r.ch=a;continue}var i=r.text.lastIndexOf("/",a),s=i>-1&&!/\S/.test(r.text.slice(i+1,a));return r.ch=a+1,s?"selfClose":"regular"}}function o(r,a){for(var i=[];;){var s=h(r),S,x=r.line,T=r.ch-(s?s[0].length:0);if(!s||!(S=g(r)))return;if(S=="selfClose")continue;if(s[1]){for(var A=i.length-1;A>=0;--A)if(i[A]==s[2]){i.length=A;break}if(A<0&&(!a||a==s[2]))return{tag:s[2],from:z(x,T),to:z(r.line,r.ch)}}else i.push(s[2])}}function d(r,a){for(var i=[];;){var s=c(r);if(!s)return;if(s=="selfClose"){p(r);continue}var S=r.line,x=r.ch,T=p(r);if(!T)return;if(T[1])i.push(T[2]);else{for(var A=i.length-1;A>=0;--A)if(i[A]==T[2]){i.length=A;break}if(A<0&&(!a||a==T[2]))return{tag:T[2],from:z(r.line,r.ch),to:z(S,x)}}}}J.registerHelper("fold","xml",function(r,a){for(var i=new B(r,a.line,0);;){var s=h(i);if(!s||i.line!=a.line)return;var S=g(i);if(!S)return;if(!s[1]&&S!="selfClose"){var x=z(i.line,i.ch),T=o(i,s[2]);return T&&P(T.from,x)>0?{from:x,to:T.from}:null}}}),J.findMatchingTag=function(r,a,i){var s=new B(r,a.line,a.ch,i);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var S=g(s),x=S&&z(s.line,s.ch),T=S&&p(s);if(!S||!T||P(s,a)>0)return;var A={from:z(s.line,s.ch),to:x,tag:T[2]};return S=="selfClose"?{open:A,close:null,at:"open"}:T[1]?{open:d(s,T[2]),close:A,at:"close"}:(s=new B(r,x.line,x.ch,i),{open:A,close:o(s,T[2]),at:"open"})},J.findEnclosingTag=function(r,a,i,s){for(var S=new B(r,a.line,a.ch,i);;){var x=d(S,s);if(!x)break;var T=new B(r,a.line,a.ch,i),A=o(T,x.tag);if(A)return{open:x,close:A}}},J.scanForClosingTag=function(r,a,i,s){var S=new B(r,a.line,a.ch,s?{from:0,to:s}:null);return o(S,i)}})},p5ED:function(He,pe,I){"use strict";var J=I("+L6B"),z=I("2/Rp"),P=I("5Dmo"),X=I("3S7+"),N=I("k1fw"),C=I("9og8"),B=I("tJVT"),M=I("WmNS"),n=I.n(M),D=I("q1tI"),g=I.n(D),p=I("vHTk"),h=I.n(p),c=I("yEEn"),o=I("ZW9T"),d=I("1vsH"),r=I("V0Rq"),a=I("m3rI");pe.a=function(i){var s,S,x,T,A,w,v,b=i.editOffice,m=b===void 0?"view":b,f=i.data,O=i.theme,E=i.type,_=i.filename,k=i.monacoEditor,F=i.className,L=i.style,G=i.close,j=i.onClose,R=i.hasMask,V=i.disabledDownload,ne=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),se=Object(B.a)(ne,2),Se=se[0],De=se[1],Ae=Object(D.useState)(""),ke=Object(B.a)(Ae,2),je=ke[0],Be=ke[1],we=Object(D.useState)(),Z=Object(B.a)(we,2),U=Z[0],K=Z[1],ee=window.ENV==="build"?"/react/build":"",oe=a.a.PROXY_SERVER||location.origin,Q,Ce=1024*1024,ze=10*Ce,nt=Object(D.useRef)();(s=f)!==null&&s!==void 0&&s.startsWith("/api")&&E!=="txt"&&(f=a.a.API_SERVER+f),E==="office"&&(Q=Object(d.T)(f).filesize,Q>ze&&(E="other")),_&&k&&(k.filename=_),Object(D.useEffect)(function(){var Oe,Ke,Qe=(Oe=document.cookie)===null||Oe===void 0||((Ke=Oe.replace(/\s/g,""))===null||Ke===void 0)?void 0:Ke.split(";");Qe==null||Qe.map(function(st){var ut=st.split("=");ut[0]==="_educoder_session"&&Be(ut[1])})},[]),Object(D.useEffect)(function(){E==="office"&&xe()},[E,f]);var xe=function(){var Oe=Object(C.a)(n.a.mark(function Ke(){var Qe,st,ut;return n.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return console.log("data:",f),Qe=f,f.startsWith("http")||(Qe=location.origin+Qe),st=new URL(Qe).pathname.split("/").pop(),wt.next=6,Object(r.V)({attachment_id:st});case 6:ut=wt.sent,K(ut);case 8:case"end":return wt.stop()}},Ke)}));return function(){return Oe.apply(this,arguments)}}(),Re=function(){if(f.startsWith("http")||f.startsWith("blob:")){Te();return}Object(d.z)(_||"educoder",f,_)},Te=function(){Object(d.x)(_||"educoder",decodeURIComponent(f))};return g.a.createElement("div",{style:Object(N.a)({},L||{}),className:"".concat(R&&h.a.bgBlack," ").concat(E?h.a.wrp:"hide")},G&&g.a.createElement("div",{className:h.a.close,ref:nt},!V&&g.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return nt.current}},g.a.createElement("span",{onClick:Te},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return nt.current}},g.a.createElement("span",{className:"",onClick:j},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(h.a[F]," ").concat(F," ").concat(h.a.monaco," ").concat(E==="txt"?"show":"hide")},E==="txt"&&g.a.createElement(o.b,k)),E==="audio"&&g.a.createElement("audio",{src:"".concat(((S=f)===null||S===void 0?void 0:S.indexOf("http://"))>-1||((x=f)===null||x===void 0?void 0:x.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(f),autoPlay:!0}),E==="video"&&g.a.createElement(g.a.Fragment,null,((T=f)===null||T===void 0?void 0:T.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),E==="office"&&U&&g.a.createElement("iframe",{src:"".concat(ee,"/office.html?key=").concat(U.key,"&url=").concat(oe+U.url,"&callbackUrl=").concat(oe+U.callbackUrl,"&fileType=").concat(U.fileType,"&title=").concat(U.title,"&model=").concat(m,"&officeServer=").concat(a.a.OFFICE_SERVER,"&disabledDownload=").concat(!!V)}),E==="html"&&g.a.createElement("iframe",{src:f+"&disposition=inline"}),E==="pdf"&&g.a.createElement("iframe",{src:"".concat(ee,"/js/pdfview/index.html?url=").concat(f,"&disabledDownload=").concat(!!V)}),E==="image"&&g.a.createElement("img",{src:"".concat(((A=f)===null||A===void 0?void 0:A.indexOf("http://"))>-1||((w=f)===null||w===void 0?void 0:w.indexOf("https://"))>-1||(v=f)!==null&&v!==void 0&&v.startsWith("/api")?"":"data:image/png;base64,").concat(f)}),E==="other"&&g.a.createElement("div",null,g.a.createElement(z.a,{type:"primary",size:"large",onClick:Re},g.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),E==="download"&&g.a.createElement(z.a,{type:"primary",size:"large",onClick:Re},g.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(He,pe,I){},pYxM:function(He,pe,I){He.exports={flex_box_center:"flex_box_center___v-DUT",flex_space_between:"flex_space_between___1bRJc",flex_box_vertical_center:"flex_box_vertical_center___k_OZG",flex_box_center_end:"flex_box_center_end___2lt4j",flex_box_column:"flex_box_column___3fVE5",active:"active___-vjVj",line:"line___3pg8N",list:"list___3yqVJ",left:"left___2dr70",mask:"mask___186YH",right:"right___17A6Y",name:"name___v6M7T",title:"title___1BhMz",a:"a___3T4cN",b:"b___1z1Bk",des:"des___29QAn",tag:"tag___FfUI2"}},pmY6:function(He,pe,I){"use strict";I.d(pe,"h",function(){return D}),I.d(pe,"g",function(){return p}),I.d(pe,"f",function(){return h}),I.d(pe,"e",function(){return c}),I.d(pe,"i",function(){return o}),I.d(pe,"b",function(){return d}),I.d(pe,"a",function(){return r}),I.d(pe,"d",function(){return a}),I.d(pe,"c",function(){return i});var J=I("C/vA"),z=I("JYp7");const P=!1;let X=null;function N(s){X=s}if(P){const s="__is_disposable_tracked__";N(new class{trackDisposable(S){const x=new Error("Potentially leaked disposable").stack;setTimeout(()=>{S[s]||console.log(x)},3e3)}setParent(S,x){if(S&&S!==r.None)try{S[s]=!0}catch(T){}}markAsDisposed(S){if(S&&S!==r.None)try{S[s]=!0}catch(x){}}markAsSingleton(S){}})}function C(s){return X==null||X.trackDisposable(s),s}function B(s){X==null||X.markAsDisposed(s)}function M(s,S){X==null||X.setParent(s,S)}function n(s,S){if(!X)return;for(const x of s)X.setParent(x,S)}function D(s){return X==null||X.markAsSingleton(s),s}class g extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function p(s){return typeof s.dispose=="function"&&s.dispose.length===0}function h(s){if(z.a.is(s)){let S=[];for(const x of s)if(x)try{x.dispose()}catch(T){S.push(T)}if(S.length===1)throw S[0];if(S.length>1)throw new g(S);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function c(...s){const S=o(()=>h(s));return n(s,S),S}function o(s){const S=C({dispose:Object(J.a)(()=>{B(S),s()})});return S}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,C(this)}dispose(){if(this._isDisposed)return;B(this),this._isDisposed=!0,this.clear()}clear(){try{h(this._toDispose.values())}finally{this._toDispose.clear()}}add(s){if(!s)return s;if(s===this)throw new Error("Cannot register a disposable on itself!");return M(s,this),this._isDisposed?d.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(s),s}}d.DISABLE_DISPOSED_WARNING=!1;class r{constructor(){this._store=new d,C(this),M(this._store,this)}dispose(){B(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}r.None=Object.freeze({dispose(){}});class a{constructor(){this._isDisposed=!1,C(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var S;if(this._isDisposed||s===this._value)return;(S=this._value)===null||S===void 0||S.dispose(),s&&M(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,B(this),(s=this._value)===null||s===void 0||s.dispose(),this._value=void 0}clearAndLeak(){const s=this._value;return this._value=void 0,s&&M(s,null),s}}class i{constructor(s){this.object=s}dispose(){}}},ps8w:function(He,pe,I){He.exports=I.p+"static/show.6268a056.svg"},psGv:function(He,pe,I){var J,z;(function(){var P;(function(){"use strict";var B=[,,function(g){function p(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}p.prototype.clone_empty=function(){var o=new p(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},p.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},p.prototype.has_match=function(o){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(o))return!0;return!1},p.prototype.set_indent=function(o,d){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},p.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(o){this.__items.push(o);var d=o.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=o.length-d:this.__character_count+=o.length},p.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function h(o,d){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),d=d||"",o.indent_level>0&&(d=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}h.prototype.get_indent_size=function(o,d){var r=this.__base_string_length;return d=d||0,o<0&&(r=0),r+=o*this.__indent_size,r+=d,r},h.prototype.get_indent_string=function(o,d){var r=this.__base_string;return d=d||0,o<0&&(o=0,r=""),d+=o*this.__indent_size,this.__ensure_cache(d),r+=this.__cache[d],r},h.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},h.prototype.__add_column=function(){var o=this.__cache.length,d=0,r="";this.__indent_size&&o>=this.__indent_size&&(d=Math.floor(o/this.__indent_size),o-=d*this.__indent_size,r=new Array(d+1).join(this.__indent_string)),o&&(r+=new Array(o+1).join(" ")),this.__cache.push(r)};function c(o,d){this.__indent_cache=new h(o,d),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(o,d){return this.__indent_cache.get_indent_string(o,d)},c.prototype.get_indent_size=function(o,d){return this.__indent_cache.get_indent_size(o,d)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(o){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
|
|
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(r=r.replace(/[\n]/g,o)),r},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(o,d){return o=o||0,d=d||0,this.next_line.set_indent(o,d),this.__lines.length>1?(this.current_line.set_indent(o,d),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(o){for(var d=0;d<o.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},c.prototype.remove_indent=function(o){for(var d=this.__lines.length;o<d;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(o,d){for(var r=this.__lines.length-2;r>=0;){var a=this.__lines[r];if(a.is_empty())break;if(a.item(0).indexOf(o)!==0&&a.item(-1)!==d){this.__lines.splice(r+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},g.exports.Output=c},function(g){function p(h,c,o,d){this.type=h,this.text=c,this.comments_before=null,this.newlines=o||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=p},,,function(g){function p(o,d){this.raw_options=h(o,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}p.prototype._get_array=function(o,d){var r=this.raw_options[o],a=d||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(a=r.concat()):typeof r=="string"&&(a=r.split(/[^a-zA-Z0-9_\/\-]+/)),a},p.prototype._get_boolean=function(o,d){var r=this.raw_options[o],a=r===void 0?!!d:!!r;return a},p.prototype._get_characters=function(o,d){var r=this.raw_options[o],a=d||"";return typeof r=="string"&&(a=r.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),a},p.prototype._get_number=function(o,d){var r=this.raw_options[o];d=parseInt(d,10),isNaN(d)&&(d=0);var a=parseInt(r,10);return isNaN(a)&&(a=d),a},p.prototype._get_selection=function(o,d,r){var a=this._get_selection_list(o,d,r);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[o]+"'");return a[0]},p.prototype._get_selection_list=function(o,d,r){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[d[0]],!this._is_valid_selection(r,d))throw new Error("Invalid Default Value!");var a=this._get_array(o,r);if(!this._is_valid_selection(a,d))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[o]+"'");return a},p.prototype._is_valid_selection=function(o,d){return o.length&&d.length&&!o.some(function(r){return d.indexOf(r)===-1})};function h(o,d){var r={};o=c(o);var a;for(a in o)a!==d&&(r[a]=o[a]);if(d&&o[d])for(a in o[d])r[a]=o[d][a];return r}function c(o){var d={},r;for(r in o){var a=r.replace(/-/g,"_");d[a]=o[r]}return d}g.exports.Options=p,g.exports.normalizeOpts=c,g.exports.mergeOpts=h},,function(g){var p=RegExp.prototype.hasOwnProperty("sticky");function h(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}h.prototype.restart=function(){this.__position=0},h.prototype.back=function(){this.__position>0&&(this.__position-=1)},h.prototype.hasNext=function(){return this.__position<this.__input_length},h.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},h.prototype.peek=function(c){var o=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(o=this.__input.charAt(c)),o},h.prototype.__match=function(c,o){c.lastIndex=o;var d=c.exec(this.__input);return d&&!(p&&c.sticky)&&(d.index!==o&&(d=null)),d},h.prototype.test=function(c,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(c,o):!1},h.prototype.testChar=function(c,o){var d=this.peek(o);return c.lastIndex=0,d!==null&&c.test(d)},h.prototype.match=function(c){var o=this.__match(c,this.__position);return o?this.__position+=o[0].length:o=null,o},h.prototype.read=function(c,o,d){var r="",a;return c&&(a=this.match(c),a&&(r+=a[0])),o&&(a||!c)&&(r+=this.readUntil(o,d)),r},h.prototype.readUntil=function(c,o){var d="",r=this.__position;c.lastIndex=this.__position;var a=c.exec(this.__input);return a?(r=a.index,o&&(r+=a[0].length)):r=this.__input_length,d=this.__input.substring(this.__position,r),this.__position=r,d},h.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},h.prototype.get_regexp=function(c,o){var d=null,r="g";return o&&p&&(r="y"),typeof c=="string"&&c!==""?d=new RegExp(c,r):c&&(d=new RegExp(c.source,r)),d},h.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},h.prototype.peekUntilAfter=function(c){var o=this.__position,d=this.readUntilAfter(c);return this.__position=o,d},h.prototype.lookBack=function(c){var o=this.__position-1;return o>=c.length&&this.__input.substring(o-c.length,o).toLowerCase()===c},g.exports.InputScanner=h},function(g,p,h){var c=h(8).InputScanner,o=h(3).Token,d=h(10).TokenStream,r=h(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(s,S){this._input=new c(s),this._options=S||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var s,S=new o(a.START,""),x=null,T=[],A=new d;S.type!==a.EOF;){for(s=this._get_next_token(S,x);this._is_comment(s);)A.add(s),s=this._get_next_token(S,x);A.isEmpty()||(s.comments_before=A,A=new d),s.parent=x,this._is_opening(s)?(T.push(x),x=s):x&&this._is_closing(s,x)&&(s.opened=x,x.closed=s,x=T.pop(),s.parent=x),s.previous=S,S.next=s,this.__tokens.add(s),S=s}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(s,S){this._readWhitespace();var x=this._input.read(/.+/g);return x?this._create_token(a.RAW,x):this._create_token(a.EOF,"")},i.prototype._is_comment=function(s){return!1},i.prototype._is_opening=function(s){return!1},i.prototype._is_closing=function(s,S){return!1},i.prototype._create_token=function(s,S){var x=new o(s,S,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return x},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=i,g.exports.TOKEN=a},function(g){function p(h){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=h}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__tokens[this.__position],this.__position+=1),h},p.prototype.peek=function(h){var c=null;return h=h||0,h+=this.__position,h>=0&&h<this.__tokens_length&&(c=this.__tokens[h]),c},p.prototype.add=function(h){this.__parent_token&&(h.parent=this.__parent_token),this.__tokens.push(h),this.__tokens_length+=1},g.exports.TokenStream=p},function(g,p,h){var c=h(12).Pattern;function o(d,r){c.call(this,d,r),r?this._line_regexp=this._input.get_regexp(r._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new c,o.prototype.__set_whitespace_patterns=function(d,r){d+="\\t ",r+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+r+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+r+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var r=this.__split(this._newline_regexp,d);this.newline_count=r.length-1,this.whitespace_before_token=r[this.newline_count]}return d},o.prototype.matching=function(d,r){var a=this._create();return a.__set_whitespace_patterns(d,r),a._update(),a},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(d,r){d.lastIndex=0;for(var a=0,i=[],s=d.exec(r);s;)i.push(r.substring(a,s.index)),a=s.index+s[0].length,s=d.exec(r);return a<r.length?i.push(r.substring(a,r.length)):i.push(""),i},g.exports.WhitespacePattern=o},function(g){function p(h,c){this._input=h,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}p.prototype.read=function(){var h=this._input.read(this._starting_pattern);return(!this._starting_pattern||h)&&(h+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),h},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(h){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(h),c._update(),c},p.prototype.until=function(h){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(h),c._update(),c},p.prototype.starting_with=function(h){var c=this._create();return c._starting_pattern=this._input.get_regexp(h,!0),c._update(),c},p.prototype.matching=function(h){var c=this._create();return c._match_pattern=this._input.get_regexp(h,!0),c._update(),c},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},g.exports.Pattern=p},function(g){function p(h,c){h=typeof h=="string"?h:h.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(h+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(h+/\sbeautify\signore:end\s/.source+c,"g")}p.prototype.get_directives=function(h){if(!h.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(h);o;)c[o[1]]=o[2],o=this.__directive_pattern.exec(h);return c},p.prototype.readIgnored=function(h){return h.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=p},function(g,p,h){var c=h(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(r,a){c.call(this,r,a),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),a&&(this.__template_pattern=this._input.get_regexp(a.__template_pattern),this._excluded=Object.assign(this._excluded,a._excluded),this._disabled=Object.assign(this._disabled,a._disabled));var i=new c(r);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new c,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(r){var a=this._create();return a._disabled[r]=!0,a._update(),a},d.prototype.read_options=function(r){var a=this._create();for(var i in o)a._disabled[i]=r.templating.indexOf(i)===-1;return a._update(),a},d.prototype.exclude=function(r){var a=this._create();return a._excluded[r]=!0,a._update(),a},d.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),r+=a,a=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},d.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},d.prototype._read_template=function(){var r="",a=this._input.peek();if(a==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(r=r||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},g.exports.TemplatablePattern=d},,,,function(g,p,h){var c=h(19).Beautifier,o=h(20).Options;function d(r,a,i,s){var S=new c(r,a,i,s);return S.beautify()}g.exports=d,g.exports.defaultOptions=function(){return new o}},function(g,p,h){var c=h(20).Options,o=h(2).Output,d=h(21).Tokenizer,r=h(21).TOKEN,a=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,s=function(O,E){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=O.max_preserve_newlines,this.preserve_newlines=O.preserve_newlines,this._output=new o(O,E)};s.prototype.current_line_has_match=function(O){return this._output.current_line.has_match(O)},s.prototype.set_space_before_token=function(O,E){this._output.space_before_token=O,this._output.non_breaking_space=E},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(O){this._output.add_raw_token(O)},s.prototype.print_preserved_newlines=function(O){var E=0;O.type!==r.TEXT&&O.previous.type!==r.TEXT&&(E=O.newlines?1:0),this.preserve_newlines&&(E=O.newlines<this.max_preserve_newlines+1?O.newlines:this.max_preserve_newlines+1);for(var _=0;_<E;_++)this.print_newline(_>0);return E!==0},s.prototype.traverse_whitespace=function(O){return O.whitespace_before||O.newlines?(this.print_preserved_newlines(O)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(O){this._output.add_new_line(O)},s.prototype.print_token=function(O){O.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(O.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(O){return O=this.indent_level+(O||0),O<1?"":this._output.get_indent_string(O)};var S=function(O){for(var E=null,_=O.next;_.type!==r.EOF&&O.closed!==_;){if(_.type===r.ATTRIBUTE&&_.text==="type"){_.next&&_.next.type===r.EQUALS&&_.next.next&&_.next.next.type===r.VALUE&&(E=_.next.next.text);break}_=_.next}return E},x=function(O,E){var _=null,k=null;return E.closed?(O==="script"?_="text/javascript":O==="style"&&(_="text/css"),_=S(E)||_,_.search("text/css")>-1?k="css":_.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?k="javascript":_.search(/(text|application|dojo)\/(x-)?(html)/)>-1?k="html":_.search(/test\/null/)>-1&&(k="null"),k):null};function T(O,E){return E.indexOf(O)!==-1}function A(O,E,_){this.parent=O||null,this.tag=E?E.tag_name:"",this.indent_level=_||0,this.parser_token=E||null}function w(O){this._printer=O,this._current_frame=null}w.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},w.prototype.record_tag=function(O){var E=new A(this._current_frame,O,this._printer.indent_level);this._current_frame=E},w.prototype._try_pop_frame=function(O){var E=null;return O&&(E=O.parser_token,this._printer.indent_level=O.indent_level,this._current_frame=O.parent),E},w.prototype._get_frame=function(O,E){for(var _=this._current_frame;_&&!(O.indexOf(_.tag)!==-1);){if(E&&E.indexOf(_.tag)!==-1){_=null;break}_=_.parent}return _},w.prototype.try_pop=function(O,E){var _=this._get_frame([O],E);return this._try_pop_frame(_)},w.prototype.indent_to_tag=function(O){var E=this._get_frame(O);E&&(this._printer.indent_level=E.indent_level)};function v(O,E,_,k){this._source_text=O||"",E=E||{},this._js_beautify=_,this._css_beautify=k,this._tag_stack=null;var F=new c(E,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O=this._source_text,E=this._options.eol;this._options.eol==="auto"&&(E=`
|
|
`,O&&a.test(O)&&(E=O.match(a)[0])),O=O.replace(i,`
|
|
`);var _=O.match(/^[\t ]*/)[0],k={text:"",type:""},F=new b,L=new s(this._options,_),G=new d(O,this._options).tokenize();this._tag_stack=new w(L);for(var j=null,R=G.next();R.type!==r.EOF;)R.type===r.TAG_OPEN||R.type===r.COMMENT?(j=this._handle_tag_open(L,R,F,k),F=j):R.type===r.ATTRIBUTE||R.type===r.EQUALS||R.type===r.VALUE||R.type===r.TEXT&&!F.tag_complete?j=this._handle_inside_tag(L,R,F,G):R.type===r.TAG_CLOSE?j=this._handle_tag_close(L,R,F):R.type===r.TEXT?j=this._handle_text(L,R,F):L.add_raw_token(R),k=j,R=G.next();var V=L._output.get_code(E);return V},v.prototype._handle_tag_close=function(O,E,_){var k={text:E.text,type:E.type};return O.alignment_size=0,_.tag_complete=!0,O.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),_.is_unformatted?O.add_raw_token(E):(_.tag_start_char==="<"&&(O.set_space_before_token(E.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&_.has_wrapped_attrs&&O.print_newline(!1)),O.print_token(E)),_.indent_content&&!(_.is_unformatted||_.is_content_unformatted)&&(O.indent(),_.indent_content=!1),!_.is_inline_element&&!(_.is_unformatted||_.is_content_unformatted)&&O.set_wrap_point(),k},v.prototype._handle_inside_tag=function(O,E,_,k){var F=_.has_wrapped_attrs,L={text:E.text,type:E.type};if(O.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),_.is_unformatted)O.add_raw_token(E);else if(_.tag_start_char==="{"&&E.type===r.TEXT)O.print_preserved_newlines(E)?(E.newlines=0,O.add_raw_token(E)):O.print_token(E);else{if(E.type===r.ATTRIBUTE?(O.set_space_before_token(!0),_.attr_count+=1):(E.type===r.EQUALS||E.type===r.VALUE&&E.previous.type===r.EQUALS)&&O.set_space_before_token(!1),E.type===r.ATTRIBUTE&&_.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(O.traverse_whitespace(E),F=F||E.newlines!==0),this._is_wrap_attributes_force)){var G=_.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&_.attr_count===1){var j=!0,R=0,V;do{if(V=k.peek(R),V.type===r.ATTRIBUTE){j=!1;break}R+=1}while(R<4&&V.type!==r.EOF&&V.type!==r.TAG_CLOSE);G=!j}G&&(O.print_newline(!1),F=!0)}O.print_token(E),F=F||O.previous_token_wrapped(),_.has_wrapped_attrs=F}return L},v.prototype._handle_text=function(O,E,_){var k={text:E.text,type:"TK_CONTENT"};return _.custom_beautifier_name?this._print_custom_beatifier_text(O,E,_):_.is_unformatted||_.is_content_unformatted?O.add_raw_token(E):(O.traverse_whitespace(E),O.print_token(E)),k},v.prototype._print_custom_beatifier_text=function(O,E,_){var k=this;if(E.text!==""){var F=E.text,L,G=1,j="",R="";_.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?L=this._js_beautify:_.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?L=this._css_beautify:_.custom_beautifier_name==="html"&&(L=function(Ae,ke){var je=new v(Ae,ke,k._js_beautify,k._css_beautify);return je.beautify()}),this._options.indent_scripts==="keep"?G=0:this._options.indent_scripts==="separate"&&(G=-O.indent_level);var V=O.get_full_indent(G);if(F=F.replace(/\n[ \t]*$/,""),_.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var ne=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!ne){O.add_raw_token(E);return}j=V+ne[1]+`
|
|
`,F=ne[4],ne[5]&&(R=V+ne[5]),F=F.replace(/\n[ \t]*$/,""),(ne[2]||ne[3].indexOf(`
|
|
`)!==-1)&&(ne=ne[3].match(/[ \t]+$/),ne&&(E.whitespace_before=ne[0]))}if(F)if(L){var se=function(){this.eol=`
|
|
`};se.prototype=this._options.raw_options;var Se=new se;F=L(V+F,Se)}else{var De=E.whitespace_before;De&&(F=F.replace(new RegExp(`
|
|
(`+De+")?","g"),`
|
|
`)),F=V+F.replace(/\n/g,`
|
|
`+V)}j&&(F?F=j+F+`
|
|
`+R:F=j+R),O.print_newline(!1),F&&(E.text=F,E.whitespace_before="",E.newlines=0,O.add_raw_token(E),O.print_newline(!0))}},v.prototype._handle_tag_open=function(O,E,_,k){var F=this._get_tag_open_token(E);return(_.is_unformatted||_.is_content_unformatted)&&!_.is_empty_element&&E.type===r.TAG_OPEN&&E.text.indexOf("</")===0?(O.add_raw_token(E),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(O.traverse_whitespace(E),this._set_tag_position(O,E,F,_,k),F.is_inline_element||O.set_wrap_point(),O.print_token(E)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=E.text.length+1),!F.tag_complete&&!F.is_unformatted&&(O.alignment_size=F.alignment_size),F};var b=function(O,E){if(this.parent=O||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!E)this.tag_complete=!0;else{var _;this.tag_start_char=E.text[0],this.text=E.text,this.tag_start_char==="<"?(_=E.text.match(/^<([^\s>]*)/),this.tag_check=_?_[1]:""):(_=E.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=_?_[1]:"",(E.text.startsWith("{{#>")||E.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&E.next!==null?this.tag_check=E.next.text.split(" ")[0]:this.tag_check=E.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),E.type===r.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||E.closed&&E.closed.text==="/>";var k=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(k=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(k)))}};v.prototype._get_tag_open_token=function(O){var E=new b(this._tag_stack.get_parser_token(),O);return E.alignment_size=this._options.wrap_attributes_indent_size,E.is_end_tag=E.is_end_tag||T(E.tag_check,this._options.void_elements),E.is_empty_element=E.tag_complete||E.is_start_tag&&E.is_end_tag,E.is_unformatted=!E.tag_complete&&T(E.tag_check,this._options.unformatted),E.is_content_unformatted=!E.is_empty_element&&T(E.tag_check,this._options.content_unformatted),E.is_inline_element=T(E.tag_name,this._options.inline)||E.tag_name.includes("-")||E.tag_start_char==="{",E},v.prototype._set_tag_position=function(O,E,_,k,F){if(_.is_empty_element||(_.is_end_tag?_.start_tag_token=this._tag_stack.try_pop(_.tag_name):(this._do_optional_end_element(_)&&(_.is_inline_element||O.print_newline(!1)),this._tag_stack.record_tag(_),(_.tag_name==="script"||_.tag_name==="style")&&!(_.is_unformatted||_.is_content_unformatted)&&(_.custom_beautifier_name=x(_.tag_check,E)))),T(_.tag_check,this._options.extra_liners)&&(O.print_newline(!1),O._output.just_added_blankline()||O.print_newline(!0)),_.is_empty_element){if(_.tag_start_char==="{"&&_.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),_.indent_content=!0;var L=O.current_line_has_match(/{{#if/);L||O.print_newline(!1)}_.tag_name==="!--"&&F.type===r.TAG_CLOSE&&k.is_end_tag&&_.text.indexOf(`
|
|
`)===-1||(_.is_inline_element||_.is_unformatted||O.print_newline(!1),this._calcluate_parent_multiline(O,_))}else if(_.is_end_tag){var G=!1;G=_.start_tag_token&&_.start_tag_token.multiline_content,G=G||!_.is_inline_element&&!(k.is_inline_element||k.is_unformatted)&&!(F.type===r.TAG_CLOSE&&_.start_tag_token===k)&&F.type!=="TK_CONTENT",(_.is_content_unformatted||_.is_unformatted)&&(G=!1),G&&O.print_newline(!1)}else _.indent_content=!_.custom_beautifier_name,_.tag_start_char==="<"&&(_.tag_name==="html"?_.indent_content=this._options.indent_inner_html:_.tag_name==="head"?_.indent_content=this._options.indent_head_inner_html:_.tag_name==="body"&&(_.indent_content=this._options.indent_body_inner_html)),!(_.is_inline_element||_.is_unformatted)&&(F.type!=="TK_CONTENT"||_.is_content_unformatted)&&O.print_newline(!1),this._calcluate_parent_multiline(O,_)},v.prototype._calcluate_parent_multiline=function(O,E){E.parent&&O._output.just_added_newline()&&!((E.is_inline_element||E.is_unformatted)&&E.parent.is_inline_element)&&(E.parent.multiline_content=!0)};var m=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],f=["a","audio","del","ins","map","noscript","video"];v.prototype._do_optional_end_element=function(O){var E=null;if(O.is_empty_element||!O.is_start_tag||!O.parent)return;if(O.tag_name==="body")E=E||this._tag_stack.try_pop("head");else if(O.tag_name==="li")E=E||this._tag_stack.try_pop("li",["ol","ul"]);else if(O.tag_name==="dd"||O.tag_name==="dt")E=E||this._tag_stack.try_pop("dt",["dl"]),E=E||this._tag_stack.try_pop("dd",["dl"]);else if(O.parent.tag_name==="p"&&m.indexOf(O.tag_name)!==-1){var _=O.parent.parent;(!_||f.indexOf(_.tag_name)===-1)&&(E=E||this._tag_stack.try_pop("p"))}else O.tag_name==="rp"||O.tag_name==="rt"?(E=E||this._tag_stack.try_pop("rt",["ruby","rtc"]),E=E||this._tag_stack.try_pop("rp",["ruby","rtc"])):O.tag_name==="optgroup"?E=E||this._tag_stack.try_pop("optgroup",["select"]):O.tag_name==="option"?E=E||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):O.tag_name==="colgroup"?E=E||this._tag_stack.try_pop("caption",["table"]):O.tag_name==="thead"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"])):O.tag_name==="tbody"||O.tag_name==="tfoot"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("thead",["table"]),E=E||this._tag_stack.try_pop("tbody",["table"])):O.tag_name==="tr"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(O.tag_name==="th"||O.tag_name==="td")&&(E=E||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),E=E||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return O.parent=this._tag_stack.get_parser_token(),E},g.exports.Beautifier=v},function(g,p,h){var c=h(6).Options;function o(d){c.call(this,d,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}o.prototype=new c,g.exports.Options=o},function(g,p,h){var c=h(9).Tokenizer,o=h(9).TOKEN,d=h(13).Directives,r=h(14).TemplatablePattern,a=h(12).Pattern,i={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:o.START,RAW:o.RAW,EOF:o.EOF},s=new d(/<\!--/,/-->/),S=function(x,T){c.call(this,x,T),this._current_tag_name="";var A=new r(this._input).read_options(this._options),w=new a(this._input);if(this.__patterns={word:A.until(/[\n\r\t <]/),single_quote:A.until_after(/'/),double_quote:A.until_after(/"/),attribute:A.until(/[\n\r\t =>]|\/>/),element_name:A.until(/[\n\r\t >\/]/),handlebars_comment:w.starting_with(/{{!--/).until_after(/--}}/),handlebars:w.starting_with(/{{/).until_after(/}}/),handlebars_open:w.until(/[\n\r\t }]/),handlebars_raw_close:w.until(/}}/),comment:w.starting_with(/<!--/).until_after(/-->/),cdata:w.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:w.starting_with(/<!\[/).until_after(/]>/),processing:w.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var v=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=w.matching(v).until_after(v)}};S.prototype=new c,S.prototype._is_comment=function(x){return!1},S.prototype._is_opening=function(x){return x.type===i.TAG_OPEN},S.prototype._is_closing=function(x,T){return x.type===i.TAG_CLOSE&&T&&((x.text===">"||x.text==="/>")&&T.text[0]==="<"||x.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},S.prototype._reset=function(){this._current_tag_name=""},S.prototype._get_next_token=function(x,T){var A=null;this._readWhitespace();var w=this._input.peek();return w===null?this._create_token(i.EOF,""):(A=A||this._read_open_handlebars(w,T),A=A||this._read_attribute(w,x,T),A=A||this._read_close(w,T),A=A||this._read_raw_content(w,x,T),A=A||this._read_content_word(w),A=A||this._read_comment_or_cdata(w),A=A||this._read_processing(w),A=A||this._read_open(w,T),A=A||this._create_token(i.UNKNOWN,this._input.next()),A)},S.prototype._read_comment_or_cdata=function(x){var T=null,A=null,w=null;if(x==="<"){var v=this._input.peek(1);v==="!"&&(A=this.__patterns.comment.read(),A?(w=s.get_directives(A),w&&w.ignore==="start"&&(A+=s.readIgnored(this._input))):A=this.__patterns.cdata.read()),A&&(T=this._create_token(i.COMMENT,A),T.directives=w)}return T},S.prototype._read_processing=function(x){var T=null,A=null,w=null;if(x==="<"){var v=this._input.peek(1);(v==="!"||v==="?")&&(A=this.__patterns.conditional_comment.read(),A=A||this.__patterns.processing.read()),A&&(T=this._create_token(i.COMMENT,A),T.directives=w)}return T},S.prototype._read_open=function(x,T){var A=null,w=null;return T||x==="<"&&(A=this._input.next(),this._input.peek()==="/"&&(A+=this._input.next()),A+=this.__patterns.element_name.read(),w=this._create_token(i.TAG_OPEN,A)),w},S.prototype._read_open_handlebars=function(x,T){var A=null,w=null;return T||this._options.indent_handlebars&&x==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(A=this.__patterns.handlebars_comment.read(),A=A||this.__patterns.handlebars.read(),w=this._create_token(i.COMMENT,A)):(A=this.__patterns.handlebars_open.read(),w=this._create_token(i.TAG_OPEN,A))),w},S.prototype._read_close=function(x,T){var A=null,w=null;return T&&(T.text[0]==="<"&&(x===">"||x==="/"&&this._input.peek(1)===">")?(A=this._input.next(),x==="/"&&(A+=this._input.next()),w=this._create_token(i.TAG_CLOSE,A)):T.text[0]==="{"&&x==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),w=this._create_token(i.TAG_CLOSE,"}}"))),w},S.prototype._read_attribute=function(x,T,A){var w=null,v="";if(A&&A.text[0]==="<")if(x==="=")w=this._create_token(i.EQUALS,this._input.next());else if(x==='"'||x==="'"){var b=this._input.next();x==='"'?b+=this.__patterns.double_quote.read():b+=this.__patterns.single_quote.read(),w=this._create_token(i.VALUE,b)}else v=this.__patterns.attribute.read(),v&&(T.type===i.EQUALS?w=this._create_token(i.VALUE,v):w=this._create_token(i.ATTRIBUTE,v));return w},S.prototype._is_content_unformatted=function(x){return this._options.void_elements.indexOf(x)===-1&&(this._options.content_unformatted.indexOf(x)!==-1||this._options.unformatted.indexOf(x)!==-1)},S.prototype._read_raw_content=function(x,T,A){var w="";if(A&&A.text[0]==="{")w=this.__patterns.handlebars_raw_close.read();else if(T.type===i.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var v=T.opened.text.substr(1).toLowerCase();if(v==="script"||v==="style"){var b=this._read_comment_or_cdata(x);if(b)return b.type=i.TEXT,b;w=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(v)&&(w=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig")))}return w?this._create_token(i.TEXT,w):null},S.prototype._read_content_word=function(x){var T="";if(this._options.unformatted_content_delimiter&&(x===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(i.TEXT,T)},g.exports.Tokenizer=S,g.exports.TOKEN=i}],M={};function n(g){var p=M[g];if(p!==void 0)return p.exports;var h=M[g]={exports:{}};return B[g](h,h.exports,n),h.exports}var D=n(18);P=D})();var X=P;if(!0)!(J=[I,I("6UM0"),I("TXwP")],z=function(B){var M=I("6UM0"),n=I("TXwP");return{html_beautify:function(D,g){return X(D,g,M.js_beautify,n.css_beautify)}}}.apply(pe,J),z!==void 0&&(He.exports=z));else var N,C})()},"rAM+":function(He,pe,I){"use strict";I.d(pe,"a",function(){return z});var J=I("Qw5x");function z(P,X){var N;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(N=Object(J.a)(P))||X&&P&&typeof P.length=="number"){N&&(P=N);var C=0,B=function(){};return{s:B,n:function(){return C>=P.length?{done:!0}:{done:!1,value:P[C++]}},e:function(p){throw p},f:B}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var M=!0,n=!1,D;return{s:function(){N=P[Symbol.iterator]()},n:function(){var p=N.next();return M=p.done,p},e:function(p){n=!0,D=p},f:function(){try{!M&&N.return!=null&&N.return()}finally{if(n)throw D}}}}},rHrb:function(He,pe,I){"use strict";Object.defineProperty(pe,"__esModule",{value:!0}),pe.CopyToClipboard=void 0;var J=P(I("q1tI")),z=P(I("+QRC"));function P(i){return i&&i.__esModule?i:{default:i}}function X(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?X=function(S){return typeof S}:X=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},X(i)}function N(i,s){var S=Object.keys(i);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(i);s&&(x=x.filter(function(T){return Object.getOwnPropertyDescriptor(i,T).enumerable})),S.push.apply(S,x)}return S}function C(i){for(var s=1;s<arguments.length;s++){var S=arguments[s]!=null?arguments[s]:{};s%2?N(S,!0).forEach(function(x){r(i,x,S[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(S)):N(S).forEach(function(x){Object.defineProperty(i,x,Object.getOwnPropertyDescriptor(S,x))})}return i}function B(i,s){if(i==null)return{};var S=M(i,s),x,T;if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(i);for(T=0;T<A.length;T++){if(x=A[T],s.indexOf(x)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(i,x))continue;S[x]=i[x]}}return S}function M(i,s){if(i==null)return{};var S={},x=Object.keys(i),T,A;for(A=0;A<x.length;A++){if(T=x[A],s.indexOf(T)>=0)continue;S[T]=i[T]}return S}function n(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}function D(i,s){for(var S=0;S<s.length;S++){var x=s[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(i,x.key,x)}}function g(i,s,S){return s&&D(i.prototype,s),S&&D(i,S),i}function p(i,s){return s&&(X(s)==="object"||typeof s=="function")?s:c(i)}function h(i){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},h(i)}function c(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function o(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),s&&d(i,s)}function d(i,s){return d=Object.setPrototypeOf||function(x,T){return x.__proto__=T,x},d(i,s)}function r(i,s,S){return s in i?Object.defineProperty(i,s,{value:S,enumerable:!0,configurable:!0,writable:!0}):i[s]=S,i}var a=function(i){o(s,i);function s(){var S,x;n(this,s);for(var T=arguments.length,A=new Array(T),w=0;w<T;w++)A[w]=arguments[w];return x=p(this,(S=h(s)).call.apply(S,[this].concat(A))),r(c(x),"onClick",function(v){var b=x.props,m=b.text,f=b.onCopy,O=b.children,E=b.options,_=J.default.Children.only(O),k=(0,z.default)(m,E);f&&f(m,k),_&&_.props&&typeof _.props.onClick=="function"&&_.props.onClick(v)}),x}return g(s,[{key:"render",value:function(){var x=this.props,T=x.text,A=x.onCopy,w=x.options,v=x.children,b=B(x,["text","onCopy","options","children"]),m=J.default.Children.only(v);return J.default.cloneElement(m,C({},b,{onClick:this.onClick}))}}]),s}(J.default.PureComponent);pe.CopyToClipboard=a,r(a,"defaultProps",{onCopy:void 0,options:void 0})},rUJ1:function(He,pe){const I=/[&<>"']/,J=/[&<>"']/g,z=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},N=w=>X[w];function C(w,v){if(v){if(I.test(w))return w.replace(J,N)}else if(z.test(w))return w.replace(P,N);return w}const B=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function M(w){return w.replace(B,(v,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const n=/(^|[^\[])\^/g;function D(w,v){w=w.source||w,v=v||"";const b={replace:(m,f)=>(f=f.source||f,f=f.replace(n,"$1"),w=w.replace(m,f),b),getRegex:()=>new RegExp(w,v)};return b}const g=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(w,v,b){if(w){let m;try{m=decodeURIComponent(M(b)).replace(g,"").toLowerCase()}catch(f){return null}if(m.indexOf("javascript:")===0||m.indexOf("vbscript:")===0||m.indexOf("data:")===0)return null}v&&!p.test(b)&&(b=a(v,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(m){return null}return b}const c={},o=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,r=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(w,v){c[" "+w]||(o.test(w)?c[" "+w]=w+"/":c[" "+w]=x(w,"/",!0)),w=c[" "+w];const b=w.indexOf(":")===-1;return v.substring(0,2)==="//"?b?v:w.replace(d,"$1")+v:v.charAt(0)==="/"?b?v:w.replace(r,"$1")+v:w+v}const i={exec:function(){}};function s(w){let v=1,b,m;for(;v<arguments.length;v++){b=arguments[v];for(m in b)Object.prototype.hasOwnProperty.call(b,m)&&(w[m]=b[m])}return w}function S(w,v){const b=w.replace(/\|/g,(O,E,_)=>{let k=!1,F=E;for(;--F>=0&&_[F]==="\\";)k=!k;return k?"|":" |"}),m=b.split(/ \|/);let f=0;if(m.length>v)m.splice(v);else for(;m.length<v;)m.push("");for(;f<m.length;f++)m[f]=m[f].trim().replace(/\\\|/g,"|");return m}function x(w,v,b){const m=w.length;if(m===0)return"";let f=0;for(;f<m;){const O=w.charAt(m-f-1);if(O===v&&!b)f++;else if(O!==v&&b)f++;else break}return w.substr(0,m-f)}function T(w,v){if(w.indexOf(v[1])===-1)return-1;const b=w.length;let m=0,f=0;for(;f<b;f++)if(w[f]==="\\")f++;else if(w[f]===v[0])m++;else if(w[f]===v[1]&&(m--,m<0))return f;return-1}function A(w){w&&w.sanitize&&!w.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")}He.exports={escape:C,unescape:M,edit:D,cleanUrl:h,resolveUrl:a,noopTest:i,merge:s,splitCells:S,rtrim:x,findClosingBracket:T,checkSanitizeDeprecation:A}},rdUC:function(He,pe,I){var J=I("MFOe"),z=J.Global;He.exports={name:"localStorage",read:X,write:N,each:C,remove:B,clearAll:M};function P(){return z.localStorage}function X(n){return P().getItem(n)}function N(n,D){return P().setItem(n,D)}function C(n){for(var D=P().length-1;D>=0;D--){var g=P().key(D);n(X(g),g)}}function B(n){return P().removeItem(n)}function M(){return P().clear()}},"s8/Y":function(He,pe,I){He.exports=I.p+"static/jx.6713fc81.svg"},"sB/4":function(He,pe,I){He.exports=I.p+"static/b.7405990c.svg"},sNtx:function(He,pe,I){},sR1s:function(He,pe,I){"use strict";I.d(pe,"b",function(){return X}),I.d(pe,"a",function(){return N}),I.d(pe,"c",function(){return C}),I.d(pe,"d",function(){return B});var J=I("U8pU"),z="RC_TABLE_KEY";function P(M){return M==null?[]:Array.isArray(M)?M:[M]}function X(M,n){if(!n&&typeof n!="number")return M;for(var D=P(n),g=M,p=0;p<D.length;p+=1){if(!g)return null;var h=D[p];g=g[h]}return g}function N(M){var n=[],D={};return M.forEach(function(g){for(var p=g||{},h=p.key,c=p.dataIndex,o=h||P(c).join("-")||z;D[o];)o="".concat(o,"_next");D[o]=!0,n.push(o)}),n}function C(){var M={};function n(h,c){c&&Object.keys(c).forEach(function(o){var d=c[o];d&&Object(J.a)(d)==="object"?(h[o]=h[o]||{},n(h[o],d)):h[o]=d})}for(var D=arguments.length,g=new Array(D),p=0;p<D;p++)g[p]=arguments[p];return g.forEach(function(h){n(M,h)}),M}function B(M){return M!=null}},sboe:function(He,pe,I){"use strict";I.d(pe,"a",function(){return P});var J=I("q1tI"),z=I.n(J),P=J.createContext(null)},"t/PP":function(He,pe,I){He.exports=I.p+"static/title.dd3b799f.svg"},t23M:function(He,pe,I){"use strict";var J=I("VTBJ"),z=I("1OyB"),P=I("vuIU"),X=I("Ji7U"),N=I("LK+K"),C=I("q1tI"),B=I.n(C),M=I("m+aA"),n=I("Zm9Q"),D=I("Kwbf"),g=I("c+Xe"),p=I("bdgK"),h="rc-observer-key",c=function(o){Object(X.a)(r,o);var d=Object(N.a)(r);function r(){var a;return Object(z.a)(this,r),a=d.apply(this,arguments),a.resizeObserver=null,a.childNode=null,a.currentElement=null,a.state={width:0,height:0,offsetHeight:0,offsetWidth:0},a.onResize=function(i){var s=a.props.onResize,S=i[0].target,x=S.getBoundingClientRect(),T=x.width,A=x.height,w=S.offsetWidth,v=S.offsetHeight,b=Math.floor(T),m=Math.floor(A);if(a.state.width!==b||a.state.height!==m||a.state.offsetWidth!==w||a.state.offsetHeight!==v){var f={width:b,height:m,offsetWidth:w,offsetHeight:v};a.setState(f),s&&Promise.resolve().then(function(){s(Object(J.a)(Object(J.a)({},f),{},{offsetWidth:w,offsetHeight:v}))})}},a.setChildNode=function(i){a.childNode=i},a}return Object(P.a)(r,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var i=this.props.disabled;if(i){this.destroyObserver();return}var s=Object(M.a)(this.childNode||this),S=s!==this.currentElement;S&&(this.destroyObserver(),this.currentElement=s),!this.resizeObserver&&s&&(this.resizeObserver=new p.default(this.onResize),this.resizeObserver.observe(s))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var i=this.props.children,s=Object(n.a)(i);if(s.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(s.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var S=s[0];if(C.isValidElement(S)&&Object(g.c)(S)){var x=S.ref;s[0]=C.cloneElement(S,{ref:Object(g.a)(x,this.setChildNode)})}return s.length===1?s[0]:s.map(function(T,A){return!C.isValidElement(T)||"key"in T&&T.key!==null?T:C.cloneElement(T,{key:"".concat(h,"-").concat(A)})})}}]),r}(C.Component);c.displayName="ResizeObserver",pe.a=c},t9D7:function(He,pe,I){"use strict";I.d(pe,"b",function(){return B}),I.d(pe,"g",function(){return n}),I.d(pe,"d",function(){return D}),I.d(pe,"e",function(){return g}),I.d(pe,"a",function(){return p}),I.d(pe,"f",function(){return o}),I.d(pe,"c",function(){return d});var J=I("Vhoy"),z=I("MI8n"),P=I("pmY6"),X=I("Cg/j"),N=I("ic2d"),C=I("nEHx");const B=Object(X.c)("themeService");var M;(function(r){function a(i){return i&&typeof i=="object"&&typeof i.id=="string"}r.isThemeColor=a})(M||(M={}));function n(r){return{id:r}}var D;(function(r){function a(A){return A&&typeof A=="object"&&typeof A.id=="string"&&(typeof A.color=="undefined"||M.isThemeColor(A.color))}r.isThemeIcon=a;const i=new RegExp(`^\\$\\((${J.a.iconNameExpression}(?:${J.a.iconModifierExpression})?)\\)$`);function s(A){const w=i.exec(A);if(!w)return;let[,v]=w;return{id:v}}r.fromString=s;function S(A,w){let v=A.id;const b=v.lastIndexOf("~");return b!==-1&&(v=v.substring(0,b)),w&&(v=`${v}~${w}`),{id:v}}r.modify=S;function x(A,w){var v,b;return A.id===w.id&&((v=A.color)===null||v===void 0?void 0:v.id)===((b=w.color)===null||b===void 0?void 0:b.id)}r.isEqual=x;function T(A,w){return{id:A.id,color:w?n(w):void 0}}r.asThemeIcon=T,r.asClassNameArray=J.a.asClassNameArray,r.asClassName=J.a.asClassName,r.asCSSSelector=J.a.asCSSSelector})(D||(D={}));function g(r){switch(r){case C.a.DARK:return"vs-dark";case C.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const p={ThemingContribution:"base.contributions.theming"};class h{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new z.b}onColorThemeChange(r){return this.themingParticipants.push(r),this.onThemingParticipantAddedEmitter.fire(r),Object(P.i)(()=>{const a=this.themingParticipants.indexOf(r);this.themingParticipants.splice(a,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new h;N.a.add(p.ThemingContribution,c);function o(r){return c.onColorThemeChange(r)}class d extends P.a{constructor(r){super();this.themeService=r,this.theme=r.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(a=>this.onThemeChange(a)))}onThemeChange(r){this.theme=r,this.updateStyles()}updateStyles(){}}},twBr:function(He,pe,I){He.exports=I.p+"static/s.1f286590.svg"},uMZB:function(He,pe,I){He.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(He,pe,I){He.exports=J;function J(){return I("gaXo"),{}}},ulZh:function(He,pe,I){typeof window!="undefined"&&function(z,P){He.exports=P()}(this,function(){return function(J){var z={};function P(X){if(z[X])return z[X].exports;var N=z[X]={i:X,l:!1,exports:{}};return J[X].call(N.exports,N,N.exports,P),N.l=!0,N.exports}return P.m=J,P.c=z,P.d=function(X,N,C){P.o(X,N)||Object.defineProperty(X,N,{enumerable:!0,get:C})},P.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},P.t=function(X,N){if(N&1&&(X=P(X)),N&8)return X;if(N&4&&typeof X=="object"&&X&&X.__esModule)return X;var C=Object.create(null);if(P.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:X}),N&2&&typeof X!="string")for(var B in X)P.d(C,B,function(M){return X[M]}.bind(null,B));return C},P.n=function(X){var N=X&&X.__esModule?function(){return X.default}:function(){return X};return P.d(N,"a",N),N},P.o=function(X,N){return Object.prototype.hasOwnProperty.call(X,N)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(J,z,P){"use strict";var X=Object.prototype.hasOwnProperty,N="~";function C(){}Object.create&&(C.prototype=Object.create(null),new C().__proto__||(N=!1));function B(g,p,h){this.fn=g,this.context=p,this.once=h||!1}function M(g,p,h,c,o){if(typeof h!="function")throw new TypeError("The listener must be a function");var d=new B(h,c||g,o),r=N?N+p:p;return g._events[r]?g._events[r].fn?g._events[r]=[g._events[r],d]:g._events[r].push(d):(g._events[r]=d,g._eventsCount++),g}function n(g,p){--g._eventsCount===0?g._events=new C:delete g._events[p]}function D(){this._events=new C,this._eventsCount=0}D.prototype.eventNames=function(){var p=[],h,c;if(this._eventsCount===0)return p;for(c in h=this._events)X.call(h,c)&&p.push(N?c.slice(1):c);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(h)):p},D.prototype.listeners=function(p){var h=N?N+p:p,c=this._events[h];if(!c)return[];if(c.fn)return[c.fn];for(var o=0,d=c.length,r=new Array(d);o<d;o++)r[o]=c[o].fn;return r},D.prototype.listenerCount=function(p){var h=N?N+p:p,c=this._events[h];return c?c.fn?1:c.length:0},D.prototype.emit=function(p,h,c,o,d,r){var a=N?N+p:p;if(!this._events[a])return!1;var i=this._events[a],s=arguments.length,S,x;if(i.fn){i.once&&this.removeListener(p,i.fn,void 0,!0);switch(s){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,h),!0;case 3:return i.fn.call(i.context,h,c),!0;case 4:return i.fn.call(i.context,h,c,o),!0;case 5:return i.fn.call(i.context,h,c,o,d),!0;case 6:return i.fn.call(i.context,h,c,o,d,r),!0}for(x=1,S=new Array(s-1);x<s;x++)S[x-1]=arguments[x];i.fn.apply(i.context,S)}else{var T=i.length,A;for(x=0;x<T;x++){i[x].once&&this.removeListener(p,i[x].fn,void 0,!0);switch(s){case 1:i[x].fn.call(i[x].context);break;case 2:i[x].fn.call(i[x].context,h);break;case 3:i[x].fn.call(i[x].context,h,c);break;case 4:i[x].fn.call(i[x].context,h,c,o);break;default:if(!S)for(A=1,S=new Array(s-1);A<s;A++)S[A-1]=arguments[A];i[x].fn.apply(i[x].context,S)}}}return!0},D.prototype.on=function(p,h,c){return M(this,p,h,c,!1)},D.prototype.once=function(p,h,c){return M(this,p,h,c,!0)},D.prototype.removeListener=function(p,h,c,o){var d=N?N+p:p;if(!this._events[d])return this;if(!h)return n(this,d),this;var r=this._events[d];if(r.fn)r.fn===h&&(!o||r.once)&&(!c||r.context===c)&&n(this,d);else{for(var a=0,i=[],s=r.length;a<s;a++)(r[a].fn!==h||o&&!r[a].once||c&&r[a].context!==c)&&i.push(r[a]);i.length?this._events[d]=i.length===1?i[0]:i:n(this,d)}return this},D.prototype.removeAllListeners=function(p){var h;return p?(h=N?N+p:p,this._events[h]&&n(this,h)):(this._events=new C,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=N,D.EventEmitter=D,J.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(J,z,P){(function(X){var N=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,C=/^([^\/?#]*)([^]*)$/,B=/(?:\/|^)\.(?=\/)/g,M=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(D,g,p){if(p=p||{},D=D.trim(),g=g.trim(),!g){if(!p.alwaysNormalize)return D;var h=n.parseURL(D);if(!h)throw new Error("Error trying to parse base URL.");return h.path=n.normalizePath(h.path),n.buildURLFromParts(h)}var c=n.parseURL(g);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return p.alwaysNormalize?(c.path=n.normalizePath(c.path),n.buildURLFromParts(c)):g;var o=n.parseURL(D);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var d=C.exec(o.path);o.netLoc=d[1],o.path=d[2]}o.netLoc&&!o.path&&(o.path="/");var r={scheme:o.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(r.netLoc=o.netLoc,c.path[0]!=="/"))if(!c.path)r.path=o.path,c.params||(r.params=o.params,c.query||(r.query=o.query));else{var a=o.path,i=a.substring(0,a.lastIndexOf("/")+1)+c.path;r.path=n.normalizePath(i)}return r.path===null&&(r.path=p.alwaysNormalize?n.normalizePath(c.path):c.path),n.buildURLFromParts(r)},parseURL:function(D){var g=N.exec(D);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(B,"");D.length!==(D=D.replace(M,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};J.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(J,z,P){function X(p){var h={};function c(d){if(h[d])return h[d].exports;var r=h[d]={i:d,l:!1,exports:{}};return p[d].call(r.exports,r,r.exports,c),r.l=!0,r.exports}c.m=p,c.c=h,c.i=function(d){return d},c.d=function(d,r,a){c.o(d,r)||Object.defineProperty(d,r,{configurable:!1,enumerable:!0,get:a})},c.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},c.n=function(d){var r=d&&d.__esModule?function(){return d.default}:function(){return d};return c.d(r,"a",r),r},c.o=function(d,r){return Object.prototype.hasOwnProperty.call(d,r)},c.p="/",c.oe=function(d){throw console.error(d),d};var o=c(c.s=ENTRY_MODULE);return o.default||o}var N="[\\.|\\-|\\+|\\w|/|@]+",C="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+N+").*?\\)";function B(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function M(p){return!isNaN(1*p)}function n(p,h,c){var o={};o[c]=[];var d=h.toString(),r=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!r)return o;for(var a=r[1],i=new RegExp("(\\\\n|\\W)"+B(a)+C,"g"),s;s=i.exec(d);){if(s[3]==="dll-reference")continue;o[c].push(s[3])}for(i=new RegExp("\\("+B(a)+'\\("(dll-reference\\s('+N+'))"\\)\\)'+C,"g");s=i.exec(d);)p[s[2]]||(o[c].push(s[1]),p[s[2]]=P(s[1]).m),o[s[2]]=o[s[2]]||[],o[s[2]].push(s[4]);for(var S=Object.keys(o),x=0;x<S.length;x++)for(var T=0;T<o[S[x]].length;T++)M(o[S[x]][T])&&(o[S[x]][T]=1*o[S[x]][T]);return o}function D(p){var h=Object.keys(p);return h.reduce(function(c,o){return c||p[o].length>0},!1)}function g(p,h){for(var c={main:[h]},o={main:[]},d={main:{}};D(c);)for(var r=Object.keys(c),a=0;a<r.length;a++){var i=r[a],s=c[i],S=s.pop();if(d[i]=d[i]||{},d[i][S]||!p[i][S])continue;d[i][S]=!0,o[i]=o[i]||[],o[i].push(S);for(var x=n(p,p[i][S],i),T=Object.keys(x),A=0;A<T.length;A++)c[T[A]]=c[T[A]]||[],c[T[A]]=c[T[A]].concat(x[T[A]])}return o}J.exports=function(p,h){h=h||{};var c={main:P.m},o=h.all?{main:Object.keys(c.main)}:g(c,p),d="";Object.keys(o).filter(function(S){return S!=="main"}).forEach(function(S){for(var x=0;o[S][x];)x++;o[S].push(x),c[S][x]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+S+" = ("+X.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+o[S].map(function(T){return""+JSON.stringify(T)+": "+c[S][T].toString()}).join(",")+`});
|
|
`}),d=d+"new (("+X.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+o.main.map(function(S){return""+JSON.stringify(S)+": "+c.main[S].toString()}).join(",")+"}))(self);";var r=new window.Blob([d],{type:"text/javascript"});if(h.bare)return r;var a=window.URL||window.webkitURL||window.mozURL||window.msURL,i=a.createObjectURL(r),s=new window.Worker(i);return s.objectURL=i,s}},"./src/config.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"hlsDefaultConfig",function(){return A}),P.d(z,"mergeConfig",function(){return v}),P.d(z,"enableStreamingMode",function(){return b});var X=P("./src/controller/abr-controller.ts"),N=P("./src/controller/audio-stream-controller.ts"),C=P("./src/controller/audio-track-controller.ts"),B=P("./src/controller/subtitle-stream-controller.ts"),M=P("./src/controller/subtitle-track-controller.ts"),n=P("./src/controller/buffer-controller.ts"),D=P("./src/controller/timeline-controller.ts"),g=P("./src/controller/cap-level-controller.ts"),p=P("./src/controller/fps-controller.ts"),h=P("./src/controller/eme-controller.ts"),c=P("./src/controller/cmcd-controller.ts"),o=P("./src/utils/xhr-loader.ts"),d=P("./src/utils/fetch-loader.ts"),r=P("./src/utils/cues.ts"),a=P("./src/utils/mediakeys-helper.ts"),i=P("./src/utils/logger.ts");function s(){return s=Object.assign||function(m){for(var f=1;f<arguments.length;f++){var O=arguments[f];for(var E in O)Object.prototype.hasOwnProperty.call(O,E)&&(m[E]=O[E])}return m},s.apply(this,arguments)}function S(m,f){var O=Object.keys(m);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(m);f&&(E=E.filter(function(_){return Object.getOwnPropertyDescriptor(m,_).enumerable})),O.push.apply(O,E)}return O}function x(m){for(var f=1;f<arguments.length;f++){var O=arguments[f]!=null?arguments[f]:{};f%2?S(Object(O),!0).forEach(function(E){T(m,E,O[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(O)):S(Object(O)).forEach(function(E){Object.defineProperty(m,E,Object.getOwnPropertyDescriptor(O,E))})}return m}function T(m,f,O){return f in m?Object.defineProperty(m,f,{value:O,enumerable:!0,configurable:!0,writable:!0}):m[f]=O,m}var A=x(x({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:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:X.default,bufferController:n.default,capLevelController:g.default,fpsController:p.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:a.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},w()),{},{subtitleStreamController:B.SubtitleStreamController,subtitleTrackController:M.default,timelineController:D.TimelineController,audioStreamController:N.default,audioTrackController:C.default,emeController:h.default,cmcdController:c.default});function w(){return{cueHandler:r.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 v(m,f){if((f.liveSyncDurationCount||f.liveMaxLatencyDurationCount)&&(f.liveSyncDuration||f.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(f.liveMaxLatencyDurationCount!==void 0&&(f.liveSyncDurationCount===void 0||f.liveMaxLatencyDurationCount<=f.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(f.liveMaxLatencyDuration!==void 0&&(f.liveSyncDuration===void 0||f.liveMaxLatencyDuration<=f.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return s({},m,f)}function b(m){var f=m.loader;if(f!==d.default&&f!==o.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),m.progressive=!1;else{var O=Object(d.fetchSupported)();O&&(m.loader=d.default,m.progressive=!0,m.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/polyfills/number.ts"),N=P("./src/utils/ewma-bandwidth-estimator.ts"),C=P("./src/events.ts"),B=P("./src/utils/buffer-helper.ts"),M=P("./src/errors.ts"),n=P("./src/types/loader.ts"),D=P("./src/utils/logger.ts");function g(c,o){for(var d=0;d<o.length;d++){var r=o[d];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(c,r.key,r)}}function p(c,o,d){return o&&g(c.prototype,o),d&&g(c,d),c}var h=function(){function c(d){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=d;var r=d.config;this.bwEstimator=new N.default(r.abrEwmaSlowVoD,r.abrEwmaFastVoD,r.abrEwmaDefaultEstimate),this.registerListeners()}var o=c.prototype;return o.registerListeners=function(){var r=this.hls;r.on(C.Events.FRAG_LOADING,this.onFragLoading,this),r.on(C.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(C.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.on(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.on(C.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var r=this.hls;r.off(C.Events.FRAG_LOADING,this.onFragLoading,this),r.off(C.Events.FRAG_LOADED,this.onFragLoaded,this),r.off(C.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.off(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.off(C.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(r,a){var i=a.frag;if(i.type===n.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=i,this.partCurrent=(s=a.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(r,a){var i=this.hls.config;a.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var r=this.fragCurrent,a=this.partCurrent,i=this.hls,s=i.autoLevelEnabled,S=i.config,x=i.media;if(!r||!x)return;var T=a?a.stats:r.stats,A=a?a.duration:r.duration;if(T.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||x.paused||!x.playbackRate||!x.readyState)return;var w=performance.now()-T.loading.start,v=Math.abs(x.playbackRate);if(w<=500*A/v)return;var b=i.levels,m=i.minAutoLevel,f=b[r.level],O=T.total||Math.max(T.loaded,Math.round(A*f.maxBitrate/8)),E=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/w),_=(O-T.loaded)/E,k=x.currentTime,F=(B.BufferHelper.bufferInfo(x,k,S.maxBufferHole).end-k)/v;if(F>=2*A/v||_<=F)return;var L=Number.POSITIVE_INFINITY,G;for(G=r.level-1;G>m;G--){var j=b[G].maxBitrate;if(L=A*j/(8*.8*E),L<F)break}if(L>=_)return;var R=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+r.sn+(a?" part "+a.index:"")+" of level "+r.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+`
|
|
Current BW estimate: `+(Object(X.isFiniteNumber)(R)?(R/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+_.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+L.toFixed(3)+` s
|
|
Time to underbuffer: `+F.toFixed(3)+" s"),i.nextLoadLevel=G,this.bwEstimator.sample(w,T.loaded),this.clearTimer(),r.loader&&(this.fragCurrent=this.partCurrent=null,r.loader.abort()),i.trigger(C.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:a,stats:T})},o.onFragLoaded=function(r,a){var i=a.frag,s=a.part;if(i.type===n.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(i.sn)){var S=s?s.stats:i.stats,x=s?s.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[i.level],A=(T.loaded?T.loaded.bytes:0)+S.loaded,w=(T.loaded?T.loaded.duration:0)+x;T.loaded={bytes:A,duration:w},T.realBitrate=Math.round(8*A/w)}if(i.bitrateTest){var v={stats:S,frag:i,part:s,id:i.type};this.onFragBuffered(C.Events.FRAG_BUFFERED,v),i.bitrateTest=!1}}},o.onFragBuffered=function(r,a){var i=a.frag,s=a.part,S=s?s.stats:i.stats;if(S.aborted)return;if(i.type!==n.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var x=S.parsing.end-S.loading.start;this.bwEstimator.sample(x,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=x/1e3:this.bitrateTestDelay=0},o.onError=function(r,a){switch(a.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var r=this.fragCurrent,a=this.partCurrent,i=this.hls,s=i.maxAutoLevel,S=i.config,x=i.minAutoLevel,T=i.media,A=a?a.duration:r?r.duration:0,w=T?T.currentTime:0,v=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,m=(B.BufferHelper.bufferInfo(T,w,S.maxBufferHole).end-w)/v,f=this.findBestLevel(b,x,s,m,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(f>=0)return f;D.logger.trace((m?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var O=A?Math.min(A,S.maxStarvationDelay):S.maxStarvationDelay,E=S.abrBandWidthFactor,_=S.abrBandWidthUpFactor;if(!m){var k=this.bitrateTestDelay;if(k){var F=A?Math.min(A,S.maxLoadingDelay):S.maxLoadingDelay;O=F-k,D.logger.trace("bitrate test took "+Math.round(1e3*k)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*O)+" ms"),E=_=1}}return f=this.findBestLevel(b,x,s,m+O,E,_),Math.max(f,0)},o.findBestLevel=function(r,a,i,s,S,x){for(var T,A=this.fragCurrent,w=this.partCurrent,v=this.lastLoadedFragLevel,b=this.hls.levels,m=b[v],f=!!(m!=null&&(T=m.details)!==null&&T!==void 0&&T.live),O=m==null?void 0:m.codecSet,E=w?w.duration:A?A.duration:0,_=i;_>=a;_--){var k=b[_];if(!k||O&&k.codecSet!==O)continue;var F=k.details,L=(w?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||E,G=void 0;_<=v?G=S*r:G=x*r;var j=b[_].maxBitrate,R=j*L/G;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+_+"/"+Math.round(G)+"/"+j+"/"+L+"/"+s+"/"+R),G>j&&(!R||f&&!this.bitrateTestDelay||R<s))return _}return-1},p(c,[{key:"nextAutoLevel",get:function(){var r=this._nextAutoLevel,a=this.bwEstimator;if(r!==-1&&(!a||!a.canEstimate()))return r;var i=this.getNextABRAutoLevel();return r!==-1&&(i=Math.min(r,i)),i},set:function(r){this._nextAutoLevel=r}}]),c}();z.default=h},"./src/controller/audio-stream-controller.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/polyfills/number.ts"),N=P("./src/controller/base-stream-controller.ts"),C=P("./src/events.ts"),B=P("./src/utils/buffer-helper.ts"),M=P("./src/controller/fragment-tracker.ts"),n=P("./src/types/level.ts"),D=P("./src/types/loader.ts"),g=P("./src/loader/fragment.ts"),p=P("./src/demux/chunk-cache.ts"),h=P("./src/demux/transmuxer-interface.ts"),c=P("./src/types/transmuxer.ts"),o=P("./src/controller/fragment-finders.ts"),d=P("./src/utils/discontinuities.ts"),r=P("./src/errors.ts"),a=P("./src/utils/logger.ts");function i(){return i=Object.assign||function(A){for(var w=1;w<arguments.length;w++){var v=arguments[w];for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(A[b]=v[b])}return A},i.apply(this,arguments)}function s(A,w){A.prototype=Object.create(w.prototype),A.prototype.constructor=A,S(A,w)}function S(A,w){return S=Object.setPrototypeOf||function(b,m){return b.__proto__=m,b},S(A,w)}var x=100,T=function(A){s(w,A);function w(b,m){var f;return f=A.call(this,b,m,"[audio-stream-controller]")||this,f.videoBuffer=null,f.videoTrackCC=-1,f.waitingVideoCC=-1,f.audioSwitch=!1,f.trackId=-1,f.waitingData=null,f.mainDetails=null,f.bufferFlushed=!1,f._registerListeners(),f}var v=w.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var m=this.hls;m.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.on(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(C.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),m.on(C.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.on(C.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.on(C.Events.ERROR,this.onError,this),m.on(C.Events.BUFFER_RESET,this.onBufferReset,this),m.on(C.Events.BUFFER_CREATED,this.onBufferCreated,this),m.on(C.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.on(C.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),m.on(C.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var m=this.hls;m.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.off(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(C.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),m.off(C.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.off(C.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.off(C.Events.ERROR,this.onError,this),m.off(C.Events.BUFFER_RESET,this.onBufferReset,this),m.off(C.Events.BUFFER_CREATED,this.onBufferCreated,this),m.off(C.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.off(C.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),m.off(C.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onInitPtsFound=function(m,f){var O=f.frag,E=f.id,_=f.initPTS;if(E==="main"){var k=O.cc;this.initPTS[O.cc]=_,this.log("InitPTS for cc: "+k+" found from main: "+_),this.videoTrackCC=k,this.state===N.State.WAITING_INIT_PTS&&this.tick()}},v.startLoad=function(m){if(!this.levels){this.startPosition=m,this.state=N.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(x),this.fragLoadError=0,f>0&&m===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=N.State.IDLE):(this.loadedmetadata=!1,this.state=N.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=m,this.tick()},v.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_TRACK:{var m,f=this.levels,O=this.trackId,E=f==null||((m=f[O])===null||m===void 0)?void 0:m.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=N.State.WAITING_INIT_PTS}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var _,k=performance.now(),F=this.retryDate;(!F||k>=F||(_=this.media)!==null&&_!==void 0&&_.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=N.State.IDLE);break}case N.State.WAITING_INIT_PTS:{var L=this.waitingData;if(L){var G=L.frag,j=L.part,R=L.cache,V=L.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.FRAG_LOADING;var ne=R.flush(),se={frag:G,part:j,payload:ne,networkDetails:null};this._handleFragmentLoadProgress(se),V&&A.prototype._handleFragmentLoadComplete.call(this,se)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Se=this.getLoadPosition(),De=B.BufferHelper.bufferInfo(this.mediaBuffer,Se,this.config.maxBufferHole),Ae=Object(o.fragmentWithinToleranceTest)(De.end,this.config.maxFragLookUpTolerance,G);Ae<0&&(a.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+De.end+" is needed"),this.clearWaitingFragment())}}else this.state=N.State.IDLE}}this.onTickEnd()},v.clearWaitingFragment=function(){var m=this.waitingData;m&&(this.fragmentTracker.removeFragment(m.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.IDLE)},v.onTickEnd=function(){var m=this.media;if(!m||!m.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:m,O=f.buffered;!this.loadedmetadata&&O.length&&(this.loadedmetadata=!0),this.lastCurrentTime=m.currentTime},v.doTickIdle=function(){var m,f,O=this.hls,E=this.levels,_=this.media,k=this.trackId,F=O.config;if(!E||!E[k])return;if(!_&&(this.startFragRequested||!F.startFragPrefetch))return;var L=E[k],G=L.details;if(!G||G.live&&this.levelLastLoaded!==k||this.waitForCdnTuneIn(G)){this.state=N.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(j===null)return;var R=j.len,V=this.getMaxBufferLength(),ne=this.audioSwitch;if(R>=V&&!ne)return;if(!ne&&this._streamEnded(j,G)){O.trigger(C.Events.BUFFER_EOS,{type:"audio"}),this.state=N.State.ENDED;return}var se=G.fragments,Se=se[0].start,De=j.end;if(ne){var Ae=this.getLoadPosition();De=Ae,G.PTSKnown&&Ae<Se&&((j.end>Se||j.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),_.currentTime=Se+.05))}var ke=this.getNextFragment(De,G);if(!ke){this.bufferFlushed=!0;return}((m=ke.decryptdata)===null||m===void 0?void 0:m.keyFormat)==="identity"&&!((f=ke.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(ke,G):this.loadFragment(ke,G,De)},v.getMaxBufferLength=function(){var m=A.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return f===null?m:Math.max(m,f.len)},v.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},v.onAudioTracksUpdated=function(m,f){var O=f.audioTracks;this.resetTransmuxer(),this.levels=O.map(function(E){return new n.Level(E)})},v.onAudioTrackSwitching=function(m,f){var O=!!f.url;this.trackId=f.id;var E=this.fragCurrent;E!=null&&E.loader&&E.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),O?this.setInterval(x):this.resetTransmuxer(),O?(this.audioSwitch=!0,this.state=N.State.IDLE):this.state=N.State.STOPPED,this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},v.onLevelLoaded=function(m,f){this.mainDetails=f.details},v.onAudioTrackLoaded=function(m,f){var O,E=this.levels,_=f.details,k=f.id;if(!E){this.warn("Audio tracks were reset while loading level "+k);return}this.log("Track "+k+" loaded ["+_.startSN+","+_.endSN+"],duration:"+_.totalduration);var F=E[k],L=0;if(_.live||(O=F.details)!==null&&O!==void 0&&O.live){var G=this.mainDetails;if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed||!G)return;!F.details&&_.hasProgramDateTime&&G.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(_,G),L=_.fragments[0].start):L=this.alignPlaylists(_,F.details)}F.details=_,this.levelLastLoaded=k,!this.startFragRequested&&(this.mainDetails||!_.live)&&this.setStartPosition(F.details,L),this.state===N.State.WAITING_TRACK&&!this.waitForCdnTuneIn(_)&&(this.state=N.State.IDLE),this.tick()},v._handleFragmentLoadProgress=function(m){var f,O=m.frag,E=m.part,_=m.payload,k=this.config,F=this.trackId,L=this.levels;if(!L){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+O.sn+" of level "+O.level+" will not be buffered");return}var G=L[F];console.assert(G,"Audio track is defined on fragment load progress");var j=G.details;console.assert(j,"Audio track details are defined on fragment load progress");var R=k.defaultAudioCodec||G.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new h.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ne=this.initPTS[O.cc],se=(f=O.initSegment)===null||f===void 0?void 0:f.data;if(ne!==void 0){var Se=!1,De=E?E.index:-1,Ae=De!==-1,ke=new c.ChunkMetadata(O.level,O.sn,O.stats.chunkCount,_.byteLength,De,Ae);V.push(_,se,R,"",O,E,j.totalduration,Se,ke,ne)}else{a.logger.log("Unknown video PTS for cc "+O.cc+", waiting for video PTS before demuxing audio frag "+O.sn+" of ["+j.startSN+" ,"+j.endSN+"],track "+F);var je=this.waitingData=this.waitingData||{frag:O,part:E,cache:new p.default,complete:!1},Be=je.cache;Be.push(new Uint8Array(_)),this.waitingVideoCC=this.videoTrackCC,this.state=N.State.WAITING_INIT_PTS}},v._handleFragmentLoadComplete=function(m){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,m)},v.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},v.onBufferCreated=function(m,f){var O=f.tracks.audio;O&&(this.mediaBuffer=O.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},v.onFragBuffered=function(m,f){var O=f.frag,E=f.part;if(O.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(O)){this.warn("Fragment "+O.sn+(E?" p: "+E.index:"")+" of level "+O.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}O.sn!=="initSegment"&&(this.fragPrevious=O,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(C.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(O,E)},v.onError=function(m,f){switch(f.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,f);break;case r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==N.State.ERROR&&this.state!==N.State.STOPPED&&(this.state=f.fatal?N.State.ERROR:N.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var O=!0,E=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);E&&E.len>.5&&(O=!this.reduceMaxBufferLength(E.len)),O&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},v.onBufferFlushed=function(m,f){var O=f.type;O===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},v._handleTransmuxComplete=function(m){var f,O="audio",E=this.hls,_=m.remuxResult,k=m.chunkMeta,F=this.getCurrentContext(k);if(!F){this.warn("The loading context changed while buffering fragment "+k.sn+" of level "+k.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(k.level);return}var L=F.frag,G=F.part,j=_.audio,R=_.text,V=_.id3,ne=_.initSegment;if(this.fragContextChanged(L))return;if(this.state=N.State.PARSING,this.audioSwitch&&j&&this.completeAudioSwitch(),ne!=null&&ne.tracks&&(this._bufferInitSegment(ne.tracks,L,k),E.trigger(C.Events.FRAG_PARSING_INIT_SEGMENT,{frag:L,id:O,tracks:ne.tracks})),j){var se=j.startPTS,Se=j.endPTS,De=j.startDTS,Ae=j.endDTS;G&&(G.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:Se,startDTS:De,endDTS:Ae}),L.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,se,Se,De,Ae),this.bufferFragmentData(j,L,G,k)}if(V!=null&&(f=V.samples)!==null&&f!==void 0&&f.length){var ke=i({frag:L,id:O},V);E.trigger(C.Events.FRAG_PARSING_METADATA,ke)}if(R){var je=i({frag:L,id:O},R);E.trigger(C.Events.FRAG_PARSING_USERDATA,je)}},v._bufferInitSegment=function(m,f,O){if(this.state!==N.State.PARSING)return;m.video&&delete m.video;var E=m.audio;if(!E)return;E.levelCodec=E.codec,E.id="audio",this.log("Init audio buffer, container:"+E.container+", codecs[parsed]=["+E.codec+"]"),this.hls.trigger(C.Events.BUFFER_CODECS,m);var _=E.initSegment;if(_!=null&&_.byteLength){var k={type:"audio",frag:f,part:null,chunkMeta:O,parent:f.type,data:_};this.hls.trigger(C.Events.BUFFER_APPENDING,k)}this.tick()},v.loadFragment=function(m,f,O){var E=this.fragmentTracker.getState(m);this.fragCurrent=m,(this.audioSwitch||E===M.FragmentState.NOT_LOADED||E===M.FragmentState.PARTIAL)&&(m.sn==="initSegment"?this._loadInitSegment(m):f.live&&!Object(X.isFiniteNumber)(this.initPTS[m.cc])?(this.log("Waiting for video PTS in continuity counter "+m.cc+" of live stream before loading audio fragment "+m.sn+" of level "+this.trackId),this.state=N.State.WAITING_INIT_PTS):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,m,f,O)))},v.completeAudioSwitch=function(){var m=this.hls,f=this.media,O=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,m.trigger(C.Events.AUDIO_TRACK_SWITCHED,{id:O})},w}(N.default);z.default=T},"./src/controller/audio-track-controller.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/events.ts"),N=P("./src/errors.ts"),C=P("./src/controller/base-playlist-controller.ts"),B=P("./src/types/loader.ts");function M(h,c){for(var o=0;o<c.length;o++){var d=c[o];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(h,d.key,d)}}function n(h,c,o){return c&&M(h.prototype,c),o&&M(h,o),h}function D(h,c){h.prototype=Object.create(c.prototype),h.prototype.constructor=h,g(h,c)}function g(h,c){return g=Object.setPrototypeOf||function(d,r){return d.__proto__=r,d},g(h,c)}var p=function(h){D(c,h);function c(d){var r;return r=h.call(this,d,"[audio-track-controller]")||this,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.trackName="",r.selectDefaultTrack=!0,r.registerListeners(),r}var o=c.prototype;return o.registerListeners=function(){var r=this.hls;r.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.on(X.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var r=this.hls;r.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.off(X.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,h.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(r,a){this.tracks=a.audioTracks||[]},o.onAudioTrackLoaded=function(r,a){var i=a.id,s=a.details,S=this.tracksInGroup[i];if(!S){this.warn("Invalid audio track id "+i);return}var x=S.details;S.details=a.details,this.log("audioTrack "+i+" loaded ["+s.startSN+"-"+s.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,a,x))},o.onLevelLoading=function(r,a){this.switchLevel(a.level)},o.onLevelSwitching=function(r,a){this.switchLevel(a.level)},o.switchLevel=function(r){var a=this.hls.levels[r];if(!(a!=null&&a.audioGroupIds))return;var i=a.audioGroupIds[a.urlId];if(this.groupId!==i){this.groupId=i;var s=this.tracks.filter(function(x){return!i||x.groupId===i});this.selectDefaultTrack&&!s.some(function(x){return x.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=s;var S={audioTracks:s};this.log("Updating audio tracks, "+s.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(X.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}},o.onError=function(r,a){if(h.prototype.onError.call(this,r,a),a.fatal||!a.context)return;a.context.type===B.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},o.setAudioTrack=function(r){var a=this.tracksInGroup;if(r<0||r>=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=a[this.trackId];this.log("Now switching to audio-track index "+r);var s=a[r],S=s.id,x=s.groupId,T=x===void 0?"":x,A=s.name,w=s.type,v=s.url;if(this.trackId=r,this.trackName=A,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:T,name:A,type:w,url:v}),s.details&&!s.details.live)return;var b=this.switchParams(s.url,i==null?void 0:i.details);this.loadPlaylist(b)},o.selectInitialTrack=function(){var r=this.tracksInGroup;console.assert(r.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,i=this.findTrackId(a)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(r){for(var a=this.tracksInGroup,i=0;i<a.length;i++){var s=a[i];if((!this.selectDefaultTrack||s.default)&&(!r||r===s.name))return s.id}return-1},o.loadPlaylist=function(r){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var i=a.id,s=a.groupId,S=a.url;if(r)try{S=r.addDirectives(S)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(X.Events.AUDIO_TRACK_LOADING,{url:S,id:i,groupId:s,deliveryDirectives:r||null})}},n(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1,this.setAudioTrack(r)}}]),c}(C.default);z.default=p},"./src/controller/base-playlist-controller.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return n});var X=P("./src/polyfills/number.ts"),N=P("./src/types/level.ts"),C=P("./src/controller/level-helper.ts"),B=P("./src/utils/logger.ts"),M=P("./src/errors.ts"),n=function(){function D(p,h){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=B.logger.log.bind(B.logger,h+":"),this.warn=B.logger.warn.bind(B.logger,h+":"),this.hls=p}var g=D.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(h,c){c.fatal&&c.type===M.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(h,c){var o=c==null?void 0:c.renditionReports;if(o)for(var d=0;d<o.length;d++){var r=o[d],a=""+r.URI;if(a===h.substr(-a.length)){var i=parseInt(r["LAST-MSN"]),s=parseInt(r["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var S=Math.min(c.age-c.partTarget,c.targetduration);s!==void 0&&S>c.partTarget&&(s+=1)}if(Object(X.isFiniteNumber)(i))return new N.HlsUrlParameters(i,Object(X.isFiniteNumber)(s)?s:void 0,N.HlsSkip.No)}}},g.loadPlaylist=function(h){},g.shouldLoadTrack=function(h){return this.canLoad&&h&&!!h.url&&(!h.details||h.details.live)},g.playlistLoaded=function(h,c,o){var d=this,r=c.details,a=c.stats,i=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(r.advancedDateTime=Date.now()-i,r.live||o!=null&&o.live){if(r.reloaded(o),o&&this.log("live playlist "+h+" "+(r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:"MISSED")),o&&r.fragments.length>0&&Object(C.mergeDetails)(o,r),!this.canLoad||!r.live)return;var s,S=void 0,x=void 0;if(r.canBlockReload&&r.endSN&&r.advanced){var T=this.hls.config.lowLatencyMode,A=r.lastPartSn,w=r.endSN,v=r.lastPartIndex,b=v!==-1,m=A===w,f=T?0:v;b?(S=m?w+1:A,x=m?f:v+1):S=w+1;var O=r.age,E=O+r.ageHeader,_=Math.min(E-r.partTarget,r.targetduration*1.5);if(_>0){if(o&&_>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+_+" with playlist age: "+r.age),_=0;else{var k=Math.floor(_/r.targetduration);if(S+=k,x!==void 0){var F=Math.round(_%r.targetduration/r.partTarget);x+=F}this.log("CDN Tune-in age: "+r.ageHeader+"s last advanced "+O.toFixed(2)+"s goal: "+_+" skip sn "+k+" to part "+x)}r.tuneInGoal=_}if(s=this.getDeliveryDirectives(r,c.deliveryDirectives,S,x),T||!m){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(r,c.deliveryDirectives,S,x);var L=Object(C.computeReloadInterval)(r,a);S!==void 0&&r.canBlockReload&&(L-=r.partTarget||1),this.log("reload live playlist "+h+" in "+Math.round(L)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(s)},L)}else this.clearTimer()},g.getDeliveryDirectives=function(h,c,o,d){var r=Object(N.getSkipValue)(h,o);return c!=null&&c.skip&&h.deltaUpdateFailed&&(o=c.msn,d=c.part,r=N.HlsSkip.No),new N.HlsUrlParameters(o,d,r)},g.retryLoadingOrFail=function(h){var c=this,o=this.hls.config,d=this.retryCount<o.levelLoadingMaxRetry;if(d){var r;if(this.retryCount++,h.details.indexOf("LoadTimeOut")>-1&&(r=h.context)!==null&&r!==void 0&&r.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+h.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+h.details+'"')}}else this.warn('cannot recover from error "'+h.details+'"'),this.clearTimer(),h.fatal=!0;return d},D}()},"./src/controller/base-stream-controller.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"State",function(){return w}),P.d(z,"default",function(){return v});var X=P("./src/polyfills/number.ts"),N=P("./src/task-loop.ts"),C=P("./src/controller/fragment-tracker.ts"),B=P("./src/utils/buffer-helper.ts"),M=P("./src/utils/logger.ts"),n=P("./src/events.ts"),D=P("./src/errors.ts"),g=P("./src/types/transmuxer.ts"),p=P("./src/utils/mp4-tools.ts"),h=P("./src/utils/discontinuities.ts"),c=P("./src/controller/fragment-finders.ts"),o=P("./src/controller/level-helper.ts"),d=P("./src/loader/fragment-loader.ts"),r=P("./src/crypt/decrypter.ts"),a=P("./src/utils/time-ranges.ts"),i=P("./src/types/loader.ts");function s(b,m){for(var f=0;f<m.length;f++){var O=m[f];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(b,O.key,O)}}function S(b,m,f){return m&&s(b.prototype,m),f&&s(b,f),b}function x(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function T(b,m){b.prototype=Object.create(m.prototype),b.prototype.constructor=b,A(b,m)}function A(b,m){return A=Object.setPrototypeOf||function(O,E){return O.__proto__=E,O},A(b,m)}var w={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"},v=function(b){T(m,b);function m(O,E,_){var k;return k=b.call(this)||this,k.hls=void 0,k.fragPrevious=null,k.fragCurrent=null,k.fragmentTracker=void 0,k.transmuxer=null,k._state=w.STOPPED,k.media=void 0,k.mediaBuffer=void 0,k.config=void 0,k.bitrateTest=!1,k.lastCurrentTime=0,k.nextLoadPosition=0,k.startPosition=0,k.loadedmetadata=!1,k.fragLoadError=0,k.retryDate=0,k.levels=null,k.fragmentLoader=void 0,k.levelLastLoaded=null,k.startFragRequested=!1,k.decrypter=void 0,k.initPTS=[],k.onvseeking=null,k.onvended=null,k.logPrefix="",k.log=void 0,k.warn=void 0,k.logPrefix=_,k.log=M.logger.log.bind(M.logger,_+":"),k.warn=M.logger.warn.bind(M.logger,_+":"),k.hls=O,k.fragmentLoader=new d.default(O.config),k.fragmentTracker=E,k.config=O.config,k.decrypter=new r.default(O,O.config),O.on(n.Events.KEY_LOADED,k.onKeyLoaded,x(k)),k}var f=m.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(E){},f.stopLoad=function(){this.fragmentLoader.abort();var E=this.fragCurrent;E&&this.fragmentTracker.removeFragment(E),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=w.STOPPED},f._streamEnded=function(E,_){var k=this.fragCurrent,F=this.fragmentTracker;if(!_.live&&k&&k.sn===_.endSN&&!E.nextStart){var L=F.getState(k);return L===C.FragmentState.PARTIAL||L===C.FragmentState.OK}return!1},f.onMediaAttached=function(E,_){var k=this.media=this.mediaBuffer=_.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),k.addEventListener("seeking",this.onvseeking),k.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===w.STOPPED&&this.startLoad(F.startPosition)},f.onMediaDetaching=function(){var E=this.media;E!=null&&E.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),E&&(E.removeEventListener("seeking",this.onvseeking),E.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},f.onMediaSeeking=function(){var E=this.config,_=this.fragCurrent,k=this.media,F=this.mediaBuffer,L=this.state,G=k?k.currentTime:0,j=B.BufferHelper.bufferInfo(F||k,G,E.maxBufferHole);if(this.log("media seeking to "+(Object(X.isFiniteNumber)(G)?G.toFixed(3):G)+", state: "+L),L===w.ENDED)this.resetLoadingState();else if(_&&!j.len){var R=E.maxFragLookUpTolerance,V=_.start-R,ne=_.start+_.duration+R,se=G>ne;(G<V||se)&&(se&&_.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),_.loader.abort()),this.resetLoadingState())}k&&(this.lastCurrentTime=G),!this.loadedmetadata&&!j.len&&(this.nextLoadPosition=this.startPosition=G),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(E,_){if(this.state!==w.KEY_LOADING||_.frag!==this.fragCurrent||!this.levels)return;this.state=w.IDLE;var k=this.levels[_.frag.level].details;k&&this.loadFragment(_.frag,k,_.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=w.STOPPED,this.hls.off(n.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,b.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(E,_){this.log("Loading key for "+E.sn+" of ["+_.startSN+"-"+_.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level),this.state=w.KEY_LOADING,this.fragCurrent=E,this.hls.trigger(n.Events.KEY_LOADING,{frag:E})},f.loadFragment=function(E,_,k){this._loadFragForPlayback(E,_,k)},f._loadFragForPlayback=function(E,_,k){var F=this,L=function(j){if(F.fragContextChanged(E)){F.warn("Fragment "+E.sn+(j.part?" p: "+j.part.index:"")+" of level "+E.level+" was dropped during download."),F.fragmentTracker.removeFragment(E);return}E.stats.chunkCount++,F._handleFragmentLoadProgress(j)};this._doFragLoad(E,_,k,L).then(function(G){if(!G)return;F.fragLoadError=0;var j=F.state;if(F.fragContextChanged(E)){(j===w.FRAG_LOADING||j===w.BACKTRACKING||!F.fragCurrent&&j===w.PARSING)&&(F.fragmentTracker.removeFragment(E),F.state=w.IDLE);return}if("payload"in G&&(F.log("Loaded fragment "+E.sn+" of level "+E.level),F.hls.trigger(n.Events.FRAG_LOADED,G),F.state===w.BACKTRACKING)){F.fragmentTracker.backtrack(E,G),F.resetFragmentLoading(E);return}F._handleFragmentLoadComplete(G)}).catch(function(G){F.warn(G),F.resetFragmentLoading(E)})},f.flushMainBuffer=function(E,_,k){if(k===void 0&&(k=null),!(E-_))return;var F={startOffset:E,endOffset:_,type:k};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,F)},f._loadInitSegment=function(E){var _=this;this._doFragLoad(E).then(function(k){if(!k||_.fragContextChanged(E)||!_.levels)throw new Error("init load aborted");return k}).then(function(k){var F=_.hls,L=k.payload,G=E.decryptdata;if(L&&L.byteLength>0&&G&&G.key&&G.iv&&G.method==="AES-128"){var j=self.performance.now();return _.decrypter.webCryptoDecrypt(new Uint8Array(L),G.key.buffer,G.iv.buffer).then(function(R){var V=self.performance.now();return F.trigger(n.Events.FRAG_DECRYPTED,{frag:E,payload:R,stats:{tstart:j,tdecrypt:V}}),k.payload=R,k})}return k}).then(function(k){var F=_.fragCurrent,L=_.hls,G=_.levels;if(!G)throw new Error("init load aborted, missing levels");var j=G[E.level].details;console.assert(j,"Level details are defined when init segment is loaded");var R=E.stats;_.state=w.IDLE,_.fragLoadError=0,E.data=new Uint8Array(k.payload),R.parsing.start=R.buffering.start=self.performance.now(),R.parsing.end=R.buffering.end=self.performance.now(),k.frag===F&&L.trigger(n.Events.FRAG_BUFFERED,{stats:R,frag:F,part:null,id:E.type}),_.tick()}).catch(function(k){_.warn(k),_.resetFragmentLoading(E)})},f.fragContextChanged=function(E){var _=this.fragCurrent;return!E||!_||E.level!==_.level||E.sn!==_.sn||E.urlId!==_.urlId},f.fragBufferedComplete=function(E,_){var k=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+E.type+" sn: "+E.sn+(_?" part: "+_.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level+" "+a.default.toString(B.BufferHelper.getBuffered(k))),this.state=w.IDLE,this.tick()},f._handleFragmentLoadComplete=function(E){var _=this.transmuxer;if(!_)return;var k=E.frag,F=E.part,L=E.partsLoaded,G=!L||L.length===0||L.some(function(R){return!R}),j=new g.ChunkMetadata(k.level,k.sn,k.stats.chunkCount+1,0,F?F.index:-1,!G);_.flush(j)},f._handleFragmentLoadProgress=function(E){},f._doFragLoad=function(E,_,k,F){var L=this;if(k===void 0&&(k=null),!this.levels)throw new Error("frag load aborted, missing levels");if(k=Math.max(E.start,k||0),this.config.lowLatencyMode&&_){var G=_.partList;if(G&&F){k>E.end&&_.fragmentHint&&(E=_.fragmentHint);var j=this.getNextPart(G,E,k);if(j>-1){var R=G[j];return this.log("Loading part sn: "+E.sn+" p: "+R.index+" cc: "+E.cc+" of playlist ["+_.startSN+"-"+_.endSN+"] parts [0-"+j+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(k.toFixed(3))),this.nextLoadPosition=R.start+R.duration,this.state=w.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,part:G[j],targetBufferTime:k}),this.doFragPartsLoad(E,G,j,F).catch(function(V){return L.handleFragLoadError(V)})}else if(!E.url||this.loadedEndOfParts(G,k))return Promise.resolve(null)}}return this.log("Loading fragment "+E.sn+" cc: "+E.cc+" "+(_?"of ["+_.startSN+"-"+_.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(k.toFixed(3))),Object(X.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=w.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,targetBufferTime:k}),this.fragmentLoader.load(E,F).catch(function(V){return L.handleFragLoadError(V)})},f.doFragPartsLoad=function(E,_,k,F){var L=this;return new Promise(function(G,j){var R=[],V=function ne(se){var Se=_[se];L.fragmentLoader.loadPart(E,Se,F).then(function(De){R[Se.index]=De;var Ae=De.part;L.hls.trigger(n.Events.FRAG_LOADED,De);var ke=_[se+1];if(ke&&ke.fragment===E)ne(se+1);else return G({frag:E,part:Ae,partsLoaded:R})}).catch(j)};V(k)})},f.handleFragLoadError=function(E){var _=E.data;return _&&_.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(_.frag,_.part):this.hls.trigger(n.Events.ERROR,_),null},f._handleTransmuxerFlush=function(E){var _=this.getCurrentContext(E);if(!_||this.state!==w.PARSING){this.fragCurrent||(this.state=w.IDLE);return}var k=_.frag,F=_.part,L=_.level,G=self.performance.now();k.stats.parsing.end=G,F&&(F.stats.parsing.end=G),this.updateLevelTiming(k,F,L,E.partial)},f.getCurrentContext=function(E){var _=this.levels,k=E.level,F=E.sn,L=E.part;if(!_||!_[k])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+k+". The current chunk will not be buffered."),null;var G=_[k],j=L>-1?Object(o.getPartWith)(G,F,L):null,R=j?j.fragment:Object(o.getFragmentWithSN)(G,F,this.fragCurrent);return R?{frag:R,part:j,level:G}:null},f.bufferFragmentData=function(E,_,k,F){if(!E||this.state!==w.PARSING)return;var L=E.data1,G=E.data2,j=L;if(L&&G&&(j=Object(p.appendUint8Array)(L,G)),!j||!j.length)return;var R={type:E.type,frag:_,part:k,chunkMeta:F,parent:_.type,data:j};this.hls.trigger(n.Events.BUFFER_APPENDING,R),E.dropped&&E.independent&&!k&&this.flushBufferGap(_)},f.flushBufferGap=function(E){var _=this.media;if(!_)return;if(!B.BufferHelper.isBuffered(_,_.currentTime)){this.flushMainBuffer(0,E.start);return}var k=_.currentTime,F=B.BufferHelper.bufferInfo(_,k,0),L=E.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,L*.25),j=Math.max(Math.min(E.start-G,F.end-G),k+G);E.start-j>G&&this.flushMainBuffer(j,E.start)},f.getFwdBufferInfo=function(E,_){var k=this.config,F=this.getLoadPosition();if(!Object(X.isFiniteNumber)(F))return null;var L=B.BufferHelper.bufferInfo(E,F,k.maxBufferHole);if(L.len===0&&L.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(F,_);if(G&&L.nextStart<G.end)return B.BufferHelper.bufferInfo(E,F,Math.max(L.nextStart,k.maxBufferHole))}return L},f.getMaxBufferLength=function(E){var _=this.config,k;return E?k=Math.max(8*_.maxBufferSize/E,_.maxBufferLength):k=_.maxBufferLength,Math.min(k,_.maxMaxBufferLength)},f.reduceMaxBufferLength=function(E){var _=this.config,k=E||_.maxBufferLength;return _.maxMaxBufferLength>=k?(_.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+_.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(E,_){var k,F,L=_.fragments,G=L.length;if(!G)return null;var j=this.config,R=L[0].start,V;if(_.live){var ne=j.initialLiveManifestSize;if(G<ne)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+ne+")"),null;!_.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(V=this.getInitialLiveFragment(_,L),this.startPosition=V?this.hls.liveSyncPosition||V.start:E)}else E<=R&&(V=L[0]);if(!V){var se=j.lowLatencyMode?_.partEnd:_.fragmentEnd;V=this.getFragmentAtPosition(E,se,_)}return(k=V)!==null&&k!==void 0&&k.initSegment&&!((F=V)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(V=V.initSegment),V},f.getNextPart=function(E,_,k){for(var F=-1,L=!1,G=!0,j=0,R=E.length;j<R;j++){var V=E[j];if(G=G&&!V.independent,F>-1&&k<V.start)break;var ne=V.loaded;!ne&&(L||V.independent||G)&&V.fragment===_&&(F=j),L=ne}return F},f.loadedEndOfParts=function(E,_){var k=E[E.length-1];return k&&_>k.start&&k.loaded},f.getInitialLiveFragment=function(E,_){var k=this.fragPrevious,F=null;if(k){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+k.programDateTime),F=Object(c.findFragmentByPDT)(_,k.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var L=k.sn+1;if(L>=E.startSN&&L<=E.endSN){var G=_[L-E.startSN];k.cc===G.cc&&(F=G,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(c.findFragWithCC)(_,k.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var j=this.hls.liveSyncPosition;j!==null&&(F=this.getFragmentAtPosition(j,this.bitrateTest?E.fragmentEnd:E.edge,E))}return F},f.getFragmentAtPosition=function(E,_,k){var F=this.config,L=this.fragPrevious,G=k.fragments,j=k.endSN,R=k.fragmentHint,V=F.maxFragLookUpTolerance,ne=!!(F.lowLatencyMode&&k.partList&&R);ne&&R&&!this.bitrateTest&&(G=G.concat(R),j=R.sn);var se;if(E<_){var Se=E>_-V?0:V;se=Object(c.findFragmentByPTS)(L,G,E,Se)}else se=G[G.length-1];if(se){var De=se.sn-k.startSN,Ae=L&&se.level===L.level,ke=G[De+1],je=this.fragmentTracker.getState(se);if(je===C.FragmentState.BACKTRACKED){se=null;for(var Be=De;G[Be]&&this.fragmentTracker.getState(G[Be])===C.FragmentState.BACKTRACKED;)L?se=G[Be--]:se=G[--Be];se||(se=ke)}else L&&se.sn===L.sn&&!ne&&(Ae&&(se.sn<j&&this.fragmentTracker.getState(ke)!==C.FragmentState.OK?(this.log("SN "+se.sn+" just loaded, load next one: "+ke.sn),se=ke):se=null))}return se},f.synchronizeToLiveEdge=function(E){var _=this.config,k=this.media;if(!k)return;var F=this.hls.liveSyncPosition,L=k.currentTime,G=E.fragments[0].start,j=E.edge,R=L>=G-_.maxFragLookUpTolerance&&L<=j;if(F!==null&&k.duration>F&&(L<F||!R)){var V=_.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:_.liveMaxLatencyDurationCount*E.targetduration;(!R&&k.readyState<4||L<j-V)&&(this.loadedmetadata||(this.nextLoadPosition=F),k.readyState&&(this.warn("Playback: "+L.toFixed(3)+" is located too far from the end of live sliding playlist: "+j+", reset currentTime to : "+F.toFixed(3)),k.currentTime=F))}},f.alignPlaylists=function(E,_){var k=this.levels,F=this.levelLastLoaded,L=this.fragPrevious,G=F!==null?k[F]:null,j=E.fragments.length;if(!j)return this.warn("No fragments in live playlist"),0;var R=E.fragments[0].start,V=!_,ne=E.alignedSliding&&Object(X.isFiniteNumber)(R);if(V||!ne&&!R){Object(h.alignStream)(L,G,E);var se=E.fragments[0].start;return this.log("Live playlist sliding: "+se.toFixed(2)+" start-sn: "+(_?_.startSN:"na")+"->"+E.startSN+" prev-sn: "+(L?L.sn:"na")+" fragments: "+j),se}return R},f.waitForCdnTuneIn=function(E){var _=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*_)},f.setStartPosition=function(E,_){var k=this.startPosition;if(k<_&&(k=-1),k===-1||this.lastCurrentTime===-1){var F=E.startTimeOffset;Object(X.isFiniteNumber)(F)?(k=_+F,F<0&&(k+=E.totalduration),k=Math.min(Math.max(_,k),_+E.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+k),this.startPosition=k):E.live?k=this.hls.liveSyncPosition||_:this.startPosition=k=0,this.lastCurrentTime=k}this.nextLoadPosition=k},f.getLoadPosition=function(){var E=this.media,_=0;return this.loadedmetadata&&E?_=E.currentTime:this.nextLoadPosition&&(_=this.nextLoadPosition),_},f.handleFragLoadAborted=function(E,_){this.transmuxer&&E.sn!=="initSegment"&&E.stats.aborted&&(this.warn("Fragment "+E.sn+(_?" part"+_.index:"")+" of level "+E.level+" was aborted"),this.resetFragmentLoading(E))},f.resetFragmentLoading=function(E){(!this.fragCurrent||!this.fragContextChanged(E))&&(this.state=w.IDLE)},f.onFragmentOrKeyLoadError=function(E,_){if(_.fatal)return;var k=_.frag;if(!k||k.type!==E)return;var F=this.fragCurrent;console.assert(F&&k.sn===F.sn&&k.level===F.level&&k.urlId===F.urlId,"Frag load error must match current frag to retry");var L=this.config;if(this.fragLoadError+1<=L.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(k.level))return;var G=Math.min(Math.pow(2,this.fragLoadError)*L.fragLoadingRetryDelay,L.fragLoadingMaxRetryTimeout);this.warn("Fragment "+k.sn+" of "+E+" "+k.level+" failed to load, retrying in "+G+"ms"),this.retryDate=self.performance.now()+G,this.fragLoadError++,this.state=w.FRAG_LOADING_WAITING_RETRY}else _.levelRetry?(E===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=w.IDLE):(M.logger.error(_.details+" reaches max retry, redispatch as fatal ..."),_.fatal=!0,this.hls.stopLoad(),this.state=w.ERROR)},f.afterBufferFlushed=function(E,_,k){if(!E)return;var F=B.BufferHelper.getBuffered(E);this.fragmentTracker.detectEvictedFragments(_,F,k),this.state===w.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=w.IDLE},f.resetLiveStartWhenNotLoaded=function(E){if(!this.loadedmetadata){this.startFragRequested=!1;var _=this.levels?this.levels[E].details:null;if(_!=null&&_.live)return this.startPosition=-1,this.setStartPosition(_,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(E,_,k,F){var L=this,G=k.details;console.assert(!!G,"level.details must be defined");var j=Object.keys(E.elementaryStreams).reduce(function(R,V){var ne=E.elementaryStreams[V];if(ne){var se=ne.endPTS-ne.startPTS;if(se<=0)return L.warn("Could not parse fragment "+E.sn+" "+V+" duration reliably ("+se+") resetting transmuxer to fallback to playlist timing"),L.resetTransmuxer(),R||!1;var Se=F?0:Object(o.updateFragPTSDTS)(G,E,ne.startPTS,ne.endPTS,ne.startDTS,ne.endDTS);return L.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:G,level:k,drift:Se,type:V,frag:E,start:ne.startPTS,end:ne.endPTS}),!0}return R},!1);j?(this.state=w.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:E,part:_})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S(m,[{key:"state",get:function(){return this._state},set:function(E){var _=this._state;_!==E&&(this._state=E,this.log(_+"->"+E))}}]),m}(N.default)},"./src/controller/buffer-controller.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return c});var X=P("./src/polyfills/number.ts"),N=P("./src/events.ts"),C=P("./src/utils/logger.ts"),B=P("./src/errors.ts"),M=P("./src/utils/buffer-helper.ts"),n=P("./src/utils/mediasource-helper.ts"),D=P("./src/loader/fragment.ts"),g=P("./src/controller/buffer-operation-queue.ts"),p=Object(n.getMediaSource)(),h=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function o(r){var a=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var i=a.hls,s=a.media,S=a.mediaSource;C.logger.log("[buffer-controller]: Media source opened"),s&&(a.updateMediaElementDuration(),i.trigger(N.Events.MEDIA_ATTACHED,{media:s})),S&&S.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){C.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){C.logger.log("[buffer-controller]: Media source ended")},this.hls=r,this._initSourceBuffer(),this.registerListeners()}var d=o.prototype;return d.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},d.destroy=function(){this.unregisterListeners(),this.details=null},d.registerListeners=function(){var a=this.hls;a.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(N.Events.BUFFER_RESET,this.onBufferReset,this),a.on(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(N.Events.BUFFER_EOS,this.onBufferEos,this),a.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(N.Events.FRAG_PARSED,this.onFragParsed,this),a.on(N.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var a=this.hls;a.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(N.Events.BUFFER_RESET,this.onBufferReset,this),a.off(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(N.Events.BUFFER_EOS,this.onBufferEos,this),a.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(N.Events.FRAG_PARSED,this.onFragParsed,this),a.off(N.Events.FRAG_CHANGED,this.onFragChanged,this)},d._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},d.onManifestParsed=function(a,i){var s=2;(i.audio&&!i.video||!i.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,C.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(a,i){var s=this.media=i.media;if(s&&p){var S=this.mediaSource=new p;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(S),this._objectUrl=s.src}},d.onMediaDetaching=function(){var a=this.media,i=this.mediaSource,s=this._objectUrl;if(i){if(C.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(S){C.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(s&&self.URL.revokeObjectURL(s),a.src===s?(a.removeAttribute("src"),a.load()):C.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(N.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(i){var s=a.sourceBuffer[i];try{s&&(a.removeBufferListeners(i),a.mediaSource&&a.mediaSource.removeSourceBuffer(s),a.sourceBuffer[i]=void 0)}catch(S){C.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",S)}}),this._initSourceBuffer()},d.onBufferCodecs=function(a,i){var s=this,S=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(x){if(S){var T=s.tracks[x];if(T&&typeof T.buffer.changeType=="function"){var A=i[x],w=A.codec,v=A.levelCodec,b=A.container,m=(T.levelCodec||T.codec).replace(h,"$1"),f=(v||w).replace(h,"$1");if(m!==f){var O=b+";codecs="+(v||w);s.appendChangeType(x,O)}}}else s.pendingTracks[x]=i[x]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(a,i){var s=this,S=this.operationQueue,x={execute:function(){var A=s.sourceBuffer[a];A&&(C.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+i),A.changeType(i)),S.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(A){C.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",A)}};S.append(x,a)},d.onBufferAppending=function(a,i){var s=this,S=this.hls,x=this.operationQueue,T=this.tracks,A=i.data,w=i.type,v=i.frag,b=i.part,m=i.chunkMeta,f=m.buffering[w],O=self.performance.now();f.start=O;var E=v.stats.buffering,_=b?b.stats.buffering:null;E.start===0&&(E.start=O),_&&_.start===0&&(_.start=O);var k=T.audio,F=w==="audio"&&m.id===1&&(k==null?void 0:k.container)==="audio/mpeg",L={execute:function(){if(f.executeStart=self.performance.now(),F){var j=s.sourceBuffer[w];if(j){var R=v.start-j.timestampOffset;Math.abs(R)>=.1&&(C.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+v.start+" (delta: "+R+") sn: "+v.sn+")"),j.timestampOffset=v.start)}}s.appendExecutor(A,w)},onStart:function(){},onComplete:function(){var j=self.performance.now();f.executeEnd=f.end=j,E.first===0&&(E.first=j),_&&_.first===0&&(_.first=j);var R=s.sourceBuffer,V={};for(var ne in R)V[ne]=M.BufferHelper.getBuffered(R[ne]);s.appendError=0,s.hls.trigger(N.Events.BUFFER_APPENDED,{type:w,frag:v,part:b,chunkMeta:m,parent:v.type,timeRanges:V})},onError:function(j){C.logger.error("[buffer-controller]: Error encountered while trying to append to the "+w+" SourceBuffer",j);var R={type:B.ErrorTypes.MEDIA_ERROR,parent:v.type,details:B.ErrorDetails.BUFFER_APPEND_ERROR,err:j,fatal:!1};j.code===DOMException.QUOTA_EXCEEDED_ERR?R.details=B.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,R.details=B.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>S.config.appendErrorMaxRetry&&(C.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),R.fatal=!0)),S.trigger(N.Events.ERROR,R)}};x.append(L,w)},d.onBufferFlushing=function(a,i){var s=this,S=this.operationQueue,x=function(A){return{execute:s.removeExecutor.bind(s,A,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(N.Events.BUFFER_FLUSHED,{type:A})},onError:function(v){C.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",v)}}};i.type?S.append(x(i.type),i.type):this.getSourceBufferTypes().forEach(function(T){S.append(x(T),T)})},d.onFragParsed=function(a,i){var s=this,S=i.frag,x=i.part,T=[],A=x?x.elementaryStreams:S.elementaryStreams;A[D.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(A[D.ElementaryStreamTypes.AUDIO]&&T.push("audio"),A[D.ElementaryStreamTypes.VIDEO]&&T.push("video"));var w=function(){var b=self.performance.now();S.stats.buffering.end=b,x&&(x.stats.buffering.end=b);var m=x?x.stats:S.stats;s.hls.trigger(N.Events.FRAG_BUFFERED,{frag:S,part:x,stats:m,id:S.type})};T.length===0&&C.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(w,T)},d.onFragChanged=function(a,i){this.flushBackBuffer()},d.onBufferEos=function(a,i){var s=this,S=this.getSourceBufferTypes().reduce(function(x,T){var A=s.sourceBuffer[T];return(!i.type||i.type===T)&&(A&&!A.ended&&(A.ended=!0,C.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),x&&!!(!A||A.ended)},!0);S&&this.blockBuffers(function(){var x=s.mediaSource;if(!x||x.readyState!=="open")return;x.endOfStream()})},d.onLevelUpdated=function(a,i){var s=i.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var a=this.hls,i=this.details,s=this.media,S=this.sourceBuffer;if(!s||i===null)return;var x=this.getSourceBufferTypes();if(!x.length)return;var T=i.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(X.isFiniteNumber)(T)||T<0)return;var A=s.currentTime,w=i.levelTargetDuration,v=Math.max(T,w),b=Math.floor(A/w)*w-v;x.forEach(function(m){var f=S[m];if(f){var O=M.BufferHelper.getBuffered(f);O.length>0&&b>O.start(0)&&(a.trigger(N.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),i.live&&a.trigger(N.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),a.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:m}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,i=this.hls,s=this.media,S=this.mediaSource,x=a.fragments[0].start+a.totalduration,T=s.duration,A=Object(X.isFiniteNumber)(S.duration)?S.duration:0;a.live&&i.config.liveDurationInfinity?(C.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(a)):(x>A&&x>T||!Object(X.isFiniteNumber)(T))&&(C.logger.log("[buffer-controller]: Updating Media Source duration to "+x.toFixed(3)),S.duration=x)},d.updateSeekableRange=function(a){var i=this.mediaSource,s=a.fragments,S=s.length;if(S&&a.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var x=Math.max(0,s[0].start),T=Math.max(x,x+a.totalduration);i.setLiveSeekableRange(x,T)}},d.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,i=this.operationQueue,s=this.pendingTracks,S=Object.keys(s).length;if(S&&!a||S===2){this.createSourceBuffers(s),this.pendingTracks={};var x=this.getSourceBufferTypes();if(x.length===0){this.hls.trigger(N.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}x.forEach(function(T){i.executeNext(T)})}},d.createSourceBuffers=function(a){var i=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var x in a)if(!i[x]){var T=a[x];if(!T)throw Error("source buffer exists for track "+x+", however track does not");var A=T.levelCodec||T.codec,w=T.container+";codecs="+A;C.logger.log("[buffer-controller]: creating sourceBuffer("+w+")");try{var v=i[x]=s.addSourceBuffer(w),b=x;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[x]={buffer:v,codec:A,container:T.container,levelCodec:T.levelCodec,id:T.id},S++}catch(m){C.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+m.message),this.hls.trigger(N.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:m,mimeType:w})}}S&&this.hls.trigger(N.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(a){var i=this.operationQueue,s=i.current(a);s.onStart()},d._onSBUpdateEnd=function(a){var i=this.operationQueue,s=i.current(a);s.onComplete(),i.shiftAndExecuteNext(a)},d._onSBUpdateError=function(a,i){C.logger.error("[buffer-controller]: "+a+" SourceBuffer error",i),this.hls.trigger(N.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(a);s&&s.onError(i)},d.removeExecutor=function(a,i,s){var S=this.media,x=this.mediaSource,T=this.operationQueue,A=this.sourceBuffer,w=A[a];if(!S||!x||!w){C.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(a);return}var v=Object(X.isFiniteNumber)(S.duration)?S.duration:Infinity,b=Object(X.isFiniteNumber)(x.duration)?x.duration:Infinity,m=Math.max(0,i),f=Math.min(s,v,b);f>m?(C.logger.log("[buffer-controller]: Removing ["+m+","+f+"] from the "+a+" SourceBuffer"),console.assert(!w.updating,a+" sourceBuffer must not be updating"),w.remove(m,f)):T.shiftAndExecuteNext(a)},d.appendExecutor=function(a,i){var s=this.operationQueue,S=this.sourceBuffer,x=S[i];if(!x){C.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(i);return}x.ended=!1,console.assert(!x.updating,i+" sourceBuffer must not be updating"),x.appendBuffer(a)},d.blockBuffers=function(a,i){var s=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){C.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var S=this.operationQueue,x=i.map(function(T){return S.appendBlocker(T)});Promise.all(x).then(function(){a(),i.forEach(function(T){var A=s.sourceBuffer[T];(!A||!A.updating)&&S.shiftAndExecuteNext(T)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(a,i,s){var S=this.sourceBuffer[a];if(!S)return;var x=s.bind(this,a);this.listeners[a].push({event:i,listener:x}),S.addEventListener(i,x)},d.removeBufferListeners=function(a){var i=this.sourceBuffer[a];if(!i)return;this.listeners[a].forEach(function(s){i.removeEventListener(s.event,s.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return N});var X=P("./src/utils/logger.ts"),N=function(){function C(M){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=M}var B=C.prototype;return B.append=function(n,D){var g=this.queues[D];g.push(n),g.length===1&&this.buffers[D]&&this.executeNext(D)},B.insertAbort=function(n,D){var g=this.queues[D];g.unshift(n),this.executeNext(D)},B.appendBlocker=function(n){var D,g=new Promise(function(h){D=h}),p={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,n),g},B.executeNext=function(n){var D=this.buffers,g=this.queues,p=D[n],h=g[n];if(h.length){var c=h[0];try{c.execute()}catch(o){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(o),(!p||!p.updating)&&(h.shift(),this.executeNext(n))}}},B.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},B.current=function(n){return this.queues[n][0]},C}()},"./src/controller/cap-level-controller.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/events.ts");function N(M,n){for(var D=0;D<n.length;D++){var g=n[D];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(M,g.key,g)}}function C(M,n,D){return n&&N(M.prototype,n),D&&N(M,D),M}var B=function(){function M(D){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=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=M.prototype;return n.setStreamController=function(g){this.streamController=g},n.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},n.registerListeners=function(){var g=this.hls;g.on(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var g=this.hls;g.off(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(g,p){M.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},n.onMediaAttaching=function(g,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},n.onManifestParsed=function(g,p){var h=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,h.config.capLevelToPlayerSize&&p.video&&this.startCapping()},n.onBufferCodecs=function(g,p){var h=this.hls;h.config.capLevelToPlayerSize&&p.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(g.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},n.getMaxLevel=function(g){var p=this,h=this.hls.levels;if(!h.length)return-1;var c=h.filter(function(o,d){return M.isLevelAllowed(d,p.restrictedLevels)&&d<=g});return this.clientRect=null,M.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},n.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,p={width:0,height:0};if(g){var h=g.getBoundingClientRect();p.width=h.width,p.height=h.height,!p.width&&!p.height&&(p.width=h.right-h.left||g.width||0,p.height=h.bottom-h.top||g.height||0)}return this.clientRect=p,p},M.isLevelAllowed=function(g,p){return p===void 0&&(p=[]),p.indexOf(g)===-1},M.getMaxLevelByMediaSize=function(g,p,h){if(!g||!g.length)return-1;for(var c=function(i,s){return s?i.width!==s.width||i.height!==s.height:!0},o=g.length-1,d=0;d<g.length;d+=1){var r=g[d];if((r.width>=p||r.height>=h)&&c(r,g[d+1])){o=d;break}}return o},C(M,[{key:"mediaWidth",get:function(){return this.getDimensions().width*M.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*M.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(p){}return g}}]),M}();z.default=B},"./src/controller/cmcd-controller.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return c});var X=P("./src/events.ts"),N=P("./src/types/cmcd.ts"),C=P("./src/utils/buffer-helper.ts"),B=P("./src/utils/logger.ts");function M(o,d){for(var r=0;r<d.length;r++){var a=d[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function n(o,d,r){return d&&M(o.prototype,d),r&&M(o,r),o}function D(o,d){var r=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(r)return(r=r.call(o)).next.bind(r);if(Array.isArray(o)||(r=g(o))||d&&o&&typeof o.length=="number"){r&&(o=r);var a=0;return function(){return a>=o.length?{done:!0}:{done:!1,value:o[a++]}}}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 g(o,d){if(!o)return;if(typeof o=="string")return p(o,d);var r=Object.prototype.toString.call(o).slice(8,-1);if(r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set")return Array.from(o);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(o,d)}function p(o,d){(d==null||d>o.length)&&(d=o.length);for(var r=0,a=new Array(d);r<d;r++)a[r]=o[r];return a}function h(){return h=Object.assign||function(o){for(var d=1;d<arguments.length;d++){var r=arguments[d];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(o[a]=r[a])}return o},h.apply(this,arguments)}var c=function(){function o(r){var a=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(){a.initialized&&(a.starved=!0),a.buffering=!0},this.onPlaying=function(){a.initialized||(a.initialized=!0),a.buffering=!1},this.applyPlaylistData=function(S){try{a.apply(S,{ot:N.CMCDObjectType.MANIFEST,su:!a.initialized})}catch(x){B.logger.warn("Could not generate manifest CMCD data.",x)}},this.applyFragmentData=function(S){try{var x=S.frag,T=a.hls.levels[x.level],A=a.getObjectType(x),w={d:x.duration*1e3,ot:A};(A===N.CMCDObjectType.VIDEO||A===N.CMCDObjectType.AUDIO||A==N.CMCDObjectType.MUXED)&&(w.br=T.bitrate/1e3,w.tb=a.getTopBandwidth(A),w.bl=a.getBufferLength(A)),a.apply(S,w)}catch(v){B.logger.warn("Could not generate segment CMCD data.",v)}},this.hls=r;var i=this.config=r.config,s=i.cmcd;s!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||o.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}var d=o.prototype;return d.registerListeners=function(){var a=this.hls;a.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.on(X.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var a=this.hls;a.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.off(X.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},d.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},d.onMediaAttached=function(a,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},d.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},d.onBufferCreated=function(a,i){var s,S;this.audioBuffer=(s=i.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(S=i.tracks.video)===null||S===void 0?void 0:S.buffer},d.createData=function(){var a;return{v:N.CMCDVersion,sf:N.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(a=this.media)===null||a===void 0?void 0:a.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},d.apply=function(a,i){i===void 0&&(i={}),h(i,this.createData());var s=i.ot===N.CMCDObjectType.INIT||i.ot===N.CMCDObjectType.VIDEO||i.ot===N.CMCDObjectType.MUXED;if(this.starved&&s&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var S=o.toHeaders(i);if(!Object.keys(S).length)return;a.headers||(a.headers={}),h(a.headers,S)}else{var x=o.toQuery(i);if(!x)return;a.url=o.appendQueryToUri(a.url,x)}},d.getObjectType=function(a){var i=a.type;return i==="subtitle"?N.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?N.CMCDObjectType.INIT:i==="audio"?N.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?N.CMCDObjectType.VIDEO:N.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(a){for(var i=0,s=a===N.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,S=D(s),x;!(x=S()).done;){var T=x.value;T.bitrate>i&&(i=T.bitrate)}return i>0?i:NaN},d.getBufferLength=function(a){var i=this.hls.media,s=a===N.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!i)return NaN;var S=C.BufferHelper.bufferInfo(s,i.currentTime,this.config.maxBufferHole);return S.len*1e3},d.createPlaylistLoader=function(){var a=this.config.pLoader,i=this.applyPlaylistData,s=a||this.config.loader;return function(){function S(T){this.loader=void 0,this.loader=new s(T)}var x=S.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(A,w,v){i(A),this.loader.load(A,w,v)},n(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},d.createFragmentLoader=function(){var a=this.config.fLoader,i=this.applyFragmentData,s=a||this.config.loader;return function(){function S(T){this.loader=void 0,this.loader=new s(T)}var x=S.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(A,w,v){i(A),this.loader.load(A,w,v)},n(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},o.uuid=function(){var a=URL.createObjectURL(new Blob),i=a.toString();return URL.revokeObjectURL(a),i.substr(i.lastIndexOf("/")+1)},o.serialize=function(a){for(var i=[],s=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},S=function(F){return Math.round(F)},x=function(F){return S(F/100)*100},T=function(F){return encodeURIComponent(F)},A={br:S,d:S,bl:x,dl:x,mtp:x,nor:T,rtp:x,tb:S},w=Object.keys(a||{}).sort(),v=D(w),b;!(b=v()).done;){var m=b.value,f=a[m];if(!s(f))continue;if(m==="v"&&f===1)continue;if(m=="pr"&&f===1)continue;var O=A[m];O&&(f=O(f));var E=typeof f,_=void 0;m==="ot"||m==="sf"||m==="st"?_=m+"="+f:E==="boolean"?_=m:E==="number"?_=m+"="+f:_=m+"="+JSON.stringify(f),i.push(_)}return i.join(",")},o.toHeaders=function(a){for(var i=Object.keys(a),s={},S=["Object","Request","Session","Status"],x=[{},{},{},{}],T={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},A=0,w=i;A<w.length;A++){var v=w[A],b=T[v]!=null?T[v]:1;x[b][v]=a[v]}for(var m=0;m<x.length;m++){var f=o.serialize(x[m]);f&&(s["CMCD-"+S[m]]=f)}return s},o.toQuery=function(a){return"CMCD="+encodeURIComponent(o.serialize(a))},o.appendQueryToUri=function(a,i){if(!i)return a;var s=a.includes("?")?"&":"?";return""+a+s+i},o}()},"./src/controller/eme-controller.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/events.ts"),N=P("./src/errors.ts"),C=P("./src/utils/logger.ts"),B=P("./src/utils/mediakeys-helper.ts");function M(c,o){for(var d=0;d<o.length;d++){var r=o[d];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(c,r.key,r)}}function n(c,o,d){return o&&M(c.prototype,o),d&&M(c,d),c}var D=3,g=function(o,d,r){var a={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(i){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:r.audioRobustness||""})}),d.forEach(function(i){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:r.videoRobustness||""})}),[a]},p=function(o,d,r,a){switch(o){case B.KeySystems.WIDEVINE:return g(d,r,a);default:throw new Error("Unknown key-system: "+o)}},h=function(){function c(d){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=d,this._config=d.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 o=c.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o._unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o.getLicenseServerUrl=function(r){switch(r){case B.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+r+'"')},o._attemptKeySystemAccess=function(r,a,i){var s=this,S=p(r,a,i,this._drmSystemOptions);C.logger.log("Requesting encrypted media key-system access");var x=this.requestMediaKeySystemAccess(r,S);this.mediaKeysPromise=x.then(function(T){return s._onMediaKeySystemAccessObtained(r,T)}),x.catch(function(T){C.logger.error('Failed to obtain key-system "'+r+'" access:',T)})},o._onMediaKeySystemAccessObtained=function(r,a){var i=this;C.logger.log('Access for key-system "'+r+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:r};this._mediaKeysList.push(s);var S=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(x){return s.mediaKeys=x,C.logger.log('Media-keys created for key-system "'+r+'"'),i._onMediaKeysCreated(),x});return S.catch(function(x){C.logger.error("Failed to create media-keys:",x)}),S},o._onMediaKeysCreated=function(){var r=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),r._onNewMediaKeySession(a.mediaKeysSession))})},o._onNewMediaKeySession=function(r){var a=this;C.logger.log("New key-system session "+r.sessionId),r.addEventListener("message",function(i){a._onKeySessionMessage(r,i.message)},!1)},o._onKeySessionMessage=function(r,a){C.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(i){C.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),r.update(i)})},o.onMediaEncrypted=function(r){var a=this;if(C.logger.log('Media is encrypted using "'+r.initDataType+'" init data type'),!this.mediaKeysPromise){C.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(S){if(!a._media)return;a._attemptSetMediaKeys(S),a._generateRequestWithPreferredKeySession(r.initDataType,r.initData)};this.mediaKeysPromise.then(i).catch(i)},o._attemptSetMediaKeys=function(r){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var a=this._mediaKeysList[0];if(!a||!a.mediaKeys){C.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}C.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(r,a){var i=this,s=this._mediaKeysList[0];if(!s){C.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){C.logger.warn("Key-Session already initialized but requested again");return}var S=s.mediaKeysSession;if(!S){C.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!a){C.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}C.logger.log('Generating key-session request for "'+r+'" init data type'),s.mediaKeysSessionInitialized=!0,S.generateRequest(r,a).then(function(){C.logger.debug("Key-session generation succeeded")}).catch(function(x){C.logger.error("Error generating key-session request:",x),i.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(r,a,i){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,r,a,i);var S=this._licenseXhrSetup;if(S)try{S.call(this.hls,s,r),S=void 0}catch(x){C.logger.error(x)}try{s.readyState||s.open("POST",r,!0),S&&S.call(this.hls,s,r)}catch(x){throw new Error("issue setting up KeySystem license XHR "+x)}return s},o._onLicenseRequestReadyStageChange=function(r,a,i,s){switch(r.readyState){case 4:if(r.status===200){this._requestLicenseFailureCount=0,C.logger.log("License request succeeded");var S=r.response,x=this._licenseResponseCallback;if(x)try{S=x.call(this.hls,r,a)}catch(A){C.logger.error(A)}s(S)}else{if(C.logger.error("License Request XHR failed ("+a+"). Status: "+r.status+" ("+r.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=D-this._requestLicenseFailureCount+1;C.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(i,s)}break}},o._generateLicenseRequestChallenge=function(r,a){switch(r.mediaKeySystemDomain){case B.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+r.mediaKeySystemDomain)},o._requestLicense=function(r,a){C.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){C.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(i.mediaKeySystemDomain),S=this._createLicenseXhr(s,r,a);C.logger.log("Sending license request to URL: "+s);var x=this._generateLicenseRequestChallenge(i,r);S.send(x)}catch(T){C.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(r,a){if(!this._emeEnabled)return;var i=a.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var r=this._media,a=this._mediaKeysList;if(!r)return;r.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return r.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(r,a){if(!this._emeEnabled)return;var i=a.levels.map(function(S){return S.audioCodec}).filter(function(S){return!!S}),s=a.levels.map(function(S){return S.videoCodec}).filter(function(S){return!!S});this._attemptKeySystemAccess(B.KeySystems.WIDEVINE,i,s)},n(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();z.default=h},"./src/controller/fps-controller.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/events.ts"),N=P("./src/utils/logger.ts"),C=function(){function B(n){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=n,this.registerListeners()}var M=B.prototype;return M.setStreamController=function(D){this.streamController=D},M.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},M.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},M.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},M.onMediaAttaching=function(D,g){var p=this.hls.config;if(p.capLevelOnFPSDrop){var h=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=h,h&&typeof h.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},M.checkFPS=function(D,g,p){var h=performance.now();if(g){if(this.lastTime){var c=h-this.lastTime,o=p-this.lastDroppedFrames,d=g-this.lastDecodedFrames,r=1e3*o/c,a=this.hls;if(a.trigger(X.Events.FPS_DROP,{currentDropped:o,currentDecoded:d,totalDroppedFrames:p}),r>0&&o>a.config.fpsDroppedMonitoringThreshold*d){var i=a.currentLevel;N.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=i)&&(i=i-1,a.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:a.currentLevel}),a.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=h,this.lastDroppedFrames=p,this.lastDecodedFrames=g}},M.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var g=D.getVideoPlaybackQuality();this.checkFPS(D,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},B}();z.default=C},"./src/controller/fragment-finders.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"findFragmentByPDT",function(){return C}),P.d(z,"findFragmentByPTS",function(){return B}),P.d(z,"fragmentWithinToleranceTest",function(){return M}),P.d(z,"pdtWithinToleranceTest",function(){return n}),P.d(z,"findFragWithCC",function(){return D});var X=P("./src/polyfills/number.ts"),N=P("./src/utils/binary-search.ts");function C(g,p,h){if(p===null||!Array.isArray(g)||!g.length||!Object(X.isFiniteNumber)(p))return null;var c=g[0].programDateTime;if(p<(c||0))return null;var o=g[g.length-1].endProgramDateTime;if(p>=(o||0))return null;h=h||0;for(var d=0;d<g.length;++d){var r=g[d];if(n(p,h,r))return r}return null}function B(g,p,h,c){h===void 0&&(h=0),c===void 0&&(c=0);var o=null;if(g?o=p[g.sn-p[0].sn+1]||null:h===0&&p[0].start===0&&(o=p[0]),o&&M(h,c,o)===0)return o;var d=N.default.search(p,M.bind(null,h,c));return d||o}function M(g,p,h){g===void 0&&(g=0),p===void 0&&(p=0);var c=Math.min(p,h.duration+(h.deltaPTS?h.deltaPTS:0));return h.start+h.duration-c<=g?1:h.start-c>g&&h.start?-1:0}function n(g,p,h){var c=Math.min(p,h.duration+(h.deltaPTS?h.deltaPTS:0))*1e3,o=h.endProgramDateTime||0;return o-c>g}function D(g,p){return N.default.search(g,function(h){return h.cc<p?1:h.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"FragmentState",function(){return C}),P.d(z,"FragmentTracker",function(){return B});var X=P("./src/events.ts"),N=P("./src/types/loader.ts"),C;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(C||(C={}));var B=function(){function D(p){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=p,this._registerListeners()}var g=D.prototype;return g._registerListeners=function(){var h=this.hls;h.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var h=this.hls;h.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(h,c){if(c===N.PlaylistLevelType.MAIN){var o=this.activeFragment,d=this.activeParts;if(!o)return null;if(d)for(var r=d.length;r--;){var a=d[r],i=a?a.end:o.appendedPTS;if(a.start<=h&&i!==void 0&&h<=i)return r>9&&(this.activeParts=d.slice(r-9)),a}else if(o.start<=h&&o.appendedPTS!==void 0&&h<=o.appendedPTS)return o}return this.getBufferedFrag(h,c)},g.getBufferedFrag=function(h,c){for(var o=this.fragments,d=Object.keys(o),r=d.length;r--;){var a=o[d[r]];if((a==null?void 0:a.body.type)===c&&a.buffered){var i=a.body;if(i.start<=h&&h<=i.end)return i}}return null},g.detectEvictedFragments=function(h,c,o){var d=this;Object.keys(this.fragments).forEach(function(r){var a=d.fragments[r];if(!a)return;if(!a.buffered){a.body.type===o&&d.removeFragment(a.body);return}var i=a.range[h];if(!i)return;i.time.some(function(s){var S=!d.isTimeBuffered(s.startPTS,s.endPTS,c);return S&&d.removeFragment(a.body),S})})},g.detectPartialFragments=function(h){var c=this,o=this.timeRanges,d=h.frag,r=h.part;if(!o||d.sn==="initSegment")return;var a=n(d),i=this.fragments[a];if(!i)return;Object.keys(o).forEach(function(s){var S=d.elementaryStreams[s];if(!S)return;var x=o[s],T=r!==null||S.partial===!0;i.range[s]=c.getBufferedTimes(d,r,T,x)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},g.fragBuffered=function(h){var c=n(h),o=this.fragments[c];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},g.getBufferedTimes=function(h,c,o,d){for(var r={time:[],partial:o},a=c?c.start:h.start,i=c?c.end:h.end,s=h.minEndPTS||i,S=h.maxStartPTS||a,x=0;x<d.length;x++){var T=d.start(x)-this.bufferPadding,A=d.end(x)+this.bufferPadding;if(S>=T&&s<=A){r.time.push({startPTS:Math.max(a,d.start(x)),endPTS:Math.min(i,d.end(x))});break}else if(a<A&&i>T)r.partial=!0,r.time.push({startPTS:Math.max(a,d.start(x)),endPTS:Math.min(i,d.end(x))});else if(i<=T)break}return r},g.getPartialFragment=function(h){var c=null,o,d,r,a=0,i=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(S){var x=s[S];if(!x)return;M(x)&&(d=x.body.start-i,r=x.body.end+i,h>=d&&h<=r&&(o=Math.min(h-d,r-h),a<=o&&(c=x.body,a=o)))}),c},g.getState=function(h){var c=n(h),o=this.fragments[c];return o?o.buffered?M(o)?C.PARTIAL:C.OK:o.backtrack?C.BACKTRACKED:C.APPENDING:C.NOT_LOADED},g.backtrack=function(h,c){var o=n(h),d=this.fragments[o];if(!d||d.backtrack)return null;var r=d.backtrack=c||d.loaded;return d.loaded=null,r},g.getBacktrackData=function(h){var c=n(h),o=this.fragments[c];if(o){var d,r=o.backtrack;if(r!=null&&(d=r.payload)!==null&&d!==void 0&&d.byteLength)return r;this.removeFragment(h)}return null},g.isTimeBuffered=function(h,c,o){for(var d,r,a=0;a<o.length;a++){if(d=o.start(a)-this.bufferPadding,r=o.end(a)+this.bufferPadding,h>=d&&c<=r)return!0;if(c<=d)return!1}return!1},g.onFragLoaded=function(h,c){var o=c.frag,d=c.part;if(o.sn==="initSegment"||o.bitrateTest||d)return;var r=n(o);this.fragments[r]={body:o,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(h,c){var o=this,d=c.frag,r=c.part,a=c.timeRanges;if(d.type===N.PlaylistLevelType.MAIN)if(this.activeFragment=d,r){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(r)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(s){var S=a[s];if(o.detectEvictedFragments(s,S),!r)for(var x=0;x<S.length;x++)d.appendedPTS=Math.max(S.end(x),d.appendedPTS||0)})},g.onFragBuffered=function(h,c){this.detectPartialFragments(c)},g.hasFragment=function(h){var c=n(h);return!!this.fragments[c]},g.removeFragmentsInRange=function(h,c,o){var d=this;Object.keys(this.fragments).forEach(function(r){var a=d.fragments[r];if(!a)return;if(a.buffered){var i=a.body;i.type===o&&i.start<c&&i.end>h&&d.removeFragment(i)}})},g.removeFragment=function(h){var c=n(h);h.stats.loaded=0,h.clearElementaryStreamInfo(),delete this.fragments[c]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function M(D){var g,p;return D.buffered&&(((g=D.range.video)===null||g===void 0?void 0:g.partial)||((p=D.range.audio)===null||p===void 0?void 0:p.partial))}function n(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"STALL_MINIMUM_DURATION_MS",function(){return M}),P.d(z,"MAX_START_GAP_JUMP",function(){return n}),P.d(z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),P.d(z,"SKIP_BUFFER_RANGE_START",function(){return g}),P.d(z,"default",function(){return p});var X=P("./src/utils/buffer-helper.ts"),N=P("./src/errors.ts"),C=P("./src/events.ts"),B=P("./src/utils/logger.ts"),M=250,n=2,D=.1,g=.05,p=function(){function h(o,d,r,a){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=o,this.media=d,this.fragmentTracker=r,this.hls=a}var c=h.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(d){var r=this.config,a=this.media,i=this.stalled,s=a.currentTime,S=a.seeking,x=this.seeking&&!S,T=!this.seeking&&S;if(this.seeking=S,s!==d){if(this.moved=!0,i!==null){if(this.stallReported){var A=self.performance.now()-i;B.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(A)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||x)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!X.BufferHelper.getBuffered(a).length)return;var w=X.BufferHelper.bufferInfo(a,s,0),v=w.len>0,b=w.nextStart||0;if(!v&&!b)return;if(S){var m=w.len>n,f=!b||b-s>n&&!this.fragmentTracker.getPartialFragment(s);if(m||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var O,E=Math.max(b,w.start||0)-s,_=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,k=_==null||((O=_.details)===null||O===void 0)?void 0:O.live,F=k?_.details.targetduration*2:n;if(E>0&&E<=F){this._trySkipBufferHole(null);return}}var L=self.performance.now();if(i===null){this.stalled=L;return}var G=L-i;!S&&G>=M&&this._reportStall(w.len);var j=X.BufferHelper.bufferInfo(a,s,r.maxBufferHole);this._tryFixBufferStall(j,G)},c._tryFixBufferStall=function(d,r){var a=this.config,i=this.fragmentTracker,s=this.media,S=s.currentTime,x=i.getPartialFragment(S);if(x){var T=this._trySkipBufferHole(x);if(T)return}d.len>a.maxBufferHole&&r>a.highBufferWatchdogPeriod*1e3&&(B.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(d){var r=this.hls,a=this.media,i=this.stallReported;i||(this.stallReported=!0,B.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+d+")"),r.trigger(C.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},c._trySkipBufferHole=function(d){for(var r=this.config,a=this.hls,i=this.media,s=i.currentTime,S=0,x=X.BufferHelper.getBuffered(i),T=0;T<x.length;T++){var A=x.start(T);if(s+r.maxBufferHole>=S&&s<A){var w=Math.max(A+g,i.currentTime+D);return B.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+w),this.moved=!0,this.stalled=null,i.currentTime=w,d&&a.trigger(C.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+w,frag:d}),w}S=x.end(T)}return 0},c._tryNudgeBuffer=function(){var d=this.config,r=this.hls,a=this.media,i=a.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<d.nudgeMaxRetry){var S=i+s*d.nudgeOffset;B.logger.warn("Nudging 'currentTime' from "+i+" to "+S),a.currentTime=S,r.trigger(C.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else B.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+d.nudgeMaxRetry+" nudges"),r.trigger(C.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},h}()},"./src/controller/id3-track-controller.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/events.ts"),N=P("./src/utils/texttrack-utils.ts"),C=P("./src/demux/id3.ts"),B=.25,M=function(){function n(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var D=n.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var p=this.hls;p.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var p=this.hls;p.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(p,h){this.media=h.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(N.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(p){if(!this.media)return;for(var h=0;h<p.length;h++){var c=p[h];if(c.kind==="metadata"&&c.label==="id3")return Object(N.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(p,h){if(!this.media)return;var c=h.frag,o=h.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,r=0;r<o.length;r++){var a=C.getID3Frames(o[r].data);if(a){var i=o[r].pts,s=r<o.length-1?o[r+1].pts:c.end,S=s-i;S<=0&&(s=i+B);for(var x=0;x<a.length;x++){var T=a[x];if(!C.isTimeStampFrame(T)){var A=new d(i,s,"");A.value=T,this.id3Track.addCue(A)}}}}},D.onBufferFlushing=function(p,h){var c=h.startOffset,o=h.endOffset,d=h.type;if(!d||d==="audio"){var r=this.id3Track;r&&Object(N.removeCuesInRange)(r,c,o)}},n}();z.default=M},"./src/controller/latency-controller.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return n});var X=P("./src/errors.ts"),N=P("./src/events.ts"),C=P("./src/utils/logger.ts");function B(D,g){for(var p=0;p<g.length;p++){var h=g[p];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function M(D,g,p){return g&&B(D.prototype,g),p&&B(D,p),D}var n=function(){function D(p){var h=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 h.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var g=D.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(N.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(N.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(N.Events.ERROR,this.onError)},g.onMediaAttached=function(h,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(h,c){var o=c.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(h,c){if(c.details!==X.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,C.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var h=this.media,c=this.levelDetails;if(!h||!c)return;this.currentTime=h.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var d=this.config,r=d.lowLatencyMode,a=d.maxLiveSyncPlaybackRate;if(!r||a===1)return;var i=this.targetLatency;if(i===null)return;var s=o-i,S=Math.min(this.maxLatency,i+c.targetduration),x=s<S;if(c.live&&x&&s>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,a)),A=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;h.playbackRate=Math.min(T,Math.max(1,A))}else h.playbackRate!==1&&h.playbackRate!==0&&(h.playbackRate=1)},g.estimateLiveEdge=function(){var h=this.levelDetails;return h===null?null:h.edge+h.age},g.computeLatency=function(){var h=this.estimateLiveEdge();return h===null?null:h-this.currentTime},M(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var h=this.config,c=this.levelDetails;return h.liveMaxLatencyDuration!==void 0?h.liveMaxLatencyDuration:c?h.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var h=this.levelDetails;if(h===null)return null;var c=h.holdBack,o=h.partHoldBack,d=h.targetduration,r=this.config,a=r.liveSyncDuration,i=r.liveSyncDurationCount,s=r.lowLatencyMode,S=this.hls.userConfig,x=s&&o||c;(S.liveSyncDuration||S.liveSyncDurationCount||x===0)&&(x=a!==void 0?a:i*d);var T=d,A=1;return x+Math.min(this.stallCount*A,T)}},{key:"liveSyncPosition",get:function(){var h=this.estimateLiveEdge(),c=this.targetLatency,o=this.levelDetails;if(h===null||c===null||o===null)return null;var d=o.edge,r=h-c-this.edgeStalled,a=d-o.totalduration,i=d-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(a,r),i)}},{key:"drift",get:function(){var h=this.levelDetails;return h===null?1:h.drift}},{key:"edgeStalled",get:function(){var h=this.levelDetails;if(h===null)return 0;var c=(this.config.lowLatencyMode&&h.partTarget||h.targetduration)*3;return Math.max(h.age-c,0)}},{key:"forwardBufferLength",get:function(){var h=this.media,c=this.levelDetails;if(!h||!c)return 0;var o=h.buffered.length;return o?h.buffered.end(o-1):c.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return r});var X=P("./src/types/level.ts"),N=P("./src/events.ts"),C=P("./src/errors.ts"),B=P("./src/utils/codecs.ts"),M=P("./src/controller/level-helper.ts"),n=P("./src/controller/base-playlist-controller.ts"),D=P("./src/types/loader.ts");function g(){return g=Object.assign||function(a){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var S in s)Object.prototype.hasOwnProperty.call(s,S)&&(a[S]=s[S])}return a},g.apply(this,arguments)}function p(a,i){for(var s=0;s<i.length;s++){var S=i[s];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function h(a,i,s){return i&&p(a.prototype,i),s&&p(a,s),a}function c(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,o(a,i)}function o(a,i){return o=Object.setPrototypeOf||function(S,x){return S.__proto__=x,S},o(a,i)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),r=function(a){c(i,a);function i(S){var x;return x=a.call(this,S,"[level-controller]")||this,x._levels=[],x._firstLevel=-1,x._startLevel=void 0,x.currentLevelIndex=-1,x.manualLevelIndex=-1,x.onParsedComplete=void 0,x._registerListeners(),x}var s=i.prototype;return s._registerListeners=function(){var x=this.hls;x.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),x.on(N.Events.ERROR,this.onError,this)},s._unregisterListeners=function(){var x=this.hls;x.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),x.off(N.Events.ERROR,this.onError,this)},s.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,a.prototype.destroy.call(this)},s.startLoad=function(){var x=this._levels;x.forEach(function(T){T.loadError=0}),a.prototype.startLoad.call(this)},s.onManifestLoaded=function(x,T){var A=[],w=[],v=[],b,m={},f,O=!1,E=!1,_=!1;if(T.levels.forEach(function(G){var j=G.attrs;O=O||!!(G.width&&G.height),E=E||!!G.videoCodec,_=_||!!G.audioCodec,d&&G.audioCodec&&G.audioCodec.indexOf("mp4a.40.34")!==-1&&(G.audioCodec=void 0);var R=G.bitrate+"-"+G.attrs.RESOLUTION+"-"+G.attrs.CODECS;f=m[R],f?f.url.push(G.url):(f=new X.Level(G),m[R]=f,A.push(f)),j&&(j.AUDIO&&Object(M.addGroupId)(f,"audio",j.AUDIO),j.SUBTITLES&&Object(M.addGroupId)(f,"text",j.SUBTITLES))}),(O||E)&&_&&(A=A.filter(function(G){var j=G.videoCodec,R=G.width,V=G.height;return!!j||!!(R&&V)})),A=A.filter(function(G){var j=G.audioCodec,R=G.videoCodec;return(!j||Object(B.isCodecSupportedInMp4)(j,"audio"))&&(!R||Object(B.isCodecSupportedInMp4)(R,"video"))}),T.audioTracks&&(w=T.audioTracks.filter(function(G){return!G.audioCodec||Object(B.isCodecSupportedInMp4)(G.audioCodec,"audio")}),Object(M.assignTrackIdsByGroup)(w)),T.subtitles&&(v=T.subtitles,Object(M.assignTrackIdsByGroup)(v)),A.length>0){b=A[0].bitrate,A.sort(function(G,j){return G.bitrate-j.bitrate}),this._levels=A;for(var k=0;k<A.length;k++)if(A[k].bitrate===b){this._firstLevel=k,this.log("manifest loaded, "+A.length+" level(s) found, first bitrate: "+b);break}var F=_&&!E,L={levels:A,audioTracks:w,subtitleTracks:v,firstLevel:this._firstLevel,stats:T.stats,audio:_,video:E,altAudio:!F&&w.some(function(G){return!!G.url})};this.hls.trigger(N.Events.MANIFEST_PARSED,L),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(N.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},s.onError=function(x,T){if(a.prototype.onError.call(this,x,T),T.fatal)return;var A=T.context,w=this._levels[this.currentLevelIndex];if(A&&(A.type===D.PlaylistContextType.AUDIO_TRACK&&w.audioGroupIds&&A.groupId===w.audioGroupIds[w.urlId]||A.type===D.PlaylistContextType.SUBTITLE_TRACK&&w.textGroupIds&&A.groupId===w.textGroupIds[w.urlId])){this.redundantFailover(this.currentLevelIndex);return}var v=!1,b=!0,m;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:if(T.frag){var f=this._levels[T.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(m=T.frag.level)):m=T.frag.level}break;case C.ErrorDetails.LEVEL_LOAD_ERROR:case C.ErrorDetails.LEVEL_LOAD_TIMEOUT:A&&(A.deliveryDirectives&&(b=!1),m=A.level),v=!0;break;case C.ErrorDetails.REMUX_ALLOC_ERROR:m=T.level,v=!0;break}m!==void 0&&this.recoverLevel(T,m,v,b)},s.recoverLevel=function(x,T,A,w){var v=x.details,b=this._levels[T];if(b.loadError++,A){var m=this.retryLoadingOrFail(x);if(m)x.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(w){var f=b.url.length;if(f>1&&b.loadError<f)x.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var O=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==O&&this._levels[O].loadError===0&&(this.warn(v+": switch to "+O),x.levelRetry=!0,this.hls.nextAutoLevel=O)}}},s.redundantFailover=function(x){var T=this._levels[x],A=T.url.length;if(A>1){var w=(T.urlId+1)%A;this.warn("Switching to redundant URL-id "+w),this._levels.forEach(function(v){v.urlId=w}),this.level=x}},s.onFragLoaded=function(x,T){var A=T.frag;if(A!==void 0&&A.type===D.PlaylistLevelType.MAIN){var w=this._levels[A.level];w!==void 0&&(w.fragmentError=0,w.loadError=0)}},s.onLevelLoaded=function(x,T){var A,w=T.level,v=T.details,b=this._levels[w];if(!b){var m;this.warn("Invalid level index "+w),(m=T.deliveryDirectives)!==null&&m!==void 0&&m.skip&&(v.deltaUpdateFailed=!0);return}w===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(w,T,b.details)):(A=T.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(v.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(x,T){var A=this.hls.levels[this.currentLevelIndex];if(!A)return;if(A.audioGroupIds){for(var w=-1,v=this.hls.audioTracks[T.id].groupId,b=0;b<A.audioGroupIds.length;b++)if(A.audioGroupIds[b]===v){w=b;break}w!==A.urlId&&(A.urlId=w,this.startLoad())}},s.loadPlaylist=function(x){var T=this.currentLevelIndex,A=this._levels[T];if(this.canLoad&&A&&A.url.length>0){var w=A.urlId,v=A.url[w];if(x)try{v=x.addDirectives(v)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+T+(x?" at sn "+x.msn+" part "+x.part:"")+" with URL-id "+w+" "+v),this.clearTimer(),this.hls.trigger(N.Events.LEVEL_LOADING,{url:v,level:T,id:w,deliveryDirectives:x||null})}},s.removeLevel=function(x,T){var A=function(b,m){return m!==T},w=this._levels.filter(function(v,b){return b!==x?!0:v.url.length>1&&T!==void 0?(v.url=v.url.filter(A),v.audioGroupIds&&(v.audioGroupIds=v.audioGroupIds.filter(A)),v.textGroupIds&&(v.textGroupIds=v.textGroupIds.filter(A)),v.urlId=0,!0):!1}).map(function(v,b){var m=v.details;return m!=null&&m.fragments&&m.fragments.forEach(function(f){f.level=b}),v});this._levels=w,this.hls.trigger(N.Events.LEVELS_UPDATED,{levels:w})},h(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(x){var T,A=this._levels;if(A.length===0)return;if(this.currentLevelIndex===x&&(T=A[x])!==null&&T!==void 0&&T.details)return;if(x<0||x>=A.length){var w=x<0;if(this.hls.trigger(N.Events.ERROR,{type:C.ErrorTypes.OTHER_ERROR,details:C.ErrorDetails.LEVEL_SWITCH_ERROR,level:x,fatal:w,reason:"invalid level idx"}),w)return;x=Math.min(x,A.length-1)}this.clearTimer();var v=this.currentLevelIndex,b=A[v],m=A[x];this.log("switching to level "+x+" from "+v),this.currentLevelIndex=x;var f=g({},m,{level:x,maxBitrate:m.maxBitrate,uri:m.uri,urlId:m.urlId});delete f._urlId,this.hls.trigger(N.Events.LEVEL_SWITCHING,f);var O=m.details;if(!O||O.live){var E=this.switchParams(m.uri,b==null?void 0:b.details);this.loadPlaylist(E)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(x){this.manualLevelIndex=x,this._startLevel===void 0&&(this._startLevel=x),x!==-1&&(this.level=x)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(x){this._firstLevel=x}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var x=this.hls.config.startLevel;return x!==void 0?x:this._firstLevel}else return this._startLevel},set:function(x){this._startLevel=x}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(x){this.level=x,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=x)}}]),i}(n.default)},"./src/controller/level-helper.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"addGroupId",function(){return C}),P.d(z,"assignTrackIdsByGroup",function(){return B}),P.d(z,"updatePTS",function(){return M}),P.d(z,"updateFragPTSDTS",function(){return D}),P.d(z,"mergeDetails",function(){return g}),P.d(z,"mapPartIntersection",function(){return p}),P.d(z,"mapFragmentIntersection",function(){return h}),P.d(z,"adjustSliding",function(){return c}),P.d(z,"addSliding",function(){return o}),P.d(z,"computeReloadInterval",function(){return d}),P.d(z,"getFragmentWithSN",function(){return r}),P.d(z,"getPartWith",function(){return a});var X=P("./src/polyfills/number.ts"),N=P("./src/utils/logger.ts");function C(i,s,S){switch(s){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(S);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(S);break}}function B(i){var s={};i.forEach(function(S){var x=S.groupId||"";S.id=s[x]=s[x]||0,s[x]++})}function M(i,s,S){var x=i[s],T=i[S];n(x,T)}function n(i,s){var S=s.startPTS;if(Object(X.isFiniteNumber)(S)){var x=0,T;s.sn>i.sn?(x=S-i.start,T=i):(x=i.start-S,T=s),T.duration!==x&&(T.duration=x)}else if(s.sn>i.sn){var A=i.cc===s.cc;A&&i.minEndPTS?s.start=i.start+(i.minEndPTS-i.start):s.start=i.start+i.duration}else s.start=Math.max(i.start-s.duration,0)}function D(i,s,S,x,T,A){var w=x-S;w<=0&&(N.logger.warn("Fragment should have a positive duration",s),x=S+s.duration,A=T+s.duration);var v=S,b=x,m=s.startPTS,f=s.endPTS;if(Object(X.isFiniteNumber)(m)){var O=Math.abs(m-S);Object(X.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(O,s.deltaPTS):s.deltaPTS=O,v=Math.max(S,m),S=Math.min(S,m),T=Math.min(T,s.startDTS),b=Math.min(x,f),x=Math.max(x,f),A=Math.max(A,s.endDTS)}s.duration=x-S;var E=S-s.start;s.appendedPTS=x,s.start=s.startPTS=S,s.maxStartPTS=v,s.startDTS=T,s.endPTS=x,s.minEndPTS=b,s.endDTS=A;var _=s.sn;if(!i||_<i.startSN||_>i.endSN)return 0;var k,F=_-i.startSN,L=i.fragments;for(L[F]=s,k=F;k>0;k--)n(L[k],L[k-1]);for(k=F;k<L.length-1;k++)n(L[k],L[k+1]);return i.fragmentHint&&n(L[L.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,E}function g(i,s){for(var S=null,x=i.fragments,T=x.length-1;T>=0;T--){var A=x[T].initSegment;if(A){S=A;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var w=0,v;if(h(i,s,function(k,F){k.relurl&&(w=k.cc-F.cc),Object(X.isFiniteNumber)(k.startPTS)&&Object(X.isFiniteNumber)(k.endPTS)&&(F.start=F.startPTS=k.startPTS,F.startDTS=k.startDTS,F.appendedPTS=k.appendedPTS,F.maxStartPTS=k.maxStartPTS,F.endPTS=k.endPTS,F.endDTS=k.endDTS,F.minEndPTS=k.minEndPTS,F.duration=k.endPTS-k.startPTS,F.duration&&(v=F),s.PTSKnown=s.alignedSliding=!0),F.elementaryStreams=k.elementaryStreams,F.loader=k.loader,F.stats=k.stats,F.urlId=k.urlId,k.initSegment&&(F.initSegment=k.initSegment,S=k.initSegment)}),S){var b=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;b.forEach(function(k){var F;(!k.initSegment||k.initSegment.relurl===((F=S)===null||F===void 0?void 0:F.relurl))&&(k.initSegment=S)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(k){return!k}),s.deltaUpdateFailed)){N.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var m=s.skippedSegments;m--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var f=s.fragments;if(w){N.logger.warn("discontinuity sliding from playlist, take drift into account");for(var O=0;O<f.length;O++)f[O].cc+=w}s.skippedSegments&&(s.startCC=s.fragments[0].cc),p(i.partList,s.partList,function(k,F){F.elementaryStreams=k.elementaryStreams,F.stats=k.stats}),v?D(s,v,v.startPTS,v.endPTS,v.startDTS,v.endDTS):c(i,s),f.length&&(s.totalduration=s.edge-f[0].start),s.driftStartTime=i.driftStartTime,s.driftStart=i.driftStart;var E=s.advancedDateTime;if(s.advanced&&E){var _=s.edge;s.driftStart||(s.driftStartTime=E,s.driftStart=_),s.driftEndTime=E,s.driftEnd=_}else s.driftEndTime=i.driftEndTime,s.driftEnd=i.driftEnd,s.advancedDateTime=i.advancedDateTime}function p(i,s,S){if(i&&s)for(var x=0,T=0,A=i.length;T<=A;T++){var w=i[T],v=s[T+x];w&&v&&w.index===v.index&&w.fragment.sn===v.fragment.sn?S(w,v):x--}}function h(i,s,S){for(var x=s.skippedSegments,T=Math.max(i.startSN,s.startSN)-s.startSN,A=(i.fragmentHint?1:0)+(x?s.endSN:Math.min(i.endSN,s.endSN))-s.startSN,w=s.startSN-i.startSN,v=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,b=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,m=T;m<=A;m++){var f=b[w+m],O=v[m];x&&!O&&m<x&&(O=s.fragments[m]=f),f&&O&&S(f,O)}}function c(i,s){var S=s.startSN+s.skippedSegments-i.startSN,x=i.fragments;if(S<0||S>=x.length)return;o(s,x[S].start)}function o(i,s){if(s){for(var S=i.fragments,x=i.skippedSegments;x<S.length;x++)S[x].start+=s;i.fragmentHint&&(i.fragmentHint.start+=s)}}function d(i,s){var S=1e3*i.levelTargetDuration,x=S/2,T=i.age,A=T>0&&T<S*3,w=s.loading.end-s.loading.start,v,b=i.availabilityDelay;if(i.updated===!1)if(A){var m=333*i.misses;v=Math.max(Math.min(x,w*2),m),i.availabilityDelay=(i.availabilityDelay||0)+v}else v=x;else A?(b=Math.min(b||S/2,T),i.availabilityDelay=b,v=b+S-T):v=S-w;return Math.round(v)}function r(i,s,S){if(!i||!i.details)return null;var x=i.details,T=x.fragments[s-x.startSN];return T||(T=x.fragmentHint,T&&T.sn===s?T:s<x.startSN&&S&&S.sn===s?S:null)}function a(i,s,S){if(!i||!i.details)return null;var x=i.details.partList;if(x)for(var T=x.length;T--;){var A=x[T];if(A.index===S&&A.fragment.sn===s)return A}return null}},"./src/controller/stream-controller.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return x});var X=P("./src/polyfills/number.ts"),N=P("./src/controller/base-stream-controller.ts"),C=P("./src/is-supported.ts"),B=P("./src/events.ts"),M=P("./src/utils/buffer-helper.ts"),n=P("./src/controller/fragment-tracker.ts"),D=P("./src/types/loader.ts"),g=P("./src/loader/fragment.ts"),p=P("./src/demux/transmuxer-interface.ts"),h=P("./src/types/transmuxer.ts"),c=P("./src/controller/gap-controller.ts"),o=P("./src/errors.ts"),d=P("./src/utils/logger.ts");function r(T,A){for(var w=0;w<A.length;w++){var v=A[w];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(T,v.key,v)}}function a(T,A,w){return A&&r(T.prototype,A),w&&r(T,w),T}function i(T,A){T.prototype=Object.create(A.prototype),T.prototype.constructor=T,s(T,A)}function s(T,A){return s=Object.setPrototypeOf||function(v,b){return v.__proto__=b,v},s(T,A)}var S=100,x=function(T){i(A,T);function A(v,b){var m;return m=T.call(this,v,b,"[stream-controller]")||this,m.audioCodecSwap=!1,m.gapController=null,m.level=-1,m._forceStartLoad=!1,m.altAudio=!1,m.audioOnly=!1,m.fragPlaying=null,m.onvplaying=null,m.onvseeked=null,m.fragLastKbps=0,m.stalled=!1,m.couldBacktrack=!1,m.audioCodecSwitch=!1,m.videoBuffer=null,m._registerListeners(),m}var w=A.prototype;return w._registerListeners=function(){var b=this.hls;b.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on(B.Events.ERROR,this.onError,this),b.on(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(B.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w._unregisterListeners=function(){var b=this.hls;b.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off(B.Events.ERROR,this.onError,this),b.off(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(B.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},w.startLoad=function(b){if(this.levels){var m=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(S),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var O=f.startLevel;O===-1&&(f.config.testBandwidth?(O=0,this.bitrateTest=!0):O=f.nextAutoLevel),this.level=f.nextLoadLevel=O,this.loadedmetadata=!1}m>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+m.toFixed(3)),b=m),this.state=N.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=N.State.STOPPED},w.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},w.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_LEVEL:{var b,m=this.levels,f=this.level,O=m==null||((b=m[f])===null||b===void 0)?void 0:b.details;if(O&&(!O.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(O))break;this.state=N.State.IDLE;break}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var E,_=self.performance.now(),k=this.retryDate;(!k||_>=k||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=N.State.IDLE)}break;default:break}this.onTickEnd()},w.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},w.doTickIdle=function(){var b,m,f=this.hls,O=this.levelLastLoaded,E=this.levels,_=this.media,k=f.config,F=f.nextLoadLevel;if(O===null||!_&&(this.startFragRequested||!k.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[F])return;var L=E[F];this.level=f.nextLoadLevel=F;var G=L.details;if(!G||this.state===N.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==F){this.state=N.State.WAITING_LEVEL;return}var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:_,D.PlaylistLevelType.MAIN);if(j===null)return;var R=j.len,V=this.getMaxBufferLength(L.maxBitrate);if(R>=V)return;if(this._streamEnded(j,G)){var ne={};this.altAudio&&(ne.type="video"),this.hls.trigger(B.Events.BUFFER_EOS,ne),this.state=N.State.ENDED;return}var se=j.end,Se=this.getNextFragment(se,G);if(this.couldBacktrack&&!this.fragPrevious&&Se&&Se.sn!=="initSegment"){var De=Se.sn-G.startSN;De>1&&(Se=G.fragments[De-1],this.fragmentTracker.removeFragment(Se))}if(Se&&this.fragmentTracker.getState(Se)===n.FragmentState.OK&&this.nextLoadPosition>se){var Ae=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(_,Ae,D.PlaylistLevelType.MAIN),Se=this.getNextFragment(this.nextLoadPosition,G)}if(!Se)return;Se.initSegment&&!Se.initSegment.data&&!this.bitrateTest&&(Se=Se.initSegment),((b=Se.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((m=Se.decryptdata)!==null&&m!==void 0&&m.key)?this.loadKey(Se,G):this.loadFragment(Se,G,se)},w.loadFragment=function(b,m,f){var O,E=this.fragmentTracker.getState(b);if(this.fragCurrent=b,E===n.FragmentState.BACKTRACKED){var _=this.fragmentTracker.getBacktrackData(b);if(_){this._handleFragmentLoadProgress(_),this._handleFragmentLoadComplete(_);return}else E=n.FragmentState.NOT_LOADED}E===n.FragmentState.NOT_LOADED||E===n.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,b,m,f)):E===n.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((O=this.media)===null||O===void 0?void 0:O.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(b){var m=this.fragmentTracker.getAppendedFrag(b,D.PlaylistLevelType.MAIN);return m&&"fragment"in m?m.fragment:m},w.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,D.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var b=this.levels,m=this.media;if(m!=null&&m.readyState){var f,O=this.getAppendedFrag(m.currentTime);if(O&&O.start>1&&this.flushMainBuffer(0,O.start-1),!m.paused&&b){var E=this.hls.nextLoadLevel,_=b[E],k=this.fragLastKbps;k&&this.fragCurrent?f=this.fragCurrent.duration*_.maxBitrate/(1e3*k)+1:f=0}else f=0;var F=this.getBufferedFrag(m.currentTime+f);if(F){var L=this.followingBufferedFrag(F);if(L){this.abortCurrentFrag();var G=L.maxStartPTS?L.maxStartPTS:L.start,j=L.duration,R=Math.max(F.end,G+Math.min(Math.max(j-this.config.maxFragLookUpTolerance,j*.5),j*.75));this.flushMainBuffer(R,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===N.State.KEY_LOADING&&(this.state=N.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(b,m){T.prototype.flushMainBuffer.call(this,b,m,this.altAudio?"video":null)},w.onMediaAttached=function(b,m){T.prototype.onMediaAttached.call(this,b,m);var f=m.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,f,this.fragmentTracker,this.hls)},w.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var b=this.media,m=b?b.currentTime:null;Object(X.isFiniteNumber)(m)&&this.log("Media seeked to "+m.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(B.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(b,m){var f=!1,O=!1,E;m.levels.forEach(function(_){E=_.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(f=!0),E.indexOf("mp4a.40.5")!==-1&&(O=!0))}),this.audioCodecSwitch=f&&O&&!Object(C.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=m.levels,this.startFragRequested=!1},w.onLevelLoading=function(b,m){var f=this.levels;if(!f||this.state!==N.State.IDLE)return;var O=f[m.level];(!O.details||O.details.live&&this.levelLastLoaded!==m.level||this.waitForCdnTuneIn(O.details))&&(this.state=N.State.WAITING_LEVEL)},w.onLevelLoaded=function(b,m){var f,O=this.levels,E=m.level,_=m.details,k=_.totalduration;if(!O){this.warn("Levels were reset while loading level "+E);return}this.log("Level "+E+" loaded ["+_.startSN+","+_.endSN+"], cc ["+_.startCC+", "+_.endCC+"] duration:"+k);var F=this.fragCurrent;F&&(this.state===N.State.FRAG_LOADING||this.state===N.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==m.level&&F.loader&&(this.state=N.State.IDLE,F.loader.abort()));var L=O[E],G=0;if(_.live||(f=L.details)!==null&&f!==void 0&&f.live){if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed)return;G=this.alignPlaylists(_,L.details)}if(L.details=_,this.levelLastLoaded=E,this.hls.trigger(B.Events.LEVEL_UPDATED,{details:_,level:E}),this.state===N.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(_))return;this.state=N.State.IDLE}this.startFragRequested?_.live&&this.synchronizeToLiveEdge(_):this.setStartPosition(_,G),this.tick()},w._handleFragmentLoadProgress=function(b){var m,f=b.frag,O=b.part,E=b.payload,_=this.levels;if(!_){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var k=_[f.level],F=k.details;if(!F){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var L=k.videoCodec,G=F.PTSKnown||!F.live,j=(m=f.initSegment)===null||m===void 0?void 0:m.data,R=this._getAudioCodec(k),V=this.transmuxer=this.transmuxer||new p.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ne=O?O.index:-1,se=ne!==-1,Se=new h.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,E.byteLength,ne,se),De=this.initPTS[f.cc];V.push(E,j,R,L,f,O,F.totalduration,G,Se,De)},w.onAudioTrackSwitching=function(b,m){var f=this.altAudio,O=!!m.url,E=m.id;if(!O){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_!=null&&_.loader&&(this.log("Switching to main audio track, cancel main fragment load"),_.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var k=this.hls;f&&k.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),k.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:E})}},w.onAudioTrackSwitched=function(b,m){var f=m.id,O=!!this.hls.audioTracks[f].url;if(O){var E=this.videoBuffer;E&&this.mediaBuffer!==E&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=E)}this.altAudio=O,this.tick()},w.onBufferCreated=function(b,m){var f=m.tracks,O,E,_=!1;for(var k in f){var F=f[k];if(F.id==="main"){if(E=k,O=F,k==="video"){var L=f[k];L&&(this.videoBuffer=L.buffer)}}else _=!0}_&&O?(this.log("Alternate track found, use "+E+".buffered to schedule main fragment loading"),this.mediaBuffer=O.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(b,m){var f=m.frag,O=m.part;if(f&&f.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(O?" p: "+O.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===N.State.PARSED&&(this.state=N.State.IDLE);return}var E=O?O.stats:f.stats;this.fragLastKbps=Math.round(8*E.total/(E.buffering.end-E.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,O)},w.onError=function(b,m){switch(m.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,m);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==N.State.ERROR&&(m.fatal?(this.warn(""+m.details),this.state=N.State.ERROR):!m.levelRetry&&this.state===N.State.WAITING_LEVEL&&(this.state=N.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(m.parent==="main"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var f=!0,O=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);O&&O.len>.5&&(f=!this.reduceMaxBufferLength(O.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},w.checkBuffer=function(){var b=this.media,m=this.gapController;if(!b||!m||!b.readyState)return;var f=M.BufferHelper.getBuffered(b);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):m.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},w.onFragLoadEmergencyAborted=function(){this.state=N.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(b,m){var f=m.type;if(f!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var O=(f===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(O,f,D.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(b,m){this.levels=m.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var b=this.media,m=b.currentTime,f=this.startPosition;if(f>=0&&m<f){if(b.seeking){d.logger.log("could not seek to "+f+", already seeking at "+m);return}var O=M.BufferHelper.getBuffered(b),E=O.length?O.start(0):0,_=E-f;_>0&&(_<this.config.maxBufferHole||_<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+_+" to match buffer start"),f+=_,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+m),b.currentTime=f}},w._getAudioCodec=function(b){var m=this.config.defaultAudioCodec||b.audioCodec;return this.audioCodecSwap&&m&&(this.log("Swapping audio codec"),m.indexOf("mp4a.40.5")!==-1?m="mp4a.40.2":m="mp4a.40.5"),m},w._loadBitrateTestFrag=function(b){var m=this;this._doFragLoad(b).then(function(f){var O=m.hls;if(!f||O.nextLoadLevel||m.fragContextChanged(b))return;m.fragLoadError=0,m.state=N.State.IDLE,m.startFragRequested=!1,m.bitrateTest=!1;var E=b.stats;E.parsing.start=E.parsing.end=E.buffering.start=E.buffering.end=self.performance.now(),O.trigger(B.Events.FRAG_LOADED,f)})},w._handleTransmuxComplete=function(b){var m,f="main",O=this.hls,E=b.remuxResult,_=b.chunkMeta,k=this.getCurrentContext(_);if(!k){this.warn("The loading context changed while buffering fragment "+_.sn+" of level "+_.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(_.level);return}var F=k.frag,L=k.part,G=k.level,j=E.video,R=E.text,V=E.id3,ne=E.initSegment,se=this.altAudio?void 0:E.audio;if(this.fragContextChanged(F))return;if(this.state=N.State.PARSING,ne){ne.tracks&&(this._bufferInitSegment(G,ne.tracks,F,_),O.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:f,tracks:ne.tracks}));var Se=ne.initPTS,De=ne.timescale;Object(X.isFiniteNumber)(Se)&&(this.initPTS[F.cc]=Se,O.trigger(B.Events.INIT_PTS_FOUND,{frag:F,id:f,initPTS:Se,timescale:De}))}if(j&&E.independent!==!1){if(G.details){var Ae=j.startPTS,ke=j.endPTS,je=j.startDTS,Be=j.endDTS;if(L)L.elementaryStreams[j.type]={startPTS:Ae,endPTS:ke,startDTS:je,endDTS:Be};else if(j.firstKeyFrame&&j.independent&&(this.couldBacktrack=!0),j.dropped&&j.independent){var we=this.getLoadPosition()+this.config.maxBufferHole;if(we<Ae){this.backtrack(F);return}F.setElementaryStreamInfo(j.type,F.start,ke,F.start,Be,!0)}F.setElementaryStreamInfo(j.type,Ae,ke,je,Be),this.bufferFragmentData(j,F,L,_)}}else if(E.independent===!1){this.backtrack(F);return}if(se){var Z=se.startPTS,U=se.endPTS,K=se.startDTS,ee=se.endDTS;L&&(L.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:Z,endPTS:U,startDTS:K,endDTS:ee}),F.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,Z,U,K,ee),this.bufferFragmentData(se,F,L,_)}if(V!=null&&(m=V.samples)!==null&&m!==void 0&&m.length){var oe={frag:F,id:f,samples:V.samples};O.trigger(B.Events.FRAG_PARSING_METADATA,oe)}if(R){var Q={frag:F,id:f,samples:R.samples};O.trigger(B.Events.FRAG_PARSING_USERDATA,Q)}},w._bufferInitSegment=function(b,m,f,O){var E=this;if(this.state!==N.State.PARSING)return;this.audioOnly=!!m.audio&&!m.video,this.altAudio&&!this.audioOnly&&delete m.audio;var _=m.audio,k=m.video,F=m.audiovideo;if(_){var L=b.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(L&&(L.indexOf("mp4a.40.5")!==-1?L="mp4a.40.2":L="mp4a.40.5"),_.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(L="mp4a.40.5")),G.indexOf("android")!==-1&&_.container!=="audio/mpeg"&&(L="mp4a.40.2",this.log("Android: force audio codec to "+L)),b.audioCodec&&b.audioCodec!==L&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+L+'"'),_.levelCodec=L,_.id="main",this.log("Init audio buffer, container:"+_.container+", codecs[selected/level/parsed]=["+(L||"")+"/"+(b.audioCodec||"")+"/"+_.codec+"]")}k&&(k.levelCodec=b.videoCodec,k.id="main",this.log("Init video buffer, container:"+k.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+k.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,m),Object.keys(m).forEach(function(j){var R=m[j],V=R.initSegment;V!=null&&V.byteLength&&E.hls.trigger(B.Events.BUFFER_APPENDING,{type:j,data:V,frag:f,part:null,chunkMeta:O,parent:f.type})}),this.tick()},w.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var m=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,m?this.resetFragmentLoading(b):this.state=N.State.BACKTRACKING},w.checkFragmentChanged=function(){var b=this.media,m=null;if(b&&b.readyState>1&&b.seeking===!1){var f=b.currentTime;if(M.BufferHelper.isBuffered(b,f)?m=this.getAppendedFrag(f):M.BufferHelper.isBuffered(b,f+.1)&&(m=this.getAppendedFrag(f+.1)),m){var O=this.fragPlaying,E=m.level;(!O||m.sn!==O.sn||O.level!==E||m.urlId!==O.urlId)&&(this.hls.trigger(B.Events.FRAG_CHANGED,{frag:m}),(!O||O.level!==E)&&this.hls.trigger(B.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=m)}}},a(A,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var m=this.getAppendedFrag(b.currentTime);if(m)return m.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var m=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(m)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),A}(N.default)},"./src/controller/subtitle-stream-controller.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"SubtitleStreamController",function(){return i});var X=P("./src/events.ts"),N=P("./src/utils/logger.ts"),C=P("./src/utils/buffer-helper.ts"),B=P("./src/controller/fragment-finders.ts"),M=P("./src/utils/discontinuities.ts"),n=P("./src/controller/level-helper.ts"),D=P("./src/controller/fragment-tracker.ts"),g=P("./src/controller/base-stream-controller.ts"),p=P("./src/types/loader.ts"),h=P("./src/types/level.ts");function c(s,S){for(var x=0;x<S.length;x++){var T=S[x];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(s,T.key,T)}}function o(s,S,x){return S&&c(s.prototype,S),x&&c(s,x),s}function d(s,S){s.prototype=Object.create(S.prototype),s.prototype.constructor=s,r(s,S)}function r(s,S){return r=Object.setPrototypeOf||function(T,A){return T.__proto__=A,T},r(s,S)}var a=500,i=function(s){d(S,s);function S(T,A){var w;return w=s.call(this,T,A,"[subtitle-stream-controller]")||this,w.levels=[],w.currentTrackId=-1,w.tracksBuffered=[],w.mainDetails=null,w._registerListeners(),w}var x=S.prototype;return x.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},x._registerListeners=function(){var A=this.hls;A.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.on(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(X.Events.ERROR,this.onError,this),A.on(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.on(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.on(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x._unregisterListeners=function(){var A=this.hls;A.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.off(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(X.Events.ERROR,this.onError,this),A.off(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.off(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.off(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(a),this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},x.onLevelLoaded=function(A,w){this.mainDetails=w.details},x.onSubtitleFragProcessed=function(A,w){var v=w.frag,b=w.success;if(this.fragPrevious=v,this.state=g.State.IDLE,!b)return;var m=this.tracksBuffered[this.currentTrackId];if(!m)return;for(var f,O=v.start,E=0;E<m.length;E++)if(O>=m[E].start&&O<=m[E].end){f=m[E];break}var _=v.start+v.duration;f?f.end=_:(f={start:O,end:_},m.push(f)),this.fragmentTracker.fragBuffered(v)},x.onBufferFlushing=function(A,w){var v=w.startOffset,b=w.endOffset;if(v===0&&b!==Number.POSITIVE_INFINITY){var m=this.currentTrackId,f=this.levels;if(!f.length||!f[m]||!f[m].details)return;var O=f[m].details,E=O.targetduration,_=b-E;if(_<=0)return;w.endOffsetSubtitles=Math.max(0,_),this.tracksBuffered.forEach(function(k){for(var F=0;F<k.length;){if(k[F].end<=_){k.shift();continue}else if(k[F].start<_)k[F].start=_;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(v,_,p.PlaylistLevelType.SUBTITLE)}},x.onError=function(A,w){var v,b=w.frag;if(!b||b.type!==p.PlaylistLevelType.SUBTITLE)return;(v=this.fragCurrent)!==null&&v!==void 0&&v.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},x.onSubtitleTracksUpdated=function(A,w){var v=this,b=w.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(m){return new h.Level(m)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(m){v.tracksBuffered[m.id]=[]}),this.mediaBuffer=null},x.onSubtitleTrackSwitch=function(A,w){if(this.currentTrackId=w.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var v=this.levels[this.currentTrackId];v!=null&&v.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,v&&this.setInterval(a)},x.onSubtitleTrackLoaded=function(A,w){var v,b=w.details,m=w.id,f=this.currentTrackId,O=this.levels;if(!O.length)return;var E=O[f];if(m>=O.length||m!==f||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(v=E.details)!==null&&v!==void 0&&v.live){var _=this.mainDetails;if(b.deltaUpdateFailed||!_)return;var k=_.fragments[0];if(!E.details)b.hasProgramDateTime&&_.hasProgramDateTime?Object(M.alignMediaPlaylistByPDT)(b,_):k&&Object(n.addSliding)(b,k.start);else{var F=this.alignPlaylists(b,E.details);F===0&&k&&Object(n.addSliding)(b,k.start)}}if(E.details=b,this.levelLastLoaded=m,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var L=Object(B.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);L||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},x._handleFragmentLoadComplete=function(A){var w=A.frag,v=A.payload,b=w.decryptdata,m=this.hls;if(this.fragContextChanged(w))return;if(v&&v.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(v),b.key.buffer,b.iv.buffer).then(function(O){var E=performance.now();m.trigger(X.Events.FRAG_DECRYPTED,{frag:w,payload:O,stats:{tstart:f,tdecrypt:E}})})}},x.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var A,w=this.currentTrackId,v=this.levels;if(!v.length||!v[w]||!v[w].details)return;var b=v[w].details,m=b.targetduration,f=this.config,O=this.media,E=C.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,O.currentTime-m,f.maxBufferHole),_=E.end,k=E.len,F=this.getMaxBufferLength()+m;if(k>F)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var L=b.fragments,G=L.length,j=b.edge,R,V=this.fragPrevious;if(_<j){var ne=f.maxFragLookUpTolerance;V&&b.hasProgramDateTime&&(R=Object(B.findFragmentByPDT)(L,V.endProgramDateTime,ne)),R||(R=Object(B.findFragmentByPTS)(V,L,_,ne),!R&&V&&V.start<L[0].start&&(R=L[0]))}else R=L[G-1];(A=R)!==null&&A!==void 0&&A.encrypted?(N.logger.log("Loading key for "+R.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(X.Events.KEY_LOADING,{frag:R})):R&&this.fragmentTracker.getState(R)===D.FragmentState.NOT_LOADED&&this.loadFragment(R,b,_)}},x.loadFragment=function(A,w,v){this.fragCurrent=A,s.prototype.loadFragment.call(this,A,w,v)},o(S,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),S}(g.default)},"./src/controller/subtitle-track-controller.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/events.ts"),N=P("./src/utils/texttrack-utils.ts"),C=P("./src/controller/base-playlist-controller.ts"),B=P("./src/types/loader.ts");function M(c,o){for(var d=0;d<o.length;d++){var r=o[d];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(c,r.key,r)}}function n(c,o,d){return o&&M(c.prototype,o),d&&M(c,d),c}function D(c,o){c.prototype=Object.create(o.prototype),c.prototype.constructor=c,g(c,o)}function g(c,o){return g=Object.setPrototypeOf||function(r,a){return r.__proto__=a,r},g(c,o)}var p=function(c){D(o,c);function o(r){var a;return a=c.call(this,r,"[subtitle-track-controller]")||this,a.media=null,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.selectDefaultTrack=!0,a.queuedDefaultTrack=-1,a.trackChangeListener=function(){return a.onTextTracksChanged()},a.asyncPollTrackChange=function(){return a.pollTrackChange(0)},a.useTextTrackPolling=!1,a.subtitlePollingInterval=-1,a.subtitleDisplay=!0,a.registerListeners(),a}var d=o.prototype;return d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},d.registerListeners=function(){var a=this.hls;a.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.on(X.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var a=this.hls;a.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.off(X.Events.ERROR,this.onError,this)},d.onMediaAttached=function(a,i){if(this.media=i.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},d.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},d.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 a=h(this.media.textTracks);a.forEach(function(i){Object(N.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},d.onManifestParsed=function(a,i){this.tracks=i.subtitleTracks},d.onSubtitleTrackLoaded=function(a,i){var s=i.id,S=i.details,x=this.trackId,T=this.tracksInGroup[x];if(!T){this.warn("Invalid subtitle track id "+s);return}var A=T.details;T.details=i.details,this.log("subtitle track "+s+" loaded ["+S.startSN+"-"+S.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,i,A))},d.onLevelLoading=function(a,i){this.switchLevel(i.level)},d.onLevelSwitching=function(a,i){this.switchLevel(i.level)},d.switchLevel=function(a){var i=this.hls.levels[a];if(!(i!=null&&i.textGroupIds))return;var s=i.textGroupIds[i.urlId];if(this.groupId!==s){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,x=this.tracks.filter(function(w){return!s||w.groupId===s});this.tracksInGroup=x;var T=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=s;var A={subtitleTracks:x};this.log("Updating subtitle tracks, "+x.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,A),T!==-1&&this.setSubtitleTrack(T,S)}},d.findTrackId=function(a){for(var i=this.tracksInGroup,s=0;s<i.length;s++){var S=i[s];if((!this.selectDefaultTrack||S.default)&&(!a||a===S.name))return S.id}return-1},d.onError=function(a,i){if(c.prototype.onError.call(this,a,i),i.fatal||!i.context)return;i.context.type===B.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},d.loadPlaylist=function(a){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var s=i.id,S=i.groupId,x=i.url;if(a)try{x=a.addDirectives(x)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+s),this.hls.trigger(X.Events.SUBTITLE_TRACK_LOADING,{url:x,id:s,groupId:S,deliveryDirectives:a||null})}},d.toggleTrackModes=function(a){var i=this,s=this.media,S=this.subtitleDisplay,x=this.trackId;if(!s)return;var T=h(s.textTracks),A=T.filter(function(b){return b.groupId===i.groupId});if(a===-1)[].slice.call(T).forEach(function(b){b.mode="disabled"});else{var w=A[x];w&&(w.mode="disabled")}var v=A[a];v&&(v.mode=S?"showing":"hidden")},d.setSubtitleTrack=function(a,i){var s,S=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=a;return}if(this.trackId!==a&&this.toggleTrackModes(a),this.trackId===a&&(a===-1||(s=S[a])!==null&&s!==void 0&&s.details)||a<-1||a>=S.length)return;this.clearTimer();var x=S[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,x){var T=x.id,A=x.groupId,w=A===void 0?"":A,v=x.name,b=x.type,m=x.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:w,name:v,type:b,url:m});var f=this.switchParams(x.url,i==null?void 0:i.details);this.loadPlaylist(f)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:a})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,i=h(this.media.textTracks),s=0;s<i.length;s++)if(i[s].mode==="hidden")a=s;else if(i[s].mode==="showing"){a=s;break}this.subtitleTrack!==a&&(this.subtitleTrack=a)},n(o,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(a,i)}}]),o}(C.default);function h(c){for(var o=[],d=0;d<c.length;d++){var r=c[d];r.kind==="subtitles"&&r.label&&o.push(c[d])}return o}z.default=p},"./src/controller/timeline-controller.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"TimelineController",function(){return h});var X=P("./src/polyfills/number.ts"),N=P("./src/events.ts"),C=P("./src/utils/cea-608-parser.ts"),B=P("./src/utils/output-filter.ts"),M=P("./src/utils/webvtt-parser.ts"),n=P("./src/utils/texttrack-utils.ts"),D=P("./src/utils/imsc1-ttml-parser.ts"),g=P("./src/types/loader.ts"),p=P("./src/utils/logger.ts"),h=function(){function r(i){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this.captionsProperties=void 0,this.hls=i,this.config=i.config,this.Cues=i.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var s=new B.default(this,"textTrack1"),S=new B.default(this,"textTrack2"),x=new B.default(this,"textTrack3"),T=new B.default(this,"textTrack4");this.cea608Parser1=new C.default(1,s,S),this.cea608Parser2=new C.default(3,x,T)}i.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(N.Events.FRAG_LOADING,this.onFragLoading,this),i.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var a=r.prototype;return a.destroy=function(){var s=this.hls;s.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.off(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.off(N.Events.FRAG_LOADING,this.onFragLoading,this),s.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.off(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.off(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},a.addCues=function(s,S,x,T,A){for(var w=!1,v=A.length;v--;){var b=A[v],m=o(b[0],b[1],S,x);if(m>=0&&(b[0]=Math.min(b[0],S),b[1]=Math.max(b[1],x),w=!0,m/(x-S)>.5))return}if(w||A.push([S,x]),this.config.renderTextTracksNatively){var f=this.captionsTracks[s];this.Cues.newCue(f,S,x,T)}else{var O=this.Cues.newCue(null,S,x,T);this.hls.trigger(N.Events.CUES_PARSED,{type:"captions",cues:O,track:s})}},a.onInitPtsFound=function(s,S){var x=this,T=S.frag,A=S.id,w=S.initPTS,v=S.timescale,b=this.unparsedVttFrags;A==="main"&&(this.initPTS[T.cc]=w,this.timescale[T.cc]=v),b.length&&(this.unparsedVttFrags=[],b.forEach(function(m){x.onFragLoaded(N.Events.FRAG_LOADED,m)}))},a.getExistingTrack=function(s){var S=this.media;if(S)for(var x=0;x<S.textTracks.length;x++){var T=S.textTracks[x];if(T[s])return T}return null},a.createCaptionsTrack=function(s){this.config.renderTextTracksNatively?this.createNativeTrack(s):this.createNonNativeTrack(s)},a.createNativeTrack=function(s){if(this.captionsTracks[s])return;var S=this.captionsProperties,x=this.captionsTracks,T=this.media,A=S[s],w=A.label,v=A.languageCode,b=this.getExistingTrack(s);if(b)x[s]=b,Object(n.clearCurrentCues)(x[s]),Object(n.sendAddTrackEvent)(x[s],T);else{var m=this.createTextTrack("captions",w,v);m&&(m[s]=!0,x[s]=m)}},a.createNonNativeTrack=function(s){if(this.nonNativeCaptionsTracks[s])return;var S=this.captionsProperties[s];if(!S)return;var x=S.label,T={_id:s,label:x,kind:"captions",default:S.media?!!S.media.default:!1,closedCaptions:S.media};this.nonNativeCaptionsTracks[s]=T,this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},a.createTextTrack=function(s,S,x){var T=this.media;return T?T.addTextTrack(s,S,x):void 0},a.onMediaAttaching=function(s,S){this.media=S.media,this._cleanTracks()},a.onMediaDetaching=function(){var s=this.captionsTracks;Object.keys(s).forEach(function(S){Object(n.clearCurrentCues)(s[S]),delete s[S]}),this.nonNativeCaptionsTracks={}},a.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),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())},a._cleanTracks=function(){var s=this.media;if(!s)return;var S=s.textTracks;if(S)for(var x=0;x<S.length;x++)Object(n.clearCurrentCues)(S[x])},a.onSubtitleTracksUpdated=function(s,S){var x=this;this.textTracks=[];var T=S.subtitleTracks||[],A=T.some(function(m){return m.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||A&&this.config.enableIMSC1){var w=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var v=this.media?this.media.textTracks:[];this.tracks.forEach(function(m,f){var O;if(f<v.length){for(var E=null,_=0;_<v.length;_++)if(c(v[_],m)){E=v[_];break}E&&(O=E)}O?Object(n.clearCurrentCues)(O):(O=x.createTextTrack("subtitles",m.name,m.lang),O&&(O.mode="disabled")),O&&(O.groupId=m.groupId,x.textTracks.push(O))})}else if(!w&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(m){return{label:m.name,kind:m.type.toLowerCase(),default:m.default,subtitleTrack:m}});this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},a.onManifestLoaded=function(s,S){var x=this;this.config.enableCEA708Captions&&S.captions&&S.captions.forEach(function(T){var A=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!A)return;var w="textTrack"+A[1],v=x.captionsProperties[w];if(!v)return;v.label=T.name,T.lang&&(v.languageCode=T.lang),v.media=T})},a.onFragLoading=function(s,S){var x=this.cea608Parser1,T=this.cea608Parser2,A=this.lastSn,w=this.lastPartIndex;if(!this.enabled||!(x&&T))return;if(S.frag.type===g.PlaylistLevelType.MAIN){var v,b,m=S.frag.sn,f=(v=S==null||((b=S.part)===null||b===void 0)?void 0:b.index)!=null?v:-1;m===A+1||m===A&&f===w+1||(x.reset(),T.reset()),this.lastSn=m,this.lastPartIndex=f}},a.onFragLoaded=function(s,S){var x=S.frag,T=S.payload,A=this.initPTS,w=this.unparsedVttFrags;if(x.type===g.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(X.isFiniteNumber)(A[x.cc])){w.push(S),A.length&&this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Missing initial subtitle PTS")});return}var v=x.decryptdata;if(v==null||v.key==null||v.method!=="AES-128"){var b=this.tracks[x.level],m=this.vttCCs;m[x.cc]||(m[x.cc]={start:x.start,prevCC:this.prevCC,new:!0},this.prevCC=x.cc),b&&b.textCodec===D.IMSC1_CODEC?this._parseIMSC1(x,T):this._parseVTTs(x,T,m)}}else this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Empty subtitle payload")})},a._parseIMSC1=function(s,S){var x=this,T=this.hls;Object(D.parseIMSC1)(S,this.initPTS[s.cc],this.timescale[s.cc],function(A){x._appendCues(A,s.level),T.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(A){p.logger.log("Failed to parse IMSC1: "+A),T.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:A})})},a._parseVTTs=function(s,S,x){var T=this,A=this.hls;Object(M.parseWebVTT)(S,this.initPTS[s.cc],this.timescale[s.cc],x,s.cc,s.start,function(w){T._appendCues(w,s.level),A.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(w){T._fallbackToIMSC1(s,S),p.logger.log("Failed to parse VTT cue: "+w),A.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:w})})},a._fallbackToIMSC1=function(s,S){var x=this,T=this.tracks[s.level];T.textCodec||Object(D.parseIMSC1)(S,this.initPTS[s.cc],this.timescale[s.cc],function(){T.textCodec=D.IMSC1_CODEC,x._parseIMSC1(s,S)},function(){T.textCodec="wvtt"})},a._appendCues=function(s,S){var x=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[S];if(T.mode==="disabled")return;s.forEach(function(v){return Object(n.addCueToTrack)(T,v)})}else{var A=this.tracks[S],w=A.default?"default":"subtitles"+S;x.trigger(N.Events.CUES_PARSED,{type:"subtitles",cues:s,track:w})}},a.onFragDecrypted=function(s,S){var x=S.frag;if(x.type===g.PlaylistLevelType.SUBTITLE){if(!Object(X.isFiniteNumber)(this.initPTS[x.cc])){this.unparsedVttFrags.push(S);return}this.onFragLoaded(N.Events.FRAG_LOADED,S)}},a.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},a.onFragParsingUserdata=function(s,S){var x=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(x&&T))return;for(var A=0;A<S.samples.length;A++){var w=S.samples[A].bytes;if(w){var v=this.extractCea608Data(w);x.addData(S.samples[A].pts,v[0]),T.addData(S.samples[A].pts,v[1])}}},a.onBufferFlushing=function(s,S){var x=S.startOffset,T=S.endOffset,A=S.endOffsetSubtitles,w=S.type,v=this.media;if(!v||v.currentTime<T)return;if(!w||w==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(f){return Object(n.removeCuesInRange)(b[f],x,T)})}if(this.config.renderTextTracksNatively&&(x===0&&A!==void 0)){var m=this.textTracks;Object.keys(m).forEach(function(f){return Object(n.removeCuesInRange)(m[f],x,A)})}},a.extractCea608Data=function(s){for(var S=s[0]&31,x=2,T=[[],[]],A=0;A<S;A++){var w=s[x++],v=127&s[x++],b=127&s[x++],m=(4&w)!==0,f=3&w;if(v===0&&b===0)continue;m&&((f===0||f===1)&&(T[f].push(v),T[f].push(b)))}return T},r}();function c(r,a){return r&&r.label===a.name&&!(r.textTrack1||r.textTrack2)}function o(r,a,i,s){return Math.min(a,s)-Math.max(r,i)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return X});var X=function(){function N(B,M){this.subtle=void 0,this.aesIV=void 0,this.subtle=B,this.aesIV=M}var C=N.prototype;return C.decrypt=function(M,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,M)},N}()},"./src/crypt/aes-decryptor.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"removePadding",function(){return N}),P.d(z,"default",function(){return C});var X=P("./src/utils/typed-array.ts");function N(B){var M=B.byteLength,n=M&&new DataView(B.buffer).getUint8(M-1);return n?Object(X.sliceUint8)(B,0,M-n):B}var C=function(){function B(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var M=B.prototype;return M.uint8ArrayToUint32Array_=function(D){for(var g=new DataView(D),p=new Uint32Array(4),h=0;h<4;h++)p[h]=g.getUint32(h*4);return p},M.initTable=function(){var D=this.sBox,g=this.invSBox,p=this.subMix,h=p[0],c=p[1],o=p[2],d=p[3],r=this.invSubMix,a=r[0],i=r[1],s=r[2],S=r[3],x=new Uint32Array(256),T=0,A=0,w=0;for(w=0;w<256;w++)w<128?x[w]=w<<1:x[w]=w<<1^283;for(w=0;w<256;w++){var v=A^A<<1^A<<2^A<<3^A<<4;v=v>>>8^v&255^99,D[T]=v,g[v]=T;var b=x[T],m=x[b],f=x[m],O=x[v]*257^v*16843008;h[T]=O<<24|O>>>8,c[T]=O<<16|O>>>16,o[T]=O<<8|O>>>24,d[T]=O,O=f*16843009^m*65537^b*257^T*16843008,a[v]=O<<24|O>>>8,i[v]=O<<16|O>>>16,s[v]=O<<8|O>>>24,S[v]=O,T?(T=b^x[x[x[f^b]]],A^=x[x[A]]):T=A=1}},M.expandKey=function(D){for(var g=this.uint8ArrayToUint32Array_(D),p=!0,h=0;h<g.length&&p;)p=g[h]===this.key[h],h++;if(p)return;this.key=g;var c=this.keySize=g.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var o=this.ksRows=(c+6+1)*4,d,r,a=this.keySchedule=new Uint32Array(o),i=this.invKeySchedule=new Uint32Array(o),s=this.sBox,S=this.rcon,x=this.invSubMix,T=x[0],A=x[1],w=x[2],v=x[3],b,m;for(d=0;d<o;d++){if(d<c){b=a[d]=g[d];continue}m=b,d%c===0?(m=m<<8|m>>>24,m=s[m>>>24]<<24|s[m>>>16&255]<<16|s[m>>>8&255]<<8|s[m&255],m^=S[d/c|0]<<24):c>6&&d%c===4&&(m=s[m>>>24]<<24|s[m>>>16&255]<<16|s[m>>>8&255]<<8|s[m&255]),a[d]=b=(a[d-c]^m)>>>0}for(r=0;r<o;r++)d=o-r,r&3?m=a[d]:m=a[d-4],r<4||d<=4?i[r]=m:i[r]=T[s[m>>>24]]^A[s[m>>>16&255]]^w[s[m>>>8&255]]^v[s[m&255]],i[r]=i[r]>>>0},M.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},M.decrypt=function(D,g,p){for(var h=this.keySize+6,c=this.invKeySchedule,o=this.invSBox,d=this.invSubMix,r=d[0],a=d[1],i=d[2],s=d[3],S=this.uint8ArrayToUint32Array_(p),x=S[0],T=S[1],A=S[2],w=S[3],v=new Int32Array(D),b=new Int32Array(v.length),m,f,O,E,_,k,F,L,G,j,R,V,ne,se,Se=this.networkToHostOrderSwap;g<v.length;){for(G=Se(v[g]),j=Se(v[g+1]),R=Se(v[g+2]),V=Se(v[g+3]),_=G^c[0],k=V^c[1],F=R^c[2],L=j^c[3],ne=4,se=1;se<h;se++)m=r[_>>>24]^a[k>>16&255]^i[F>>8&255]^s[L&255]^c[ne],f=r[k>>>24]^a[F>>16&255]^i[L>>8&255]^s[_&255]^c[ne+1],O=r[F>>>24]^a[L>>16&255]^i[_>>8&255]^s[k&255]^c[ne+2],E=r[L>>>24]^a[_>>16&255]^i[k>>8&255]^s[F&255]^c[ne+3],_=m,k=f,F=O,L=E,ne=ne+4;m=o[_>>>24]<<24^o[k>>16&255]<<16^o[F>>8&255]<<8^o[L&255]^c[ne],f=o[k>>>24]<<24^o[F>>16&255]<<16^o[L>>8&255]<<8^o[_&255]^c[ne+1],O=o[F>>>24]<<24^o[L>>16&255]<<16^o[_>>8&255]<<8^o[k&255]^c[ne+2],E=o[L>>>24]<<24^o[_>>16&255]<<16^o[k>>8&255]<<8^o[F&255]^c[ne+3],b[g]=Se(m^x),b[g+1]=Se(E^T),b[g+2]=Se(O^A),b[g+3]=Se(f^w),x=G,T=j,A=R,w=V,g=g+4}return b.buffer},B}()},"./src/crypt/decrypter.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return g});var X=P("./src/crypt/aes-crypto.ts"),N=P("./src/crypt/fast-aes-key.ts"),C=P("./src/crypt/aes-decryptor.ts"),B=P("./src/utils/logger.ts"),M=P("./src/utils/mp4-tools.ts"),n=P("./src/utils/typed-array.ts"),D=16,g=function(){function p(c,o,d){var r=d===void 0?{}:d,a=r.removePKCS7Padding,i=a===void 0?!0:a;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=c,this.config=o,this.removePKCS7Padding=i,i)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(S){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var h=p.prototype;return h.destroy=function(){this.observer=null},h.isSync=function(){return this.config.enableSoftwareAES},h.flush=function(){var o=this.currentResult;if(!o){this.reset();return}var d=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(C.removePadding)(d):d},h.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},h.decrypt=function(o,d,r,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),d,r);var i=this.flush();i&&a(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),d,r).then(a)},h.softwareDecrypt=function(o,d,r){var a=this.currentIV,i=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(o=Object(M.appendUint8Array)(s,o),this.remainderData=null);var S=this.getValidChunk(o);if(!S.length)return null;a&&(r=a);var x=this.softwareDecrypter;x||(x=this.softwareDecrypter=new C.default),x.expandKey(d);var T=i;return this.currentResult=x.decrypt(S.buffer,0,r),this.currentIV=Object(n.sliceUint8)(S,-16).buffer,T||null},h.webCryptoDecrypt=function(o,d,r){var a=this,i=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new N.default(i,d)),this.fastAesKey.expandKey().then(function(s){if(!i)return Promise.reject(new Error("web crypto not initialized"));var S=new X.default(i,r);return S.decrypt(o.buffer,s)}).catch(function(s){return a.onWebCryptoError(s,o,d,r)})},h.onWebCryptoError=function(o,d,r,a){return B.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,r,a)},h.getValidChunk=function(o){var d=o,r=o.length-o.length%D;return r!==o.length&&(d=Object(n.sliceUint8)(o,0,r),this.remainderData=Object(n.sliceUint8)(o,r)),d},h.logOnce=function(o){if(!this.logEnabled)return;B.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return X});var X=function(){function N(B,M){this.subtle=void 0,this.key=void 0,this.subtle=B,this.key=M}var C=N.prototype;return C.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},N}()},"./src/demux/aacdemuxer.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/demux/base-audio-demuxer.ts"),N=P("./src/demux/adts.ts"),C=P("./src/utils/logger.ts"),B=P("./src/demux/id3.ts");function M(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,n(g,p)}function n(g,p){return n=Object.setPrototypeOf||function(c,o){return c.__proto__=o,c},n(g,p)}var D=function(g){M(p,g);function p(c,o){var d;return d=g.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=c,d.config=o,d}var h=p.prototype;return h.resetInitSegment=function(o,d,r){g.prototype.resetInitSegment.call(this,o,d,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:r,inputTimeScale:9e4,dropped:0}},p.probe=function(o){if(!o)return!1;for(var d=B.getID3Data(o,0)||[],r=d.length,a=o.length;r<a;r++)if(N.probe(o,r))return C.logger.log("ADTS sync word found !"),!0;return!1},h.canParse=function(o,d){return N.canParse(o,d)},h.appendFrame=function(o,d,r){N.initTrackConfig(o,this.observer,d,r,o.manifestCodec);var a=N.appendFrame(o,d,r,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},p}(X.default);D.minProbeByteLength=9,z.default=D},"./src/demux/adts.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"getAudioConfig",function(){return B}),P.d(z,"isHeaderPattern",function(){return M}),P.d(z,"getHeaderLength",function(){return n}),P.d(z,"getFullFrameLength",function(){return D}),P.d(z,"canGetFrameLength",function(){return g}),P.d(z,"isHeader",function(){return p}),P.d(z,"canParse",function(){return h}),P.d(z,"probe",function(){return c}),P.d(z,"initTrackConfig",function(){return o}),P.d(z,"getFrameDuration",function(){return d}),P.d(z,"parseFrameHeader",function(){return r}),P.d(z,"appendFrame",function(){return a});var X=P("./src/utils/logger.ts"),N=P("./src/errors.ts"),C=P("./src/events.ts");function B(i,s,S,x){var T,A,w,v,b=navigator.userAgent.toLowerCase(),m=x,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((s[S+2]&192)>>>6)+1;var O=(s[S+2]&60)>>>2;if(O>f.length-1){i.trigger(C.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+O});return}return w=(s[S+2]&1)<<2,w|=(s[S+3]&192)>>>6,X.logger.log("manifest codec:"+x+", ADTS type:"+T+", samplingIndex:"+O),/firefox/i.test(b)?O>=6?(T=5,v=new Array(4),A=O-3):(T=2,v=new Array(2),A=O):b.indexOf("android")!==-1?(T=2,v=new Array(2),A=O):(T=5,v=new Array(4),x&&(x.indexOf("mp4a.40.29")!==-1||x.indexOf("mp4a.40.5")!==-1)||!x&&O>=6?A=O-3:((x&&x.indexOf("mp4a.40.2")!==-1&&(O>=6&&w===1||/vivaldi/i.test(b))||!x&&w===1)&&(T=2,v=new Array(2)),A=O)),v[0]=T<<3,v[0]|=(O&14)>>1,v[1]|=(O&1)<<7,v[1]|=w<<3,T===5&&(v[1]|=(A&14)>>1,v[2]=(A&1)<<7,v[2]|=2<<2,v[3]=0),{config:v,samplerate:f[O],channelCount:w,codec:"mp4a.40."+T,manifestCodec:m}}function M(i,s){return i[s]===255&&(i[s+1]&246)===240}function n(i,s){return i[s+1]&1?7:9}function D(i,s){return(i[s+3]&3)<<11|i[s+4]<<3|(i[s+5]&224)>>>5}function g(i,s){return s+5<i.length}function p(i,s){return s+1<i.length&&M(i,s)}function h(i,s){return g(i,s)&&M(i,s)&&D(i,s)<=i.length-s}function c(i,s){if(p(i,s)){var S=n(i,s);if(s+S>=i.length)return!1;var x=D(i,s);if(x<=S)return!1;var T=s+x;return T===i.length||p(i,T)}return!1}function o(i,s,S,x,T){if(!i.samplerate){var A=B(s,S,x,T);if(!A)return;i.config=A.config,i.samplerate=A.samplerate,i.channelCount=A.channelCount,i.codec=A.codec,i.manifestCodec=A.manifestCodec,X.logger.log("parsed codec:"+i.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function d(i){return 1024*9e4/i}function r(i,s,S,x,T){var A=n(i,s),w=D(i,s);if(w-=A,w>0){var v=S+x*T;return{headerLength:A,frameLength:w,stamp:v}}}function a(i,s,S,x,T){var A=d(i.samplerate),w=r(s,S,x,T,A);if(w){var v=w.frameLength,b=w.headerLength,m=w.stamp,f=b+v,O=Math.max(0,S+f-s.length),E;O?(E=new Uint8Array(f-b),E.set(s.subarray(S+b,s.length),0)):E=s.subarray(S+b,S+f);var _={unit:E,pts:m};return O||i.samples.push(_),{sample:_,length:f,missing:O}}}},"./src/demux/base-audio-demuxer.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"initPTSFn",function(){return D});var X=P("./src/polyfills/number.ts"),N=P("./src/demux/id3.ts"),C=P("./src/demux/dummy-demuxed-track.ts"),B=P("./src/utils/mp4-tools.ts"),M=P("./src/utils/typed-array.ts"),n=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=g.prototype;return p.resetInitSegment=function(c,o,d){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(c,o){return!1},p.appendFrame=function(c,o,d){},p.demux=function(c,o){this.cachedData&&(c=Object(B.appendUint8Array)(this.cachedData,c),this.cachedData=null);var d=N.getID3Data(c,0),r=d?d.length:0,a,i,s=this._audioTrack,S=this._id3Track,x=d?N.getTimeStamp(d):void 0,T=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(x,o)),d&&d.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),i=this.initPTS;r<T;){if(this.canParse(c,r)){var A=this.appendFrame(s,c,r);A?(this.frameIndex++,i=A.sample.pts,r+=A.length,a=r):r=T}else N.canParse(c,r)?(d=N.getID3Data(c,r),S.samples.push({pts:i,dts:i,data:d}),r+=d.length,a=r):r++;if(r===T&&a!==T){var w=Object(M.sliceUint8)(c,a);this.cachedData?this.cachedData=Object(B.appendUint8Array)(this.cachedData,w):this.cachedData=w}}return{audioTrack:s,avcTrack:Object(C.dummyTrack)(),id3Track:S,textTrack:Object(C.dummyTrack)()}},p.demuxSampleAes=function(c,o,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(c){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(C.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(C.dummyTrack)()}},p.destroy=function(){},g}(),D=function(p,h){return Object(X.isFiniteNumber)(p)?p*90:h*9e4};z.default=n},"./src/demux/chunk-cache.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return X});var X=function(){function C(){this.chunks=[],this.dataLength=0}var B=C.prototype;return B.push=function(n){this.chunks.push(n),this.dataLength+=n.length},B.flush=function(){var n=this.chunks,D=this.dataLength,g;if(n.length)n.length===1?g=n[0]:g=N(n,D);else return new Uint8Array(0);return this.reset(),g},B.reset=function(){this.chunks.length=0,this.dataLength=0},C}();function N(C,B){for(var M=new Uint8Array(B),n=0,D=0;D<C.length;D++){var g=C[D];M.set(g,n),n+=g.length}return M}},"./src/demux/dummy-demuxed-track.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"dummyTrack",function(){return X});function X(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/utils/logger.ts"),N=function(){function C(M){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=M,this.bytesAvailable=M.byteLength,this.word=0,this.bitsAvailable=0}var B=C.prototype;return B.loadWord=function(){var n=this.data,D=this.bytesAvailable,g=n.byteLength-D,p=new Uint8Array(4),h=Math.min(4,D);if(h===0)throw new Error("no bytes available");p.set(n.subarray(g,g+h)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=h*8,this.bytesAvailable-=h},B.skipBits=function(n){var D;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,D=n>>3,n-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},B.readBits=function(n){var D=Math.min(this.bitsAvailable,n),g=this.word>>>32-D;return n>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=n-D,D>0&&this.bitsAvailable?g<<D|this.readBits(D):g},B.skipLZ=function(){var n;for(n=0;n<this.bitsAvailable;++n)if((this.word&2147483648>>>n)!==0)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},B.skipUEG=function(){this.skipBits(1+this.skipLZ())},B.skipEG=function(){this.skipBits(1+this.skipLZ())},B.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},B.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},B.readBoolean=function(){return this.readBits(1)===1},B.readUByte=function(){return this.readBits(8)},B.readUShort=function(){return this.readBits(16)},B.readUInt=function(){return this.readBits(32)},B.skipScalingList=function(n){for(var D=8,g=8,p,h=0;h<n;h++)g!==0&&(p=this.readEG(),g=(D+p+256)%256),D=g===0?D:g},B.readSPS=function(){var n=0,D=0,g=0,p=0,h,c,o,d=this.readUByte.bind(this),r=this.readBits.bind(this),a=this.readUEG.bind(this),i=this.readBoolean.bind(this),s=this.skipBits.bind(this),S=this.skipEG.bind(this),x=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);d();var A=d();if(r(5),s(3),d(),x(),A===100||A===110||A===122||A===244||A===44||A===83||A===86||A===118||A===128){var w=a();if(w===3&&s(1),x(),x(),s(1),i())for(c=w!==3?8:12,o=0;o<c;o++)i()&&(o<6?T(16):T(64))}x();var v=a();if(v===0)a();else if(v===1)for(s(1),S(),S(),h=a(),o=0;o<h;o++)S();x(),s(1);var b=a(),m=a(),f=r(1);f===0&&s(1),s(1),i()&&(n=a(),D=a(),g=a(),p=a());var O=[1,1];if(i()&&i()){var E=d();switch(E){case 1:O=[1,1];break;case 2:O=[12,11];break;case 3:O=[10,11];break;case 4:O=[16,11];break;case 5:O=[40,33];break;case 6:O=[24,11];break;case 7:O=[20,11];break;case 8:O=[32,11];break;case 9:O=[80,33];break;case 10:O=[18,11];break;case 11:O=[15,11];break;case 12:O=[64,33];break;case 13:O=[160,99];break;case 14:O=[4,3];break;case 15:O=[3,2];break;case 16:O=[2,1];break;case 255:{O=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((b+1)*16-n*2-D*2),height:(2-f)*(m+1)*16-(f?2:4)*(g+p),pixelRatio:O}},B.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},C}();z.default=N},"./src/demux/id3.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"isHeader",function(){return X}),P.d(z,"isFooter",function(){return N}),P.d(z,"getID3Data",function(){return C}),P.d(z,"canParse",function(){return M}),P.d(z,"getTimeStamp",function(){return n}),P.d(z,"isTimeStampFrame",function(){return D}),P.d(z,"getID3Frames",function(){return p}),P.d(z,"decodeFrame",function(){return h}),P.d(z,"utf8ArrayToStr",function(){return a}),P.d(z,"testables",function(){return i});var X=function(T,A){return A+10<=T.length&&(T[A]===73&&T[A+1]===68&&T[A+2]===51&&(T[A+3]<255&&T[A+4]<255&&(T[A+6]<128&&T[A+7]<128&&T[A+8]<128&&T[A+9]<128)))},N=function(T,A){return A+10<=T.length&&(T[A]===51&&T[A+1]===68&&T[A+2]===73&&(T[A+3]<255&&T[A+4]<255&&(T[A+6]<128&&T[A+7]<128&&T[A+8]<128&&T[A+9]<128)))},C=function(T,A){for(var w=A,v=0;X(T,A);){v+=10;var b=B(T,A+6);v+=b,N(T,A+10)&&(v+=10),A+=v}return v>0?T.subarray(w,w+v):void 0},B=function(T,A){var w=0;return w=(T[A]&127)<<21,w|=(T[A+1]&127)<<14,w|=(T[A+2]&127)<<7,w|=T[A+3]&127,w},M=function(T,A){return X(T,A)&&B(T,A+6)+10<=T.length-A},n=function(T){for(var A=p(T),w=0;w<A.length;w++){var v=A[w];if(D(v))return r(v)}return},D=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},g=function(T){var A=String.fromCharCode(T[0],T[1],T[2],T[3]),w=B(T,4),v=10;return{type:A,size:w,data:T.subarray(v,v+w)}},p=function(T){for(var A=0,w=[];X(T,A);){var v=B(T,A+6);A+=10;for(var b=A+v;A+8<b;){var m=g(T.subarray(A)),f=h(m);f&&w.push(f),A+=m.size+10}N(T,A)&&(A+=10)}return w},h=function(T){return T.type==="PRIV"?c(T):T.type[0]==="W"?d(T):o(T)},c=function(T){if(T.size<2)return;var A=a(T.data,!0),w=new Uint8Array(T.data.subarray(A.length+1));return{key:T.type,info:A,data:w.buffer}},o=function(T){if(T.size<2)return;if(T.type==="TXXX"){var A=1,w=a(T.data.subarray(A),!0);A+=w.length+1;var v=a(T.data.subarray(A));return{key:T.type,info:w,data:v}}var b=a(T.data.subarray(1));return{key:T.type,data:b}},d=function(T){if(T.type==="WXXX"){if(T.size<2)return;var A=1,w=a(T.data.subarray(A),!0);A+=w.length+1;var v=a(T.data.subarray(A));return{key:T.type,info:w,data:v}}var b=a(T.data);return{key:T.type,data:b}},r=function(T){if(T.data.byteLength===8){var A=new Uint8Array(T.data),w=A[3]&1,v=(A[4]<<23)+(A[5]<<15)+(A[6]<<7)+A[7];return v/=45,w&&(v+=4772185884e-2),Math.round(v)}return},a=function(T,A){A===void 0&&(A=!1);var w=S();if(w){var v=w.decode(T);if(A){var b=v.indexOf("\0");return b!==-1?v.substring(0,b):v}return v.replace(/\0/g,"")}for(var m=T.length,f,O,E,_="",k=0;k<m;){if(f=T[k++],f===0&&A)return _;if(f===0||f===3)continue;switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:_+=String.fromCharCode(f);break;case 12:case 13:O=T[k++],_+=String.fromCharCode((f&31)<<6|O&63);break;case 14:O=T[k++],E=T[k++],_+=String.fromCharCode((f&15)<<12|(O&63)<<6|(E&63)<<0);break;default:}}return _},i={decodeTextFrame:o},s;function S(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/demux/base-audio-demuxer.ts"),N=P("./src/demux/id3.ts"),C=P("./src/utils/logger.ts"),B=P("./src/demux/mpegaudio.ts");function M(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,n(g,p)}function n(g,p){return n=Object.setPrototypeOf||function(c,o){return c.__proto__=o,c},n(g,p)}var D=function(g){M(p,g);function p(){return g.apply(this,arguments)||this}var h=p.prototype;return h.resetInitSegment=function(o,d,r){g.prototype.resetInitSegment.call(this,o,d,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:r,inputTimeScale:9e4,dropped:0}},p.probe=function(o){if(!o)return!1;for(var d=N.getID3Data(o,0)||[],r=d.length,a=o.length;r<a;r++)if(B.probe(o,r))return C.logger.log("MPEG Audio sync word found !"),!0;return!1},h.canParse=function(o,d){return B.canParse(o,d)},h.appendFrame=function(o,d,r){return this.initPTS===null?void 0:B.appendFrame(o,d,r,this.initPTS,this.frameIndex)},p}(X.default);D.minProbeByteLength=4,z.default=D},"./src/demux/mp4demuxer.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/utils/mp4-tools.ts"),N=P("./src/demux/dummy-demuxed-track.ts"),C=function(){function B(n,D){this.remainderData=null,this.config=void 0,this.config=D}var M=B.prototype;return M.resetTimeStamp=function(){},M.resetInitSegment=function(){},M.resetContiguity=function(){},B.probe=function(D){return Object(X.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},M.demux=function(D){var g=D,p=Object(N.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(X.appendUint8Array)(this.remainderData,D));var h=Object(X.segmentValidRange)(g);this.remainderData=h.remainder,p.samples=h.valid||new Uint8Array}else p.samples=g;return{audioTrack:Object(N.dummyTrack)(),avcTrack:p,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},M.flush=function(){var D=Object(N.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(N.dummyTrack)(),avcTrack:D,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},M.demuxSampleAes=function(D,g,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},M.destroy=function(){},B}();C.minProbeByteLength=1024,z.default=C},"./src/demux/mpegaudio.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"appendFrame",function(){return n}),P.d(z,"parseHeader",function(){return D}),P.d(z,"isHeaderPattern",function(){return g}),P.d(z,"isHeader",function(){return p}),P.d(z,"canParse",function(){return h}),P.d(z,"probe",function(){return c});var X=null,N=[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],C=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],B=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],M=[0,1,1,4];function n(o,d,r,a,i){if(r+24>d.length)return;var s=D(d,r);if(s&&r+s.frameLength<=d.length){var S=s.samplesPerFrame*9e4/s.sampleRate,x=a+i*S,T={unit:d.subarray(r,r+s.frameLength),pts:x,dts:x};return o.config=[],o.channelCount=s.channelCount,o.samplerate=s.sampleRate,o.samples.push(T),{sample:T,length:s.frameLength,missing:0}}}function D(o,d){var r=o[d+1]>>3&3,a=o[d+1]>>1&3,i=o[d+2]>>4&15,s=o[d+2]>>2&3;if(r!==1&&i!==0&&i!==15&&s!==3){var S=o[d+2]>>1&1,x=o[d+3]>>6,T=r===3?3-a:a===3?3:4,A=N[T*14+i-1]*1e3,w=r===3?0:r===2?1:2,v=C[w*3+s],b=x===3?1:2,m=B[r][a],f=M[a],O=m*8*f,E=Math.floor(m*A/v+S)*f;if(X===null){var _=navigator.userAgent||"",k=_.match(/Chrome\/(\d+)/i);X=k?parseInt(k[1]):0}var F=!!X&&X<=87;return F&&a===2&&A>=224e3&&x===0&&(o[d+3]=o[d+3]|128),{sampleRate:v,channelCount:b,frameLength:E,samplesPerFrame:O}}}function g(o,d){return o[d]===255&&(o[d+1]&224)===224&&(o[d+1]&6)!==0}function p(o,d){return d+1<o.length&&g(o,d)}function h(o,d){var r=4;return g(o,d)&&r<=o.length-d}function c(o,d){if(d+1<o.length&&g(o,d)){var r=4,a=D(o,d),i=r;a!=null&&a.frameLength&&(i=a.frameLength);var s=d+i;return s===o.length||p(o,s)}return!1}},"./src/demux/sample-aes.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/crypt/decrypter.ts"),N=P("./src/demux/tsdemuxer.ts"),C=function(){function B(n,D,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new X.default(n,D,{removePKCS7Padding:!1})}var M=B.prototype;return M.decryptBuffer=function(D,g){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,g)},M.decryptAacSample=function(D,g,p,h){var c=D[g].unit,o=c.subarray(16,c.length-c.length%16),d=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),r=this;this.decryptBuffer(d,function(a){var i=new Uint8Array(a);c.set(i,16),h||r.decryptAacSamples(D,g+1,p)})},M.decryptAacSamples=function(D,g,p){for(;;g++){if(g>=D.length){p();return}if(D[g].unit.length<32)continue;var h=this.decrypter.isSync();if(this.decryptAacSample(D,g,p,h),!h)return}},M.getAvcEncryptedData=function(D){for(var g=Math.floor((D.length-48)/160)*16+16,p=new Int8Array(g),h=0,c=32;c<=D.length-16;c+=160,h+=16)p.set(D.subarray(c,c+16),h);return p},M.getAvcDecryptedUnit=function(D,g){for(var p=new Uint8Array(g),h=0,c=32;c<=D.length-16;c+=160,h+=16)D.set(p.subarray(h,h+16),c);return D},M.decryptAvcSample=function(D,g,p,h,c,o){var d=Object(N.discardEPB)(c.data),r=this.getAvcEncryptedData(d),a=this;this.decryptBuffer(r.buffer,function(i){c.data=a.getAvcDecryptedUnit(d,i),o||a.decryptAvcSamples(D,g,p+1,h)})},M.decryptAvcSamples=function(D,g,p,h){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,p=0){if(g>=D.length){h();return}for(var c=D[g].units;!(p>=c.length);p++){var o=c[p];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(D,g,p,h,o,d),!d)return}}},B}();z.default=C},"./src/demux/transmuxer-interface.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return c});var X=P("./node_modules/webworkify-webpack/index.js"),N=P.n(X),C=P("./src/events.ts"),B=P("./src/demux/transmuxer.ts"),M=P("./src/utils/logger.ts"),n=P("./src/errors.ts"),D=P("./src/utils/mediasource-helper.ts"),g=P("./node_modules/eventemitter3/index.js"),p=P.n(g),h=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function o(r,a,i,s){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=r,this.id=a,this.onTransmuxComplete=i,this.onFlush=s;var x=r.config,T=function(m,f){f=f||{},f.frag=S.frag,f.id=S.id,r.trigger(m,f)};this.observer=new g.EventEmitter,this.observer.on(C.Events.FRAG_DECRYPTED,T),this.observer.on(C.Events.ERROR,T);var A={mp4:h.isTypeSupported("video/mp4"),mpeg:h.isTypeSupported("audio/mpeg"),mp3:h.isTypeSupported('audio/mp4; codecs="mp3"')},w=navigator.vendor;if(x.enableWorker&&typeof Worker!="undefined"){M.logger.log("demuxing in webworker");var v;try{v=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(b){r.trigger(C.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},v.postMessage({cmd:"init",typeSupported:A,vendor:w,id:a,config:JSON.stringify(x)})}catch(b){M.logger.warn("Error in worker:",b),M.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new B.default(this.observer,A,x,w,a),this.worker=null}}else this.transmuxer=new B.default(this.observer,A,x,w,a)}var d=o.prototype;return d.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var s=this.observer;s&&s.removeAllListeners(),this.observer=null},d.push=function(a,i,s,S,x,T,A,w,v,b){var m=this;v.transmuxing.start=self.performance.now();var f=this.transmuxer,O=this.worker,E=T?T.start:x.start,_=x.decryptdata,k=this.frag,F=!(k&&x.cc===k.cc),L=!(k&&v.level===k.level),G=k?v.sn-k.sn:-1,j=this.part?v.part-this.part.index:1,R=!L&&(G===1||G===0&&j===1),V=self.performance.now();(L||G||x.stats.parsing.start===0)&&(x.stats.parsing.start=V),T&&(j||!R)&&(T.stats.parsing.start=V);var ne=new B.TransmuxState(F,R,w,L,E);if(!R||F){M.logger.log("[transmuxer-interface, "+x.type+"]: Starting new transmux session for sn: "+v.sn+" p: "+v.part+" level: "+v.level+" id: "+v.id+`
|
|
discontinuity: `+F+`
|
|
trackSwitch: `+L+`
|
|
contiguous: `+R+`
|
|
accurateTimeOffset: `+w+`
|
|
timeOffset: `+E);var se=new B.TransmuxConfig(s,S,i,A,b);this.configureTransmuxer(se)}if(this.frag=x,this.part=T,O)O.postMessage({cmd:"demux",data:a,decryptdata:_,chunkMeta:v,state:ne},a instanceof ArrayBuffer?[a]:[]);else if(f){var Se=f.push(a,_,v,ne);Object(B.isPromise)(Se)?Se.then(function(De){m.handleTransmuxComplete(De)}):this.handleTransmuxComplete(Se)}},d.flush=function(a){var i=this;a.transmuxing.start=self.performance.now();var s=this.transmuxer,S=this.worker;if(S)S.postMessage({cmd:"flush",chunkMeta:a});else if(s){var x=s.flush(a);Object(B.isPromise)(x)?x.then(function(T){i.handleFlushResult(T,a)}):this.handleFlushResult(x,a)}},d.handleFlushResult=function(a,i){var s=this;a.forEach(function(S){s.handleTransmuxComplete(S)}),this.onFlush(i)},d.onWorkerMessage=function(a){var i=a.data,s=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,s.trigger(i.event,i.data);break}}},d.configureTransmuxer=function(a){var i=this.worker,s=this.transmuxer;i?i.postMessage({cmd:"configure",config:a}):s&&s.configure(a)},d.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},o}()},"./src/demux/transmuxer-worker.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return n});var X=P("./src/demux/transmuxer.ts"),N=P("./src/events.ts"),C=P("./src/utils/logger.ts"),B=P("./node_modules/eventemitter3/index.js"),M=P.n(B);function n(c){var o=new B.EventEmitter,d=function(a,i){c.postMessage({event:a,data:i})};o.on(N.Events.FRAG_DECRYPTED,d),o.on(N.Events.ERROR,d),c.addEventListener("message",function(r){var a=r.data;switch(a.cmd){case"init":{var i=JSON.parse(a.config);c.transmuxer=new X.default(o,a.typeSupported,i,a.vendor,a.id),Object(C.enableLogs)(i.debug),d("init",null);break}case"configure":{c.transmuxer.configure(a.config);break}case"demux":{var s=c.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(X.isPromise)(s)?s.then(function(T){D(c,T)}):D(c,s);break}case"flush":{var S=a.chunkMeta,x=c.transmuxer.flush(S);Object(X.isPromise)(x)?x.then(function(T){p(c,T,S)}):p(c,x,S);break}default:break}})}function D(c,o){if(h(o.remuxResult))return;var d=[],r=o.remuxResult,a=r.audio,i=r.video;a&&g(d,a),i&&g(d,i),c.postMessage({event:"transmuxComplete",data:o},d)}function g(c,o){o.data1&&c.push(o.data1.buffer),o.data2&&c.push(o.data2.buffer)}function p(c,o,d){o.forEach(function(r){D(c,r)}),c.postMessage({event:"flush",data:d})}function h(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return i}),P.d(z,"isPromise",function(){return x}),P.d(z,"TransmuxConfig",function(){return T}),P.d(z,"TransmuxState",function(){return A});var X=P("./src/events.ts"),N=P("./src/errors.ts"),C=P("./src/crypt/decrypter.ts"),B=P("./src/demux/aacdemuxer.ts"),M=P("./src/demux/mp4demuxer.ts"),n=P("./src/demux/tsdemuxer.ts"),D=P("./src/demux/mp3demuxer.ts"),g=P("./src/remux/mp4-remuxer.ts"),p=P("./src/remux/passthrough-remuxer.ts"),h=P("./src/demux/chunk-cache.ts"),c=P("./src/utils/mp4-tools.ts"),o=P("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(w){o.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var r=[{demux:n.default,remux:g.default},{demux:M.default,remux:p.default},{demux:B.default,remux:g.default},{demux:D.default,remux:g.default}],a=1024;r.forEach(function(w){var v=w.demux;a=Math.max(a,v.minProbeByteLength)});var i=function(){function w(b,m,f,O,E){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new h.default,this.observer=b,this.typeSupported=m,this.config=f,this.vendor=O,this.id=E}var v=w.prototype;return v.configure=function(m){this.transmuxConfig=m,this.decrypter&&this.decrypter.reset()},v.push=function(m,f,O,E){var _=this,k=O.transmuxing;k.executeStart=d();var F=new Uint8Array(m),L=this.cache,G=this.config,j=this.currentTransmuxState,R=this.transmuxConfig;E&&(this.currentTransmuxState=E);var V=s(F,f);if(V&&V.method==="AES-128"){var ne=this.getDecrypter();if(G.enableSoftwareAES){var se=ne.softwareDecrypt(F,V.key.buffer,V.iv.buffer);if(!se)return k.executeEnd=d(),S(O);F=new Uint8Array(se)}else return this.decryptionPromise=ne.webCryptoDecrypt(F,V.key.buffer,V.iv.buffer).then(function(ze){var nt=_.push(ze,null,O);return _.decryptionPromise=null,nt}),this.decryptionPromise}var Se=E||j,De=Se.contiguous,Ae=Se.discontinuity,ke=Se.trackSwitch,je=Se.accurateTimeOffset,Be=Se.timeOffset,we=R.audioCodec,Z=R.videoCodec,U=R.defaultInitPts,K=R.duration,ee=R.initSegmentData;if((Ae||ke)&&this.resetInitSegment(ee,we,Z,K),Ae&&this.resetInitialTimestamp(U),De||this.resetContiguity(),this.needsProbing(F,Ae,ke)){if(L.dataLength){var oe=L.flush();F=Object(c.appendUint8Array)(oe,F)}this.configureTransmuxer(F,R)}var Q=this.transmux(F,V,Be,je,O),Ce=this.currentTransmuxState;return Ce.contiguous=!0,Ce.discontinuity=!1,Ce.trackSwitch=!1,k.executeEnd=d(),Q},v.flush=function(m){var f=this,O=m.transmuxing;O.executeStart=d();var E=this.decrypter,_=this.cache,k=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return f.flush(m)});var L=[],G=k.timeOffset;if(E){var j=E.flush();j&&L.push(this.push(j,null,m))}var R=_.dataLength;_.reset();var V=this.demuxer,ne=this.remuxer;if(!V||!ne)return R>=a&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),O.executeEnd=d(),[S(m)];var se=V.flush(G);return x(se)?se.then(function(Se){return f.flushRemux(L,Se,m),L}):(this.flushRemux(L,se,m),L)},v.flushRemux=function(m,f,O){var E=f.audioTrack,_=f.avcTrack,k=f.id3Track,F=f.textTrack,L=this.currentTransmuxState,G=L.accurateTimeOffset,j=L.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+O.sn+(O.part>-1?" p: "+O.part:"")+" of level "+O.level);var R=this.remuxer.remux(E,_,k,F,j,G,!0,this.id);m.push({remuxResult:R,chunkMeta:O}),O.transmuxing.executeEnd=d()},v.resetInitialTimestamp=function(m){var f=this.demuxer,O=this.remuxer;if(!f||!O)return;f.resetTimeStamp(m),O.resetTimeStamp(m)},v.resetContiguity=function(){var m=this.demuxer,f=this.remuxer;if(!m||!f)return;m.resetContiguity(),f.resetNextTimestamp()},v.resetInitSegment=function(m,f,O,E){var _=this.demuxer,k=this.remuxer;if(!_||!k)return;_.resetInitSegment(f,O,E),k.resetInitSegment(m,f,O)},v.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},v.transmux=function(m,f,O,E,_){var k;return f&&f.method==="SAMPLE-AES"?k=this.transmuxSampleAes(m,f,O,E,_):k=this.transmuxUnencrypted(m,O,E,_),k},v.transmuxUnencrypted=function(m,f,O,E){var _=this.demuxer.demux(m,f,!1,!this.config.progressive),k=_.audioTrack,F=_.avcTrack,L=_.id3Track,G=_.textTrack,j=this.remuxer.remux(k,F,L,G,f,O,!1,this.id);return{remuxResult:j,chunkMeta:E}},v.transmuxSampleAes=function(m,f,O,E,_){var k=this;return this.demuxer.demuxSampleAes(m,f,O).then(function(F){var L=k.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,O,E,!1,k.id);return{remuxResult:L,chunkMeta:_}})},v.configureTransmuxer=function(m,f){for(var O=this.config,E=this.observer,_=this.typeSupported,k=this.vendor,F=f.audioCodec,L=f.defaultInitPts,G=f.duration,j=f.initSegmentData,R=f.videoCodec,V,ne=0,se=r.length;ne<se;ne++)if(r[ne].demux.probe(m)){V=r[ne];break}V||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),V={demux:M.default,remux:p.default});var Se=this.demuxer,De=this.remuxer,Ae=V.remux,ke=V.demux;(!De||!(De instanceof Ae))&&(this.remuxer=new Ae(E,O,_,k)),(!Se||!(Se instanceof ke))&&(this.demuxer=new ke(E,O,_),this.probe=ke.probe),this.resetInitSegment(j,F,R,G),this.resetInitialTimestamp(L)},v.needsProbing=function(m,f,O){return!this.demuxer||!this.remuxer||f||O},v.getDecrypter=function(){var m=this.decrypter;return m||(m=this.decrypter=new C.default(this.observer,this.config)),m},w}();function s(w,v){var b=null;return w.byteLength>0&&v!=null&&v.key!=null&&v.iv!==null&&v.method!=null&&(b=v),b}var S=function(v){return{remuxResult:{},chunkMeta:v}};function x(w){return"then"in w&&w.then instanceof Function}var T=function(v,b,m,f,O){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=v,this.videoCodec=b,this.initSegmentData=m,this.duration=f,this.defaultInitPts=O},A=function(v,b,m,f,O){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=v,this.contiguous=b,this.accurateTimeOffset=m,this.trackSwitch=f,this.timeOffset=O}},"./src/demux/tsdemuxer.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"discardEPB",function(){return S});var X=P("./src/demux/adts.ts"),N=P("./src/demux/mpegaudio.ts"),C=P("./src/demux/exp-golomb.ts"),B=P("./src/demux/id3.ts"),M=P("./src/demux/sample-aes.ts"),n=P("./src/events.ts"),D=P("./src/utils/mp4-tools.ts"),g=P("./src/utils/logger.ts"),p=P("./src/errors.ts"),h={video:1,audio:2,id3:3,text:4},c=function(){function x(A,w,v){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=A,this.config=w,this.typeSupported=v}x.probe=function(w){var v=x.syncOffset(w);return v<0?!1:(v&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+v+", junk ahead ?"),!0)},x.syncOffset=function(w){for(var v=Math.min(1e3,w.length-3*188),b=0;b<v;){if(w[b]===71&&w[b+188]===71&&w[b+2*188]===71)return b;b++}return-1},x.createTrack=function(w,v){return{container:w==="video"||w==="audio"?"video/mp2t":void 0,type:w,id:h[w],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:w==="audio"?v:void 0}};var T=x.prototype;return T.resetInitSegment=function(w,v,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=x.createTrack("video",b),this._audioTrack=x.createTrack("audio",b),this._id3Track=x.createTrack("id3",b),this._txtTrack=x.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=w,this.videoCodec=v,this._duration=b},T.resetTimeStamp=function(){},T.resetContiguity=function(){var w=this._audioTrack,v=this._avcTrack,b=this._id3Track;w&&(w.pesData=null),v&&(v.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(w,v,b,m){b===void 0&&(b=!1),m===void 0&&(m=!1),b||(this.sampleAes=null);var f,O=this._avcTrack,E=this._audioTrack,_=this._id3Track,k=O.pid,F=O.pesData,L=E.pid,G=_.pid,j=E.pesData,R=_.pesData,V=!1,ne=this.pmtParsed,se=this._pmtId,Se=w.length;if(this.remainderData&&(w=Object(D.appendUint8Array)(this.remainderData,w),Se=w.length,this.remainderData=null),Se<188&&!m)return this.remainderData=w,{audioTrack:E,avcTrack:O,id3Track:_,textTrack:this._txtTrack};var De=Math.max(0,x.syncOffset(w));Se-=(Se+De)%188,Se<w.byteLength&&!m&&(this.remainderData=new Uint8Array(w.buffer,Se,w.buffer.byteLength-Se));for(var Ae=De;Ae<Se;Ae+=188)if(w[Ae]===71){var ke=!!(w[Ae+1]&64),je=((w[Ae+1]&31)<<8)+w[Ae+2],Be=(w[Ae+3]&48)>>4,we=void 0;if(Be>1){if(we=Ae+5+w[Ae+4],we===Ae+188)continue}else we=Ae+4;switch(je){case k:ke&&(F&&(f=a(F))&&this.parseAVCPES(f,!1),F={data:[],size:0}),F&&(F.data.push(w.subarray(we,Ae+188)),F.size+=Ae+188-we);break;case L:ke&&(j&&(f=a(j))&&(E.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),j={data:[],size:0}),j&&(j.data.push(w.subarray(we,Ae+188)),j.size+=Ae+188-we);break;case G:ke&&(R&&(f=a(R))&&this.parseID3PES(f),R={data:[],size:0}),R&&(R.data.push(w.subarray(we,Ae+188)),R.size+=Ae+188-we);break;case 0:ke&&(we+=w[we]+1),se=this._pmtId=d(w,we);break;case se:{ke&&(we+=w[we]+1);var Z=r(w,we,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);k=Z.avc,k>0&&(O.pid=k),L=Z.audio,L>0&&(E.pid=L,E.isAAC=Z.isAAC),G=Z.id3,G>0&&(_.pid=G),V&&!ne&&(g.logger.log("reparse from beginning"),V=!1,Ae=De-188),ne=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});O.pesData=F,E.pesData=j,_.pesData=R;var U={audioTrack:E,avcTrack:O,id3Track:_,textTrack:this._txtTrack};return m&&this.extractRemainingSamples(U),U},T.flush=function(){var w=this.remainderData;this.remainderData=null;var v;return w?v=this.demux(w,-1,!1,!0):v={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(v),this.sampleAes?this.decrypt(v,this.sampleAes):v},T.extractRemainingSamples=function(w){var v=w.audioTrack,b=w.avcTrack,m=w.id3Track,f=b.pesData,O=v.pesData,E=m.pesData,_;f&&(_=a(f))?(this.parseAVCPES(_,!0),b.pesData=null):b.pesData=f,O&&(_=a(O))?(v.isAAC?this.parseAACPES(_):this.parseMPEGPES(_),v.pesData=null):(O!=null&&O.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=O),E&&(_=a(E))?(this.parseID3PES(_),m.pesData=null):m.pesData=E},T.demuxSampleAes=function(w,v,b){var m=this.demux(w,b,!0,!this.config.progressive),f=this.sampleAes=new M.default(this.observer,this.config,v);return this.decrypt(m,f)},T.decrypt=function(w,v){return new Promise(function(b){var m=w.audioTrack,f=w.avcTrack;m.samples&&m.isAAC?v.decryptAacSamples(m.samples,0,function(){f.samples?v.decryptAvcSamples(f.samples,0,0,function(){b(w)}):b(w)}):f.samples&&v.decryptAvcSamples(f.samples,0,0,function(){b(w)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(w,v){var b=this,m=this._avcTrack,f=this.parseAVCNALu(w.data),O=!1,E=this.avcSample,_,k=!1;w.data=null,E&&f.length&&!m.audFound&&(i(E,m),E=this.avcSample=o(!1,w.pts,w.dts,"")),f.forEach(function(F){switch(F.type){case 1:{_=!0,E||(E=b.avcSample=o(!0,w.pts,w.dts,"")),O&&(E.debug+="NDR "),E.frame=!0;var L=F.data;if(k&&L.length>4){var G=new C.default(L).readSliceType();(G===2||G===4||G===7||G===9)&&(E.key=!0)}break}case 5:_=!0,E||(E=b.avcSample=o(!0,w.pts,w.dts,"")),O&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{_=!0,O&&E&&(E.debug+="SEI ");var j=new C.default(S(F.data));j.readUByte();for(var R=0,V=0,ne=!1,se=0;!ne&&j.bytesAvailable>1;){R=0;do se=j.readUByte(),R+=se;while(se===255);V=0;do se=j.readUByte(),V+=se;while(se===255);if(R===4&&j.bytesAvailable!==0){ne=!0;var Se=j.readUByte();if(Se===181){var De=j.readUShort();if(De===49){var Ae=j.readUInt();if(Ae===1195456820){var ke=j.readUByte();if(ke===3){for(var je=j.readUByte(),Be=j.readUByte(),we=31&je,Z=[je,Be],U=0;U<we;U++)Z.push(j.readUByte()),Z.push(j.readUByte()),Z.push(j.readUByte());s(b._txtTrack.samples,{type:3,pts:w.pts,bytes:Z})}}}}}else if(R===5&&j.bytesAvailable!==0){if(ne=!0,V>16){for(var K=[],ee=0;ee<16;ee++)K.push(j.readUByte().toString(16)),(ee===3||ee===5||ee===7||ee===9)&&K.push("-");for(var oe=V-16,Q=new Uint8Array(oe),Ce=0;Ce<oe;Ce++)Q[Ce]=j.readUByte();s(b._txtTrack.samples,{pts:w.pts,payloadType:R,uuid:K.join(""),userData:Object(B.utf8ArrayToStr)(Q),userDataBytes:Q})}}else if(V<j.bytesAvailable)for(var ze=0;ze<V;ze++)j.readUByte()}break}case 7:if(_=!0,k=!0,O&&E&&(E.debug+="SPS "),!m.sps){var nt=new C.default(F.data),xe=nt.readSPS();m.width=xe.width,m.height=xe.height,m.pixelRatio=xe.pixelRatio,m.sps=[F.data],m.duration=b._duration;for(var Re=F.data.subarray(1,4),Te="avc1.",Oe=0;Oe<3;Oe++){var Ke=Re[Oe].toString(16);Ke.length<2&&(Ke="0"+Ke),Te+=Ke}m.codec=Te}break;case 8:_=!0,O&&E&&(E.debug+="PPS "),m.pps||(m.pps=[F.data]);break;case 9:_=!1,m.audFound=!0,E&&i(E,m),E=b.avcSample=o(!1,w.pts,w.dts,O?"AUD ":"");break;case 12:_=!1;break;default:_=!1,E&&(E.debug+="unknown NAL "+F.type+" ");break}if(E&&_){var Qe=E.units;Qe.push(F)}}),v&&E&&(i(E,m),this.avcSample=null)},T.getLastNalUnit=function(){var w,v=this.avcSample,b;if(!v||v.units.length===0){var m=this._avcTrack.samples;v=m[m.length-1]}if((w=v)!==null&&w!==void 0&&w.units){var f=v.units;b=f[f.length-1]}return b},T.parseAVCNALu=function(w){var v=w.byteLength,b=this._avcTrack,m=b.naluState||0,f=m,O=[],E=0,_,k,F,L=-1,G=0;for(m===-1&&(L=0,G=w[0]&31,m=0,E=1);E<v;){if(_=w[E++],!m){m=_?0:1;continue}if(m===1){m=_?0:2;continue}if(!_)m=3;else if(_===1){if(L>=0){var j={data:w.subarray(L,E-m-1),type:G};O.push(j)}else{var R=this.getLastNalUnit();if(R&&(f&&E<=4-f&&(R.state&&(R.data=R.data.subarray(0,R.data.byteLength-f))),k=E-m-1,k>0)){var V=new Uint8Array(R.data.byteLength+k);V.set(R.data,0),V.set(w.subarray(0,k),R.data.byteLength),R.data=V,R.state=0}}E<v?(F=w[E]&31,L=E,G=F,m=0):m=-1}else m=0}if(L>=0&&m>=0){var ne={data:w.subarray(L,v),type:G,state:m};O.push(ne)}if(O.length===0){var se=this.getLastNalUnit();if(se){var Se=new Uint8Array(se.data.byteLength+w.byteLength);Se.set(se.data,0),Se.set(w,se.data.byteLength),se.data=Se}}return b.naluState=m,O},T.parseAACPES=function(w){var v=0,b=this._audioTrack,m=this.aacOverFlow,f=w.data;if(m){this.aacOverFlow=null;var O=m.sample.unit.byteLength,E=Math.min(m.missing,O),_=O-E;m.sample.unit.set(f.subarray(0,E),_),b.samples.push(m.sample),v=m.missing}var k,F;for(k=v,F=f.length;k<F-1&&!X.isHeader(f,k);k++);if(k!==v){var L,G;if(k<F-1?(L="AAC PES did not start with ADTS header,offset:"+k,G=!1):(L="no ADTS header found in AAC PES",G=!0),g.logger.warn("parsing error:"+L),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:G,reason:L}),G)return}X.initTrackConfig(b,this.observer,f,k,this.audioCodec);var j;if(w.pts!==void 0)j=w.pts;else if(m){var R=X.getFrameDuration(b.samplerate);j=m.sample.pts+R}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var V=0;k<F;)if(X.isHeader(f,k)){if(k+5<F){var ne=X.appendFrame(b,f,k,j,V);if(ne)if(ne.missing)this.aacOverFlow=ne;else{k+=ne.length,V++;continue}}break}else k++},T.parseMPEGPES=function(w){var v=w.data,b=v.length,m=0,f=0,O=w.pts;if(O===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<b;)if(N.isHeader(v,f)){var E=N.appendFrame(this._audioTrack,v,f,O,m);if(E)f+=E.length,m++;else break}else f++},T.parseID3PES=function(w){if(w.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(w)},x}();c.minProbeByteLength=188;function o(x,T,A,w){return{key:x,frame:!1,pts:T,dts:A,units:[],debug:w,length:0}}function d(x,T){return(x[T+10]&31)<<8|x[T+11]}function r(x,T,A,w){var v={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(x[T+1]&15)<<8|x[T+2],m=T+3+b-4,f=(x[T+10]&15)<<8|x[T+11];for(T+=12+f;T<m;){var O=(x[T+1]&31)<<8|x[T+2];switch(x[T]){case 207:if(!w){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:v.audio===-1&&(v.audio=O);break;case 21:v.id3===-1&&(v.id3=O);break;case 219:if(!w){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:v.avc===-1&&(v.avc=O);break;case 3:case 4:A?v.audio===-1&&(v.audio=O,v.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}T+=((x[T+3]&15)<<8|x[T+4])+5}return v}function a(x){var T=0,A,w,v,b,m,f=x.data;if(!x||x.size===0)return null;for(;f[0].length<19&&f.length>1;){var O=new Uint8Array(f[0].length+f[1].length);O.set(f[0]),O.set(f[1],f[0].length),f[0]=O,f.splice(1,1)}A=f[0];var E=(A[0]<<16)+(A[1]<<8)+A[2];if(E===1){if(w=(A[4]<<8)+A[5],w&&w>x.size-6)return null;var _=A[7];_&192&&(b=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,_&64?(m=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,b-m>60*9e4&&(g.logger.warn(Math.round((b-m)/9e4)+"s delta between PTS and DTS, align them"),b=m)):m=b),v=A[8];var k=v+9;if(x.size<=k)return null;x.size-=k;for(var F=new Uint8Array(x.size),L=0,G=f.length;L<G;L++){A=f[L];var j=A.byteLength;if(k)if(k>j){k-=j;continue}else A=A.subarray(k),j-=k,k=0;F.set(A,T),T+=j}return w&&(w-=v+3),{data:F,pts:b,dts:m,len:w}}return null}function i(x,T){if(x.units.length&&x.frame){if(x.pts===void 0){var A=T.samples,w=A.length;if(w){var v=A[w-1];x.pts=v.pts,x.dts=v.dts}else{T.dropped++;return}}T.samples.push(x)}x.debug.length&&g.logger.log(x.pts+"/"+x.dts+":"+x.debug)}function s(x,T){var A=x.length;if(A>0){if(T.pts>=x[A-1].pts)x.push(T);else for(var w=A-1;w>=0;w--)if(T.pts<x[w].pts){x.splice(w,0,T);break}}else x.push(T)}function S(x){for(var T=x.byteLength,A=[],w=1;w<T-2;)x[w]===0&&x[w+1]===0&&x[w+2]===3?(A.push(w+2),w+=2):w++;if(A.length===0)return x;var v=T-A.length,b=new Uint8Array(v),m=0;for(w=0;w<v;m++,w++)m===A[0]&&(m++,A.shift()),b[w]=x[m];return b}z.default=c},"./src/errors.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"ErrorTypes",function(){return X}),P.d(z,"ErrorDetails",function(){return N});var X;(function(C){C.NETWORK_ERROR="networkError",C.MEDIA_ERROR="mediaError",C.KEY_SYSTEM_ERROR="keySystemError",C.MUX_ERROR="muxError",C.OTHER_ERROR="otherError"})(X||(X={}));var N;(function(C){C.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",C.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",C.KEY_SYSTEM_NO_SESSION="keySystemNoSession",C.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",C.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",C.MANIFEST_LOAD_ERROR="manifestLoadError",C.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",C.MANIFEST_PARSING_ERROR="manifestParsingError",C.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",C.LEVEL_EMPTY_ERROR="levelEmptyError",C.LEVEL_LOAD_ERROR="levelLoadError",C.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",C.LEVEL_SWITCH_ERROR="levelSwitchError",C.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",C.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",C.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",C.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",C.FRAG_LOAD_ERROR="fragLoadError",C.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",C.FRAG_DECRYPT_ERROR="fragDecryptError",C.FRAG_PARSING_ERROR="fragParsingError",C.REMUX_ALLOC_ERROR="remuxAllocError",C.KEY_LOAD_ERROR="keyLoadError",C.KEY_LOAD_TIMEOUT="keyLoadTimeOut",C.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",C.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",C.BUFFER_APPEND_ERROR="bufferAppendError",C.BUFFER_APPENDING_ERROR="bufferAppendingError",C.BUFFER_STALLED_ERROR="bufferStalledError",C.BUFFER_FULL_ERROR="bufferFullError",C.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",C.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",C.INTERNAL_EXCEPTION="internalException",C.INTERNAL_ABORTED="aborted",C.UNKNOWN="unknown"})(N||(N={}))},"./src/events.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"Events",function(){return X});var X;(function(N){N.MEDIA_ATTACHING="hlsMediaAttaching",N.MEDIA_ATTACHED="hlsMediaAttached",N.MEDIA_DETACHING="hlsMediaDetaching",N.MEDIA_DETACHED="hlsMediaDetached",N.BUFFER_RESET="hlsBufferReset",N.BUFFER_CODECS="hlsBufferCodecs",N.BUFFER_CREATED="hlsBufferCreated",N.BUFFER_APPENDING="hlsBufferAppending",N.BUFFER_APPENDED="hlsBufferAppended",N.BUFFER_EOS="hlsBufferEos",N.BUFFER_FLUSHING="hlsBufferFlushing",N.BUFFER_FLUSHED="hlsBufferFlushed",N.MANIFEST_LOADING="hlsManifestLoading",N.MANIFEST_LOADED="hlsManifestLoaded",N.MANIFEST_PARSED="hlsManifestParsed",N.LEVEL_SWITCHING="hlsLevelSwitching",N.LEVEL_SWITCHED="hlsLevelSwitched",N.LEVEL_LOADING="hlsLevelLoading",N.LEVEL_LOADED="hlsLevelLoaded",N.LEVEL_UPDATED="hlsLevelUpdated",N.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",N.LEVELS_UPDATED="hlsLevelsUpdated",N.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",N.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",N.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",N.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",N.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",N.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",N.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",N.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",N.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",N.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",N.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",N.CUES_PARSED="hlsCuesParsed",N.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",N.INIT_PTS_FOUND="hlsInitPtsFound",N.FRAG_LOADING="hlsFragLoading",N.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",N.FRAG_LOADED="hlsFragLoaded",N.FRAG_DECRYPTED="hlsFragDecrypted",N.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",N.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",N.FRAG_PARSING_METADATA="hlsFragParsingMetadata",N.FRAG_PARSED="hlsFragParsed",N.FRAG_BUFFERED="hlsFragBuffered",N.FRAG_CHANGED="hlsFragChanged",N.FPS_DROP="hlsFpsDrop",N.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",N.ERROR="hlsError",N.DESTROYING="hlsDestroying",N.KEY_LOADING="hlsKeyLoading",N.KEY_LOADED="hlsKeyLoaded",N.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",N.BACK_BUFFER_REACHED="hlsBackBufferReached"})(X||(X={}))},"./src/hls.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return x});var X=P("./node_modules/url-toolkit/src/url-toolkit.js"),N=P.n(X),C=P("./src/loader/playlist-loader.ts"),B=P("./src/loader/key-loader.ts"),M=P("./src/controller/id3-track-controller.ts"),n=P("./src/controller/latency-controller.ts"),D=P("./src/controller/level-controller.ts"),g=P("./src/controller/fragment-tracker.ts"),p=P("./src/controller/stream-controller.ts"),h=P("./src/is-supported.ts"),c=P("./src/utils/logger.ts"),o=P("./src/config.ts"),d=P("./node_modules/eventemitter3/index.js"),r=P.n(d),a=P("./src/events.ts"),i=P("./src/errors.ts");function s(T,A){for(var w=0;w<A.length;w++){var v=A[w];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(T,v.key,v)}}function S(T,A,w){return A&&s(T.prototype,A),w&&s(T,w),T}var x=function(){T.isSupported=function(){return Object(h.isSupported)()};function T(w){w===void 0&&(w={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new d.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 v=this.config=Object(o.mergeConfig)(T.DefaultConfig,w);this.userConfig=w,Object(c.enableLogs)(v.debug),this._autoLevelCapping=-1,v.progressive&&Object(o.enableStreamingMode)(v);var b=v.abrController,m=v.bufferController,f=v.capLevelController,O=v.fpsController,E=this.abrController=new b(this),_=this.bufferController=new m(this),k=this.capLevelController=new f(this),F=new O(this),L=new C.default(this),G=new B.default(this),j=new M.default(this),R=this.levelController=new D.default(this),V=new g.FragmentTracker(this),ne=this.streamController=new p.default(this,V);k.setStreamController(ne),F.setStreamController(ne);var se=[R,ne];this.networkControllers=se;var Se=[L,G,E,_,k,F,j,V];this.audioTrackController=this.createController(v.audioTrackController,null,se),this.createController(v.audioStreamController,V,se),this.subtitleTrackController=this.createController(v.subtitleTrackController,null,se),this.createController(v.subtitleStreamController,V,se),this.createController(v.timelineController,null,Se),this.emeController=this.createController(v.emeController,null,Se),this.cmcdController=this.createController(v.cmcdController,null,Se),this.latencyController=this.createController(n.default,null,Se),this.coreComponents=Se}var A=T.prototype;return A.createController=function(v,b,m){if(v){var f=b?new v(this,b):new v(this);return m&&m.push(f),f}return null},A.on=function(v,b,m){m===void 0&&(m=this),this._emitter.on(v,b,m)},A.once=function(v,b,m){m===void 0&&(m=this),this._emitter.once(v,b,m)},A.removeAllListeners=function(v){this._emitter.removeAllListeners(v)},A.off=function(v,b,m,f){m===void 0&&(m=this),this._emitter.off(v,b,m,f)},A.listeners=function(v){return this._emitter.listeners(v)},A.emit=function(v,b,m){return this._emitter.emit(v,b,m)},A.trigger=function(v,b){if(this.config.debug)return this.emit(v,v,b);try{return this.emit(v,v,b)}catch(m){c.logger.error("An internal error happened while handling event "+v+'. Error message: "'+m.message+'". Here is a stacktrace:',m),this.trigger(a.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:v,error:m})}return!1},A.listenerCount=function(v){return this._emitter.listenerCount(v)},A.destroy=function(){c.logger.log("destroy"),this.trigger(a.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(v){return v.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(v){return v.destroy()}),this.coreComponents.length=0},A.attachMedia=function(v){c.logger.log("attachMedia"),this._media=v,this.trigger(a.Events.MEDIA_ATTACHING,{media:v})},A.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(a.Events.MEDIA_DETACHING,void 0),this._media=null},A.loadSource=function(v){this.stopLoad();var b=this.media,m=this.url,f=this.url=X.buildAbsoluteURL(self.location.href,v,{alwaysNormalize:!0});c.logger.log("loadSource:"+f),b&&m&&m!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(a.Events.MANIFEST_LOADING,{url:v})},A.startLoad=function(v){v===void 0&&(v=-1),c.logger.log("startLoad("+v+")"),this.networkControllers.forEach(function(b){b.startLoad(v)})},A.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(v){v.stopLoad()})},A.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},A.recoverMediaError=function(){c.logger.log("recoverMediaError");var v=this._media;this.detachMedia(),v&&this.attachMedia(v)},A.removeLevel=function(v,b){b===void 0&&(b=0),this.levelController.removeLevel(v,b)},S(T,[{key:"levels",get:function(){var v=this.levelController.levels;return v||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(v){c.logger.log("set currentLevel:"+v),this.loadLevel=v,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(v){c.logger.log("set nextLevel:"+v),this.levelController.manualLevel=v,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(v){c.logger.log("set loadLevel:"+v),this.levelController.manualLevel=v}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(v){this.levelController.nextLoadLevel=v}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(v){c.logger.log("set firstLevel:"+v),this.levelController.firstLevel=v}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(v){c.logger.log("set startLevel:"+v),v!==-1&&(v=Math.max(v,this.minAutoLevel)),this.levelController.startLevel=v}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(v){var b=!!v;b!==this.config.capLevelToPlayerSize&&(b?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=b)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(v){this._autoLevelCapping!==v&&(c.logger.log("set autoLevelCapping:"+v),this._autoLevelCapping=v)}},{key:"bandwidthEstimate",get:function(){var v=this.abrController.bwEstimator;return v?v.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var v=this.levels,b=this.config.minAutoBitrate;if(!v)return 0;for(var m=v.length,f=0;f<m;f++)if(v[f].maxBitrate>b)return f;return 0}},{key:"maxAutoLevel",get:function(){var v=this.levels,b=this.autoLevelCapping,m;return b===-1&&v&&v.length?m=v.length-1:m=b,m}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(v){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,v)}},{key:"audioTracks",get:function(){var v=this.audioTrackController;return v?v.audioTracks:[]}},{key:"audioTrack",get:function(){var v=this.audioTrackController;return v?v.audioTrack:-1},set:function(v){var b=this.audioTrackController;b&&(b.audioTrack=v)}},{key:"subtitleTracks",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTrack:-1},set:function(v){var b=this.subtitleTrackController;b&&(b.subtitleTrack=v)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var v=this.subtitleTrackController;return v?v.subtitleDisplay:!1},set:function(v){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=v)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(v){this.config.lowLatencyMode=v}},{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 a.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:o.hlsDefaultConfig},set:function(v){T.defaultConfig=v}}]),T}();x.defaultConfig=void 0},"./src/is-supported.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"isSupported",function(){return C}),P.d(z,"changeTypeSupported",function(){return B});var X=P("./src/utils/mediasource-helper.ts");function N(){return self.SourceBuffer||self.WebKitSourceBuffer}function C(){var M=Object(X.getMediaSource)();if(!M)return!1;var n=N(),D=M&&typeof M.isTypeSupported=="function"&&M.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!D&&!!g}function B(){var M,n=N();return typeof(n==null||((M=n.prototype)===null||M===void 0)?void 0:M.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return c}),P.d(z,"LoadError",function(){return d});var X=P("./src/polyfills/number.ts"),N=P("./src/errors.ts");function C(r,a){r.prototype=Object.create(a.prototype),r.prototype.constructor=r,g(r,a)}function B(r){var a=typeof Map=="function"?new Map:void 0;return B=function(s){if(s===null||!D(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(s))return a.get(s);a.set(s,S)}function S(){return M(s,arguments,p(this).constructor)}return S.prototype=Object.create(s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),g(S,s)},B(r)}function M(r,a,i){return n()?M=Reflect.construct:M=function(S,x,T){var A=[null];A.push.apply(A,x);var w=Function.bind.apply(S,A),v=new w;return T&&g(v,T.prototype),v},M.apply(null,arguments)}function n(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}function D(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function g(r,a){return g=Object.setPrototypeOf||function(s,S){return s.__proto__=S,s},g(r,a)}function p(r){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},p(r)}var h=Math.pow(2,17),c=function(){function r(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var a=r.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(s,S){var x=this,T=s.url;if(!T)return Promise.reject(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var A=this.config,w=A.fLoader,v=A.loader;return new Promise(function(b,m){x.loader&&x.loader.destroy();var f=x.loader=s.loader=w?new w(A):new v(A),O=o(s),E={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:h};s.stats=f.stats,f.load(O,E,{onSuccess:function(k,F,L,G){x.resetLoader(s,f),b({frag:s,part:null,payload:k.data,networkDetails:G})},onError:function(k,F,L){x.resetLoader(s,f),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:k,networkDetails:L}))},onAbort:function(k,F,L){x.resetLoader(s,f),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:L}))},onTimeout:function(k,F,L){x.resetLoader(s,f),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:L}))},onProgress:function(k,F,L,G){S&&S({frag:s,part:null,payload:L,networkDetails:G})}})})},a.loadPart=function(s,S,x){var T=this;this.abort();var A=this.config,w=A.fLoader,v=A.loader;return new Promise(function(b,m){T.loader&&T.loader.destroy();var f=T.loader=s.loader=w?new w(A):new v(A),O=o(s,S),E={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:h};S.stats=f.stats,f.load(O,E,{onSuccess:function(k,F,L,G){T.resetLoader(s,f),T.updateStatsFromPart(s,S);var j={frag:s,part:S,payload:k.data,networkDetails:G};x(j),b(j)},onError:function(k,F,L){T.resetLoader(s,f),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:S,response:k,networkDetails:L}))},onAbort:function(k,F,L){s.stats.aborted=S.stats.aborted,T.resetLoader(s,f),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:S,networkDetails:L}))},onTimeout:function(k,F,L){T.resetLoader(s,f),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:S,networkDetails:L}))}})})},a.updateStatsFromPart=function(s,S){var x=s.stats,T=S.stats,A=T.total;if(x.loaded+=T.loaded,A){var w=Math.round(s.duration/S.duration),v=Math.min(Math.round(x.loaded/A),w),b=w-v,m=b*Math.round(x.loaded/v);x.total=x.loaded+m}else x.total=Math.max(x.loaded,x.total);var f=x.loading,O=T.loading;f.start?f.first+=O.first-O.start:(f.start=O.start,f.first=O.first),f.end=O.end},a.resetLoader=function(s,S){s.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},r}();function o(r,a){a===void 0&&(a=null);var i=a||r,s={frag:r,part:a,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},S=i.byteRangeStartOffset,x=i.byteRangeEndOffset;return Object(X.isFiniteNumber)(S)&&Object(X.isFiniteNumber)(x)&&(s.rangeStart=S,s.rangeEnd=x),s}var d=function(r){C(a,r);function a(i){for(var s,S=arguments.length,x=new Array(S>1?S-1:0),T=1;T<S;T++)x[T-1]=arguments[T];return s=r.call.apply(r,[this].concat(x))||this,s.data=void 0,s.data=i,s}return a}(B(Error))},"./src/loader/fragment.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"ElementaryStreamTypes",function(){return c}),P.d(z,"BaseSegment",function(){return o}),P.d(z,"Fragment",function(){return d}),P.d(z,"Part",function(){return r});var X=P("./src/polyfills/number.ts"),N=P("./node_modules/url-toolkit/src/url-toolkit.js"),C=P.n(N),B=P("./src/utils/logger.ts"),M=P("./src/loader/level-key.ts"),n=P("./src/loader/load-stats.ts");function D(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,g(a,i)}function g(a,i){return g=Object.setPrototypeOf||function(S,x){return S.__proto__=x,S},g(a,i)}function p(a,i){for(var s=0;s<i.length;s++){var S=i[s];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function h(a,i,s){return i&&p(a.prototype,i),s&&p(a,s),a}var c;(function(a){a.AUDIO="audio",a.VIDEO="video",a.AUDIOVIDEO="audiovideo"})(c||(c={}));var o=function(){function a(s){var S;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(S={},S[c.AUDIO]=null,S[c.VIDEO]=null,S[c.AUDIOVIDEO]=null,S),this.baseurl=s}var i=a.prototype;return i.setByteRange=function(S,x){var T=S.split("@",2),A=[];T.length===1?A[0]=x?x.byteRangeEndOffset:0:A[0]=parseInt(T[1]),A[1]=parseInt(T[0])+A[0],this._byteRange=A},h(a,[{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(N.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(S){this._url=S}}]),a}(),d=function(a){D(i,a);function i(S,x){var T;return T=a.call(this,x)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new n.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=S,T}var s=i.prototype;return s.createInitializationVector=function(x){for(var T=new Uint8Array(16),A=12;A<16;A++)T[A]=x>>8*(15-A)&255;return T},s.setDecryptDataFromLevelKey=function(x,T){var A=x;return(x==null?void 0:x.method)==="AES-128"&&x.uri&&!x.iv&&(A=M.LevelKey.fromURI(x.uri),A.method=x.method,A.iv=this.createInitializationVector(T),A.keyFormat="identity"),A},s.setElementaryStreamInfo=function(x,T,A,w,v,b){b===void 0&&(b=!1);var m=this.elementaryStreams,f=m[x];if(!f){m[x]={startPTS:T,endPTS:A,startDTS:w,endDTS:v,partial:b};return}f.startPTS=Math.min(f.startPTS,T),f.endPTS=Math.max(f.endPTS,A),f.startDTS=Math.min(f.startDTS,w),f.endDTS=Math.max(f.endDTS,v)},s.clearElementaryStreamInfo=function(){var x=this.elementaryStreams;x[c.AUDIO]=null,x[c.VIDEO]=null,x[c.AUDIOVIDEO]=null},h(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var x=this.sn;typeof x!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&B.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),x=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,x)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(X.isFiniteNumber)(this.programDateTime))return null;var x=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+x*1e3}},{key:"encrypted",get:function(){var x;return!!((x=this.decryptdata)!==null&&x!==void 0&&x.keyFormat&&this.decryptdata.uri)}}]),i}(o),r=function(a){D(i,a);function i(s,S,x,T,A){var w;w=a.call(this,x)||this,w.fragOffset=0,w.duration=0,w.gap=!1,w.independent=!1,w.relurl=void 0,w.fragment=void 0,w.index=void 0,w.stats=new n.LoadStats,w.duration=s.decimalFloatingPoint("DURATION"),w.gap=s.bool("GAP"),w.independent=s.bool("INDEPENDENT"),w.relurl=s.enumeratedString("URI"),w.fragment=S,w.index=T;var v=s.enumeratedString("BYTERANGE");return v&&w.setByteRange(v,A),A&&(w.fragOffset=A.fragOffset+A.duration),w}return h(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),i}(o)},"./src/loader/key-loader.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return B});var X=P("./src/events.ts"),N=P("./src/errors.ts"),C=P("./src/utils/logger.ts"),B=function(){function M(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var n=M.prototype;return n._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var p=this.loaders[g];p&&p.destroy()}this.loaders={}},n.onKeyLoading=function(g,p){var h=p.frag,c=h.type,o=this.loaders[c];if(!h.decryptdata){C.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=h.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var r=this.hls.config;if(o&&(C.logger.warn("abort previous key loader for type:"+c),o.abort()),!d){C.logger.warn("key uri is falsy");return}var a=r.loader,i=h.loader=this.loaders[c]=new a(r);this.decrypturl=d,this.decryptkey=null;var s={url:d,frag:h,responseType:"arraybuffer"},S={timeout:r.fragLoadingTimeOut,maxRetry:0,retryDelay:r.fragLoadingRetryDelay,maxRetryDelay:r.fragLoadingMaxRetryTimeout,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(s,S,x)}else this.decryptkey&&(h.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:h}))},n.loadsuccess=function(g,p,h){var c=h.frag;if(!c.decryptdata){C.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(g.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:c})},n.loaderror=function(g,p){var h=p.frag,c=h.loader;c&&c.abort(),delete this.loaders[h.type],this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:h,response:g})},n.loadtimeout=function(g,p){var h=p.frag,c=h.loader;c&&c.abort(),delete this.loaders[h.type],this.hls.trigger(X.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:h})},M}()},"./src/loader/level-details.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"LevelDetails",function(){return M});var X=P("./src/polyfills/number.ts");function N(n,D){for(var g=0;g<D.length;g++){var p=D[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function C(n,D,g){return D&&N(n.prototype,D),g&&N(n,g),n}var B=10,M=function(){function n(g){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=g}var D=n.prototype;return D.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var h=this.lastPartSn-p.lastPartSn,c=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!c||!!h,this.advanced=this.endSN>p.endSN||h>0||h===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},C(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||B}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var h=this.driftEnd-this.driftStart;return h*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"LevelKey",function(){return M});var X=P("./node_modules/url-toolkit/src/url-toolkit.js"),N=P.n(X);function C(n,D){for(var g=0;g<D.length;g++){var p=D[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function B(n,D,g){return D&&C(n.prototype,D),g&&C(n,g),n}var M=function(){n.fromURL=function(g,p){return new n(g,p)},n.fromURI=function(g){return new n(g)};function n(D,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(X.buildAbsoluteURL)(D,g,{alwaysNormalize:!0}):this._uri=D}return B(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"LoadStats",function(){return X});var X=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(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return i});var X=P("./src/polyfills/number.ts"),N=P("./node_modules/url-toolkit/src/url-toolkit.js"),C=P.n(N),B=P("./src/loader/fragment.ts"),M=P("./src/loader/level-details.ts"),n=P("./src/loader/level-key.ts"),D=P("./src/utils/attr-list.ts"),g=P("./src/utils/logger.ts"),p=P("./src/utils/codecs.ts"),h=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,c=/#EXT-X-MEDIA:(.*)/g,o=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),d=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("|")),r=/\.(mp4|m4s|m4v|m4a)$/i;function a(A){var w,v;return r.test((w=(v=N.parseURL(A))===null||v===void 0?void 0:v.path)!=null?w:"")}var i=function(){function A(){}return A.findGroup=function(v,b){for(var m=0;m<v.length;m++){var f=v[m];if(f.id===b)return f}},A.convertAVC1ToAVCOTI=function(v){var b=v.split(".");if(b.length>2){var m=b.shift()+".";return m+=parseInt(b.shift()).toString(16),m+=("000"+parseInt(b.shift()).toString(16)).substr(-4),m}return v},A.resolve=function(v,b){return N.buildAbsoluteURL(b,v,{alwaysNormalize:!0})},A.parseMasterPlaylist=function(v,b){var m=[],f={},O=!1;h.lastIndex=0;for(var E;(E=h.exec(v))!=null;)if(E[1]){var _=new D.AttrList(E[1]),k={attrs:_,bitrate:_.decimalInteger("AVERAGE-BANDWIDTH")||_.decimalInteger("BANDWIDTH"),name:_.NAME,url:A.resolve(E[2],b)},F=_.decimalResolution("RESOLUTION");F&&(k.width=F.width,k.height=F.height),s((_.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),k),k.videoCodec&&k.videoCodec.indexOf("avc1")!==-1&&(k.videoCodec=A.convertAVC1ToAVCOTI(k.videoCodec)),m.push(k)}else if(E[3]){var L=new D.AttrList(E[3]);L["DATA-ID"]&&(O=!0,f[L["DATA-ID"]]=L)}return{levels:m,sessionData:O?f:null}},A.parseMasterPlaylistMedia=function(v,b,m,f){f===void 0&&(f=[]);var O,E=[],_=0;for(c.lastIndex=0;(O=c.exec(v))!==null;){var k=new D.AttrList(O[1]);if(k.TYPE===m){var F={attrs:k,bitrate:0,id:_++,groupId:k["GROUP-ID"],instreamId:k["INSTREAM-ID"],name:k.NAME||k.LANGUAGE||"",type:m,default:k.bool("DEFAULT"),autoselect:k.bool("AUTOSELECT"),forced:k.bool("FORCED"),lang:k.LANGUAGE,url:k.URI?A.resolve(k.URI,b):""};if(f.length){var L=A.findGroup(f,F.groupId)||f[0];S(F,L,"audioCodec"),S(F,L,"textCodec")}E.push(F)}}return E},A.parseLevelPlaylist=function(v,b,m,f,O){var E=new M.LevelDetails(b),_=E.fragments,k=null,F=0,L=0,G=0,j=0,R=null,V=new B.Fragment(f,b),ne,se,Se,De=-1,Ae=!1;for(o.lastIndex=0,E.m3u8=v;(ne=o.exec(v))!==null;){Ae&&(Ae=!1,V=new B.Fragment(f,b),V.start=G,V.sn=F,V.cc=j,V.level=m,k&&(V.initSegment=k,V.rawProgramDateTime=k.rawProgramDateTime));var ke=ne[1];if(ke){V.duration=parseFloat(ke);var je=(" "+ne[2]).slice(1);V.title=je||null,V.tagList.push(je?["INF",ke,je]:["INF",ke])}else if(ne[3])Object(X.isFiniteNumber)(V.duration)&&(V.start=G,Se&&(V.levelkey=Se),V.sn=F,V.level=m,V.cc=j,V.urlId=O,_.push(V),V.relurl=(" "+ne[3]).slice(1),T(V,R),R=V,G+=V.duration,F++,L=0,Ae=!0);else if(ne[4]){var Be=(" "+ne[4]).slice(1);R?V.setByteRange(Be,R):V.setByteRange(Be)}else if(ne[5])V.rawProgramDateTime=(" "+ne[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),De===-1&&(De=_.length);else{if(ne=ne[0].match(d),!ne){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(se=1;se<ne.length&&!(typeof ne[se]!="undefined");se++);var we=(" "+ne[se]).slice(1),Z=(" "+ne[se+1]).slice(1),U=ne[se+2]?(" "+ne[se+2]).slice(1):"";switch(we){case"PLAYLIST-TYPE":E.type=Z.toUpperCase();break;case"MEDIA-SEQUENCE":F=E.startSN=parseInt(Z);break;case"SKIP":{var K=new D.AttrList(Z),ee=K.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(ee)){E.skippedSegments=ee;for(var oe=ee;oe--;)_.unshift(null);F+=ee}var Q=K.enumeratedString("RECENTLY-REMOVED-DATERANGES");Q&&(E.recentlyRemovedDateranges=Q.split(" "));break}case"TARGETDURATION":E.targetduration=parseFloat(Z);break;case"VERSION":E.version=parseInt(Z);break;case"EXTM3U":break;case"ENDLIST":E.live=!1;break;case"#":(Z||U)&&V.tagList.push(U?[Z,U]:[Z]);break;case"DIS":j++;case"GAP":V.tagList.push([we]);break;case"BITRATE":V.tagList.push([we,Z]);break;case"DISCONTINUITY-SEQ":j=parseInt(Z);break;case"KEY":{var Ce,ze=new D.AttrList(Z),nt=ze.enumeratedString("METHOD"),xe=ze.URI,Re=ze.hexadecimalInteger("IV"),Te=ze.enumeratedString("KEYFORMATVERSIONS"),Oe=ze.enumeratedString("KEYID"),Ke=(Ce=ze.enumeratedString("KEYFORMAT"))!=null?Ce:"identity",Qe=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Qe.indexOf(Ke)>-1){g.logger.warn("Keyformat "+Ke+" is not supported from the manifest");continue}else if(Ke!=="identity")continue;nt&&(Se=n.LevelKey.fromURL(b,xe),xe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(nt)>=0&&(Se.method=nt,Se.keyFormat=Ke,Oe&&(Se.keyID=Oe),Te&&(Se.keyFormatVersions=Te),Se.iv=Re));break}case"START":{var st=new D.AttrList(Z),ut=st.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(ut)&&(E.startTimeOffset=ut);break}case"MAP":{var xt=new D.AttrList(Z);V.relurl=xt.URI,xt.BYTERANGE&&V.setByteRange(xt.BYTERANGE),V.level=m,V.sn="initSegment",Se&&(V.levelkey=Se),V.initSegment=null,k=V,Ae=!0;break}case"SERVER-CONTROL":{var wt=new D.AttrList(Z);E.canBlockReload=wt.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=wt.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&wt.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=wt.optionalFloat("PART-HOLD-BACK",0),E.holdBack=wt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Fe=new D.AttrList(Z);E.partTarget=Fe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ue=E.partList;Ue||(Ue=E.partList=[]);var it=L>0?Ue[Ue.length-1]:void 0,lt=L++,fe=new B.Part(new D.AttrList(Z),V,b,lt,it);Ue.push(fe),V.duration+=fe.duration;break}case"PRELOAD-HINT":{var ie=new D.AttrList(Z);E.preloadHint=ie;break}case"RENDITION-REPORT":{var re=new D.AttrList(Z);E.renditionReports=E.renditionReports||[],E.renditionReports.push(re);break}default:g.logger.warn("line parsed but not handled: "+ne);break}}}R&&!R.relurl?(_.pop(),G-=R.duration,E.partList&&(E.fragmentHint=R)):E.partList&&(T(V,R),V.cc=j,E.fragmentHint=V);var de=_.length,me=_[0],le=_[de-1];if(G+=E.skippedSegments*E.targetduration,G>0&&de&&le){E.averagetargetduration=G/de;var he=le.sn;E.endSN=he!=="initSegment"?he:0,me&&(E.startCC=me.cc,me.initSegment||E.fragments.every(function(Ee){return Ee.relurl&&a(Ee.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new B.Fragment(f,b),V.relurl=le.relurl,V.level=m,V.sn="initSegment",me.initSegment=V,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(G+=E.fragmentHint.duration),E.totalduration=G,E.endCC=j,De>0&&x(_,De),E},A}();function s(A,w){["video","audio","text"].forEach(function(v){var b=A.filter(function(f){return Object(p.isCodecType)(f,v)});if(b.length){var m=b.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});w[v+"Codec"]=m.length>0?m[0]:b[0],A=A.filter(function(f){return b.indexOf(f)===-1})}}),w.unknownCodecs=A}function S(A,w,v){var b=w[v];b&&(A[v]=b)}function x(A,w){for(var v=A[w],b=w;b--;){var m=A[b];if(!m)return;m.programDateTime=v.programDateTime-m.duration*1e3,v=m}}function T(A,w){A.rawProgramDateTime?A.programDateTime=Date.parse(A.rawProgramDateTime):w!=null&&w.programDateTime&&(A.programDateTime=w.endProgramDateTime),Object(X.isFiniteNumber)(A.programDateTime)||(A.programDateTime=null,A.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/polyfills/number.ts"),N=P("./src/events.ts"),C=P("./src/errors.ts"),B=P("./src/utils/logger.ts"),M=P("./src/utils/mp4-tools.ts"),n=P("./src/loader/m3u8-parser.ts"),D=P("./src/types/loader.ts"),g=P("./src/utils/attr-list.ts");function p(o){var d=o.type;switch(d){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function h(o,d){var r=o.url;return(r===void 0||r.indexOf("data:")===0)&&(r=d.url),r}var c=function(){function o(r){this.hls=void 0,this.loaders=Object.create(null),this.hls=r,this.registerListeners()}var d=o.prototype;return d.registerListeners=function(){var a=this.hls;a.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var a=this.hls;a.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(a){var i=this.hls.config,s=i.pLoader,S=i.loader,x=s||S,T=new x(i);return a.loader=T,this.loaders[a.type]=T,T},d.getInternalLoader=function(a){return this.loaders[a.type]},d.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},d.destroyInternalLoaders=function(){for(var a in this.loaders){var i=this.loaders[a];i&&i.destroy(),this.resetInternalLoader(a)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(a,i){var s=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},d.onLevelLoading=function(a,i){var s=i.id,S=i.level,x=i.url,T=i.deliveryDirectives;this.load({id:s,groupId:null,level:S,responseType:"text",type:D.PlaylistContextType.LEVEL,url:x,deliveryDirectives:T})},d.onAudioTrackLoading=function(a,i){var s=i.id,S=i.groupId,x=i.url,T=i.deliveryDirectives;this.load({id:s,groupId:S,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:x,deliveryDirectives:T})},d.onSubtitleTrackLoading=function(a,i){var s=i.id,S=i.groupId,x=i.url,T=i.deliveryDirectives;this.load({id:s,groupId:S,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:x,deliveryDirectives:T})},d.load=function(a){var i,s=this.hls.config,S=this.getInternalLoader(a);if(S){var x=S.context;if(x&&x.url===a.url){B.logger.trace("[playlist-loader]: playlist request ongoing");return}B.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),S.abort()}var T,A,w,v;switch(a.type){case D.PlaylistContextType.MANIFEST:T=s.manifestLoadingMaxRetry,A=s.manifestLoadingTimeOut,w=s.manifestLoadingRetryDelay,v=s.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:T=0,A=s.levelLoadingTimeOut;break;default:T=s.levelLoadingMaxRetry,A=s.levelLoadingTimeOut,w=s.levelLoadingRetryDelay,v=s.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(a),(i=a.deliveryDirectives)!==null&&i!==void 0&&i.part){var b;if(a.type===D.PlaylistContextType.LEVEL&&a.level!==null?b=this.hls.levels[a.level].details:a.type===D.PlaylistContextType.AUDIO_TRACK&&a.id!==null?b=this.hls.audioTracks[a.id].details:a.type===D.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(b=this.hls.subtitleTracks[a.id].details),b){var m=b.partTarget,f=b.targetduration;m&&f&&(A=Math.min(Math.max(m*3,f*.8)*1e3,A))}}var O={timeout:A,maxRetry:T,retryDelay:w,maxRetryDelay:v,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(a,O,E)},d.loadsuccess=function(a,i,s,S){if(S===void 0&&(S=null),s.isSidxRequest){this.handleSidxRequest(a,s),this.handlePlaylistLoaded(a,i,s,S);return}this.resetInternalLoader(s.type);var x=a.data;if(x.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,s,"no EXTM3U delimiter",S);return}i.parsing.start=performance.now(),x.indexOf("#EXTINF:")>0||x.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,i,s,S):this.handleMasterPlaylist(a,i,s,S)},d.loaderror=function(a,i,s){s===void 0&&(s=null),this.handleNetworkError(i,s,!1,a)},d.loadtimeout=function(a,i,s){s===void 0&&(s=null),this.handleNetworkError(i,s,!0)},d.handleMasterPlaylist=function(a,i,s,S){var x=this.hls,T=a.data,A=h(a,s),w=n.default.parseMasterPlaylist(T,A),v=w.levels,b=w.sessionData;if(!v.length){this.handleManifestParsingError(a,s,"no level found in manifest",S);return}var m=v.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),f=v.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),O=n.default.parseMasterPlaylistMedia(T,A,"AUDIO",m),E=n.default.parseMasterPlaylistMedia(T,A,"SUBTITLES",f),_=n.default.parseMasterPlaylistMedia(T,A,"CLOSED-CAPTIONS");if(O.length){var k=O.some(function(F){return!F.url});!k&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(B.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),O.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}x.trigger(N.Events.MANIFEST_LOADED,{levels:v,audioTracks:O,subtitles:E,captions:_,url:A,stats:i,networkDetails:S,sessionData:b})},d.handleTrackOrLevelPlaylist=function(a,i,s,S){var x=this.hls,T=s.id,A=s.level,w=s.type,v=h(a,s),b=Object(X.isFiniteNumber)(T)?T:0,m=Object(X.isFiniteNumber)(A)?A:b,f=p(s),O=n.default.parseLevelPlaylist(a.data,v,m,f,b);if(!O.fragments.length){x.trigger(N.Events.ERROR,{type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:v,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(w===D.PlaylistContextType.MANIFEST){var E={attrs:new g.AttrList({}),bitrate:0,details:O,name:"",url:v};x.trigger(N.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:v,stats:i,networkDetails:S,sessionData:null})}if(i.parsing.end=performance.now(),O.needSidxRanges){var _,k=(_=O.fragments[0].initSegment)===null||_===void 0?void 0:_.url;this.load({url:k,isSidxRequest:!0,type:w,level:A,levelDetails:O,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=O,this.handlePlaylistLoaded(a,i,s,S)},d.handleSidxRequest=function(a,i){var s=Object(M.parseSegmentIndex)(new Uint8Array(a.data));if(!s)return;var S=s.references,x=i.levelDetails;S.forEach(function(T,A){var w=T.info,v=x.fragments[A];v.byteRange.length===0&&v.setByteRange(String(1+w.end-w.start)+"@"+String(w.start)),v.initSegment&&v.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(a,i,s,S){this.hls.trigger(N.Events.ERROR,{type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===D.PlaylistContextType.MANIFEST,url:a.url,reason:s,response:a,context:i,networkDetails:S})},d.handleNetworkError=function(a,i,s,S){s===void 0&&(s=!1),B.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var x=C.ErrorDetails.UNKNOWN,T=!1,A=this.getInternalLoader(a);switch(a.type){case D.PlaylistContextType.MANIFEST:x=s?C.ErrorDetails.MANIFEST_LOAD_TIMEOUT:C.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case D.PlaylistContextType.LEVEL:x=s?C.ErrorDetails.LEVEL_LOAD_TIMEOUT:C.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case D.PlaylistContextType.AUDIO_TRACK:x=s?C.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:C.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:x=s?C.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:C.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}A&&this.resetInternalLoader(a.type);var w={type:C.ErrorTypes.NETWORK_ERROR,details:x,fatal:T,url:a.url,loader:A,context:a,networkDetails:i};S&&(w.response=S),this.hls.trigger(N.Events.ERROR,w)},d.handlePlaylistLoaded=function(a,i,s,S){var x=s.type,T=s.level,A=s.id,w=s.groupId,v=s.loader,b=s.levelDetails,m=s.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(a,s,"invalid target duration",S);return}if(!v)return;b.live&&(v.getCacheAge&&(b.ageHeader=v.getCacheAge()||0),(!v.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(x){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(N.Events.LEVEL_LOADED,{details:b,level:T||0,id:A||0,stats:i,networkDetails:S,deliveryDirectives:m});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(N.Events.AUDIO_TRACK_LOADED,{details:b,id:A||0,groupId:w||"",stats:i,networkDetails:S,deliveryDirectives:m});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADED,{details:b,id:A||0,groupId:w||"",stats:i,networkDetails:S,deliveryDirectives:m});break}},o}();z.default=c},"./src/polyfills/number.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"isFiniteNumber",function(){return X}),P.d(z,"MAX_SAFE_INTEGER",function(){return N});var X=Number.isFinite||function(C){return typeof C=="number"&&isFinite(C)},N=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(J,z,P){"use strict";P.r(z);var X=function(){function N(){}return N.getSilentFrame=function(B,M){switch(B){case"mp4a.40.2":if(M===1)return new Uint8Array([0,200,0,128,35,128]);if(M===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(M===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(M===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(M===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(M===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(M===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(M===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(M===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},N}();z.default=X},"./src/remux/mp4-generator.ts":function(J,z,P){"use strict";P.r(z);var X=Math.pow(2,32)-1,N=function(){function C(){}return C.init=function(){C.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var M;for(M in C.types)C.types.hasOwnProperty(M)&&(C.types[M]=[M.charCodeAt(0),M.charCodeAt(1),M.charCodeAt(2),M.charCodeAt(3)]);var n=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),D=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]);C.HDLR_TYPES={video:n,audio:D};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);C.STTS=C.STSC=C.STCO=p,C.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),C.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),C.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),C.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var h=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);C.FTYP=C.box(C.types.ftyp,h,o,h,c),C.DINF=C.box(C.types.dinf,C.box(C.types.dref,g))},C.box=function(M){for(var n=8,D=arguments.length,g=new Array(D>1?D-1:0),p=1;p<D;p++)g[p-1]=arguments[p];for(var h=g.length,c=h;h--;)n+=g[h].byteLength;var o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(M,4),h=0,n=8;h<c;h++)o.set(g[h],n),n+=g[h].byteLength;return o},C.hdlr=function(M){return C.box(C.types.hdlr,C.HDLR_TYPES[M])},C.mdat=function(M){return C.box(C.types.mdat,M)},C.mdhd=function(M,n){n*=M;var D=Math.floor(n/(X+1)),g=Math.floor(n%(X+1));return C.box(C.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,M>>24&255,M>>16&255,M>>8&255,M&255,D>>24,D>>16&255,D>>8&255,D&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},C.mdia=function(M){return C.box(C.types.mdia,C.mdhd(M.timescale,M.duration),C.hdlr(M.type),C.minf(M))},C.mfhd=function(M){return C.box(C.types.mfhd,new Uint8Array([0,0,0,0,M>>24,M>>16&255,M>>8&255,M&255]))},C.minf=function(M){return M.type==="audio"?C.box(C.types.minf,C.box(C.types.smhd,C.SMHD),C.DINF,C.stbl(M)):C.box(C.types.minf,C.box(C.types.vmhd,C.VMHD),C.DINF,C.stbl(M))},C.moof=function(M,n,D){return C.box(C.types.moof,C.mfhd(M),C.traf(D,n))},C.moov=function(M){for(var n=M.length,D=[];n--;)D[n]=C.trak(M[n]);return C.box.apply(null,[C.types.moov,C.mvhd(M[0].timescale,M[0].duration)].concat(D).concat(C.mvex(M)))},C.mvex=function(M){for(var n=M.length,D=[];n--;)D[n]=C.trex(M[n]);return C.box.apply(null,[C.types.mvex].concat(D))},C.mvhd=function(M,n){n*=M;var D=Math.floor(n/(X+1)),g=Math.floor(n%(X+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,M>>24&255,M>>16&255,M>>8&255,M&255,D>>24,D>>16&255,D>>8&255,D&255,g>>24,g>>16&255,g>>8&255,g&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 C.box(C.types.mvhd,p)},C.sdtp=function(M){var n=M.samples||[],D=new Uint8Array(4+n.length),g,p;for(g=0;g<n.length;g++)p=n[g].flags,D[g+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return C.box(C.types.sdtp,D)},C.stbl=function(M){return C.box(C.types.stbl,C.stsd(M),C.box(C.types.stts,C.STTS),C.box(C.types.stsc,C.STSC),C.box(C.types.stsz,C.STSZ),C.box(C.types.stco,C.STCO))},C.avc1=function(M){var n=[],D=[],g,p,h;for(g=0;g<M.sps.length;g++)p=M.sps[g],h=p.byteLength,n.push(h>>>8&255),n.push(h&255),n=n.concat(Array.prototype.slice.call(p));for(g=0;g<M.pps.length;g++)p=M.pps[g],h=p.byteLength,D.push(h>>>8&255),D.push(h&255),D=D.concat(Array.prototype.slice.call(p));var c=C.box(C.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|M.sps.length].concat(n).concat([M.pps.length]).concat(D))),o=M.width,d=M.height,r=M.pixelRatio[0],a=M.pixelRatio[1];return C.box(C.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,o>>8&255,o&255,d>>8&255,d&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c,C.box(C.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),C.box(C.types.pasp,new Uint8Array([r>>24,r>>16&255,r>>8&255,r&255,a>>24,a>>16&255,a>>8&255,a&255])))},C.esds=function(M){var n=M.config.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(M.config).concat([6,1,2]))},C.mp4a=function(M){var n=M.samplerate;return C.box(C.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,M.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),C.box(C.types.esds,C.esds(M)))},C.mp3=function(M){var n=M.samplerate;return C.box(C.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,M.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},C.stsd=function(M){return M.type==="audio"?!M.isAAC&&M.codec==="mp3"?C.box(C.types.stsd,C.STSD,C.mp3(M)):C.box(C.types.stsd,C.STSD,C.mp4a(M)):C.box(C.types.stsd,C.STSD,C.avc1(M))},C.tkhd=function(M){var n=M.id,D=M.duration*M.timescale,g=M.width,p=M.height,h=Math.floor(D/(X+1)),c=Math.floor(D%(X+1));return C.box(C.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,n&255,0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,c>>24,c>>16&255,c>>8&255,c&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,g>>8&255,g&255,0,0,p>>8&255,p&255,0,0]))},C.traf=function(M,n){var D=C.sdtp(M),g=M.id,p=Math.floor(n/(X+1)),h=Math.floor(n%(X+1));return C.box(C.types.traf,C.box(C.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),C.box(C.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,h>>24,h>>16&255,h>>8&255,h&255])),C.trun(M,D.length+16+20+8+16+8+8),D)},C.trak=function(M){return M.duration=M.duration||4294967295,C.box(C.types.trak,C.tkhd(M),C.mdia(M))},C.trex=function(M){var n=M.id;return C.box(C.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},C.trun=function(M,n){var D=M.samples||[],g=D.length,p=12+16*g,h=new Uint8Array(p),c,o,d,r,a,i;for(n+=8+p,h.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),c=0;c<g;c++)o=D[c],d=o.duration,r=o.size,a=o.flags,i=o.cts,h.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*c);return C.box(C.types.trun,h)},C.initSegment=function(M){C.types||C.init();var n=C.moov(M),D=new Uint8Array(C.FTYP.byteLength+n.byteLength);return D.set(C.FTYP),D.set(n,C.FTYP.byteLength),D},C}();N.types=void 0,N.HDLR_TYPES=void 0,N.STTS=void 0,N.STSC=void 0,N.STCO=void 0,N.STSZ=void 0,N.VMHD=void 0,N.SMHD=void 0,N.STSD=void 0,N.FTYP=void 0,N.DINF=void 0,z.default=N},"./src/remux/mp4-remuxer.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return i}),P.d(z,"normalizePts",function(){return s});var X=P("./src/polyfills/number.ts"),N=P("./src/remux/aac-helper.ts"),C=P("./src/remux/mp4-generator.ts"),B=P("./src/events.ts"),M=P("./src/errors.ts"),n=P("./src/utils/logger.ts"),D=P("./src/types/loader.ts"),g=P("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(A){for(var w=1;w<arguments.length;w++){var v=arguments[w];for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(A[b]=v[b])}return A},p.apply(this,arguments)}var h=10*1e3,c=1024,o=1152,d=null,r=null,a=!1,i=function(){function A(v,b,m,f){if(f===void 0&&(f=""),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=v,this.config=b,this.typeSupported=m,this.ISGenerated=!1,d===null){var O=navigator.userAgent||"",E=O.match(/Chrome\/(\d+)/i);d=E?parseInt(E[1]):0}if(r===null){var _=navigator.userAgent.match(/Safari\/(\d+)/i);r=_?parseInt(_[1]):0}a=!!d&&d<75||!!r&&r<600}var w=A.prototype;return w.destroy=function(){},w.resetTimeStamp=function(b){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},w.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},w.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},w.getVideoStartPts=function(b){var m=!1,f=b.reduce(function(O,E){var _=E.pts-O;return _<-4294967296?(m=!0,s(O,E.pts)):_>0?O:E.pts},b[0].pts);return m&&n.logger.debug("PTS rollover detected"),f},w.remux=function(b,m,f,O,E,_,k,F){var L,G,j,R,V,ne,se=E,Se=E,De=b.pid>-1,Ae=m.pid>-1,ke=m.samples.length,je=b.samples.length>0,Be=ke>1,we=(!De||je)&&(!Ae||Be)||this.ISGenerated||k;if(we){this.ISGenerated||(j=this.generateIS(b,m,E));var Z=this.isVideoContiguous,U=-1;if(Be&&(U=S(m.samples),!Z&&this.config.forceKeyFrameOnDiscontinuity))if(ne=!0,U>0){n.logger.warn("[mp4-remuxer]: Dropped "+U+" out of "+ke+" video samples due to a missing keyframe");var K=this.getVideoStartPts(m.samples);m.samples=m.samples.slice(U),m.dropped+=U,Se+=(m.samples[0].pts-K)/(m.timescale||9e4)}else U===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+ke+" video samples"),ne=!1);if(this.ISGenerated){if(je&&Be){var ee=this.getVideoStartPts(m.samples),oe=s(b.samples[0].pts,ee)-ee,Q=oe/m.inputTimeScale;se+=Math.max(0,Q),Se+=Math.max(0,-Q)}if(je){if(b.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),j=this.generateIS(b,m,E)),G=this.remuxAudio(b,se,this.isAudioContiguous,_,Ae||Be||F===D.PlaylistLevelType.AUDIO?Se:void 0),Be){var Ce=G?G.endPTS-G.startPTS:0;m.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),j=this.generateIS(b,m,E)),L=this.remuxVideo(m,Se,Z,Ce)}}else Be&&(L=this.remuxVideo(m,Se,Z,0));L&&(L.firstKeyFrame=U,L.independent=U!==-1)}}return this.ISGenerated&&(f.samples.length&&(V=this.remuxID3(f,E)),O.samples.length&&(R=this.remuxText(O,E))),{audio:G,video:L,initSegment:j,independent:ne,text:R,id3:V}},w.generateIS=function(b,m,f){var O=b.samples,E=m.samples,_=this.typeSupported,k={},F=!Object(X.isFiniteNumber)(this._initPTS),L="audio/mp4",G,j,R;if(F&&(G=j=Infinity),b.config&&O.length&&(b.timescale=b.samplerate,b.isAAC||(_.mpeg?(L="audio/mpeg",b.codec=""):_.mp3&&(b.codec="mp3")),k.audio={id:"audio",container:L,codec:b.codec,initSegment:!b.isAAC&&_.mpeg?new Uint8Array(0):C.default.initSegment([b]),metadata:{channelCount:b.channelCount}},F&&(R=b.inputTimeScale,G=j=O[0].pts-Math.round(R*f))),m.sps&&m.pps&&E.length&&(m.timescale=m.inputTimeScale,k.video={id:"main",container:"video/mp4",codec:m.codec,initSegment:C.default.initSegment([m]),metadata:{width:m.width,height:m.height}},F)){R=m.inputTimeScale;var V=this.getVideoStartPts(E),ne=Math.round(R*f);j=Math.min(j,s(E[0].dts,V)-ne),G=Math.min(G,V-ne)}if(Object.keys(k).length)return this.ISGenerated=!0,F&&(this._initPTS=G,this._initDTS=j),{tracks:k,initPTS:G,timescale:R}},w.remuxVideo=function(b,m,f,O){var E=b.inputTimeScale,_=b.samples,k=[],F=_.length,L=this._initPTS,G=this.nextAvcDts,j=8,R,V,ne,se=Number.POSITIVE_INFINITY,Se=Number.NEGATIVE_INFINITY,De=0,Ae=!1;if(!f||G===null){var ke=m*E,je=_[0].pts-s(_[0].dts,_[0].pts);G=ke-je}for(var Be=0;Be<F;Be++){var we=_[Be];if(we.pts=s(we.pts-L,G),we.dts=s(we.dts-L,G),we.dts>we.pts){var Z=9e4*.2;De=Math.max(Math.min(De,we.pts-we.dts),-1*Z)}we.dts<_[Be>0?Be-1:Be].dts&&(Ae=!0)}Ae&&_.sort(function(St,Ye){var at=St.dts-Ye.dts,Ve=St.pts-Ye.pts;return at||Ve}),V=_[0].dts,ne=_[_.length-1].dts;var U=Math.round((ne-V)/(F-1));if(De<0){if(De<U*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-U,!0)+" ms");for(var K=De,ee=0;ee<F;ee++)_[ee].dts=K=Math.max(K,_[ee].pts-U),_[ee].pts=Math.max(K,_[ee].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(De,!0)+" ms to overcome this issue");for(var oe=0;oe<F;oe++)_[oe].dts=_[oe].dts+De}V=_[0].dts}if(f){var Q=V-G,Ce=Q>U,ze=Q<-1;if(Ce||ze){Ce?n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(Q,!0)+" ms ("+Q+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-Q,!0)+" ms ("+Q+"dts) overlapping between fragments detected"),V=G;var nt=_[0].pts-Q;_[0].dts=V,_[0].pts=nt,n.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(nt,!0)+"/"+Object(g.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(Q,!0)+" ms")}}a&&(V=Math.max(0,V));for(var xe=0,Re=0,Te=0;Te<F;Te++){for(var Oe=_[Te],Ke=Oe.units,Qe=Ke.length,st=0,ut=0;ut<Qe;ut++)st+=Ke[ut].data.length;Re+=st,xe+=Qe,Oe.length=st,Oe.dts=Math.max(Oe.dts,V),Oe.pts=Math.max(Oe.pts,Oe.dts,0),se=Math.min(Oe.pts,se),Se=Math.max(Oe.pts,Se)}ne=_[F-1].dts;var xt=Re+4*xe+8,wt;try{wt=new Uint8Array(xt)}catch(St){this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:M.ErrorTypes.MUX_ERROR,details:M.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:xt,reason:"fail allocating video mdat "+xt});return}var Fe=new DataView(wt.buffer);Fe.setUint32(0,xt),wt.set(C.default.types.mdat,4);for(var Ue=0;Ue<F;Ue++){for(var it=_[Ue],lt=it.units,fe=0,ie=0,re=lt.length;ie<re;ie++){var de=lt[ie],me=de.data,le=de.data.byteLength;Fe.setUint32(j,le),j+=4,wt.set(me,j),j+=le,fe+=4+le}if(Ue<F-1)R=_[Ue+1].dts-it.dts;else{var he=this.config,Ee=it.dts-_[Ue>0?Ue-1:Ue].dts;if(he.stretchShortVideoTrack&&this.nextAudioPts!==null){var ye=Math.floor(he.maxBufferHole*E),Le=(O?se+O*E:this.nextAudioPts)-it.pts;Le>ye?(R=Le-Ee,R<0&&(R=Ee),n.logger.log("[mp4-remuxer]: It is approximately "+Le/90+" ms to the next segment; using duration "+R/90+" ms for the last video frame.")):R=Ee}else R=Ee}var Ne=Math.round(it.pts-it.dts);k.push(new x(it.key,R,fe,Ne))}if(k.length&&d&&d<70){var tt=k[0].flags;tt.dependsOn=2,tt.isNonSync=0}console.assert(R!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=ne+R,this.isVideoContiguous=!0;var gt=C.default.moof(b.sequenceNumber++,V,p({},b,{samples:k})),Ct="video",Ot={data1:gt,data2:wt,startPTS:se/E,endPTS:(Se+R)/E,startDTS:V/E,endDTS:G/E,type:Ct,hasAudio:!1,hasVideo:!0,nb:k.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(wt.length,"MDAT length must not be zero"),Ot},w.remuxAudio=function(b,m,f,O,E){var _=b.inputTimeScale,k=b.samplerate?b.samplerate:_,F=_/k,L=b.isAAC?c:o,G=L*F,j=this._initPTS,R=!b.isAAC&&this.typeSupported.mpeg,V=[],ne=b.samples,se=R?0:8,Se=this.nextAudioPts||-1,De=m*_;if(this.isAudioContiguous=f=f||ne.length&&Se>0&&(O&&Math.abs(De-Se)<9e3||Math.abs(s(ne[0].pts-j,De)-Se)<20*G),ne.forEach(function(me){me.pts=s(me.pts-j,De)}),!f||Se<0){if(ne=ne.filter(function(me){return me.pts>=0}),!ne.length)return;E===0?Se=0:O?Se=Math.max(0,De):Se=ne[0].pts}if(b.isAAC)for(var Ae=E!==void 0,ke=this.config.maxAudioFramesDrift,je=0,Be=Se;je<ne.length;je++){var we=ne[je],Z=we.pts,U=Z-Be,K=Math.abs(1e3*U/_);if(U<=-ke*G&&Ae)je===0&&(n.logger.warn("Audio frame @ "+(Z/_).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*U/_)+" ms."),this.nextAudioPts=Se=Be=Z);else if(U>=ke*G&&K<h&&Ae){var ee=Math.round(U/G);Be=Z-ee*G,Be<0&&(ee--,Be+=G),je===0&&(this.nextAudioPts=Se=Be),n.logger.warn("[mp4-remuxer]: Injecting "+ee+" audio frame @ "+(Be/_).toFixed(3)+"s due to "+Math.round(1e3*U/_)+" ms gap.");for(var oe=0;oe<ee;oe++){var Q=Math.max(Be,0),Ce=N.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);Ce||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ce=we.unit.subarray()),ne.splice(je,0,{unit:Ce,pts:Q}),Be+=G,je++}}we.pts=Be,Be+=G}for(var ze=null,nt=null,xe,Re=0,Te=ne.length;Te--;)Re+=ne[Te].unit.byteLength;for(var Oe=0,Ke=ne.length;Oe<Ke;Oe++){var Qe=ne[Oe],st=Qe.unit,ut=Qe.pts;if(nt!==null){var xt=V[Oe-1];xt.duration=Math.round((ut-nt)/F)}else if(f&&b.isAAC&&(ut=Se),ze=ut,Re>0){Re+=se;try{xe=new Uint8Array(Re)}catch(me){this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:M.ErrorTypes.MUX_ERROR,details:M.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Re,reason:"fail allocating audio mdat "+Re});return}if(!R){var wt=new DataView(xe.buffer);wt.setUint32(0,Re),xe.set(C.default.types.mdat,4)}}else return;xe.set(st,se);var Fe=st.byteLength;se+=Fe,V.push(new x(!0,L,Fe,0)),nt=ut}var Ue=V.length;if(!Ue)return;var it=V[V.length-1];this.nextAudioPts=Se=nt+F*it.duration;var lt=R?new Uint8Array(0):C.default.moof(b.sequenceNumber++,ze/F,p({},b,{samples:V}));b.samples=[];var fe=ze/_,ie=Se/_,re="audio",de={data1:lt,data2:xe,startPTS:fe,endPTS:ie,startDTS:fe,endDTS:ie,type:re,hasAudio:!0,hasVideo:!1,nb:Ue};return this.isAudioContiguous=!0,console.assert(xe.length,"MDAT length must not be zero"),de},w.remuxEmptyAudio=function(b,m,f,O){var E=b.inputTimeScale,_=b.samplerate?b.samplerate:E,k=E/_,F=this.nextAudioPts,L=(F!==null?F:O.startDTS*E)+this._initDTS,G=O.endDTS*E+this._initDTS,j=k*c,R=Math.ceil((G-L)/j),V=N.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ne=[],se=0;se<R;se++){var Se=L+se*j;ne.push({unit:V,pts:Se,dts:Se})}return b.samples=ne,this.remuxAudio(b,m,f,!1)},w.remuxID3=function(b,m){var f=b.samples.length;if(!f)return;for(var O=b.inputTimeScale,E=this._initPTS,_=this._initDTS,k=0;k<f;k++){var F=b.samples[k];F.pts=s(F.pts-E,m*O)/O,F.dts=s(F.dts-_,m*O)/O}var L=b.samples;return b.samples=[],{samples:L}},w.remuxText=function(b,m){var f=b.samples.length;if(!f)return;for(var O=b.inputTimeScale,E=this._initPTS,_=0;_<f;_++){var k=b.samples[_];k.pts=s(k.pts-E,m*O)/O}b.samples.sort(function(L,G){return L.pts-G.pts});var F=b.samples;return b.samples=[],{samples:F}},A}();function s(A,w){var v;if(w===null)return A;for(w<A?v=-8589934592:v=8589934592;Math.abs(A-w)>4294967296;)A+=v;return A}function S(A){for(var w=0;w<A.length;w++)if(A[w].key)return w;return-1}var x=function(w,v,b,m){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=v,this.size=b,this.cts=m,this.flags=new T(w)},T=function(w){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=w?2:1,this.isNonSync=w?0:1}},"./src/remux/passthrough-remuxer.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/polyfills/number.ts"),N=P("./src/utils/mp4-tools.ts"),C=P("./src/loader/fragment.ts"),B=P("./src/utils/logger.ts"),M=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var p=g.prototype;return p.destroy=function(){},p.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(c,o,d){this.audioCodec=o,this.videoCodec=d,this.generateInitSegment(c),this.emitInitSegment=!0},p.generateInitSegment=function(c){var o=this.audioCodec,d=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var r=this.initData=Object(N.parseInitSegment)(c);o||(o=D(r.audio,C.ElementaryStreamTypes.AUDIO)),d||(d=D(r.video,C.ElementaryStreamTypes.VIDEO));var a={};r.audio&&r.video?a.audiovideo={container:"video/mp4",codec:o+","+d,initSegment:c,id:"main"}:r.audio?a.audio={container:"audio/mp4",codec:o,initSegment:c,id:"audio"}:r.video?a.video={container:"video/mp4",codec:d,initSegment:c,id:"main"}:B.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},p.remux=function(c,o,d,r,a){var i=this.initPTS,s=this.lastEndDTS,S={audio:void 0,video:void 0,text:r,id3:d,initSegment:void 0};Object(X.isFiniteNumber)(s)||(s=this.lastEndDTS=a||0);var x=o.samples;if(!x||!x.length)return S;var T={initPTS:void 0,timescale:1},A=this.initData;if((!A||!A.length)&&(this.generateInitSegment(x),A=this.initData),!A||!A.length)return B.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(X.isFiniteNumber)(i)||(this.initPTS=T.initPTS=i=n(A,x,s));var w=Object(N.getDuration)(x,A),v=s,b=w+v;Object(N.offsetStartDTS)(A,x,i),w>0?this.lastEndDTS=b:(B.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var m=!!A.audio,f=!!A.video,O="";m&&(O+="audio"),f&&(O+="video");var E={data1:x,startPTS:v,startDTS:v,endPTS:b,endDTS:b,type:O,hasAudio:m,hasVideo:f,nb:1,dropped:0};return S.audio=E.type==="audio"?E:void 0,S.video=E.type!=="audio"?E:void 0,S.text=r,S.id3=d,S.initSegment=T,S},g}(),n=function(p,h,c){return Object(N.getStartDTS)(p,h)-c};function D(g,p){var h=g==null?void 0:g.codec;return h&&h.length>4?h:h==="hvc1"?"hvc1.1.c.L120.90":h==="av01"?"av01.0.04M.08":h==="avc1"||p===C.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}z.default=M},"./src/task-loop.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return X});var X=function(){function N(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var C=N.prototype;return C.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},C.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},C.onHandlerDestroyed=function(){},C.hasInterval=function(){return!!this._tickInterval},C.hasNextTick=function(){return!!this._tickTimer},C.setInterval=function(M){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,M),!0)},C.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},C.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},C.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},C.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},C.doTick=function(){},N}()},"./src/types/cmcd.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"CMCDVersion",function(){return X}),P.d(z,"CMCDObjectType",function(){return N}),P.d(z,"CMCDStreamingFormat",function(){return C}),P.d(z,"CMCDStreamType",function(){return B});var X=1,N;(function(M){M.MANIFEST="m",M.AUDIO="a",M.VIDEO="v",M.MUXED="av",M.INIT="i",M.CAPTION="c",M.TIMED_TEXT="tt",M.KEY="k",M.OTHER="o"})(N||(N={}));var C;(function(M){M.DASH="d",M.HLS="h",M.SMOOTH="s",M.OTHER="o"})(C||(C={}));var B;(function(M){M.VOD="v",M.LIVE="l"})(B||(B={}))},"./src/types/level.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"HlsSkip",function(){return C}),P.d(z,"getSkipValue",function(){return B}),P.d(z,"HlsUrlParameters",function(){return M}),P.d(z,"Level",function(){return n});function X(D,g){for(var p=0;p<g.length;p++){var h=g[p];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function N(D,g,p){return g&&X(D.prototype,g),p&&X(D,p),D}var C;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(C||(C={}));function B(D,g){var p=D.canSkipUntil,h=D.canSkipDateRanges,c=D.endSN,o=g!==void 0?g-c:0;return p&&o<p?h?C.v2:C.Yes:C.No}var M=function(){function D(p,h,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=h,this.skip=c}var g=D.prototype;return g.addDirectives=function(h){var c=new self.URL(h);return this.msn!==void 0&&c.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&c.searchParams.set("_HLS_part",this.part.toString()),this.skip&&c.searchParams.set("_HLS_skip",this.skip),c.toString()},D}(),n=function(){function D(g){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=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(p){return p}).join(",").replace(/\.[^.,]+/g,"")}return N(D,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(p){var h=p%this.url.length;this._urlId!==h&&(this.details=void 0,this._urlId=h)}}]),D}()},"./src/types/loader.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"PlaylistContextType",function(){return X}),P.d(z,"PlaylistLevelType",function(){return N});var X;(function(C){C.MANIFEST="manifest",C.LEVEL="level",C.AUDIO_TRACK="audioTrack",C.SUBTITLE_TRACK="subtitleTrack"})(X||(X={}));var N;(function(C){C.MAIN="main",C.AUDIO="audio",C.SUBTITLE="subtitle"})(N||(N={}))},"./src/types/transmuxer.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"ChunkMetadata",function(){return X});var X=function(B,M,n,D,g,p){D===void 0&&(D=0),g===void 0&&(g=-1),p===void 0&&(p=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=N(),this.buffering={audio:N(),video:N(),audiovideo:N()},this.level=B,this.sn=M,this.id=n,this.size=D,this.part=g,this.partial=p};function N(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"AttrList",function(){return C});var X=/^(\d+)x(\d+)$/,N=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,C=function(){function B(n){typeof n=="string"&&(n=B.parseAttrList(n));for(var D in n)n.hasOwnProperty(D)&&(this[D]=n[D])}var M=B.prototype;return M.decimalInteger=function(D){var g=parseInt(this[D],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},M.hexadecimalInteger=function(D){if(this[D]){var g=(this[D]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var p=new Uint8Array(g.length/2),h=0;h<g.length/2;h++)p[h]=parseInt(g.slice(h*2,h*2+2),16);return p}else return null},M.hexadecimalIntegerAsNumber=function(D){var g=parseInt(this[D],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},M.decimalFloatingPoint=function(D){return parseFloat(this[D])},M.optionalFloat=function(D,g){var p=this[D];return p?parseFloat(p):g},M.enumeratedString=function(D){return this[D]},M.bool=function(D){return this[D]==="YES"},M.decimalResolution=function(D){var g=X.exec(this[D]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},B.parseAttrList=function(D){var g,p={},h='"';for(N.lastIndex=0;(g=N.exec(D))!==null;){var c=g[2];c.indexOf(h)===0&&c.lastIndexOf(h)===c.length-1&&(c=c.slice(1,-1)),p[g[1]]=c}return p},B}()},"./src/utils/binary-search.ts":function(J,z,P){"use strict";P.r(z);var X={search:function(C,B){for(var M=0,n=C.length-1,D=null,g=null;M<=n;){D=(M+n)/2|0,g=C[D];var p=B(g);if(p>0)M=D+1;else if(p<0)n=D-1;else return g}return null}};z.default=X},"./src/utils/buffer-helper.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"BufferHelper",function(){return C});var X=P("./src/utils/logger.ts"),N={length:0,start:function(){return 0},end:function(){return 0}},C=function(){function B(){}return B.isBuffered=function(n,D){try{if(n){for(var g=B.getBuffered(n),p=0;p<g.length;p++)if(D>=g.start(p)&&D<=g.end(p))return!0}}catch(h){}return!1},B.bufferInfo=function(n,D,g){try{if(n){var p=B.getBuffered(n),h=[],c;for(c=0;c<p.length;c++)h.push({start:p.start(c),end:p.end(c)});return this.bufferedInfo(h,D,g)}}catch(o){}return{len:0,start:D,end:D,nextStart:void 0}},B.bufferedInfo=function(n,D,g){D=Math.max(0,D),n.sort(function(T,A){var w=T.start-A.start;return w||A.end-T.end});var p=[];if(g)for(var h=0;h<n.length;h++){var c=p.length;if(c){var o=p[c-1].end;n[h].start-o<g?n[h].end>o&&(p[c-1].end=n[h].end):p.push(n[h])}else p.push(n[h])}else p=n;for(var d=0,r,a=D,i=D,s=0;s<p.length;s++){var S=p[s].start,x=p[s].end;if(D+g>=S&&D<x)a=S,i=x,d=i-D;else if(D+g<S){r=S;break}}return{len:d,start:a||0,end:i||0,nextStart:r}},B.getBuffered=function(n){try{return n.buffered}catch(D){return X.logger.log("failed to get media.buffered",D),N}},B}()},"./src/utils/cea-608-parser.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"Row",function(){return i}),P.d(z,"CaptionScreen",function(){return s});var X=P("./src/utils/logger.ts"),N={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},C=function(b){var m=b;return N.hasOwnProperty(b)&&(m=N[b]),String.fromCharCode(m)},B=15,M=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c;(function(v){v[v.ERROR=0]="ERROR",v[v.TEXT=1]="TEXT",v[v.WARNING=2]="WARNING",v[v.INFO=2]="INFO",v[v.DEBUG=3]="DEBUG",v[v.DATA=3]="DATA"})(c||(c={}));var o=function(){function v(){this.time=null,this.verboseLevel=c.ERROR}var b=v.prototype;return b.log=function(f,O){this.verboseLevel>=f&&X.logger.log(this.time+" ["+f+"] "+O)},v}(),d=function(b){for(var m=[],f=0;f<b.length;f++)m.push(b[f].toString(16));return m},r=function(){function v(m,f,O,E,_){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=m||"white",this.underline=f||!1,this.italics=O||!1,this.background=E||"black",this.flash=_||!1}var b=v.prototype;return b.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},b.setStyles=function(f){for(var O=["foreground","underline","italics","background","flash"],E=0;E<O.length;E++){var _=O[E];f.hasOwnProperty(_)&&(this[_]=f[_])}},b.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},b.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},b.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},b.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},v}(),a=function(){function v(m,f,O,E,_,k){this.uchar=void 0,this.penState=void 0,this.uchar=m||" ",this.penState=new r(f,O,E,_,k)}var b=v.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(f,O){this.uchar=f,this.penState.copy(O)},b.setPenState=function(f){this.penState.copy(f)},b.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},b.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},b.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},v}(),i=function(){function v(m){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var f=0;f<M;f++)this.chars.push(new a);this.logger=m,this.pos=0,this.currPenState=new r}var b=v.prototype;return b.equals=function(f){for(var O=!0,E=0;E<M;E++)if(!this.chars[E].equals(f.chars[E])){O=!1;break}return O},b.copy=function(f){for(var O=0;O<M;O++)this.chars[O].copy(f.chars[O])},b.isEmpty=function(){for(var f=!0,O=0;O<M;O++)if(!this.chars[O].isEmpty()){f=!1;break}return f},b.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>M&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=M)},b.moveCursor=function(f){var O=this.pos+f;if(f>1)for(var E=this.pos+1;E<O+1;E++)this.chars[E].setPenState(this.currPenState);this.setCursor(O)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(f){f>=144&&this.backSpace();var O=C(f);if(this.pos>=M){this.logger.log(c.ERROR,"Cannot insert "+f.toString(16)+" ("+O+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(O,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(f){var O;for(O=f;O<M;O++)this.chars[O].reset()},b.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},b.clearToEndOfRow=function(){this.clearFromPos(this.pos)},b.getTextString=function(){for(var f=[],O=!0,E=0;E<M;E++){var _=this.chars[E].uchar;_!==" "&&(O=!1),f.push(_)}return O?"":f.join("")},b.setPenStyles=function(f){this.currPenState.setStyles(f);var O=this.chars[this.pos];O.setPenState(this.currPenState)},v}(),s=function(){function v(m){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var f=0;f<B;f++)this.rows.push(new i(m));this.logger=m,this.currRow=B-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=v.prototype;return b.reset=function(){for(var f=0;f<B;f++)this.rows[f].clear();this.currRow=B-1},b.equals=function(f){for(var O=!0,E=0;E<B;E++)if(!this.rows[E].equals(f.rows[E])){O=!1;break}return O},b.copy=function(f){for(var O=0;O<B;O++)this.rows[O].copy(f.rows[O])},b.isEmpty=function(){for(var f=!0,O=0;O<B;O++)if(!this.rows[O].isEmpty()){f=!1;break}return f},b.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},b.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},b.insertChar=function(f){var O=this.rows[this.currRow];O.insertChar(f)},b.setPen=function(f){var O=this.rows[this.currRow];O.setPenStyles(f)},b.moveCursor=function(f){var O=this.rows[this.currRow];O.moveCursor(f)},b.setCursor=function(f){this.logger.log(c.INFO,"setCursor: "+f);var O=this.rows[this.currRow];O.setCursor(f)},b.setPAC=function(f){this.logger.log(c.INFO,"pacData = "+JSON.stringify(f));var O=f.row-1;if(this.nrRollUpRows&&O<this.nrRollUpRows-1&&(O=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==O){for(var E=0;E<B;E++)this.rows[E].clear();var _=this.currRow+1-this.nrRollUpRows,k=this.lastOutputScreen;if(k){var F=k.rows[_].cueStartTime,L=this.logger.time;if(F&&L!==null&&F<L)for(var G=0;G<this.nrRollUpRows;G++)this.rows[O-this.nrRollUpRows+G+1].copy(k.rows[_+G])}}this.currRow=O;var j=this.rows[this.currRow];if(f.indent!==null){var R=f.indent,V=Math.max(R-1,0);j.setCursor(f.indent),f.color=j.chars[V].penState.foreground}var ne={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(ne)},b.setBkgData=function(f){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},b.setRollUpRows=function(f){this.nrRollUpRows=f},b.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(c.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(c.TEXT,this.getDisplayText());var f=this.currRow+1-this.nrRollUpRows,O=this.rows.splice(f,1)[0];O.clear(),this.rows.splice(this.currRow,0,O),this.logger.log(c.INFO,"Rolling up")},b.getDisplayText=function(f){f=f||!1;for(var O=[],E="",_=-1,k=0;k<B;k++){var F=this.rows[k].getTextString();F&&(_=k+1,f?O.push("Row "+_+": '"+F+"'"):O.push(F.trim()))}return O.length>0&&(f?E="["+O.join(" | ")+"]":E=O.join(`
|
|
`)),E},b.getTextAndFormat=function(){return this.rows},v}(),S=function(){function v(m,f,O){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=m,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new s(O),this.nonDisplayedMemory=new s(O),this.lastOutputScreen=new s(O),this.currRollUpRow=this.displayedMemory.rows[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=O}var b=v.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(f){this.outputFilter=f},b.setPAC=function(f){this.writeScreen.setPAC(f)},b.setBkgData=function(f){this.writeScreen.setBkgData(f)},b.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(c.INFO,"MODE="+f),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=f},b.insertChars=function(f){for(var O=0;O<f.length;O++)this.writeScreen.insertChar(f[O]);var E=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,E+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(c.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},b.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},b.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},b.ccAOF=function(){},b.ccAON=function(){},b.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},b.ccRU=function(f){this.logger.log(c.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},b.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},b.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},b.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},b.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},b.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},b.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},b.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},b.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var f=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=f,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},b.ccTO=function(f){this.logger.log(c.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},b.ccMIDROW=function(f){var O={flash:!1};if(O.underline=f%2===1,O.italics=f>=46,O.italics)O.foreground="white";else{var E=Math.floor(f/2)-16,_=["white","green","blue","cyan","red","yellow","magenta"];O.foreground=_[E]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(O)),this.writeScreen.setPen(O)},b.outputDataUpdate=function(f){f===void 0&&(f=!1);var O=this.logger.time;if(O===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=O:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,O,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:O),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},v}(),x=function(){function v(m,f,O){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new o;this.channels=[null,new S(m,f,E),new S(m+1,O,E)],this.cmdHistory=w(),this.logger=E}var b=v.prototype;return b.getHandler=function(f){return this.channels[f].getHandler()},b.setHandler=function(f,O){this.channels[f].setHandler(O)},b.addData=function(f,O){var E,_,k,F=!1;this.logger.time=f;for(var L=0;L<O.length;L+=2){if(_=O[L]&127,k=O[L+1]&127,_===0&&k===0)continue;if(this.logger.log(c.DATA,"["+d([O[L],O[L+1]])+"] -> ("+d([_,k])+")"),E=this.parseCmd(_,k),E||(E=this.parseMidrow(_,k)),E||(E=this.parsePAC(_,k)),E||(E=this.parseBackgroundAttributes(_,k)),!E&&(F=this.parseChars(_,k),F)){var G=this.currentChannel;if(G&&G>0){var j=this.channels[G];j.insertChars(F)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!E&&!F&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+d([_,k])+" orig: "+d([O[L],O[L+1]]))}},b.parseCmd=function(f,O){var E=this.cmdHistory,_=(f===20||f===28||f===21||f===29)&&O>=32&&O<=47,k=(f===23||f===31)&&O>=33&&O<=35;if(!(_||k))return!1;if(A(f,O,E))return T(null,null,E),this.logger.log(c.DEBUG,"Repeated command ("+d([f,O])+") is dropped"),!0;var F=f===20||f===21||f===23?1:2,L=this.channels[F];return f===20||f===21||f===28||f===29?O===32?L.ccRCL():O===33?L.ccBS():O===34?L.ccAOF():O===35?L.ccAON():O===36?L.ccDER():O===37?L.ccRU(2):O===38?L.ccRU(3):O===39?L.ccRU(4):O===40?L.ccFON():O===41?L.ccRDC():O===42?L.ccTR():O===43?L.ccRTD():O===44?L.ccEDM():O===45?L.ccCR():O===46?L.ccENM():O===47&&L.ccEOC():L.ccTO(O-32),T(f,O,E),this.currentChannel=F,!0},b.parseMidrow=function(f,O){var E=0;if((f===17||f===25)&&O>=32&&O<=47){if(f===17?E=1:E=2,E!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var _=this.channels[E];return _?(_.ccMIDROW(O),this.logger.log(c.DEBUG,"MIDROW ("+d([f,O])+")"),!0):!1}return!1},b.parsePAC=function(f,O){var E,_=this.cmdHistory,k=(f>=17&&f<=23||f>=25&&f<=31)&&O>=64&&O<=127,F=(f===16||f===24)&&O>=64&&O<=95;if(!(k||F))return!1;if(A(f,O,_))return T(null,null,_),!0;var L=f<=23?1:2;O>=64&&O<=95?E=L===1?n[f]:g[f]:E=L===1?D[f]:p[f];var G=this.channels[L];return G?(G.setPAC(this.interpretPAC(E,O)),T(f,O,_),this.currentChannel=L,!0):!1},b.interpretPAC=function(f,O){var E,_={color:null,italics:!1,indent:null,underline:!1,row:f};return O>95?E=O-96:E=O-64,_.underline=(E&1)===1,E<=13?_.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(E/2)]:E<=15?(_.italics=!0,_.color="white"):_.indent=Math.floor((E-16)/2)*4,_},b.parseChars=function(f,O){var E,_=null,k=null;if(f>=25?(E=2,k=f-8):(E=1,k=f),k>=17&&k<=19){var F;k===17?F=O+80:k===18?F=O+112:F=O+144,this.logger.log(c.INFO,"Special char '"+C(F)+"' in channel "+E),_=[F]}else f>=32&&f<=127&&(_=O===0?[f]:[f,O]);if(_){var L=d(_);this.logger.log(c.DEBUG,"Char codes = "+L.join(",")),T(f,O,this.cmdHistory)}return _},b.parseBackgroundAttributes=function(f,O){var E=(f===16||f===24)&&O>=32&&O<=47,_=(f===23||f===31)&&O>=45&&O<=47;if(!(E||_))return!1;var k,F={};f===16||f===24?(k=Math.floor((O-32)/2),F.background=h[k],O%2===1&&(F.background=F.background+"_semi")):O===45?F.background="transparent":(F.foreground="black",O===47&&(F.underline=!0));var L=f<=23?1:2,G=this.channels[L];return G.setBkgData(F),T(f,O,this.cmdHistory),!0},b.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var O=this.channels[f];O&&O.reset()}this.cmdHistory=w()},b.cueSplitAtTime=function(f){for(var O=0;O<this.channels.length;O++){var E=this.channels[O];E&&E.cueSplitAtTime(f)}},v}();function T(v,b,m){m.a=v,m.b=b}function A(v,b,m){return m.a===v&&m.b===b}function w(){return{a:null,b:null}}z.default=x},"./src/utils/codecs.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"isCodecType",function(){return N}),P.d(z,"isCodecSupportedInMp4",function(){return C});var X={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 N(B,M){var n=X[M];return!!n&&n[B.slice(0,4)]===!0}function C(B,M){return MediaSource.isTypeSupported((M||"video")+'/mp4;codecs="'+B+'"')}},"./src/utils/cues.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/utils/vttparser.ts"),N=P("./src/utils/webvtt-parser.ts"),C=P("./src/utils/texttrack-utils.ts"),B=/\s/,M={newCue:function(D,g,p,h){for(var c=[],o,d,r,a,i,s=self.VTTCue||self.TextTrackCue,S=0;S<h.rows.length;S++)if(o=h.rows[S],r=!0,a=0,i="",!o.isEmpty()){for(var x=0;x<o.chars.length;x++)B.test(o.chars[x].uchar)&&r?a++:(i+=o.chars[x].uchar,r=!1);o.cueStartTime=g,g===p&&(p+=1e-4),a>=16?a--:a++;var T=Object(X.fixLineBreaks)(i.trim()),A=Object(N.generateCueId)(g,p,T);(!D||!D.cues||!D.cues.getCueById(A))&&(d=new s(g,p,T),d.id=A,d.line=S+1,d.align="left",d.position=10+Math.min(80,Math.floor(a*8/32)*10),c.push(d))}return D&&c.length&&(c.sort(function(w,v){return w.line==="auto"||v.line==="auto"?0:w.line>8&&v.line>8?v.line-w.line:w.line-v.line}),c.forEach(function(w){return Object(C.addCueToTrack)(D,w)})),c}};z.default=M},"./src/utils/discontinuities.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"findFirstFragWithCC",function(){return B}),P.d(z,"shouldAlignOnDiscontinuities",function(){return M}),P.d(z,"findDiscontinuousReferenceFrag",function(){return n}),P.d(z,"adjustSlidingStart",function(){return g}),P.d(z,"alignStream",function(){return p}),P.d(z,"alignPDT",function(){return c}),P.d(z,"alignFragmentByPDTDelta",function(){return o}),P.d(z,"alignMediaPlaylistByPDT",function(){return d});var X=P("./src/polyfills/number.ts"),N=P("./src/utils/logger.ts"),C=P("./src/controller/level-helper.ts");function B(r,a){for(var i=null,s=0,S=r.length;s<S;s++){var x=r[s];if(x&&x.cc===a){i=x;break}}return i}function M(r,a,i){return!!(a.details&&(i.endCC>i.startCC||r&&r.cc<i.startCC))}function n(r,a){var i=r.fragments,s=a.fragments;if(!s.length||!i.length){N.logger.log("No fragments to align");return}var S=B(i,s[0].cc);if(!S||S&&!S.startPTS){N.logger.log("No frag in previous level to align on");return}return S}function D(r,a){if(r){var i=r.start+a;r.start=r.startPTS=i,r.endPTS=i+r.duration}}function g(r,a){for(var i=a.fragments,s=0,S=i.length;s<S;s++)D(i[s],r);a.fragmentHint&&D(a.fragmentHint,r),a.alignedSliding=!0}function p(r,a,i){if(!a)return;h(r,i,a),!i.alignedSliding&&a.details&&c(i,a.details),!i.alignedSliding&&a.details&&!i.skippedSegments&&Object(C.adjustSliding)(a.details,i)}function h(r,a,i){if(M(r,i,a)){var s=n(i.details,a);s&&Object(X.isFiniteNumber)(s.start)&&(N.logger.log("Adjusting PTS using last level due to CC increase within current level "+a.url),g(s.start,a))}}function c(r,a){if(!a.fragments.length||!r.hasProgramDateTime||!a.hasProgramDateTime)return;var i=a.fragments[0].programDateTime,s=r.fragments[0].programDateTime,S=(s-i)/1e3+a.fragments[0].start;S&&Object(X.isFiniteNumber)(S)&&(N.logger.log("Adjusting PTS using programDateTime delta "+(s-i)+"ms, sliding:"+S.toFixed(3)+" "+r.url+" "),g(S,r))}function o(r,a){var i=r.programDateTime;if(!i)return;var s=(i-a)/1e3;r.start=r.startPTS=s,r.endPTS=s+r.duration}function d(r,a){if(!a.fragments.length||!r.hasProgramDateTime||!a.hasProgramDateTime)return;var i=a.fragments[0].programDateTime,s=a.fragments[0].start,S=i-s*1e3;r.fragments.forEach(function(x){o(x,S)}),r.fragmentHint&&o(r.fragmentHint,S),r.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/utils/ewma.ts"),N=function(){function C(M,n,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new X.default(M),this.fast_=new X.default(n)}var B=C.prototype;return B.update=function(n,D){var g=this.slow_,p=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new X.default(n,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new X.default(D,p.getEstimate(),p.getTotalWeight()))},B.sample=function(n,D){n=Math.max(n,this.minDelayMs_);var g=8*D,p=n/1e3,h=g/p;this.fast_.sample(p,h),this.slow_.sample(p,h)},B.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},B.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},B.destroy=function(){},C}();z.default=N},"./src/utils/ewma.ts":function(J,z,P){"use strict";P.r(z);var X=function(){function N(B,M,n){M===void 0&&(M=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=B,this.alpha_=B?Math.exp(Math.log(.5)/B):0,this.estimate_=M,this.totalWeight_=n}var C=N.prototype;return C.sample=function(M,n){var D=Math.pow(this.alpha_,M);this.estimate_=n*(1-D)+D*this.estimate_,this.totalWeight_+=M},C.getTotalWeight=function(){return this.totalWeight_},C.getEstimate=function(){if(this.alpha_){var M=1-Math.pow(this.alpha_,this.totalWeight_);if(M)return this.estimate_/M}return this.estimate_},N}();z.default=X},"./src/utils/fetch-loader.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"fetchSupported",function(){return o});var X=P("./src/polyfills/number.ts"),N=P("./src/loader/load-stats.ts"),C=P("./src/demux/chunk-cache.ts");function B(s,S){s.prototype=Object.create(S.prototype),s.prototype.constructor=s,p(s,S)}function M(s){var S=typeof Map=="function"?new Map:void 0;return M=function(T){if(T===null||!g(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof S!="undefined"){if(S.has(T))return S.get(T);S.set(T,A)}function A(){return n(T,arguments,h(this).constructor)}return A.prototype=Object.create(T.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),p(A,T)},M(s)}function n(s,S,x){return D()?n=Reflect.construct:n=function(A,w,v){var b=[null];b.push.apply(b,w);var m=Function.bind.apply(A,b),f=new m;return v&&p(f,v.prototype),f},n.apply(null,arguments)}function D(){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(s){return!1}}function g(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function p(s,S){return p=Object.setPrototypeOf||function(T,A){return T.__proto__=A,T},p(s,S)}function h(s){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},h(s)}function c(){return c=Object.assign||function(s){for(var S=1;S<arguments.length;S++){var x=arguments[S];for(var T in x)Object.prototype.hasOwnProperty.call(x,T)&&(s[T]=x[T])}return s},c.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(s){}return!1}var d=function(){function s(x){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=x.fetchSetup||a,this.controller=new self.AbortController,this.stats=new N.LoadStats}var S=s.prototype;return S.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},S.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},S.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},S.load=function(T,A,w){var v=this,b=this.stats;if(b.loading.start)throw new Error("Loader can only be used once.");b.loading.start=self.performance.now();var m=r(T,this.controller.signal),f=w.onProgress,O=T.responseType==="arraybuffer",E=O?"byteLength":"length";this.context=T,this.config=A,this.callbacks=w,this.request=this.fetchSetup(T,m),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){v.abortInternal(),w.onTimeout(b,T,v.response)},A.timeout),self.fetch(this.request).then(function(_){if(v.response=v.loader=_,!_.ok){var k=_.status,F=_.statusText;throw new i(F||"fetch, bad network response",k,_)}return b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(_.headers.get("Content-Length")||"0"),f&&Object(X.isFiniteNumber)(A.highWaterMark)?v.loadProgressively(_,b,T,A.highWaterMark,f):O?_.arrayBuffer():_.text()}).then(function(_){var k=v.response;self.clearTimeout(v.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=_[E];var F={url:k.url,data:_};f&&!Object(X.isFiniteNumber)(A.highWaterMark)&&f(b,T,_,k),w.onSuccess(F,b,T,k)}).catch(function(_){if(self.clearTimeout(v.requestTimeout),b.aborted)return;var k=_.code||0;w.onError({code:k,text:_.message},T,_.details)})},S.getCacheAge=function(){var T=null;if(this.response){var A=this.response.headers.get("age");T=A?parseFloat(A):null}return T},S.loadProgressively=function(T,A,w,v,b){v===void 0&&(v=0);var m=new C.default,f=T.body.getReader(),O=function E(){return f.read().then(function(_){if(_.done)return m.dataLength&&b(A,w,m.flush(),T),Promise.resolve(new ArrayBuffer(0));var k=_.value,F=k.length;return A.loaded+=F,F<v||m.dataLength?(m.push(k),m.dataLength>=v&&b(A,w,m.flush(),T)):b(A,w,k,T),E()}).catch(function(){return Promise.reject()})};return O()},s}();function r(s,S){var x={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(c({},s.headers))};return s.rangeEnd&&x.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),x}function a(s,S){return new self.Request(s.url,S)}var i=function(s){B(S,s);function S(x,T,A){var w;return w=s.call(this,x)||this,w.code=void 0,w.details=void 0,w.code=T,w.details=A,w}return S}(M(Error));z.default=d},"./src/utils/imsc1-ttml-parser.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"IMSC1_CODEC",function(){return g}),P.d(z,"parseIMSC1",function(){return o});var X=P("./src/utils/mp4-tools.ts"),N=P("./src/utils/vttparser.ts"),C=P("./src/utils/vttcue.ts"),B=P("./src/demux/id3.ts"),M=P("./src/utils/timescale-conversion.ts"),n=P("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(v){for(var b=1;b<arguments.length;b++){var m=arguments[b];for(var f in m)Object.prototype.hasOwnProperty.call(m,f)&&(v[f]=m[f])}return v},D.apply(this,arguments)}var g="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,h=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(v,b,m,f,O){var E=Object(X.findBox)(new Uint8Array(v),["mdat"]);if(E.length===0){O(new Error("Could not parse IMSC1 mdat"));return}var _=E[0],k=Object(B.utf8ArrayToStr)(new Uint8Array(v,_.start,_.end-_.start)),F=Object(M.toTimescaleFromScale)(b,1,m);try{f(d(k,F))}catch(L){O(L)}}function d(v,b){var m=new DOMParser,f=m.parseFromString(v,"text/xml"),O=f.getElementsByTagName("tt")[0];if(!O)throw new Error("Invalid ttml");var E={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},_=Object.keys(E).reduce(function(j,R){return j[R]=O.getAttribute("ttp:"+R)||E[R],j},{}),k=O.getAttribute("xml:space")!=="preserve",F=a(r(O,"styling","style")),L=a(r(O,"layout","region")),G=r(O,"body","[begin]");return[].map.call(G,function(j){var R=i(j,k);if(!R||!j.hasAttribute("begin"))return null;var V=T(j.getAttribute("begin"),_),ne=T(j.getAttribute("dur"),_),se=T(j.getAttribute("end"),_);if(V===null)throw x(j);if(se===null){if(ne===null)throw x(j);se=V+ne}var Se=new C.default(V-b,se-b,R);Se.id=Object(n.generateCueId)(Se.startTime,Se.endTime,Se.text);var De=L[j.getAttribute("region")],Ae=F[j.getAttribute("style")];Se.position=10,Se.size=80;var ke=s(De,Ae),je=ke.textAlign;if(je){var Be=c[je];Be&&(Se.lineAlign=Be),Se.align=je}return D(Se,ke),Se}).filter(function(j){return j!==null})}function r(v,b,m){var f=v.getElementsByTagName(b)[0];return f?[].slice.call(f.querySelectorAll(m)):[]}function a(v){return v.reduce(function(b,m){var f=m.getAttribute("xml:id");return f&&(b[f]=m),b},{})}function i(v,b){return[].slice.call(v.childNodes).reduce(function(m,f,O){var E;return f.nodeName==="br"&&O?m+`
|
|
`:(E=f.childNodes)!==null&&E!==void 0&&E.length?i(f,b):b?m+f.textContent.trim().replace(/\s+/g," "):m+f.textContent},"")}function s(v,b){var m="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(O,E){var _=S(b,m,E)||S(v,m,E);return _&&(O[E]=_),O},{})}function S(v,b,m){return v.hasAttributeNS(b,m)?v.getAttributeNS(b,m):null}function x(v){return new Error("Could not parse ttml timestamp "+v)}function T(v,b){if(!v)return null;var m=Object(N.parseTimeStamp)(v);return m===null&&(p.test(v)?m=A(v,b):h.test(v)&&(m=w(v,b))),m}function A(v,b){var m=p.exec(v),f=(m[4]|0)+(m[5]|0)/b.subFrameRate;return(m[1]|0)*3600+(m[2]|0)*60+(m[3]|0)+f/b.frameRate}function w(v,b){var m=h.exec(v),f=Number(m[1]),O=m[2];switch(O){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/b.frameRate;case"t":return f/b.tickRate}return f}},"./src/utils/logger.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"enableLogs",function(){return n}),P.d(z,"logger",function(){return D});var X=function(){},N={trace:X,debug:X,log:X,warn:X,info:X,error:X},C=N;function B(g){var p=self.console[g];return p?p.bind(self.console,"["+g+"] >"):X}function M(g){for(var p=arguments.length,h=new Array(p>1?p-1:0),c=1;c<p;c++)h[c-1]=arguments[c];h.forEach(function(o){C[o]=g[o]?g[o].bind(g):B(o)})}function n(g){if(self.console&&g===!0||typeof g=="object"){M(g,"debug","log","info","warn","error");try{C.log()}catch(p){C=N}}else C=N}var D=C},"./src/utils/mediakeys-helper.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"KeySystems",function(){return X}),P.d(z,"requestMediaKeySystemAccess",function(){return N});var X;(function(C){C.WIDEVINE="com.widevine.alpha",C.PLAYREADY="com.microsoft.playready"})(X||(X={}));var N=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"getMediaSource",function(){return X});function X(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"bin2str",function(){return M}),P.d(z,"readUint16",function(){return n}),P.d(z,"readUint32",function(){return D}),P.d(z,"writeUint32",function(){return g}),P.d(z,"findBox",function(){return p}),P.d(z,"parseSegmentIndex",function(){return h}),P.d(z,"parseInitSegment",function(){return c}),P.d(z,"getStartDTS",function(){return o}),P.d(z,"getDuration",function(){return d}),P.d(z,"computeRawDurationFromSamples",function(){return r}),P.d(z,"offsetStartDTS",function(){return a}),P.d(z,"segmentValidRange",function(){return i}),P.d(z,"appendUint8Array",function(){return s});var X=P("./src/utils/typed-array.ts"),N=P("./src/loader/fragment.ts"),C=Math.pow(2,32)-1,B=[].push;function M(S){return String.fromCharCode.apply(null,S)}function n(S,x){"data"in S&&(x+=S.start,S=S.data);var T=S[x]<<8|S[x+1];return T<0?65536+T:T}function D(S,x){"data"in S&&(x+=S.start,S=S.data);var T=S[x]<<24|S[x+1]<<16|S[x+2]<<8|S[x+3];return T<0?4294967296+T:T}function g(S,x,T){"data"in S&&(x+=S.start,S=S.data),S[x]=T>>24,S[x+1]=T>>16&255,S[x+2]=T>>8&255,S[x+3]=T&255}function p(S,x){var T=[];if(!x.length)return T;var A,w,v;"data"in S?(A=S.data,w=S.start,v=S.end):(A=S,w=0,v=A.byteLength);for(var b=w;b<v;){var m=D(A,b),f=M(A.subarray(b+4,b+8)),O=m>1?b+m:v;if(f===x[0])if(x.length===1)T.push({data:A,start:b+8,end:O});else{var E=p({data:A,start:b+8,end:O},x.slice(1));E.length&&B.apply(T,E)}b=O}return T}function h(S){var x=p(S,["moov"]),T=x[0],A=T?T.end:null,w=p(S,["sidx"]);if(!w||!w[0])return null;var v=[],b=w[0],m=b.data[0],f=m===0?8:16,O=D(b,f);f+=4;var E=0,_=0;m===0?f+=8:f+=16,f+=2;var k=b.end+_,F=n(b,f);f+=2;for(var L=0;L<F;L++){var G=f,j=D(b,G);G+=4;var R=j&2147483647,V=(j&2147483648)>>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ne=D(b,G);G+=4,v.push({referenceSize:R,subsegmentDuration:ne,info:{duration:ne/O,start:k,end:k+R-1}}),k+=R,G+=4,f=G}return{earliestPresentationTime:E,timescale:O,version:m,referencesCount:F,references:v,moovEndOffset:A}}function c(S){for(var x=[],T=p(S,["moov","trak"]),A=0;A<T.length;A++){var w=T[A],v=p(w,["tkhd"])[0];if(v){var b=v.data[v.start],m=b===0?12:20,f=D(v,m),O=p(w,["mdia","mdhd"])[0];if(O){b=O.data[O.start],m=b===0?12:20;var E=D(O,m),_=p(w,["mdia","hdlr"])[0];if(_){var k=M(_.data.subarray(_.start+8,_.start+12)),F={soun:N.ElementaryStreamTypes.AUDIO,vide:N.ElementaryStreamTypes.VIDEO}[k];if(F){var L=p(w,["mdia","minf","stbl","stsd"])[0],G=void 0;L&&(G=M(L.data.subarray(L.start+12,L.start+16))),x[f]={timescale:E,type:F},x[F]={timescale:E,id:f,codec:G}}}}}}var j=p(S,["moov","mvex","trex"]);return j.forEach(function(R){var V=D(R,4),ne=x[V];ne&&(ne.default={duration:D(R,12),flags:D(R,20)})}),x}function o(S,x){return p(x,["moof","traf"]).reduce(function(T,A){var w=p(A,["tfdt"])[0],v=w.data[w.start],b=p(A,["tfhd"]).reduce(function(m,f){var O=D(f,4),E=S[O];if(E){var _=D(w,4);v===1&&(_*=Math.pow(2,32),_+=D(w,8));var k=E.timescale||9e4,F=_/k;if(isFinite(F)&&(m===null||F<m))return F}return m},null);return b!==null&&isFinite(b)&&(T===null||b<T)?b:T},null)||0}function d(S,x){for(var T=0,A=0,w=0,v=p(S,["moof","traf"]),b=0;b<v.length;b++){var m=v[b],f=p(m,["tfhd"])[0],O=D(f,4),E=x[O];if(!E)continue;var _=E.default,k=D(f,0)|(_==null?void 0:_.flags),F=_==null?void 0:_.duration;k&8&&(k&2?F=D(f,12):F=D(f,8));for(var L=E.timescale||9e4,G=p(m,["trun"]),j=0;j<G.length;j++){if(F){var R=D(G[j],4);T=F*R}else T=r(G[j]);E.type===N.ElementaryStreamTypes.VIDEO?A+=T/L:E.type===N.ElementaryStreamTypes.AUDIO&&(w+=T/L)}}if(A===0&&w===0){var V=h(S);if(V!=null&&V.references)return V.references.reduce(function(ne,se){return ne+se.info.duration||0},0)}return A||w}function r(S){var x=D(S,0),T=8;x&1&&(T+=4),x&4&&(T+=4);for(var A=0,w=D(S,4),v=0;v<w;v++){if(x&256){var b=D(S,T);A+=b,T+=4}x&512&&(T+=4),x&1024&&(T+=4),x&2048&&(T+=4)}return A}function a(S,x,T){p(x,["moof","traf"]).forEach(function(A){p(A,["tfhd"]).forEach(function(w){var v=D(w,4),b=S[v];if(!b)return;var m=b.timescale||9e4;p(A,["tfdt"]).forEach(function(f){var O=f.data[f.start],E=D(f,4);if(O===0)g(f,4,E-T*m);else{E*=Math.pow(2,32),E+=D(f,8),E-=T*m,E=Math.max(E,0);var _=Math.floor(E/(C+1)),k=Math.floor(E%(C+1));g(f,4,_),g(f,8,k)}})})})}function i(S){var x={valid:null,remainder:null},T=p(S,["moof"]);if(T){if(T.length<2)return x.remainder=S,x}else return x;var A=T[T.length-1];return x.valid=Object(X.sliceUint8)(S,0,A.start-8),x.remainder=Object(X.sliceUint8)(S,A.start-8),x}function s(S,x){var T=new Uint8Array(S.length+x.length);return T.set(S),T.set(x,S.length),T}},"./src/utils/output-filter.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"default",function(){return X});var X=function(){function N(B,M){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=B,this.trackName=M}var C=N.prototype;return C.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},C.newCue=function(M,n,D){(this.startTime===null||this.startTime>M)&&(this.startTime=M),this.endTime=n,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},C.reset=function(){this.cueRanges=[]},N}()},"./src/utils/texttrack-utils.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"sendAddTrackEvent",function(){return N}),P.d(z,"addCueToTrack",function(){return C}),P.d(z,"clearCurrentCues",function(){return B}),P.d(z,"removeCuesInRange",function(){return M}),P.d(z,"getCuesInRange",function(){return D});var X=P("./src/utils/logger.ts");function N(g,p){var h;try{h=new Event("addtrack")}catch(c){h=document.createEvent("Event"),h.initEvent("addtrack",!1,!1)}h.track=g,p.dispatchEvent(h)}function C(g,p){var h=g.mode;if(h==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(p.id))try{if(g.addCue(p),!g.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(o){X.logger.debug("[texttrack-utils]: "+o);var c=new self.TextTrackCue(p.startTime,p.endTime,p.text);c.id=p.id,g.addCue(c)}h==="disabled"&&(g.mode=h)}function B(g){var p=g.mode;if(p==="disabled"&&(g.mode="hidden"),g.cues)for(var h=g.cues.length;h--;)g.removeCue(g.cues[h]);p==="disabled"&&(g.mode=p)}function M(g,p,h){var c=g.mode;if(c==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var o=D(g.cues,p,h),d=0;d<o.length;d++)g.removeCue(o[d]);c==="disabled"&&(g.mode=c)}function n(g,p){if(p<g[0].startTime)return 0;var h=g.length-1;if(p>g[h].endTime)return-1;for(var c=0,o=h;c<=o;){var d=Math.floor((o+c)/2);if(p<g[d].startTime)o=d-1;else if(p>g[d].startTime&&c<h)c=d+1;else return d}return g[c].startTime-p<p-g[o].startTime?c:o}function D(g,p,h){var c=[],o=n(g,p);if(o>-1)for(var d=o,r=g.length;d<r;d++){var a=g[d];if(a.startTime>=p&&a.endTime<=h)c.push(a);else if(a.startTime>h)return c}return c}},"./src/utils/time-ranges.ts":function(J,z,P){"use strict";P.r(z);var X={toString:function(C){for(var B="",M=C.length,n=0;n<M;n++)B+="["+C.start(n).toFixed(3)+","+C.end(n).toFixed(3)+"]";return B}};z.default=X},"./src/utils/timescale-conversion.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"toTimescaleFromBase",function(){return N}),P.d(z,"toTimescaleFromScale",function(){return C}),P.d(z,"toMsFromMpegTsClock",function(){return B}),P.d(z,"toMpegTsClockFromTimescale",function(){return M});var X=9e4;function N(n,D,g,p){g===void 0&&(g=1),p===void 0&&(p=!1);var h=n*D*g;return p?Math.round(h):h}function C(n,D,g,p){return g===void 0&&(g=1),p===void 0&&(p=!1),N(n,D,1/g,p)}function B(n,D){return D===void 0&&(D=!1),N(n,1e3,1/X,D)}function M(n,D){return D===void 0&&(D=1),N(n,X,1/D)}},"./src/utils/typed-array.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"sliceUint8",function(){return X});function X(N,C,B){return Uint8Array.prototype.slice?N.slice(C,B):new Uint8Array(Array.prototype.slice.call(N,C,B))}},"./src/utils/vttcue.ts":function(J,z,P){"use strict";P.r(z),z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var X=["","lr","rl"],N=["start","middle","end","left","right"];function C(g,p){if(typeof p!="string")return!1;if(!Array.isArray(g))return!1;var h=p.toLowerCase();return~g.indexOf(h)?h:!1}function B(g){return C(X,g)}function M(g){return C(N,g)}function n(g){for(var p=arguments.length,h=new Array(p>1?p-1:0),c=1;c<p;c++)h[c-1]=arguments[c];for(var o=1;o<arguments.length;o++){var d=arguments[o];for(var r in d)g[r]=d[r]}return g}function D(g,p,h){var c=this,o={enumerable:!0};c.hasBeenReset=!1;var d="",r=!1,a=g,i=p,s=h,S=null,x="",T=!0,A="auto",w="start",v=50,b="middle",m=50,f="middle";Object.defineProperty(c,"id",n({},o,{get:function(){return d},set:function(E){d=""+E}})),Object.defineProperty(c,"pauseOnExit",n({},o,{get:function(){return r},set:function(E){r=!!E}})),Object.defineProperty(c,"startTime",n({},o,{get:function(){return a},set:function(E){if(typeof E!="number")throw new TypeError("Start time must be set to a number.");a=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},o,{get:function(){return i},set:function(E){if(typeof E!="number")throw new TypeError("End time must be set to a number.");i=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},o,{get:function(){return s},set:function(E){s=""+E,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},o,{get:function(){return S},set:function(E){S=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},o,{get:function(){return x},set:function(E){var _=B(E);if(_===!1)throw new SyntaxError("An invalid or illegal string was specified.");x=_,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},o,{get:function(){return T},set:function(E){T=!!E,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},o,{get:function(){return A},set:function(E){if(typeof E!="number"&&E!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");A=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},o,{get:function(){return w},set:function(E){var _=M(E);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");w=_,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},o,{get:function(){return v},set:function(E){if(E<0||E>100)throw new Error("Position must be between 0 and 100.");v=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",n({},o,{get:function(){return b},set:function(E){var _=M(E);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");b=_,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},o,{get:function(){return m},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");m=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},o,{get:function(){return f},set:function(E){var _=M(E);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");f=_,this.hasBeenReset=!0}})),c.displayState=void 0}return D.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"parseTimeStamp",function(){return C}),P.d(z,"fixLineBreaks",function(){return p}),P.d(z,"VTTParser",function(){return h});var X=P("./src/utils/vttcue.ts"),N=function(){function c(){}var o=c.prototype;return o.decode=function(r,a){if(!r)return"";if(typeof r!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(r))},c}();function C(c){function o(r,a,i,s){return(r|0)*3600+(a|0)*60+(i|0)+parseFloat(s||0)}var d=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?o(d[2],d[3],0,d[4]):o(d[1],d[2],d[3],d[4]):null}var B=function(){function c(){this.values=Object.create(null)}var o=c.prototype;return o.set=function(r,a){!this.get(r)&&a!==""&&(this.values[r]=a)},o.get=function(r,a,i){return i?this.has(r)?this.values[r]:a[i]:this.has(r)?this.values[r]:a},o.has=function(r){return r in this.values},o.alt=function(r,a,i){for(var s=0;s<i.length;++s)if(a===i[s]){this.set(r,a);break}},o.integer=function(r,a){/^-?\d+$/.test(a)&&this.set(r,parseInt(a,10))},o.percent=function(r,a){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(a)){var i=parseFloat(a);if(i>=0&&i<=100)return this.set(r,i),!0}return!1},c}();function M(c,o,d,r){var a=r?c.split(r):[c];for(var i in a){if(typeof a[i]!="string")continue;var s=a[i].split(d);if(s.length!==2)continue;var S=s[0],x=s[1];o(S,x)}}var n=new X.default(0,0,""),D=n.align==="middle"?"middle":"center";function g(c,o,d){var r=c;function a(){var S=C(c);if(S===null)throw new Error("Malformed timestamp: "+r);return c=c.replace(/^[^\sa-zA-Z-]+/,""),S}function i(S,x){var T=new B;M(S,function(v,b){var m;switch(v){case"region":for(var f=d.length-1;f>=0;f--)if(d[f].id===b){T.set(v,d[f].region);break}break;case"vertical":T.alt(v,b,["rl","lr"]);break;case"line":m=b.split(","),T.integer(v,m[0]),T.percent(v,m[0])&&T.set("snapToLines",!1),T.alt(v,m[0],["auto"]),m.length===2&&T.alt("lineAlign",m[1],["start",D,"end"]);break;case"position":m=b.split(","),T.percent(v,m[0]),m.length===2&&T.alt("positionAlign",m[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":T.percent(v,b);break;case"align":T.alt(v,b,["start",D,"end","left","right"]);break}},/:/,/\s/),x.region=T.get("region",null),x.vertical=T.get("vertical","");var A=T.get("line","auto");A==="auto"&&n.line===-1&&(A=-1),x.line=A,x.lineAlign=T.get("lineAlign","start"),x.snapToLines=T.get("snapToLines",!0),x.size=T.get("size",100),x.align=T.get("align",D);var w=T.get("position","auto");w==="auto"&&n.position===50&&(w=x.align==="start"||x.align==="left"?0:x.align==="end"||x.align==="right"?100:50),x.position=w}function s(){c=c.replace(/^\s+/,"")}if(s(),o.startTime=a(),s(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+r);c=c.substr(3),s(),o.endTime=a(),s(),i(c,o)}function p(c){return c.replace(/<br(?: \/)?>/gi,`
|
|
`)}var h=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new N,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=c.prototype;return o.parse=function(r){var a=this;r&&(a.buffer+=a.decoder.decode(r,{stream:!0}));function i(){var w=a.buffer,v=0;for(w=p(w);v<w.length&&w[v]!=="\r"&&w[v]!==`
|
|
`;)++v;var b=w.substr(0,v);return w[v]==="\r"&&++v,w[v]===`
|
|
`&&++v,a.buffer=w.substr(v),b}function s(w){M(w,function(v,b){},/:/)}try{var S="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;S=i();var x=S.match(/^()?WEBVTT([ \t].*)?$/);if(!x||!x[0])throw new Error("Malformed WebVTT signature.");a.state="HEADER"}for(var T=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;T?T=!1:S=i();switch(a.state){case"HEADER":/:/.test(S)?s(S):S||(a.state="ID");continue;case"NOTE":S||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){a.state="NOTE";break}if(!S)continue;if(a.cue=new X.default(0,0,""),a.state="CUE",S.indexOf("-->")===-1){a.cue.id=S;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{g(S,a.cue,a.regionList)}catch(w){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var A=S.indexOf("-->")!==-1;if(!S||A&&(T=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=`
|
|
`),a.cue.text+=S}continue;case"BADCUE":S||(a.state="ID")}}}catch(w){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var r=this;try{if((r.cue||r.state==="HEADER")&&(r.buffer+=`
|
|
|
|
`,r.parse()),r.state==="INITIAL"||r.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){r.onparsingerror&&r.onparsingerror(a)}return r.onflush&&r.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(J,z,P){"use strict";P.r(z),P.d(z,"generateCueId",function(){return h}),P.d(z,"parseWebVTT",function(){return o});var X=P("./src/polyfills/number.ts"),N=P("./src/utils/vttparser.ts"),C=P("./src/demux/id3.ts"),B=P("./src/utils/timescale-conversion.ts"),M=P("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,D=function(r,a,i){return i===void 0&&(i=0),r.substr(i,a.length)===a},g=function(r){var a=parseInt(r.substr(-3)),i=parseInt(r.substr(-6,2)),s=parseInt(r.substr(-9,2)),S=r.length>9?parseInt(r.substr(0,r.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(i)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+r);return a+=1e3*i,a+=60*1e3*s,a+=60*60*1e3*S,a},p=function(r){for(var a=5381,i=r.length;i;)a=a*33^r.charCodeAt(--i);return(a>>>0).toString()};function h(d,r,a){return p(d.toString())+p(r.toString())+p(a)}var c=function(r,a,i){var s=r[a],S=r[s.prevCC];if(!S||!S.new&&s.new){r.ccOffset=r.presentationOffset=s.start,s.new=!1;return}for(;(x=S)!==null&&x!==void 0&&x.new;){var x;r.ccOffset+=s.start-S.start,s.new=!1,s=S,S=r[s.prevCC]}r.presentationOffset=i};function o(d,r,a,i,s,S,x,T){var A=new N.VTTParser,w=Object(C.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(n,`
|
|
`).split(`
|
|
`),v=[],b=Object(B.toMpegTsClockFromTimescale)(r,a),m="00:00.000",f=0,O=0,E,_=!0,k=!1;A.oncue=function(F){var L=i[s],G=i.ccOffset,j=(f-b)/9e4;if(L!=null&&L.new&&(O!==void 0?G=i.ccOffset=L.start:c(i,s,j)),j&&(G=j-i.presentationOffset),k){var R=F.endTime-F.startTime,V=Object(M.normalizePts)((F.startTime+G-O)*9e4,S*9e4)/9e4;F.startTime=V,F.endTime=V+R}var ne=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(ne)),F.id||(F.id=h(F.startTime,F.endTime,ne)),F.endTime>0&&v.push(F)},A.onparsingerror=function(F){E=F},A.onflush=function(){if(E){T(E);return}x(v)},w.forEach(function(F){if(_)if(D(F,"X-TIMESTAMP-MAP=")){_=!1,k=!0,F.substr(16).split(",").forEach(function(L){D(L,"LOCAL:")?m=L.substr(6):D(L,"MPEGTS:")&&(f=parseInt(L.substr(7)))});try{O=g(m)/1e3}catch(L){k=!1,E=L}return}else F===""&&(_=!1);A.parse(F+`
|
|
`)}),A.flush()}},"./src/utils/xhr-loader.ts":function(J,z,P){"use strict";P.r(z);var X=P("./src/utils/logger.ts"),N=P("./src/loader/load-stats.ts"),C=/^age:\s*[\d.]+\s*$/m,B=function(){function M(D){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=D?D.xhrSetup:null,this.stats=new N.LoadStats,this.retryDelay=0}var n=M.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},n.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(g,p,h){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=p,this.callbacks=h,this.retryDelay=p.retryDelay,this.loadInternal()},n.loadInternal=function(){var g=this.config,p=this.context;if(!g)return;var h=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var o=this.xhrSetup;try{if(o)try{o(h,p.url)}catch(a){h.open("GET",p.url,!0),o(h,p.url)}h.readyState||h.open("GET",p.url,!0);var d=this.context.headers;if(d)for(var r in d)h.setRequestHeader(r,d[r])}catch(a){this.callbacks.onError({code:h.status,text:a.message},p,h);return}p.rangeEnd&&h.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),h.onreadystatechange=this.readystatechange.bind(this),h.onprogress=this.loadprogress.bind(this),h.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),h.send()},n.readystatechange=function(){var g=this.context,p=this.loader,h=this.stats;if(!g||!p)return;var c=p.readyState,o=this.config;if(h.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),h.loading.first===0&&(h.loading.first=Math.max(self.performance.now(),h.loading.start)),c===4){p.onreadystatechange=null,p.onprogress=null;var d=p.status;if(d>=200&&d<300){h.loading.end=Math.max(self.performance.now(),h.loading.first);var r,a;if(g.responseType==="arraybuffer"?(r=p.response,a=r.byteLength):(r=p.responseText,a=r.length),h.loaded=h.total=a,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(h,g,r,p),!this.callbacks)return;var s={url:p.responseURL,data:r};this.callbacks.onSuccess(s,h,g,p)}else h.retry>=o.maxRetry||d>=400&&d<499?(X.logger.error(d+" while loading "+g.url),this.callbacks.onError({code:d,text:p.statusText},g,p)):(X.logger.warn(d+" while loading "+g.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,o.maxRetryDelay),h.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},n.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(g){var p=this.stats;p.loaded=g.loaded,g.lengthComputable&&(p.total=g.total)},n.getCacheAge=function(){var g=null;if(this.loader&&C.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");g=p?parseFloat(p):null}return g},M}();z.default=B}}).default})},vHTk:function(He,pe,I){He.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vef1:function(He,pe,I){He.exports={upload:"upload___3GNI5"}},wCXF:function(He,pe,I){"use strict";I.d(pe,"a",function(){return st});var J=I("rePB"),z=I("VTBJ"),P=I("KQm4"),X=I("U8pU"),N=I("ODXe"),C=I("q1tI"),B=I("TSYQ"),M=I.n(B),n=I("Gytx"),D=I.n(n),g=I("Kwbf"),p=I("t23M"),h=I("qx4F"),c=I("6eGT"),o=I("IBYe"),d=I("Ff2n"),r=I("c+Xe"),a=I("fyJ8"),i=I("biw7");function s(Fe,Ue,it,lt,fe){var ie=it[Fe]||{},re=it[Ue]||{},de,me;ie.fixed==="left"?de=lt.left[Fe]:re.fixed==="right"&&(me=lt.right[Ue]);var le=!1,he=!1,Ee=!1,ye=!1,Le=it[Ue+1],Ne=it[Fe-1];if(fe==="rtl"){if(de!==void 0){var tt=Ne&&Ne.fixed==="left";ye=!tt}else if(me!==void 0){var gt=Le&&Le.fixed==="right";Ee=!gt}}else if(de!==void 0){var Ct=Le&&Le.fixed==="left";le=!Ct}else if(me!==void 0){var Ot=Ne&&Ne.fixed==="right";he=!Ot}return{fixLeft:de,fixRight:me,lastFixLeft:le,firstFixRight:he,lastFixRight:Ee,firstFixLeft:ye,isSticky:lt.isSticky}}var S=I("sR1s");function x(Fe){var Ue=Fe.cells,it=Fe.stickyOffsets,lt=Fe.flattenColumns,fe=Fe.rowComponent,ie=Fe.cellComponent,re=Fe.onHeaderRow,de=Fe.index,me=C.useContext(i.a),le=me.prefixCls,he=me.direction,Ee;re&&(Ee=re(Ue.map(function(Le){return Le.column}),de));var ye=Object(S.a)(Ue.map(function(Le){return Le.column}));return C.createElement(fe,Object.assign({},Ee),Ue.map(function(Le,Ne){var tt=Le.column,gt=s(Le.colStart,Le.colEnd,lt,it,he),Ct;return tt&&tt.onHeaderCell&&(Ct=Le.column.onHeaderCell(tt)),C.createElement(a.a,Object.assign({},Le,{ellipsis:tt.ellipsis,align:tt.align,component:ie,prefixCls:le,key:ye[Ne]},gt,{additionalProps:Ct,rowType:"header"}))}))}x.displayName="HeaderRow";var T=x;function A(Fe){var Ue=[];function it(re,de){var me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ue[me]=Ue[me]||[];var le=de,he=re.filter(Boolean).map(function(Ee){var ye={key:Ee.key,className:Ee.className||"",children:Ee.title,column:Ee,colStart:le},Le=1,Ne=Ee.children;return Ne&&Ne.length>0&&(Le=it(Ne,le,me+1).reduce(function(tt,gt){return tt+gt},0),ye.hasSubColumns=!0),"colSpan"in Ee&&(Le=Ee.colSpan),"rowSpan"in Ee&&(ye.rowSpan=Ee.rowSpan),ye.colSpan=Le,ye.colEnd=ye.colStart+Le-1,Ue[me].push(ye),le+=Le,Le});return he}it(Fe,0);for(var lt=Ue.length,fe=function(de){Ue[de].forEach(function(me){!("rowSpan"in me)&&!me.hasSubColumns&&(me.rowSpan=lt-de)})},ie=0;ie<lt;ie+=1)fe(ie);return Ue}function w(Fe){var Ue=Fe.stickyOffsets,it=Fe.columns,lt=Fe.flattenColumns,fe=Fe.onHeaderRow,ie=C.useContext(i.a),re=ie.prefixCls,de=ie.getComponent,me=C.useMemo(function(){return A(it)},[it]),le=de(["header","wrapper"],"thead"),he=de(["header","row"],"tr"),Ee=de(["header","cell"],"th");return C.createElement(le,{className:"".concat(re,"-thead")},me.map(function(ye,Le){var Ne=C.createElement(T,{key:Le,flattenColumns:lt,cells:ye,stickyOffsets:Ue,rowComponent:he,cellComponent:Ee,onHeaderRow:fe,index:Le});return Ne}))}var v=w,b=I("hW8S");function m(Fe){for(var Ue=Fe.colWidths,it=Fe.columns,lt=Fe.columCount,fe=[],ie=lt||it.length,re=!1,de=ie-1;de>=0;de-=1){var me=Ue[de],le=it&&it[de],he=le&&le[b.a];(me||he||re)&&(fe.unshift(C.createElement("col",Object.assign({key:de,style:{width:me,minWidth:me}},he))),re=!0)}return C.createElement("colgroup",null,fe)}var f=m;function O(Fe,Ue){return Object(C.useMemo)(function(){for(var it=[],lt=0;lt<Ue;lt+=1){var fe=Fe[lt];if(fe!==void 0)it[lt]=fe;else return null}return it},[Fe.join("_"),Ue])}var E=C.forwardRef(function(Fe,Ue){var it=Fe.noData,lt=Fe.columns,fe=Fe.flattenColumns,ie=Fe.colWidths,re=Fe.columCount,de=Fe.stickyOffsets,me=Fe.direction,le=Fe.fixHeader,he=Fe.offsetHeader,Ee=Fe.stickyClassName,ye=Fe.onScroll,Le=Object(d.a)(Fe,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Ne=C.useContext(i.a),tt=Ne.prefixCls,gt=Ne.scrollbarSize,Ct=Ne.isSticky,Ot=Ct&&!le?0:gt,St=C.useRef(null),Ye=C.useCallback(function(Rt){Object(r.b)(Ue,Rt),Object(r.b)(St,Rt)},[]);C.useEffect(function(){var Rt;function Lt(et){var dt=et.currentTarget,vt=et.deltaX;vt&&(ye({currentTarget:dt,scrollLeft:dt.scrollLeft+vt}),et.preventDefault())}return(Rt=St.current)===null||Rt===void 0||Rt.addEventListener("wheel",Lt),function(){var et;(et=St.current)===null||et===void 0||et.removeEventListener("wheel",Lt)}},[]);var at=fe[fe.length-1],Ve={fixed:at?at.fixed:null,onHeaderCell:function(){return{className:"".concat(tt,"-cell-scrollbar")}}},be=Object(C.useMemo)(function(){return Ot?[].concat(Object(P.a)(lt),[Ve]):lt},[Ot,lt]),Ie=Object(C.useMemo)(function(){return Ot?[].concat(Object(P.a)(fe),[Ve]):fe},[Ot,fe]),ot=Object(C.useMemo)(function(){var Rt=de.right,Lt=de.left;return Object(z.a)(Object(z.a)({},de),{},{left:me==="rtl"?[].concat(Object(P.a)(Lt.map(function(et){return et+Ot})),[0]):Lt,right:me==="rtl"?Rt:[].concat(Object(P.a)(Rt.map(function(et){return et+Ot})),[0]),isSticky:Ct})},[Ot,de,Ct]),Xe=O(ie,re);return C.createElement("div",{style:Object(z.a)({overflow:"hidden"},Ct?{top:he}:{}),ref:Ye,className:M()("".concat(tt,"-header"),Object(J.a)({},Ee,!!Ee))},C.createElement("table",{style:{tableLayout:"fixed",visibility:it||Xe?null:"hidden"}},C.createElement(f,{colWidths:Xe?[].concat(Object(P.a)(Xe),[Ot]):[],columCount:re+1,columns:Ie}),C.createElement(v,Object.assign({},Le,{stickyOffsets:ot,columns:be,flattenColumns:Ie}))))});E.displayName="FixedHeader";var _=E,k=C.createContext(null),F=k;function L(Fe){var Ue=Fe.prefixCls,it=Fe.children,lt=Fe.component,fe=Fe.cellComponent,ie=Fe.fixHeader,re=Fe.fixColumn,de=Fe.horizonScroll,me=Fe.className,le=Fe.expanded,he=Fe.componentWidth,Ee=Fe.colSpan,ye=C.useContext(i.a),Le=ye.scrollbarSize;return C.useMemo(function(){var Ne=it;return re&&(Ne=C.createElement("div",{style:{width:he-(ie?Le:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Ue,"-expanded-row-fixed")},Ne)),C.createElement(lt,{className:me,style:{display:le?null:"none"}},C.createElement(a.a,{component:fe,prefixCls:Ue,colSpan:Ee},Ne))},[it,lt,ie,de,me,le,he,Ee,Le])}var G=L;function j(Fe){var Ue=Fe.className,it=Fe.style,lt=Fe.record,fe=Fe.index,ie=Fe.rowKey,re=Fe.getRowKey,de=Fe.rowExpandable,me=Fe.expandedKeys,le=Fe.onRow,he=Fe.indent,Ee=he===void 0?0:he,ye=Fe.rowComponent,Le=Fe.cellComponent,Ne=Fe.childrenColumnName,tt=C.useContext(i.a),gt=tt.prefixCls,Ct=tt.fixedInfoList,Ot=C.useContext(F),St=Ot.fixHeader,Ye=Ot.fixColumn,at=Ot.horizonScroll,Ve=Ot.componentWidth,be=Ot.flattenColumns,Ie=Ot.expandableType,ot=Ot.expandRowByClick,Xe=Ot.onTriggerExpand,Rt=Ot.rowClassName,Lt=Ot.expandedRowClassName,et=Ot.indentSize,dt=Ot.expandIcon,vt=Ot.expandedRowRender,Tt=Ot.expandIconColumnIndex,Pt=C.useState(!1),_e=Object(N.a)(Pt,2),ce=_e[0],W=_e[1],Y=me&&me.has(Fe.recordKey);C.useEffect(function(){Y&&W(!0)},[Y]);var $=Ie==="row"&&(!de||de(lt)),te=Ie==="nest",ve=Ne&<&<[Ne],Pe=$||te,Ge;le&&(Ge=le(lt,fe));var _t=function(pt){if(ot&&Pe&&Xe(lt,pt),Ge&&Ge.onClick){for(var Cn,ft=arguments.length,hn=new Array(ft>1?ft-1:0),pn=1;pn<ft;pn++)hn[pn-1]=arguments[pn];(Cn=Ge).onClick.apply(Cn,[pt].concat(hn))}},bt;typeof Rt=="string"?bt=Rt:typeof Rt=="function"&&(bt=Rt(lt,fe,Ee));var $e=Object(S.a)(be),At=C.createElement(ye,Object.assign({},Ge,{"data-row-key":ie,className:M()(Ue,"".concat(gt,"-row"),"".concat(gt,"-row-level-").concat(Ee),bt,Ge&&Ge.className),style:Object(z.a)(Object(z.a)({},it),Ge?Ge.style:null),onClick:_t}),be.map(function(Ut,pt){var Cn=Ut.render,ft=Ut.dataIndex,hn=Ut.className,pn=$e[pt],Yn=Ct[pt],ni;pt===(Tt||0)&&te&&(ni=C.createElement(C.Fragment,null,C.createElement("span",{style:{paddingLeft:"".concat(et*Ee,"px")},className:"".concat(gt,"-row-indent indent-level-").concat(Ee)}),dt({prefixCls:gt,expanded:Y,expandable:ve,record:lt,onExpand:Xe})));var En;return Ut.onCell&&(En=Ut.onCell(lt,fe)),C.createElement(a.a,Object.assign({className:hn,ellipsis:Ut.ellipsis,align:Ut.align,component:Le,prefixCls:gt,key:pn,record:lt,index:fe,dataIndex:ft,render:Cn,shouldCellUpdate:Ut.shouldCellUpdate},Yn,{appendNode:ni,additionalProps:En}))})),Jt;if($&&(ce||Y)){var Et=vt(lt,fe,Ee+1,Y),sn=Lt&&Lt(lt,fe,Ee);Jt=C.createElement(G,{expanded:Y,className:M()("".concat(gt,"-expanded-row"),"".concat(gt,"-expanded-row-level-").concat(Ee+1),sn),prefixCls:gt,fixHeader:St,fixColumn:Ye,horizonScroll:at,component:ye,componentWidth:Ve,cellComponent:Le,colSpan:be.length},Et)}var Yt;return ve&&Y&&(Yt=(lt[Ne]||[]).map(function(Ut,pt){var Cn=re(Ut,pt);return C.createElement(j,Object.assign({},Fe,{key:Cn,rowKey:Cn,record:Ut,recordKey:Cn,index:pt,indent:Ee+1}))})),C.createElement(C.Fragment,null,At,Jt,Yt)}j.displayName="BodyRow";var R=j,V=C.createContext(null),ne=V;function se(Fe){var Ue=Fe.columnKey,it=Fe.onColumnResize,lt=C.useRef();return C.useEffect(function(){lt.current&&it(Ue,lt.current.offsetWidth)},[]),C.createElement(p.a,{onResize:function(ie){var re=ie.offsetWidth;it(Ue,re)}},C.createElement("td",{ref:lt,style:{padding:0,border:0,height:0}},C.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function Se(Fe){var Ue=Fe.data,it=Fe.getRowKey,lt=Fe.measureColumnWidth,fe=Fe.expandedKeys,ie=Fe.onRow,re=Fe.rowExpandable,de=Fe.emptyNode,me=Fe.childrenColumnName,le=C.useContext(ne),he=le.onColumnResize,Ee=C.useContext(i.a),ye=Ee.prefixCls,Le=Ee.getComponent,Ne=C.useContext(F),tt=Ne.fixHeader,gt=Ne.horizonScroll,Ct=Ne.flattenColumns,Ot=Ne.componentWidth;return C.useMemo(function(){var St=Le(["body","wrapper"],"tbody"),Ye=Le(["body","row"],"tr"),at=Le(["body","cell"],"td"),Ve;Ue.length?Ve=Ue.map(function(Ie,ot){var Xe=it(Ie,ot);return C.createElement(R,{key:Xe,rowKey:Xe,record:Ie,recordKey:Xe,index:ot,rowComponent:Ye,cellComponent:at,expandedKeys:fe,onRow:ie,getRowKey:it,rowExpandable:re,childrenColumnName:me})}):Ve=C.createElement(G,{expanded:!0,className:"".concat(ye,"-placeholder"),prefixCls:ye,fixHeader:tt,fixColumn:gt,horizonScroll:gt,component:Ye,componentWidth:Ot,cellComponent:at,colSpan:Ct.length},de);var be=Object(S.a)(Ct);return C.createElement(St,{className:"".concat(ye,"-tbody")},lt&&C.createElement("tr",{"aria-hidden":"true",className:"".concat(ye,"-measure-row"),style:{height:0}},be.map(function(Ie){return C.createElement(se,{key:Ie,columnKey:Ie,onColumnResize:he})})),Ve)},[Ue,ye,ie,lt,fe,it,Le,Ot,de,Ct])}var De=C.memo(Se);De.displayName="Body";var Ae=De,ke=I("wRmb"),je=I("xEkU"),Be=I.n(je);function we(Fe){var Ue=Object(C.useRef)(Fe),it=Object(C.useState)({}),lt=Object(N.a)(it,2),fe=lt[1],ie=Object(C.useRef)(null),re=Object(C.useRef)([]);function de(me){ie.current===null&&(re.current=[],ie.current=Be()(function(){re.current.forEach(function(le){Ue.current=le(Ue.current)}),ie.current=null,fe({})})),re.current.push(me)}return Object(C.useEffect)(function(){return function(){Be.a.cancel(ie.current)}},[]),[Ue.current,de]}function Z(Fe){var Ue=Object(C.useRef)(Fe),it=Object(C.useRef)(null);function lt(){window.clearTimeout(it.current)}function fe(re){Ue.current=re,lt(),it.current=window.setTimeout(function(){Ue.current=null,it.current=null},100)}function ie(){return Ue.current}return Object(C.useEffect)(function(){return lt},[]),[fe,ie]}function U(Fe,Ue,it){var lt=Object(C.useMemo)(function(){for(var fe=[],ie=[],re=0,de=0,me=0;me<Ue;me+=1)if(it==="rtl"){ie[me]=de,de+=Fe[me]||0;var le=Ue-me-1;fe[le]=re,re+=Fe[le]||0}else{fe[me]=re,re+=Fe[me]||0;var he=Ue-me-1;ie[he]=de,de+=Fe[he]||0}return{left:fe,right:ie}},[Fe,Ue,it]);return lt}var K=U;function ee(Fe){var Ue=Fe.className,it=Fe.children;return C.createElement("div",{className:Ue},it)}var oe=ee,Q=I("n6Qo");function Ce(Fe){var Ue,it=Fe.prefixCls,lt=Fe.record,fe=Fe.onExpand,ie=Fe.expanded,re=Fe.expandable,de="".concat(it,"-row-expand-icon");if(!re)return C.createElement("span",{className:M()(de,"".concat(it,"-row-spaced"))});var me=function(he){fe(lt,he),he.stopPropagation()};return C.createElement("span",{className:M()(de,(Ue={},Object(J.a)(Ue,"".concat(it,"-row-expanded"),ie),Object(J.a)(Ue,"".concat(it,"-row-collapsed"),!ie),Ue)),onClick:me})}function ze(Fe,Ue,it){var lt=[];function fe(ie){(ie||[]).forEach(function(re,de){lt.push(Ue(re,de)),fe(re[it])})}return fe(Fe),lt}var nt=I("zT1h"),xe=I("y0+3"),Re=function(Ue,it){var lt,fe,ie=Ue.scrollBodyRef,re=Ue.onScroll,de=Ue.offsetScroll,me=C.useContext(i.a),le=me.prefixCls,he=((lt=ie.current)===null||lt===void 0?void 0:lt.scrollWidth)||0,Ee=((fe=ie.current)===null||fe===void 0?void 0:fe.clientWidth)||0,ye=he&&Ee*(Ee/he),Le=C.useRef(),Ne=we({scrollLeft:0,isHiddenScrollBar:!1}),tt=Object(N.a)(Ne,2),gt=tt[0],Ct=tt[1],Ot=C.useRef({delta:0,x:0}),St=C.useState(!1),Ye=Object(N.a)(St,2),at=Ye[0],Ve=Ye[1],be=function(){Ve(!1)},Ie=function(et){et.persist(),Ot.current.delta=et.pageX-gt.scrollLeft,Ot.current.x=0,Ve(!0),et.preventDefault()},ot=function(et){var dt,vt=et||((dt=window)===null||dt===void 0?void 0:dt.event),Tt=vt.buttons;if(!at||Tt===0){at&&Ve(!1);return}var Pt=Ot.current.x+et.pageX-Ot.current.x-Ot.current.delta;Pt<=0&&(Pt=0),Pt+ye>=Ee&&(Pt=Ee-ye),re({scrollLeft:Pt/Ee*(he+2)}),Ot.current.x=et.pageX},Xe=function(){var et=Object(xe.b)(ie.current).top,dt=et+ie.current.offsetHeight,vt=document.documentElement.scrollTop+window.innerHeight;dt-Object(h.a)()<=vt||et>=vt-de?Ct(function(Tt){return Object(z.a)(Object(z.a)({},Tt),{},{isHiddenScrollBar:!0})}):Ct(function(Tt){return Object(z.a)(Object(z.a)({},Tt),{},{isHiddenScrollBar:!1})})},Rt=function(et){Ct(function(dt){return Object(z.a)(Object(z.a)({},dt),{},{scrollLeft:et/he*Ee||0})})};return C.useImperativeHandle(it,function(){return{setScrollLeft:Rt}}),C.useEffect(function(){var Lt=Object(nt.a)(document.body,"mouseup",be,!1),et=Object(nt.a)(document.body,"mousemove",ot,!1);return Xe(),function(){Lt.remove(),et.remove()}},[ye,at]),C.useEffect(function(){var Lt=Object(nt.a)(window,"scroll",Xe,!1),et=Object(nt.a)(window,"resize",Xe,!1);return function(){Lt.remove(),et.remove()}},[]),C.useEffect(function(){gt.isHiddenScrollBar||Ct(function(Lt){var et,dt;return Object(z.a)(Object(z.a)({},Lt),{},{scrollLeft:ie.current.scrollLeft/((et=ie.current)===null||et===void 0?void 0:et.scrollWidth)*((dt=ie.current)===null||dt===void 0?void 0:dt.clientWidth)})})},[gt.isHiddenScrollBar]),he<=Ee||!ye||gt.isHiddenScrollBar?null:C.createElement("div",{style:{height:Object(h.a)(),width:Ee,bottom:de},className:"".concat(le,"-sticky-scroll")},C.createElement("div",{onMouseDown:Ie,ref:Le,className:M()("".concat(le,"-sticky-scroll-bar"),Object(J.a)({},"".concat(le,"-sticky-scroll-bar-active"),at)),style:{width:"".concat(ye,"px"),transform:"translate3d(".concat(gt.scrollLeft,"px, 0, 0)")}}))},Te=C.forwardRef(Re);function Oe(Fe,Ue){return C.useMemo(function(){var it=!!Fe;return{isSticky:it,stickyClassName:it?"".concat(Ue,"-sticky-header"):"",offsetHeader:Object(X.a)(Fe)==="object"&&Fe.offsetHeader||0,offsetScroll:Object(X.a)(Fe)==="object"&&Fe.offsetScroll||0}},[Fe,Ue])}var Ke=[],Qe={},st="rc-table-internal-hook",ut=C.memo(function(Fe){var Ue=Fe.children;return Ue},function(Fe,Ue){return D()(Fe.props,Ue.props)?Fe.pingLeft!==Ue.pingLeft||Fe.pingRight!==Ue.pingRight:!1});function xt(Fe){var Ue,it=Fe.prefixCls,lt=Fe.className,fe=Fe.rowClassName,ie=Fe.style,re=Fe.data,de=Fe.rowKey,me=Fe.scroll,le=Fe.tableLayout,he=Fe.direction,Ee=Fe.title,ye=Fe.footer,Le=Fe.summary,Ne=Fe.id,tt=Fe.showHeader,gt=Fe.components,Ct=Fe.emptyText,Ot=Fe.onRow,St=Fe.onHeaderRow,Ye=Fe.internalHooks,at=Fe.transformColumns,Ve=Fe.internalRefs,be=Fe.sticky,Ie=re||Ke,ot=!!Ie.length,Xe=C.useState(0),Rt=Object(N.a)(Xe,2),Lt=Rt[0],et=Rt[1];C.useEffect(function(){et(Object(h.a)())});var dt=C.useMemo(function(){return Object(S.c)(gt,{})},[gt]),vt=C.useCallback(function(Vt,Bt){return Object(S.b)(dt,Vt)||Bt},[dt]),Tt=C.useMemo(function(){return typeof de=="function"?de:function(Vt){var Bt=Vt&&Vt[de];return Bt}},[de]),Pt=Object(b.c)(Fe),_e=Pt.expandIcon,ce=Pt.expandedRowKeys,W=Pt.defaultExpandedRowKeys,Y=Pt.defaultExpandAllRows,$=Pt.expandedRowRender,te=Pt.onExpand,ve=Pt.onExpandedRowsChange,Pe=Pt.expandRowByClick,Ge=Pt.rowExpandable,_t=Pt.expandIconColumnIndex,bt=Pt.expandedRowClassName,$e=Pt.childrenColumnName,At=Pt.indentSize,Jt=_e||Ce,Et=$e||"children",sn=C.useMemo(function(){return $?"row":Fe.expandable&&Ye===st&&Fe.expandable.__PARENT_RENDER_ICON__||Ie.some(function(Vt){return Vt&&Object(X.a)(Vt)==="object"&&Vt[Et]})?"nest":!1},[!!$,Ie]),Yt=C.useState(function(){return W||(Y?ze(Ie,Tt,Et):[])}),Ut=Object(N.a)(Yt,2),pt=Ut[0],Cn=Ut[1],ft=C.useMemo(function(){return new Set(ce||pt||[])},[ce,pt]),hn=C.useCallback(function(Vt){var Bt=Tt(Vt,Ie.indexOf(Vt)),rt,mt=ft.has(Bt);mt?(ft.delete(Bt),rt=Object(P.a)(ft)):rt=[].concat(Object(P.a)(ft),[Bt]),Cn(rt),te&&te(!mt,Vt),ve&&ve(rt)},[Tt,ft,Ie,te,ve]),pn=C.useState(0),Yn=Object(N.a)(pn,2),ni=Yn[0],En=Yn[1],gi=Object(ke.b)(Object(z.a)(Object(z.a)(Object(z.a)({},Fe),Pt),{},{expandable:!!$,expandedKeys:ft,getRowKey:Tt,onTriggerExpand:hn,expandIcon:Jt,expandIconColumnIndex:_t,direction:he}),Ye===st?at:null),Jn=Object(N.a)(gi,2),An=Jn[0],Pn=Jn[1],Di=C.useMemo(function(){return{columns:An,flattenColumns:Pn}},[An,Pn]),Hi=C.useRef(),vi=C.useRef(),ii=C.useRef(),_i=C.useState(!1),Qi=Object(N.a)(_i,2),yi=Qi[0],ri=Qi[1],Pi=C.useState(!1),Li=Object(N.a)(Pi,2),Oi=Li[0],Si=Li[1],cr=we(new Map),_r=Object(N.a)(cr,2),rr=_r[0],Zi=_r[1],Ar=Object(S.a)(Pn),Nr=Ar.map(function(Vt){return rr.get(Vt)}),Ur=C.useMemo(function(){return Nr},[Nr.join("_")]),ar=K(Ur,Pn.length,he),pi=me&&Object(S.d)(me.y),ci=me&&Object(S.d)(me.x),Yi=ci&&Pn.some(function(Vt){var Bt=Vt.fixed;return Bt}),qi=C.useRef(),sr=Oe(be,it),er=sr.isSticky,zr=sr.offsetHeader,ea=sr.offsetScroll,tr=sr.stickyClassName,dr,Lr,Br;pi&&(Lr={overflowY:"scroll",maxHeight:me.y}),ci&&(dr={overflowX:"auto"},pi||(Lr={overflowY:"hidden"}),Br={width:me.x===!0?"auto":me.x,minWidth:"100%"});var Ir=C.useCallback(function(Vt,Bt){Zi(function(rt){var mt=new Map(rt);return mt.set(Vt,Bt),mt})},[]),br=Z(null),Vr=Object(N.a)(br,2),hr=Vr[0],Xr=Vr[1];function Yr(Vt,Bt){if(!Bt)return;typeof Bt=="function"?Bt(Vt):Bt.scrollLeft!==Vt&&(Bt.scrollLeft=Vt)}var or=function(Bt){var rt=Bt.currentTarget,mt=Bt.scrollLeft,en=typeof mt=="number"?mt:rt.scrollLeft,ct=rt||Qe;if(!Xr()||Xr()===ct){var tn;hr(ct),Yr(en,vi.current),Yr(en,ii.current),Yr(en,(tn=qi.current)===null||tn===void 0?void 0:tn.setScrollLeft)}if(rt){var Dt=rt.scrollWidth,on=rt.clientWidth;ri(en>0),Si(en<Dt-on)}},Jr=function(){ii.current&&or({currentTarget:ii.current})},rn=function(Bt){var rt=Bt.width;Jr(),En(Hi.current?Hi.current.offsetWidth:rt)};C.useEffect(function(){return Jr},[]),C.useEffect(function(){ci&&Jr()},[ci]),C.useEffect(function(){Ye===st&&Ve&&(Ve.body.current=ii.current)});var yn=vt(["table"],"table"),ln=C.useMemo(function(){return le||(Yi?me.x==="max-content"?"auto":"fixed":pi||Pn.some(function(Vt){var Bt=Vt.ellipsis;return Bt})?"fixed":"auto")},[pi,Yi,Pn,le]),In,Hn={colWidths:Ur,columCount:Pn.length,stickyOffsets:ar,onHeaderRow:St,fixHeader:pi},Zt=C.useMemo(function(){return ot?null:typeof Ct=="function"?Ct():Ct},[ot,Ct]),Dn=C.createElement(Ae,{data:Ie,measureColumnWidth:pi||ci||er,expandedKeys:ft,rowExpandable:Ge,getRowKey:Tt,onRow:Ot,emptyNode:Zt,childrenColumnName:Et}),bi=C.createElement(f,{colWidths:Pn.map(function(Vt){var Bt=Vt.width;return Bt}),columns:Pn}),Fi=Le&&C.createElement(Q.b,null,Le(Ie)),Fn=vt(["body"]);if(pi||er){var fr;typeof Fn=="function"?(fr=Fn(Ie,{scrollbarSize:Lt,ref:ii,onScroll:or}),Hn.colWidths=Pn.map(function(Vt,Bt){var rt=Vt.width,mt=Bt===An.length-1?rt-Lt:rt;return typeof mt=="number"&&!Number.isNaN(mt)?mt:(Object(g.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):fr=C.createElement("div",{style:Object(z.a)(Object(z.a)({},dr),Lr),onScroll:or,ref:ii,className:M()("".concat(it,"-body"))},C.createElement(yn,{style:Object(z.a)(Object(z.a)({},Br),{},{tableLayout:ln})},bi,Dn,Fi),er&&C.createElement(Te,{ref:qi,offsetScroll:ea,scrollBodyRef:ii,onScroll:or})),In=C.createElement(C.Fragment,null,tt!==!1&&C.createElement(_,Object.assign({noData:!Ie.length},Hn,Di,{direction:he,offsetHeader:zr,stickyClassName:tr,ref:vi,onScroll:or})),fr)}else In=C.createElement("div",{style:Object(z.a)(Object(z.a)({},dr),Lr),className:M()("".concat(it,"-content")),onScroll:or,ref:ii},C.createElement(yn,{style:Object(z.a)(Object(z.a)({},Br),{},{tableLayout:ln})},bi,tt!==!1&&C.createElement(v,Object.assign({},Hn,Di)),Dn,Fi));var Qn=Object(b.b)(Fe),Ze=C.createElement("div",Object.assign({className:M()(it,lt,(Ue={},Object(J.a)(Ue,"".concat(it,"-rtl"),he==="rtl"),Object(J.a)(Ue,"".concat(it,"-ping-left"),yi),Object(J.a)(Ue,"".concat(it,"-ping-right"),Oi),Object(J.a)(Ue,"".concat(it,"-layout-fixed"),le==="fixed"),Object(J.a)(Ue,"".concat(it,"-fixed-header"),pi),Object(J.a)(Ue,"".concat(it,"-fixed-column"),Yi),Object(J.a)(Ue,"".concat(it,"-scroll-horizontal"),ci),Object(J.a)(Ue,"".concat(it,"-has-fix-left"),Pn[0]&&Pn[0].fixed),Object(J.a)(Ue,"".concat(it,"-has-fix-right"),Pn[Pn.length-1]&&Pn[Pn.length-1].fixed==="right"),Ue)),style:ie,id:Ne,ref:Hi},Qn),C.createElement(ut,{pingLeft:yi,pingRight:Oi,props:Object(z.a)(Object(z.a)({},Fe),{},{stickyOffsets:ar,mergedExpandedKeys:ft})},Ee&&C.createElement(oe,{className:"".concat(it,"-title")},Ee(Ie)),C.createElement("div",{className:"".concat(it,"-container")},In),ye&&C.createElement(oe,{className:"".concat(it,"-footer")},ye(Ie))));ci&&(Ze=C.createElement(p.a,{onResize:rn},Ze));var ht=C.useMemo(function(){return{prefixCls:it,getComponent:vt,scrollbarSize:Lt,direction:he,fixedInfoList:Pn.map(function(Vt,Bt){return s(Bt,Bt,Pn,ar,he)}),isSticky:er}},[it,vt,Lt,he,Pn,ar,he,er]),Nt=C.useMemo(function(){return Object(z.a)(Object(z.a)({},Di),{},{tableLayout:ln,rowClassName:fe,expandedRowClassName:bt,componentWidth:ni,fixHeader:pi,fixColumn:Yi,horizonScroll:ci,expandIcon:Jt,expandableType:sn,expandRowByClick:Pe,expandedRowRender:$,onTriggerExpand:hn,expandIconColumnIndex:_t,indentSize:At})},[Di,ln,fe,bt,ni,pi,Yi,ci,Jt,sn,Pe,$,hn,_t,At]),nn=C.useMemo(function(){return{onColumnResize:Ir}},[Ir]);return C.createElement(i.a.Provider,{value:ht},C.createElement(F.Provider,{value:Nt},C.createElement(ne.Provider,{value:nn},Ze)))}xt.Column=o.a,xt.ColumnGroup=c.a,xt.Summary=Q.a,xt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var wt=pe.b=xt},wRmb:function(He,pe,I){"use strict";I.d(pe,"a",function(){return D});var J=I("rePB"),z=I("KQm4"),P=I("VTBJ"),X=I("Ff2n"),N=I("q1tI"),C=I.n(N),B=I("Kwbf"),M=I("Zm9Q"),n=I("hW8S");function D(o){return Object(M.a)(o).filter(function(d){return N.isValidElement(d)}).map(function(d){var r=d.key,a=d.props,i=a.children,s=Object(X.a)(a,["children"]),S=Object(P.a)({key:r},s);return i&&(S.children=D(i)),S})}function g(o){return o.reduce(function(d,r){var a=r.fixed,i=a===!0?"left":a,s=r.children;return s&&s.length>0?[].concat(Object(z.a)(d),Object(z.a)(g(s).map(function(S){return Object(P.a)({fixed:i},S)}))):[].concat(Object(z.a)(d),[Object(P.a)(Object(P.a)({},r),{},{fixed:i})])},[])}function p(o){for(var d=!0,r=0;r<o.length;r+=1){var a=o[r];if(d&&a.fixed!=="left")d=!1;else if(!d&&a.fixed==="left"){Object(B.a)(!1,"Index ".concat(r-1," of `columns` missing `fixed='left'` prop."));break}}for(var i=!0,s=o.length-1;s>=0;s-=1){var S=o[s];if(i&&S.fixed!=="right")i=!1;else if(!i&&S.fixed==="right"){Object(B.a)(!1,"Index ".concat(s+1," of `columns` missing `fixed='right'` prop."));break}}}function h(o){return o.map(function(d){var r=d.fixed,a=Object(X.a)(d,["fixed"]),i=r;return r==="left"?i="right":r==="right"&&(i="left"),Object(P.a)({fixed:i},a)})}function c(o,d){var r=o.prefixCls,a=o.columns,i=o.children,s=o.expandable,S=o.expandedKeys,x=o.getRowKey,T=o.onTriggerExpand,A=o.expandIcon,w=o.rowExpandable,v=o.expandIconColumnIndex,b=o.direction,m=o.expandRowByClick,f=N.useMemo(function(){return a||D(i)},[a,i]),O=N.useMemo(function(){if(s){var k,F=v||0,L=f[F],G=(k={},Object(J.a)(k,n.a,{className:"".concat(r,"-expand-icon-col")}),Object(J.a)(k,"title",""),Object(J.a)(k,"fixed",L?L.fixed:null),Object(J.a)(k,"className","".concat(r,"-row-expand-icon-cell")),Object(J.a)(k,"render",function(V,ne,se){var Se=x(ne,se),De=S.has(Se),Ae=w?w(ne):!0,ke=A({prefixCls:r,expanded:De,expandable:Ae,record:ne,onExpand:T});return m?N.createElement("span",{onClick:function(Be){return Be.stopPropagation()}},ke):ke}),k),j=f.slice();return F>=0&&j.splice(F,0,G),j}return f},[s,f,x,S,A,b]),E=N.useMemo(function(){var k=O;return d&&(k=d(k)),k.length||(k=[{render:function(){return null}}]),k},[d,O,b]),_=N.useMemo(function(){return b==="rtl"?h(g(E)):g(E)},[E,b]);return[E,_]}pe.b=c},wW8i:function(He,pe,I){He.exports={flex_box_center:"flex_box_center___3xqQI",flex_space_between:"flex_space_between___1fvHN",flex_box_vertical_center:"flex_box_vertical_center___1Gb4J",flex_box_center_end:"flex_box_center_end___8RbQi",flex_box_column:"flex_box_column___3xL78",discuss:"discuss___ybobd",reply:"reply___3EgHc",pagination:"pagination___2EiMG"}},"y0+3":function(He,pe,I){"use strict";I.d(pe,"a",function(){return g}),I.d(pe,"b",function(){return h});var J=/margin|padding|width|height|max|min|offset/,z={left:!0,top:!0},P={cssFloat:1,styleFloat:1,float:1};function X(c){return c.nodeType===1?c.ownerDocument.defaultView.getComputedStyle(c,null):{}}function N(c,o,d){if(o=o.toLowerCase(),d==="auto"){if(o==="height")return c.offsetHeight;if(o==="width")return c.offsetWidth}return o in z||(z[o]=J.test(o)),z[o]?parseFloat(d)||0:d}function C(c,o){var d=arguments.length,r=X(c);return o=P[o]?"cssFloat"in c.style?"cssFloat":"styleFloat":o,d===1?r:N(c,o,r[o]||c.style[o])}function B(c,o,d){var r=arguments.length;if(o=P[o]?"cssFloat"in c.style?"cssFloat":"styleFloat":o,r===3)return typeof d=="number"&&J.test(o)&&(d="".concat(d,"px")),c.style[o]=d,d;for(var a in o)o.hasOwnProperty(a)&&B(c,a,o[a]);return X(c)}function M(c){return c===document.body?document.documentElement.clientWidth:c.offsetWidth}function n(c){return c===document.body?window.innerHeight||document.documentElement.clientHeight:c.offsetHeight}function D(){var c=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:c,height:o}}function g(){var c=document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;return{width:c,height:o}}function p(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function h(c){var o=c.getBoundingClientRect(),d=document.documentElement;return{left:o.left+(window.pageXOffset||d.scrollLeft)-(d.clientLeft||document.body.clientLeft||0),top:o.top+(window.pageYOffset||d.scrollTop)-(d.clientTop||document.body.clientTop||0)}}},ynwM:function(He,pe,I){var J=I("MFOe"),z=J.Global;He.exports={name:"oldFF-globalStorage",read:X,write:N,each:C,remove:B,clearAll:M};var P=z.globalStorage;function X(n){return P[n]}function N(n,D){P[n]=D}function C(n){for(var D=P.length-1;D>=0;D--){var g=P.key(D);n(P[g],g)}}function B(n){return P.removeItem(n)}function M(){C(function(n,D){delete P[n]})}}}]);
|